diff --git a/bin/cascade.js b/bin/cascade.js index c194df91..886f324d 100755 --- a/bin/cascade.js +++ b/bin/cascade.js @@ -1,3 +1,4 @@ #!/usr/bin/env node import { execute } from '@oclif/core'; + await execute({ dir: import.meta.url }); diff --git a/biome.json b/biome.json index 6a7fcf8f..20972b0d 100644 --- a/biome.json +++ b/biome.json @@ -1,13 +1,11 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.10/schema.json", "vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }, - "organizeImports": { - "enabled": true - }, + "assist": { "actions": { "source": { "organizeImports": "on" } } }, "linter": { "enabled": true, "rules": { @@ -34,6 +32,13 @@ } }, "files": { - "ignore": ["node_modules", "dist", "coverage", "*.json"] + "includes": [ + "**", + "!**/node_modules", + "!**/dist", + "!**/coverage", + "!**/*.json", + "!web/src/index.css" + ] } } diff --git a/package-lock.json b/package-lock.json index 45f628a2..77a5c967 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "cascade-tools": "bin/cascade-tools.js" }, "devDependencies": { - "@biomejs/biome": "^1.9.4", + "@biomejs/biome": "^2.4.10", "@commitlint/cli": "^20.1.0", "@commitlint/config-conventional": "^20.0.0", "@testing-library/dom": "^10.4.1", @@ -277,9 +277,10 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.9.4", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.4.10.tgz", + "integrity": "sha512-xxA3AphFQ1geij4JTHXv4EeSTda1IFn22ye9LdyVPoJU19fNVl0uzfEuhsfQ4Yue/0FaLs2/ccVi4UDiE7R30w==", "dev": true, - "hasInstallScript": true, "license": "MIT OR Apache-2.0", "bin": { "biome": "bin/biome" @@ -292,18 +293,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.9.4", - "@biomejs/cli-darwin-x64": "1.9.4", - "@biomejs/cli-linux-arm64": "1.9.4", - "@biomejs/cli-linux-arm64-musl": "1.9.4", - "@biomejs/cli-linux-x64": "1.9.4", - "@biomejs/cli-linux-x64-musl": "1.9.4", - "@biomejs/cli-win32-arm64": "1.9.4", - "@biomejs/cli-win32-x64": "1.9.4" + "@biomejs/cli-darwin-arm64": "2.4.10", + "@biomejs/cli-darwin-x64": "2.4.10", + "@biomejs/cli-linux-arm64": "2.4.10", + "@biomejs/cli-linux-arm64-musl": "2.4.10", + "@biomejs/cli-linux-x64": "2.4.10", + "@biomejs/cli-linux-x64-musl": "2.4.10", + "@biomejs/cli-win32-arm64": "2.4.10", + "@biomejs/cli-win32-x64": "2.4.10" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.9.4", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.4.10.tgz", + "integrity": "sha512-vuzzI1cWqDVzOMIkYyHbKqp+AkQq4K7k+UCXWpkYcY/HDn1UxdsbsfgtVpa40shem8Kax4TLDLlx8kMAecgqiw==", "cpu": [ "arm64" ], @@ -318,9 +321,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", - "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.4.10.tgz", + "integrity": "sha512-14fzASRo+BPotwp7nWULy2W5xeUyFnTaq1V13Etrrxkrih+ez/2QfgFm5Ehtf5vSjtgx/IJycMMpn5kPd5ZNaA==", "cpu": [ "x64" ], @@ -335,9 +338,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", - "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.4.10.tgz", + "integrity": "sha512-7MH1CMW5uuxQ/s7FLST63qF8B3Hgu2HRdZ7tA1X1+mk+St4JOuIrqdhIBnnyqeyWJNI+Bww7Es5QZ0wIc1Cmkw==", "cpu": [ "arm64" ], @@ -352,9 +355,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", - "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.4.10.tgz", + "integrity": "sha512-WrJY6UuiSD/Dh+nwK2qOTu8kdMDlLV3dLMmychIghHPAysWFq1/DGC1pVZx8POE3ZkzKR3PUUnVrtZfMfaJjyQ==", "cpu": [ "arm64" ], @@ -369,9 +372,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", - "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.4.10.tgz", + "integrity": "sha512-tZLvEEi2u9Xu1zAqRjTcpIDGVtldigVvzug2fTuPG0ME/g8/mXpRPcNgLB22bGn6FvLJpHHnqLnwliOu8xjYrg==", "cpu": [ "x64" ], @@ -386,9 +389,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", - "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.4.10.tgz", + "integrity": "sha512-kDTi3pI6PBN6CiczsWYOyP2zk0IJI08EWEQyDMQWW221rPaaEz6FvjLhnU07KMzLv8q3qSuoB93ua6inSQ55Tw==", "cpu": [ "x64" ], @@ -403,9 +406,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", - "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.4.10.tgz", + "integrity": "sha512-umwQU6qPzH+ISTf/eHyJ/QoQnJs3V9Vpjz2OjZXe9MVBZ7prgGafMy7yYeRGnlmDAn87AKTF3Q6weLoMGpeqdQ==", "cpu": [ "arm64" ], @@ -420,9 +423,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", - "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.4.10.tgz", + "integrity": "sha512-aW/JU5GuyH4uxMrNYpoC2kjaHlyJGLgIa3XkhPEZI0uKhZhJZU8BuEyJmvgzSPQNGozBwWjC972RaNdcJ9KyJg==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 3ebfcfa1..5aad896c 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "zod": "^3.25.0" }, "devDependencies": { - "@biomejs/biome": "^1.9.4", + "@biomejs/biome": "^2.4.10", "@commitlint/cli": "^20.1.0", "@commitlint/config-conventional": "^20.0.0", "@testing-library/dom": "^10.4.1", diff --git a/src/agents/capabilities/resolver.ts b/src/agents/capabilities/resolver.ts index 077907c7..c22e34a2 100644 --- a/src/agents/capabilities/resolver.ts +++ b/src/agents/capabilities/resolver.ts @@ -8,12 +8,6 @@ import { AstGrep } from '../../gadgets/AstGrep.js'; import { FileMultiEdit } from '../../gadgets/FileMultiEdit.js'; import { FileSearchAndReplace } from '../../gadgets/FileSearchAndReplace.js'; import { Finish } from '../../gadgets/Finish.js'; -import { ListDirectory } from '../../gadgets/ListDirectory.js'; -import { ReadFile } from '../../gadgets/ReadFile.js'; -import { RipGrep } from '../../gadgets/RipGrep.js'; -import { Sleep } from '../../gadgets/Sleep.js'; -import { VerifyChanges } from '../../gadgets/VerifyChanges.js'; -import { WriteFile } from '../../gadgets/WriteFile.js'; import { CreatePR, CreatePRReview, @@ -26,6 +20,7 @@ import { ReplyToReviewComment, UpdatePRComment, } from '../../gadgets/github/index.js'; +import { ListDirectory } from '../../gadgets/ListDirectory.js'; import { AddChecklist, CreateWorkItem, @@ -37,6 +32,9 @@ import { ReadWorkItem, UpdateWorkItem, } from '../../gadgets/pm/index.js'; +import { ReadFile } from '../../gadgets/ReadFile.js'; +import { RipGrep } from '../../gadgets/RipGrep.js'; +import { Sleep } from '../../gadgets/Sleep.js'; import { GetAlertingEventDetail, GetAlertingIssue, @@ -44,6 +42,8 @@ import { } from '../../gadgets/sentry/index.js'; import { Tmux } from '../../gadgets/tmux.js'; import { TodoDelete, TodoUpdateStatus, TodoUpsert } from '../../gadgets/todo/index.js'; +import { VerifyChanges } from '../../gadgets/VerifyChanges.js'; +import { WriteFile } from '../../gadgets/WriteFile.js'; import type { ToolManifest } from '../contracts/index.js'; import type { IntegrationCategory } from '../definitions/schema.js'; import { diff --git a/src/agents/definitions/contextSteps.ts b/src/agents/definitions/contextSteps.ts index 4f11ba94..f60ce477 100644 --- a/src/agents/definitions/contextSteps.ts +++ b/src/agents/definitions/contextSteps.ts @@ -6,21 +6,20 @@ */ import { execFileSync } from 'node:child_process'; - -import { ListDirectory } from '../../gadgets/ListDirectory.js'; import { formatCheckStatus } from '../../gadgets/github/core/getPRChecks.js'; +import { ListDirectory } from '../../gadgets/ListDirectory.js'; import { readWorkItem, readWorkItemWithMedia } from '../../gadgets/pm/core/readWorkItem.js'; import { formatSentryEvent } from '../../gadgets/sentry/core/format.js'; +import type { Todo } from '../../gadgets/todo/storage.js'; import { formatTodoList, getNextId, initTodoSession, saveTodos, } from '../../gadgets/todo/storage.js'; -import type { Todo } from '../../gadgets/todo/storage.js'; import { githubClient } from '../../github/client.js'; import { getJiraConfig, getTrelloConfig } from '../../pm/config.js'; -import { MAX_IMAGES_PER_WORK_ITEM, getPMProviderOrNull } from '../../pm/index.js'; +import { getPMProviderOrNull, MAX_IMAGES_PER_WORK_ITEM } from '../../pm/index.js'; import { getSentryClient } from '../../sentry/client.js'; import type { AgentInput, ProjectConfig } from '../../types/index.js'; import { parseRepoFullName } from '../../utils/repo.js'; diff --git a/src/agents/definitions/index.ts b/src/agents/definitions/index.ts index a339415b..2e6ea670 100644 --- a/src/agents/definitions/index.ts +++ b/src/agents/definitions/index.ts @@ -1,44 +1,43 @@ -export { - AgentDefinitionSchema, - IntegrationHooksSchema, - type AgentDefinition, - type AgentCapabilities, - type IntegrationHooks, - type TrailingHookFlags, - type FinishHookFlags, -} from './schema.js'; -export { - loadAgentDefinition, - loadAllAgentDefinitions, - getKnownAgentTypes, - clearDefinitionCache, - resolveAgentDefinition, - resolveAllAgentDefinitions, - resolveKnownAgentTypes, - invalidateDefinitionCache, - isPMFocusedAgent, -} from './loader.js'; -export { CONTEXT_STEP_REGISTRY } from './strategies.js'; -export type { FetchContextParams } from './contextSteps.js'; -export type { AgentProfile } from './profiles.js'; -export { getAgentProfile, getAgentCapabilities, needsGitStateStopHooks } from './profiles.js'; -export { getToolManifests } from './toolManifests.js'; - // Re-export capability system export { + buildGadgetsFromCapabilities, CAPABILITIES, CAPABILITY_REGISTRY, type Capability, type CapabilityDefinition, - getCapabilitiesByIntegration, - getCapabilityIntegration, - isBuiltInCapability, - isValidCapability, - buildGadgetsFromCapabilities, deriveIntegrations, deriveRequiredIntegrations, filterToolManifests, + getCapabilitiesByIntegration, + getCapabilityIntegration, getGadgetNamesFromCapabilities, getSdkToolsFromCapabilities, + isBuiltInCapability, + isValidCapability, resolveEffectiveCapabilities, } from '../capabilities/index.js'; +export type { FetchContextParams } from './contextSteps.js'; +export { + clearDefinitionCache, + getKnownAgentTypes, + invalidateDefinitionCache, + isPMFocusedAgent, + loadAgentDefinition, + loadAllAgentDefinitions, + resolveAgentDefinition, + resolveAllAgentDefinitions, + resolveKnownAgentTypes, +} from './loader.js'; +export type { AgentProfile } from './profiles.js'; +export { getAgentCapabilities, getAgentProfile, needsGitStateStopHooks } from './profiles.js'; +export { + type AgentCapabilities, + type AgentDefinition, + AgentDefinitionSchema, + type FinishHookFlags, + type IntegrationHooks, + IntegrationHooksSchema, + type TrailingHookFlags, +} from './schema.js'; +export { CONTEXT_STEP_REGISTRY } from './strategies.js'; +export { getToolManifests } from './toolManifests.js'; diff --git a/src/agents/definitions/loader.ts b/src/agents/definitions/loader.ts index 69de9b46..dabeafff 100644 --- a/src/agents/definitions/loader.ts +++ b/src/agents/definitions/loader.ts @@ -1,4 +1,4 @@ -import { readFileSync, readdirSync } from 'node:fs'; +import { readdirSync, readFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; import yaml from 'js-yaml'; diff --git a/src/agents/definitions/strategies.ts b/src/agents/definitions/strategies.ts index 14276d89..dc4d4304 100644 --- a/src/agents/definitions/strategies.ts +++ b/src/agents/definitions/strategies.ts @@ -14,9 +14,9 @@ import { fetchAlertingIssueStep, fetchContextFilesStep, fetchDirectoryListingStep, + fetchPipelineSnapshotStep, fetchPRContextStep, fetchPRConversationStep, - fetchPipelineSnapshotStep, fetchSquintStep, fetchWorkItemStep, prepopulateTodosStep, diff --git a/src/agents/prompts/index.ts b/src/agents/prompts/index.ts index 36b1f3d7..0c3cc73e 100644 --- a/src/agents/prompts/index.ts +++ b/src/agents/prompts/index.ts @@ -1,4 +1,4 @@ -import { readFileSync, readdirSync } from 'node:fs'; +import { readdirSync, readFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; import { Eta } from 'eta'; diff --git a/src/agents/shared/builderFactory.ts b/src/agents/shared/builderFactory.ts index ebe9a5b7..a214c39c 100644 --- a/src/agents/shared/builderFactory.ts +++ b/src/agents/shared/builderFactory.ts @@ -2,15 +2,15 @@ import { execSync } from 'node:child_process'; import { AgentBuilder, BudgetPricingUnavailableError, - type LLMist, type createLogger, + type LLMist, } from 'llmist'; import { getCompactionConfig } from '../../config/compactionConfig.js'; import { getIterationTrailingMessage } from '../../config/hintConfig.js'; import { getRateLimitForModel } from '../../config/rateLimits.js'; import { getRetryConfig } from '../../config/retryConfig.js'; -import { type SessionHooks, initSessionState, setReadOnlyFs } from '../../gadgets/sessionState.js'; +import { initSessionState, type SessionHooks, setReadOnlyFs } from '../../gadgets/sessionState.js'; import type { LLMCallLogger } from '../../utils/llmLogging.js'; import { resolveSquintDbPath } from '../../utils/squintDb.js'; import type { IProgressMonitor } from '../contracts/index.js'; diff --git a/src/agents/shared/capabilities.ts b/src/agents/shared/capabilities.ts index b620b624..f1cab599 100644 --- a/src/agents/shared/capabilities.ts +++ b/src/agents/shared/capabilities.ts @@ -8,30 +8,26 @@ * - '../definitions/schema.js' for AgentCapabilities type */ -// Re-export capability types -export type { Capability, AgentCapabilities } from '../definitions/schema.js'; - // Re-export capability functions export { + buildGadgetsFromCapabilities, CAPABILITIES, CAPABILITY_REGISTRY, - getCapabilitiesByIntegration, - getCapabilityIntegration, - isBuiltInCapability, - isValidCapability, -} from '../capabilities/index.js'; - -export { - buildGadgetsFromCapabilities, deriveIntegrations, deriveRequiredIntegrations, filterToolManifests, generateUnavailableCapabilitiesNote, + getCapabilitiesByIntegration, + getCapabilityIntegration, getGadgetNamesFromCapabilities, getSdkToolsFromCapabilities, getUnavailableOptionalCapabilities, + isBuiltInCapability, + isValidCapability, resolveEffectiveCapabilities, } from '../capabilities/index.js'; +// Re-export capability types +export type { AgentCapabilities, Capability } from '../definitions/schema.js'; import { resolveAgentDefinition } from '../definitions/index.js'; diff --git a/src/agents/shared/executionPipeline.ts b/src/agents/shared/executionPipeline.ts index 7f423908..171ed04c 100644 --- a/src/agents/shared/executionPipeline.ts +++ b/src/agents/shared/executionPipeline.ts @@ -15,6 +15,7 @@ export type AgentLogger = ReturnType; // Re-export from the canonical single definition in contracts. export type { LogWriter } from '../contracts/index.js'; + import type { LogWriter } from '../contracts/index.js'; /** diff --git a/src/agents/shared/modelResolution.ts b/src/agents/shared/modelResolution.ts index 47a4f0e5..28d1f149 100644 --- a/src/agents/shared/modelResolution.ts +++ b/src/agents/shared/modelResolution.ts @@ -3,9 +3,9 @@ import type { AgentInput, CascadeConfig, ProjectConfig } from '../../types/index import { logger } from '../../utils/logging.js'; import { resolveAgentDefinition } from '../definitions/loader.js'; import { - type PromptContext, buildTaskPromptContext, getSystemPrompt, + type PromptContext, renderCustomPrompt, renderInlineTaskPrompt, } from '../prompts/index.js'; diff --git a/src/agents/shared/prFormatting.ts b/src/agents/shared/prFormatting.ts index e0b1053b..a9c4eb67 100644 --- a/src/agents/shared/prFormatting.ts +++ b/src/agents/shared/prFormatting.ts @@ -1,7 +1,7 @@ import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; -import { REVIEW_FILE_CONTENT_TOKEN_LIMIT, estimateTokens } from '../../config/reviewConfig.js'; +import { estimateTokens, REVIEW_FILE_CONTENT_TOKEN_LIMIT } from '../../config/reviewConfig.js'; import type { githubClient } from '../../github/client.js'; type PRDetails = Awaited>; @@ -10,7 +10,7 @@ type PRComments = Awaited>; type PRReviews = Awaited>; type PRIssueComments = Awaited>; -export type { PRDetails, PRDiff, PRComments, PRReviews, PRIssueComments }; +export type { PRComments, PRDetails, PRDiff, PRIssueComments, PRReviews }; export function formatPRDetails(prDetails: PRDetails): string { return [ diff --git a/src/agents/shared/syntheticCalls.ts b/src/agents/shared/syntheticCalls.ts index d33163ba..8fb47f66 100644 --- a/src/agents/shared/syntheticCalls.ts +++ b/src/agents/shared/syntheticCalls.ts @@ -2,7 +2,7 @@ import { imageFromBase64, text } from 'llmist'; import { logger } from '../../utils/logging.js'; import type { ContextImage } from '../contracts/index.js'; -import { type TrackingContext, recordSyntheticInvocationId } from '../utils/tracking.js'; +import { recordSyntheticInvocationId, type TrackingContext } from '../utils/tracking.js'; import type { BuilderType } from './builderFactory.js'; /** MIME types supported by the llmist SDK for image content parts. */ diff --git a/src/agents/utils/agentLoop.ts b/src/agents/utils/agentLoop.ts index 68959192..8a23eba6 100644 --- a/src/agents/utils/agentLoop.ts +++ b/src/agents/utils/agentLoop.ts @@ -14,12 +14,12 @@ import { } from '../../utils/interactive.js'; import type { createAgentLogger } from './logging.js'; import { - type TrackingContext, consumeLoopAction, consumeLoopWarning, incrementGadgetCall, isSyntheticCall, recordGadgetCallForLoop, + type TrackingContext, } from './tracking.js'; // ============================================================================ diff --git a/src/agents/utils/checklistSync.ts b/src/agents/utils/checklistSync.ts index 93ce43b6..f4571094 100644 --- a/src/agents/utils/checklistSync.ts +++ b/src/agents/utils/checklistSync.ts @@ -5,7 +5,7 @@ * items as local TODOs are completed. */ -import { type Todo, loadTodos } from '../../gadgets/todo/storage.js'; +import { loadTodos, type Todo } from '../../gadgets/todo/storage.js'; import { type ChecklistItem, getPMProvider } from '../../pm/index.js'; import type { Checklist } from '../../pm/types.js'; import { logger } from '../../utils/logging.js'; diff --git a/src/agents/utils/hooks.ts b/src/agents/utils/hooks.ts index 33c0e0a8..34a52f68 100644 --- a/src/agents/utils/hooks.ts +++ b/src/agents/utils/hooks.ts @@ -19,7 +19,7 @@ import type { LLMCallLogger } from '../../utils/llmLogging.js'; import { calculateCost } from '../../utils/llmMetrics.js'; import { logger } from '../../utils/logging.js'; import type { IProgressMonitor, LogWriter } from '../contracts/index.js'; -import { type TrackingContext, checkForLoopAndAdvance, incrementLLMIteration } from './tracking.js'; +import { checkForLoopAndAdvance, incrementLLMIteration, type TrackingContext } from './tracking.js'; // Re-export LogWriter for downstream consumers that imported it from here. export type { LogWriter } from '../contracts/index.js'; diff --git a/src/agents/utils/index.ts b/src/agents/utils/index.ts index ce74315f..cb3e1fc9 100644 --- a/src/agents/utils/index.ts +++ b/src/agents/utils/index.ts @@ -1,14 +1,13 @@ +export { type AgentRunResult, runAgentLoop, truncateContent } from './agentLoop.js'; + +export { type AgentLogger, createAgentLogger } from './logging.js'; export { - LOG_LEVELS, - getLogLevel, type ContextFile, - readContextFiles, type DependencyInstallResult, + getLogLevel, installDependencies, + LOG_LEVELS, + readContextFiles, type TypeScriptWarmResult, warmTypeScriptCache, } from './setup.js'; - -export { type AgentLogger, createAgentLogger } from './logging.js'; - -export { type AgentRunResult, runAgentLoop, truncateContent } from './agentLoop.js'; diff --git a/src/api/routers/runs.ts b/src/api/routers/runs.ts index d7a29179..e0f85182 100644 --- a/src/api/routers/runs.ts +++ b/src/api/routers/runs.ts @@ -3,8 +3,8 @@ import { z } from 'zod'; import { loadProjectConfigById } from '../../config/provider.js'; import { isAgentEnabledForProject } from '../../db/repositories/agentConfigsRepository.js'; import { - DEFAULT_STALE_RUN_THRESHOLD_MS, cancelRunById, + DEFAULT_STALE_RUN_THRESHOLD_MS, deleteDebugAnalysisByRunId, getDebugAnalysisByRunId, getLlmCallByNumber, diff --git a/src/api/trpc.ts b/src/api/trpc.ts index 698addb1..47cd077a 100644 --- a/src/api/trpc.ts +++ b/src/api/trpc.ts @@ -1,4 +1,4 @@ -import { TRPCError, initTRPC } from '@trpc/server'; +import { initTRPC, TRPCError } from '@trpc/server'; export interface TRPCUser { id: string; diff --git a/src/backends/adapter.ts b/src/backends/adapter.ts index 68e7d0bc..20c8a8a4 100644 --- a/src/backends/adapter.ts +++ b/src/backends/adapter.ts @@ -1,5 +1,5 @@ import { getAgentProfile } from '../agents/definitions/profiles.js'; -import { type PipelineContext, executeAgentPipeline } from '../agents/shared/executionPipeline.js'; +import { executeAgentPipeline, type PipelineContext } from '../agents/shared/executionPipeline.js'; import { setupRepository } from '../agents/shared/repository.js'; import { finalizeEngineRun, tryCreateRun } from '../agents/shared/runTracking.js'; import { createAgentLogger } from '../agents/utils/logging.js'; diff --git a/src/backends/claude-code/index.ts b/src/backends/claude-code/index.ts index 71c717e7..64bf1600 100644 --- a/src/backends/claude-code/index.ts +++ b/src/backends/claude-code/index.ts @@ -1,15 +1,15 @@ -import { constants, accessSync, existsSync, readdirSync, statSync, writeFileSync } from 'node:fs'; +import { accessSync, constants, existsSync, readdirSync, statSync, writeFileSync } from 'node:fs'; import { rm } from 'node:fs/promises'; import { homedir } from 'node:os'; import path from 'node:path'; -import { query } from '@anthropic-ai/claude-agent-sdk'; import type { SDKUserMessage } from '@anthropic-ai/claude-agent-sdk'; +import { query } from '@anthropic-ai/claude-agent-sdk'; import { getEngineSettings } from '../../config/engineSettings.js'; import { logger } from '../../utils/logging.js'; import { getWorkspaceDir } from '../../utils/repo.js'; import { CLAUDE_CODE_ENGINE_DEFINITION } from '../catalog.js'; -import { NativeToolEngine } from '../shared/NativeToolEngine.js'; import { runContinuationLoop } from '../shared/continuationLoop.js'; +import { NativeToolEngine } from '../shared/NativeToolEngine.js'; import { buildSystemPrompt, buildTaskPrompt } from '../shared/nativeToolPrompts.js'; import type { AgentEngineResult, AgentExecutionPlan } from '../types.js'; import { ALLOWED_ENV_EXACT, buildClaudeEnv } from './env.js'; @@ -24,9 +24,9 @@ import { CLAUDE_CODE_MODEL_IDS, DEFAULT_CLAUDE_CODE_MODEL } from './models.js'; import { ClaudeCodeSettingsSchema, resolveClaudeCodeSettings } from './settings.js'; export { - buildToolGuidance, - buildTaskPrompt, buildSystemPrompt, + buildTaskPrompt, + buildToolGuidance, } from '../shared/nativeToolPrompts.js'; export { buildClaudeEnv as buildEnv } from './env.js'; export { buildPromptWithImages, formatErrorMessage } from './messageProcessing.js'; diff --git a/src/backends/claude-code/messageProcessing.ts b/src/backends/claude-code/messageProcessing.ts index fc891752..75d65e4d 100644 --- a/src/backends/claude-code/messageProcessing.ts +++ b/src/backends/claude-code/messageProcessing.ts @@ -1,5 +1,6 @@ import { randomUUID } from 'node:crypto'; import type { + query, SDKAssistantMessage, SDKResultMessage, SDKResultSuccess, @@ -7,7 +8,6 @@ import type { SDKSystemMessage, SDKUserMessage, } from '@anthropic-ai/claude-agent-sdk'; -import type { query } from '@anthropic-ai/claude-agent-sdk'; import { calculateCost } from '../../utils/llmMetrics.js'; import { extractPRUrl } from '../../utils/prUrl.js'; import { buildEngineResult } from '../shared/engineResult.js'; diff --git a/src/backends/codex/index.ts b/src/backends/codex/index.ts index 5a9c1d81..138de946 100644 --- a/src/backends/codex/index.ts +++ b/src/backends/codex/index.ts @@ -7,20 +7,20 @@ import { createInterface } from 'node:readline'; import { writeProjectCredential } from '../../db/repositories/credentialsRepository.js'; import { CODEX_ENGINE_DEFINITION } from '../catalog.js'; -import { NativeToolEngine } from '../shared/NativeToolEngine.js'; import { cleanupContextFiles } from '../shared/contextFiles.js'; import { appendEngineLog } from '../shared/engineLog.js'; import { buildEngineResult, extractAndBuildPrEvidence } from '../shared/engineResult.js'; import { SHARED_ALLOWED_ENV_EXACT } from '../shared/envFilter.js'; import { logLlmCall } from '../shared/llmCallLogger.js'; +import { NativeToolEngine } from '../shared/NativeToolEngine.js'; import { buildSystemPrompt, buildTaskPrompt } from '../shared/nativeToolPrompts.js'; import type { AgentEngineResult, AgentExecutionPlan, LogWriter } from '../types.js'; -import { extractUsage, parseCodexEvent } from './jsonlParser.js'; import type { UsageSummary } from './jsonlParser.js'; +import { extractUsage, parseCodexEvent } from './jsonlParser.js'; import { CODEX_MODEL_IDS, DEFAULT_CODEX_MODEL } from './models.js'; import { - CodexSettingsSchema, assertHeadlessCodexSettings, + CodexSettingsSchema, resolveCodexSettings, } from './settings.js'; @@ -616,10 +616,10 @@ export class CodexEngine extends NativeToolEngine { } } -export { resolveCodexModel }; export { extractErrorMessage, - extractToolCall, extractTextParts, + extractToolCall, extractUsage, } from './jsonlParser.js'; +export { resolveCodexModel }; diff --git a/src/backends/index.ts b/src/backends/index.ts index 0349ebac..88bfdc04 100644 --- a/src/backends/index.ts +++ b/src/backends/index.ts @@ -1,3 +1,20 @@ +export { executeWithEngine } from './adapter.js'; +export { registerBuiltInEngines } from './bootstrap.js'; +export { ClaudeCodeEngine } from './claude-code/index.js'; +export { CodexEngine } from './codex/index.js'; +export { LlmistEngine } from './llmist/index.js'; +export { OpenCodeEngine } from './opencode/index.js'; +export { createProgressMonitor, ProgressMonitor } from './progress.js'; +export { + getEngine, + getEngineCatalog, + getRegisteredEngines, + isNativeToolEngine, + isNativeToolEngineDefinition, + registerEngine, +} from './registry.js'; +export { resolveEngineName } from './resolution.js'; +export { NativeToolEngine } from './shared/index.js'; export type { AgentEngine, AgentEngineDefinition, @@ -10,21 +27,3 @@ export type { ProgressReporter, ToolManifest, } from './types.js'; -export { NativeToolEngine } from './shared/index.js'; - -export { - getEngine, - getEngineCatalog, - getRegisteredEngines, - isNativeToolEngine, - isNativeToolEngineDefinition, - registerEngine, -} from './registry.js'; -export { registerBuiltInEngines } from './bootstrap.js'; -export { resolveEngineName } from './resolution.js'; -export { executeWithEngine } from './adapter.js'; -export { createProgressMonitor, ProgressMonitor } from './progress.js'; -export { LlmistEngine } from './llmist/index.js'; -export { ClaudeCodeEngine } from './claude-code/index.js'; -export { CodexEngine } from './codex/index.js'; -export { OpenCodeEngine } from './opencode/index.js'; diff --git a/src/backends/llmist/index.ts b/src/backends/llmist/index.ts index ab9976bd..8db7ab48 100644 --- a/src/backends/llmist/index.ts +++ b/src/backends/llmist/index.ts @@ -1,6 +1,6 @@ import os from 'node:os'; -import { LLMist, type ModelSpec, createLogger } from 'llmist'; +import { createLogger, LLMist, type ModelSpec } from 'llmist'; import { createIntegrationChecker } from '../../agents/capabilities/index.js'; import { getAgentProfile } from '../../agents/definitions/profiles.js'; diff --git a/src/backends/opencode/index.ts b/src/backends/opencode/index.ts index 6c9c2b91..16c911eb 100644 --- a/src/backends/opencode/index.ts +++ b/src/backends/opencode/index.ts @@ -1,5 +1,5 @@ -import { createOpencodeClient } from '@opencode-ai/sdk/client'; import type { AssistantMessage, Config, Part } from '@opencode-ai/sdk/client'; +import { createOpencodeClient } from '@opencode-ai/sdk/client'; import { logger } from '../../utils/logging.js'; import { OPENCODE_ENGINE_DEFINITION } from '../catalog.js'; @@ -8,23 +8,23 @@ import { isRetryableNativeToolError, retryNativeToolOperation, } from '../nativeToolRetry.js'; -import { NativeToolEngine } from '../shared/NativeToolEngine.js'; import { cleanupContextFiles } from '../shared/contextFiles.js'; import { runContinuationLoop } from '../shared/continuationLoop.js'; import { buildEngineResult, extractAndBuildPrEvidence } from '../shared/engineResult.js'; import { SHARED_ALLOWED_ENV_EXACT } from '../shared/envFilter.js'; +import { NativeToolEngine } from '../shared/NativeToolEngine.js'; import { buildSystemPrompt, buildTaskPrompt } from '../shared/nativeToolPrompts.js'; import type { AgentEngineResult, AgentExecutionPlan } from '../types.js'; import { DEFAULT_OPENCODE_MODEL } from './models.js'; import { buildPermissionConfig } from './permissions.js'; import { - type OpenCodeServerState, attachServerState, formatOpenCodeServerExitError, + type OpenCodeServerState, startOpenCodeServer, } from './server.js'; import { OpenCodeSettingsSchema, resolveOpenCodeSettings } from './settings.js'; -import { type OpenCodeStreamState, getPartialOutput, processStreamEvent } from './stream.js'; +import { getPartialOutput, type OpenCodeStreamState, processStreamEvent } from './stream.js'; export function resolveOpenCodeModel(cascadeModel: string): string { if (cascadeModel.includes('/') && !cascadeModel.includes(':')) return cascadeModel; diff --git a/src/backends/opencode/server.ts b/src/backends/opencode/server.ts index 5f2f46ac..e212647a 100644 --- a/src/backends/opencode/server.ts +++ b/src/backends/opencode/server.ts @@ -6,7 +6,7 @@ */ import { spawn } from 'node:child_process'; -import { type Server, createServer } from 'node:net'; +import { createServer, type Server } from 'node:net'; import type { Config } from '@opencode-ai/sdk/client'; diff --git a/src/backends/opencode/stream.ts b/src/backends/opencode/stream.ts index 5a374cd6..e1282b02 100644 --- a/src/backends/opencode/stream.ts +++ b/src/backends/opencode/stream.ts @@ -5,16 +5,15 @@ * permission requests, session lifecycle events, and message part updates. */ -import type { createOpencodeClient } from '@opencode-ai/sdk/client'; -import type { Event, Part, ToolPart } from '@opencode-ai/sdk/client'; +import type { createOpencodeClient, Event, Part, ToolPart } from '@opencode-ai/sdk/client'; import { retryNativeToolOperation } from '../nativeToolRetry.js'; import { appendEngineLog } from '../shared/engineLog.js'; import { logLlmCall } from '../shared/llmCallLogger.js'; import type { AgentExecutionPlan } from '../types.js'; import { - type OpenCodePermissionConfig, normalizePermissionDecision, + type OpenCodePermissionConfig, resolvePermissionDecision, } from './permissions.js'; diff --git a/src/backends/progressMonitor.ts b/src/backends/progressMonitor.ts index dfd1f247..2ec8e67a 100644 --- a/src/backends/progressMonitor.ts +++ b/src/backends/progressMonitor.ts @@ -23,11 +23,11 @@ import { formatStatusMessage } from '../config/statusUpdateConfig.js'; import { captureException } from '../sentry.js'; import { buildRunLink, buildWorkItemRunsLink, getDashboardUrl } from '../utils/runLink.js'; import { callProgressModel } from './progressModel.js'; -import { clearProgressCommentId, writeProgressCommentId } from './progressState.js'; import { ProgressAccumulator } from './progressState/accumulator.js'; import { GitHubProgressPoster } from './progressState/githubPoster.js'; import { PMProgressPoster } from './progressState/pmPoster.js'; import { DEFAULT_SCHEDULE_MINUTES, ProgressScheduler } from './progressState/scheduler.js'; +import { clearProgressCommentId, writeProgressCommentId } from './progressState.js'; import type { LogWriter, ProgressReporter } from './types.js'; export interface ProgressMonitorConfig { diff --git a/src/backends/shared/continuationLoop.ts b/src/backends/shared/continuationLoop.ts index 02b39748..91ab8254 100644 --- a/src/backends/shared/continuationLoop.ts +++ b/src/backends/shared/continuationLoop.ts @@ -13,8 +13,8 @@ */ import { - type CompletionRequirements, applyCompletionEvidence, + type CompletionRequirements, getCompletionFailure, readCompletionEvidence, } from '../completion.js'; diff --git a/src/backends/shared/envBuilder.ts b/src/backends/shared/envBuilder.ts index cf2e7456..d889520d 100644 --- a/src/backends/shared/envBuilder.ts +++ b/src/backends/shared/envBuilder.ts @@ -10,10 +10,10 @@ import { buildNativeToolPath } from '../nativeToolRuntime.js'; import { + filterProcessEnv, SHARED_ALLOWED_ENV_EXACT, SHARED_ALLOWED_ENV_PREFIXES, SHARED_BLOCKED_ENV_EXACT, - filterProcessEnv, } from './envFilter.js'; export interface BuildEngineEnvOptions { diff --git a/src/backends/sidecarManager.ts b/src/backends/sidecarManager.ts index 9f2ede8b..3fd21798 100644 --- a/src/backends/sidecarManager.ts +++ b/src/backends/sidecarManager.ts @@ -4,11 +4,11 @@ import { join } from 'node:path'; import type { getAgentProfile } from '../agents/definitions/profiles.js'; import { + clearInitialComment, PM_WRITE_SIDECAR_ENV_VAR, PR_SIDECAR_ENV_VAR, PUSHED_CHANGES_SIDECAR_ENV_VAR, REVIEW_SIDECAR_ENV_VAR, - clearInitialComment, recordPRCreation, recordReviewSubmission, } from '../gadgets/sessionState.js'; diff --git a/src/cli/dashboard/_shared/base.ts b/src/cli/dashboard/_shared/base.ts index 8e937e81..76b7bd5d 100644 --- a/src/cli/dashboard/_shared/base.ts +++ b/src/cli/dashboard/_shared/base.ts @@ -1,7 +1,7 @@ import { Command, Flags } from '@oclif/core'; import { TRPCClientError } from '@trpc/client'; import chalk from 'chalk'; -import { type DashboardClient, createDashboardClient } from './client.js'; +import { createDashboardClient, type DashboardClient } from './client.js'; import { type CliConfig, loadConfig } from './config.js'; import { formatActionableError, mapError } from './errors.js'; import { printCompact, printCsv, printDetail, printTable } from './format.js'; diff --git a/src/cli/pm/add-checklist.ts b/src/cli/pm/add-checklist.ts index 6ad06092..a872f6e0 100644 --- a/src/cli/pm/add-checklist.ts +++ b/src/cli/pm/add-checklist.ts @@ -1,4 +1,4 @@ -import { type ChecklistItemInput, addChecklist } from '../../gadgets/pm/core/addChecklist.js'; +import { addChecklist, type ChecklistItemInput } from '../../gadgets/pm/core/addChecklist.js'; import { addChecklistDef } from '../../gadgets/pm/definitions.js'; import { writePMWriteSidecar } from '../../gadgets/session/core/sidecar.js'; import { PM_WRITE_SIDECAR_ENV_VAR } from '../../gadgets/sessionState.js'; diff --git a/src/cli/session/finish.ts b/src/cli/session/finish.ts index afa57b3e..e72108bc 100644 --- a/src/cli/session/finish.ts +++ b/src/cli/session/finish.ts @@ -1,7 +1,6 @@ import { Command, Flags } from '@oclif/core'; import { readCompletionEvidence } from '../../backends/completion.js'; -import { validateFinish } from '../../gadgets/session/core/finish.js'; -import { writePushedChangesSidecar } from '../../gadgets/session/core/finish.js'; +import { validateFinish, writePushedChangesSidecar } from '../../gadgets/session/core/finish.js'; import { finishDef } from '../../gadgets/session/definitions.js'; import type { SessionHooks } from '../../gadgets/sessionState.js'; import { diff --git a/src/config/retryConfig.ts b/src/config/retryConfig.ts index 418ef331..1acaca30 100644 --- a/src/config/retryConfig.ts +++ b/src/config/retryConfig.ts @@ -1,5 +1,5 @@ -import { type RetryConfig, isRetryableError } from 'llmist'; import type { ILogObj, Logger } from 'llmist'; +import { isRetryableError, type RetryConfig } from 'llmist'; import { addBreadcrumb, captureException } from '../sentry.js'; /** diff --git a/src/db/repositories/agentDefinitionsRepository.ts b/src/db/repositories/agentDefinitionsRepository.ts index b08555fa..5a101908 100644 --- a/src/db/repositories/agentDefinitionsRepository.ts +++ b/src/db/repositories/agentDefinitionsRepository.ts @@ -1,6 +1,6 @@ import { eq } from 'drizzle-orm'; -import { AgentDefinitionSchema } from '../../agents/definitions/schema.js'; import type { AgentDefinition } from '../../agents/definitions/schema.js'; +import { AgentDefinitionSchema } from '../../agents/definitions/schema.js'; import { getDb } from '../client.js'; import { agentDefinitions } from '../schema/index.js'; diff --git a/src/db/repositories/configRepository.ts b/src/db/repositories/configRepository.ts index f2376450..558a6a04 100644 --- a/src/db/repositories/configRepository.ts +++ b/src/db/repositories/configRepository.ts @@ -1,12 +1,12 @@ -import { type SQL, eq, sql } from 'drizzle-orm'; +import { eq, type SQL, sql } from 'drizzle-orm'; import { validateConfig } from '../../config/schema.js'; import type { CascadeConfig, ProjectConfig } from '../../types/index.js'; import { getDb } from '../client.js'; import { agentConfigs, projectIntegrations, projects } from '../schema/index.js'; import { type AgentConfigRow, - type IntegrationRow, extractIntegrationConfigs, + type IntegrationRow, mapProjectRow, } from './configMapper.js'; diff --git a/src/db/repositories/joinHelpers.ts b/src/db/repositories/joinHelpers.ts index 86b32062..1703364b 100644 --- a/src/db/repositories/joinHelpers.ts +++ b/src/db/repositories/joinHelpers.ts @@ -1,4 +1,4 @@ -import { type SQL, and, eq, or, sql } from 'drizzle-orm'; +import { and, eq, or, type SQL, sql } from 'drizzle-orm'; import { agentRuns, prWorkItems } from '../schema/index.js'; /** diff --git a/src/db/repositories/prWorkItemsRepository.ts b/src/db/repositories/prWorkItemsRepository.ts index 623cd08a..822816be 100644 --- a/src/db/repositories/prWorkItemsRepository.ts +++ b/src/db/repositories/prWorkItemsRepository.ts @@ -1,5 +1,4 @@ import { - type SQL, and, countDistinct, desc, @@ -8,10 +7,11 @@ import { isNotNull, isNull, max, + type SQL, sum, } from 'drizzle-orm'; import { getDb } from '../client.js'; -import { agentRuns, prWorkItems, projects } from '../schema/index.js'; +import { agentRuns, projects, prWorkItems } from '../schema/index.js'; import { buildAgentRunWorkItemJoin } from './joinHelpers.js'; export interface LinkPRToWorkItemOptions { diff --git a/src/db/repositories/runStatsRepository.ts b/src/db/repositories/runStatsRepository.ts index 68279bfe..4d303f09 100644 --- a/src/db/repositories/runStatsRepository.ts +++ b/src/db/repositories/runStatsRepository.ts @@ -1,6 +1,6 @@ -import { type SQL, and, asc, count, desc, eq, gte, inArray, lte, sql } from 'drizzle-orm'; +import { and, asc, count, desc, eq, gte, inArray, lte, type SQL, sql } from 'drizzle-orm'; import { getDb } from '../client.js'; -import { agentRuns, organizations, prWorkItems, projects } from '../schema/index.js'; +import { agentRuns, organizations, projects, prWorkItems } from '../schema/index.js'; import { buildAgentRunWorkItemJoin } from './joinHelpers.js'; // ============================================================================ diff --git a/src/db/repositories/runsRepository.ts b/src/db/repositories/runsRepository.ts index 18854df5..13144691 100644 --- a/src/db/repositories/runsRepository.ts +++ b/src/db/repositories/runsRepository.ts @@ -1,4 +1,4 @@ -import { type SQL, and, count, desc, eq, gte, isNull } from 'drizzle-orm'; +import { and, count, desc, eq, gte, isNull, type SQL } from 'drizzle-orm'; import { getDb } from '../client.js'; import { agentRuns, prWorkItems } from '../schema/index.js'; import { buildAgentRunWorkItemJoin } from './joinHelpers.js'; @@ -306,6 +306,13 @@ export async function cancelRunById(runId: string, reason: string): Promise { - output += data.toString(); + _output += data.toString(); }); sg.stderr.on('data', (data: Buffer) => { errorOutput += data.toString(); diff --git a/src/gadgets/Finish.ts b/src/gadgets/Finish.ts index 423a444a..d539461f 100644 --- a/src/gadgets/Finish.ts +++ b/src/gadgets/Finish.ts @@ -1,8 +1,7 @@ import { TaskCompletionSignal } from 'llmist'; import { validateFinish, writePushedChangesSidecar } from './session/core/finish.js'; import { finishDef } from './session/definitions.js'; -import { PUSHED_CHANGES_SIDECAR_ENV_VAR } from './sessionState.js'; -import { getSessionState } from './sessionState.js'; +import { getSessionState, PUSHED_CHANGES_SIDECAR_ENV_VAR } from './sessionState.js'; import { createGadgetClass } from './shared/gadgetFactory.js'; export const Finish = createGadgetClass(finishDef, async (params) => { diff --git a/src/gadgets/ListDirectory.ts b/src/gadgets/ListDirectory.ts index 602522a7..1e01489b 100644 --- a/src/gadgets/ListDirectory.ts +++ b/src/gadgets/ListDirectory.ts @@ -5,7 +5,7 @@ * Use includeGitIgnored=true to include all files. */ import { execSync } from 'node:child_process'; -import { type Stats, readdirSync, statSync } from 'node:fs'; +import { readdirSync, type Stats, statSync } from 'node:fs'; import { join, relative } from 'node:path'; import { Gadget, z } from 'llmist'; diff --git a/src/gadgets/github/index.ts b/src/gadgets/github/index.ts index 25a055bf..0eaef1b0 100644 --- a/src/gadgets/github/index.ts +++ b/src/gadgets/github/index.ts @@ -1,13 +1,5 @@ export { CreatePR } from './CreatePR.js'; export { CreatePRReview } from './CreatePRReview.js'; -export { GetCIRunLogs } from './GetCIRunLogs.js'; -export { formatCheckStatus, GetPRChecks } from './GetPRChecks.js'; -export { GetPRComments } from './GetPRComments.js'; -export { GetPRDetails } from './GetPRDetails.js'; -export { GetPRDiff } from './GetPRDiff.js'; -export { PostPRComment } from './PostPRComment.js'; -export { ReplyToReviewComment } from './ReplyToReviewComment.js'; -export { UpdatePRComment } from './UpdatePRComment.js'; export { createPRDef, createPRReviewDef, @@ -20,3 +12,11 @@ export { replyToReviewCommentDef, updatePRCommentDef, } from './definitions.js'; +export { GetCIRunLogs } from './GetCIRunLogs.js'; +export { formatCheckStatus, GetPRChecks } from './GetPRChecks.js'; +export { GetPRComments } from './GetPRComments.js'; +export { GetPRDetails } from './GetPRDetails.js'; +export { GetPRDiff } from './GetPRDiff.js'; +export { PostPRComment } from './PostPRComment.js'; +export { ReplyToReviewComment } from './ReplyToReviewComment.js'; +export { UpdatePRComment } from './UpdatePRComment.js'; diff --git a/src/gadgets/pm/AddChecklist.ts b/src/gadgets/pm/AddChecklist.ts index 9d3c96be..7e19fb6b 100644 --- a/src/gadgets/pm/AddChecklist.ts +++ b/src/gadgets/pm/AddChecklist.ts @@ -1,5 +1,5 @@ import { createGadgetClass } from '../shared/gadgetFactory.js'; -import { type ChecklistItemInput, addChecklist } from './core/addChecklist.js'; +import { addChecklist, type ChecklistItemInput } from './core/addChecklist.js'; import { addChecklistDef } from './definitions.js'; export const AddChecklist = createGadgetClass(addChecklistDef, async (params) => { diff --git a/src/gadgets/pm/core/readWorkItem.ts b/src/gadgets/pm/core/readWorkItem.ts index 912f4928..674198da 100644 --- a/src/gadgets/pm/core/readWorkItem.ts +++ b/src/gadgets/pm/core/readWorkItem.ts @@ -1,5 +1,5 @@ -import { filterImageMedia, getPMProvider } from '../../../pm/index.js'; import type { Attachment, MediaReference } from '../../../pm/index.js'; +import { filterImageMedia, getPMProvider } from '../../../pm/index.js'; interface Label { name: string; diff --git a/src/gadgets/pm/index.ts b/src/gadgets/pm/index.ts index 5a0cc88d..aae6ed07 100644 --- a/src/gadgets/pm/index.ts +++ b/src/gadgets/pm/index.ts @@ -1,9 +1,9 @@ -export { ReadWorkItem } from './ReadWorkItem.js'; -export { PostComment } from './PostComment.js'; -export { UpdateWorkItem } from './UpdateWorkItem.js'; +export { AddChecklist } from './AddChecklist.js'; export { CreateWorkItem } from './CreateWorkItem.js'; +export { PMDeleteChecklistItem } from './DeleteChecklistItem.js'; export { ListWorkItems } from './ListWorkItems.js'; export { MoveWorkItem } from './MoveWorkItem.js'; -export { AddChecklist } from './AddChecklist.js'; +export { PostComment } from './PostComment.js'; +export { ReadWorkItem } from './ReadWorkItem.js'; export { PMUpdateChecklistItem } from './UpdateChecklistItem.js'; -export { PMDeleteChecklistItem } from './DeleteChecklistItem.js'; +export { UpdateWorkItem } from './UpdateWorkItem.js'; diff --git a/src/gadgets/sentry/index.ts b/src/gadgets/sentry/index.ts index 1106f329..86dcbfbb 100644 --- a/src/gadgets/sentry/index.ts +++ b/src/gadgets/sentry/index.ts @@ -1,3 +1,3 @@ -export { GetAlertingIssue } from './GetAlertingIssue.js'; export { GetAlertingEventDetail } from './GetAlertingEventDetail.js'; +export { GetAlertingIssue } from './GetAlertingIssue.js'; export { ListAlertingEvents } from './ListAlertingEvents.js'; diff --git a/src/gadgets/shared/diagnosticState.ts b/src/gadgets/shared/diagnosticState.ts index 8ed42269..8a8448a4 100644 --- a/src/gadgets/shared/diagnosticState.ts +++ b/src/gadgets/shared/diagnosticState.ts @@ -5,8 +5,8 @@ * allowing the trailing message to display consolidated diagnostic status. */ -import { runDiagnostics as runDiagnosticsCore, shouldRunDiagnostics } from './diagnostics.js'; import type { DiagnosticsResult } from './diagnostics.js'; +import { runDiagnostics as runDiagnosticsCore, shouldRunDiagnostics } from './diagnostics.js'; /** * Individual diagnostic error. diff --git a/src/gadgets/shared/index.ts b/src/gadgets/shared/index.ts index 0809dc76..293b4639 100644 --- a/src/gadgets/shared/index.ts +++ b/src/gadgets/shared/index.ts @@ -2,14 +2,14 @@ * Shared utilities and factory functions for gadgets, CLI commands, and tool manifests. */ -export * from './types.js'; -export * from './matcher.js'; -export * from './pathValidation.js'; -export * from './diagnostics.js'; +export * from './cliCommandFactory.js'; export * from './diagnosticState.js'; +export * from './diagnostics.js'; +export * from './gadgetFactory.js'; +export * from './manifestGenerator.js'; +export * from './matcher.js'; export * from './onFileEditHook.js'; +export * from './pathValidation.js'; export * from './postEditChecks.js'; export * from './toolDefinition.js'; -export * from './gadgetFactory.js'; -export * from './cliCommandFactory.js'; -export * from './manifestGenerator.js'; +export * from './types.js'; diff --git a/src/gadgets/tmux.ts b/src/gadgets/tmux.ts index 891eb44d..a1ab93de 100644 --- a/src/gadgets/tmux.ts +++ b/src/gadgets/tmux.ts @@ -1,7 +1,7 @@ +export type { CompletedSessionNotice } from './tmux/index.js'; export { - Tmux, consumePendingSessionNotices, - validateGitCommand, resolveWorkingDirectory, + Tmux, + validateGitCommand, } from './tmux/index.js'; -export type { CompletedSessionNotice } from './tmux/index.js'; diff --git a/src/gadgets/tmux/TmuxGadget.ts b/src/gadgets/tmux/TmuxGadget.ts index 6142c6b3..a7ba131d 100644 --- a/src/gadgets/tmux/TmuxGadget.ts +++ b/src/gadgets/tmux/TmuxGadget.ts @@ -5,7 +5,6 @@ * All commands run as windows within a single control session. */ import { Gadget, z } from 'llmist'; -import { type TmuxControlClient, getControlClient } from './TmuxControlClient.js'; import { DEFAULT_TIMEOUT_MS, DEFAULT_WAIT_MS, @@ -18,6 +17,7 @@ import { import { CommandFailedError } from './errors.js'; import { validateGitCommand } from './gitValidation.js'; import { addPendingNotice } from './sessionNotices.js'; +import { getControlClient, type TmuxControlClient } from './TmuxControlClient.js'; import { sanitizeSessionName, sleep } from './utils.js'; export class TmuxGadget extends Gadget({ diff --git a/src/gadgets/tmux/index.ts b/src/gadgets/tmux/index.ts index 79f29402..a0f74bc7 100644 --- a/src/gadgets/tmux/index.ts +++ b/src/gadgets/tmux/index.ts @@ -1,5 +1,5 @@ -export { TmuxGadget as Tmux } from './TmuxGadget.js'; -export { consumePendingSessionNotices } from './sessionNotices.js'; -export type { CompletedSessionNotice } from './sessionNotices.js'; export { validateGitCommand } from './gitValidation.js'; +export type { CompletedSessionNotice } from './sessionNotices.js'; +export { consumePendingSessionNotices } from './sessionNotices.js'; +export { TmuxGadget as Tmux } from './TmuxGadget.js'; export { resolveWorkingDirectory } from './utils.js'; diff --git a/src/gadgets/todo/TodoUpdateStatus.ts b/src/gadgets/todo/TodoUpdateStatus.ts index db407b8e..aa39d5d4 100644 --- a/src/gadgets/todo/TodoUpdateStatus.ts +++ b/src/gadgets/todo/TodoUpdateStatus.ts @@ -3,7 +3,7 @@ * Helps agents track progress through implementation tasks. */ import { Gadget, z } from 'llmist'; -import { type TodoStatus, formatTodoList, loadTodos, saveTodos } from './storage.js'; +import { formatTodoList, loadTodos, saveTodos, type TodoStatus } from './storage.js'; export class TodoUpdateStatus extends Gadget({ name: 'TodoUpdateStatus', diff --git a/src/gadgets/todo/TodoUpsert.ts b/src/gadgets/todo/TodoUpsert.ts index d9b3fe19..28528b3f 100644 --- a/src/gadgets/todo/TodoUpsert.ts +++ b/src/gadgets/todo/TodoUpsert.ts @@ -3,7 +3,7 @@ * Helps agents plan and organize their implementation tasks. */ import { Gadget, z } from 'llmist'; -import { type Todo, formatTodoList, getNextId, loadTodos, saveTodos } from './storage.js'; +import { formatTodoList, getNextId, loadTodos, saveTodos, type Todo } from './storage.js'; interface TodoItem { id?: string; diff --git a/src/gadgets/todo/index.ts b/src/gadgets/todo/index.ts index 55cc36a3..001e052d 100644 --- a/src/gadgets/todo/index.ts +++ b/src/gadgets/todo/index.ts @@ -2,7 +2,8 @@ * Todo gadgets for agent task tracking. * Helps agents plan work and track progress through implementation tasks. */ + +export { initTodoSession } from './storage.js'; +export { TodoDelete } from './TodoDelete.js'; export { TodoUpdateStatus } from './TodoUpdateStatus.js'; export { TodoUpsert } from './TodoUpsert.js'; -export { TodoDelete } from './TodoDelete.js'; -export { initTodoSession } from './storage.js'; diff --git a/src/gadgets/todo/storage.ts b/src/gadgets/todo/storage.ts index 4ef69bc8..9bafcb44 100644 --- a/src/gadgets/todo/storage.ts +++ b/src/gadgets/todo/storage.ts @@ -88,7 +88,7 @@ export function saveTodos(todos: Todo[]): void { * Generates the next available todo ID (incrementing integer). */ export function getNextId(todos: Todo[]): string { - const maxId = todos.reduce((max, t) => Math.max(max, Number.parseInt(t.id) || 0), 0); + const maxId = todos.reduce((max, t) => Math.max(max, Number.parseInt(t.id, 10) || 0), 0); return String(maxId + 1); } diff --git a/src/integrations/index.ts b/src/integrations/index.ts index f264ce17..ee45be4d 100644 --- a/src/integrations/index.ts +++ b/src/integrations/index.ts @@ -10,7 +10,7 @@ * - `integrationRegistry` singleton — the shared registry instance */ -export type { IntegrationModule, IntegrationWebhookEvent } from './types.js'; -export type { SCMIntegration } from './scm.js'; export type { AlertingIntegration } from './alerting.js'; export { IntegrationRegistry, integrationRegistry } from './registry.js'; +export type { SCMIntegration } from './scm.js'; +export type { IntegrationModule, IntegrationWebhookEvent } from './types.js'; diff --git a/src/pm/index.ts b/src/pm/index.ts index 13eab619..332e2894 100644 --- a/src/pm/index.ts +++ b/src/pm/index.ts @@ -1,34 +1,31 @@ +export { getPMProvider, getPMProviderOrNull, withPMProvider } from './context.js'; +// PMIntegration interface + registry +export type { PMIntegration, PMWebhookEvent } from './integration.js'; +export { hasPmIntegration } from './integration.js'; +export { JiraPMProvider } from './jira/adapter.js'; +export type { ProjectPMConfig } from './lifecycle.js'; +export { hasAutoLabel, PMLifecycleManager, resolveProjectPMConfig } from './lifecycle.js'; +export { + extractMarkdownImages, + filterImageMedia, + isImageMimeType, + MAX_IMAGE_SIZE_BYTES, + MAX_IMAGES_PER_WORK_ITEM, +} from './media.js'; +export { pmRegistry } from './registry.js'; +export { TrelloPMProvider } from './trello/adapter.js'; export type { + Attachment, + Checklist, + ChecklistItem, + CreateWorkItemConfig, + MediaReference, PMProvider, PMType, WorkItem, WorkItemComment, WorkItemLabel, - Checklist, - ChecklistItem, - Attachment, - CreateWorkItemConfig, - MediaReference, } from './types.js'; - -export { - MAX_IMAGE_SIZE_BYTES, - MAX_IMAGES_PER_WORK_ITEM, - isImageMimeType, - filterImageMedia, - extractMarkdownImages, -} from './media.js'; - -export { withPMProvider, getPMProvider, getPMProviderOrNull } from './context.js'; -export { TrelloPMProvider } from './trello/adapter.js'; -export { JiraPMProvider } from './jira/adapter.js'; -export { PMLifecycleManager, resolveProjectPMConfig, hasAutoLabel } from './lifecycle.js'; -export type { ProjectPMConfig } from './lifecycle.js'; - -// PMIntegration interface + registry -export type { PMIntegration, PMWebhookEvent } from './integration.js'; -export { hasPmIntegration } from './integration.js'; -export { pmRegistry } from './registry.js'; export { processPMWebhook } from './webhook-handler.js'; import { integrationRegistry } from '../integrations/registry.js'; diff --git a/src/router/ackMessageGenerator.ts b/src/router/ackMessageGenerator.ts index bab9d2f8..0f757d26 100644 --- a/src/router/ackMessageGenerator.ts +++ b/src/router/ackMessageGenerator.ts @@ -231,7 +231,7 @@ export async function generateAckMessage( const result = await Promise.race([llmPromise, timeoutPromise]); - if (!result || !result.trim()) { + if (!result?.trim()) { return fallback; } diff --git a/src/router/adapters/github.ts b/src/router/adapters/github.ts index da717bd7..65bd914f 100644 --- a/src/router/adapters/github.ts +++ b/src/router/adapters/github.ts @@ -12,8 +12,8 @@ import { getProjectGitHubToken } from '../../config/projects.js'; import { findProjectByRepo } from '../../config/provider.js'; import { withGitHubToken } from '../../github/client.js'; import { - type PersonaIdentities, isCascadeBot, + type PersonaIdentities, resolvePersonaIdentities, } from '../../github/personas.js'; import { withPMCredentials, withPMProvider } from '../../pm/context.js'; @@ -30,7 +30,7 @@ import { postTrelloAck, resolveGitHubTokenForAckByAgent, } from '../acknowledgments.js'; -import { type RouterProjectConfig, loadProjectConfig } from '../config.js'; +import { loadProjectConfig, type RouterProjectConfig } from '../config.js'; import { extractPRNumber } from '../notifications.js'; import type { AckResult, ParsedWebhookEvent, RouterPlatformAdapter } from '../platform-adapter.js'; import { addEyesReactionToPR } from '../pre-actions.js'; diff --git a/src/router/adapters/jira.ts b/src/router/adapters/jira.ts index 91475d3b..0e8c0544 100644 --- a/src/router/adapters/jira.ts +++ b/src/router/adapters/jira.ts @@ -14,7 +14,7 @@ import { logger } from '../../utils/logging.js'; import { buildWorkItemRunsLink, getDashboardUrl } from '../../utils/runLink.js'; import { extractJiraContext, generateAckMessage } from '../ackMessageGenerator.js'; import { postJiraAck, resolveJiraBotAccountId } from '../acknowledgments.js'; -import { type RouterProjectConfig, loadProjectConfig } from '../config.js'; +import { loadProjectConfig, type RouterProjectConfig } from '../config.js'; import type { AckResult, ParsedWebhookEvent, RouterPlatformAdapter } from '../platform-adapter.js'; import { resolveJiraCredentials } from '../platformClients/index.js'; import type { CascadeJob, JiraJob } from '../queue.js'; diff --git a/src/router/adapters/sentry.ts b/src/router/adapters/sentry.ts index a49f2a65..78bcfab1 100644 --- a/src/router/adapters/sentry.ts +++ b/src/router/adapters/sentry.ts @@ -11,7 +11,7 @@ import type { SentryAugmentedPayload } from '../../sentry/types.js'; import type { TriggerRegistry } from '../../triggers/registry.js'; import type { TriggerContext, TriggerResult } from '../../types/index.js'; import { logger } from '../../utils/logging.js'; -import { type RouterProjectConfig, loadProjectConfig } from '../config.js'; +import { loadProjectConfig, type RouterProjectConfig } from '../config.js'; import type { AckResult, ParsedWebhookEvent, RouterPlatformAdapter } from '../platform-adapter.js'; import type { CascadeJob, SentryJob } from '../queue.js'; diff --git a/src/router/adapters/trello.ts b/src/router/adapters/trello.ts index b9c60d4a..88a4b8f7 100644 --- a/src/router/adapters/trello.ts +++ b/src/router/adapters/trello.ts @@ -14,7 +14,7 @@ import { logger } from '../../utils/logging.js'; import { buildWorkItemRunsLink, getDashboardUrl } from '../../utils/runLink.js'; import { extractTrelloContext, generateAckMessage } from '../ackMessageGenerator.js'; import { postTrelloAck } from '../acknowledgments.js'; -import { type RouterProjectConfig, loadProjectConfig } from '../config.js'; +import { loadProjectConfig, type RouterProjectConfig } from '../config.js'; import type { AckResult, ParsedWebhookEvent, RouterPlatformAdapter } from '../platform-adapter.js'; import { resolveTrelloCredentials } from '../platformClients/index.js'; import type { CascadeJob, TrelloJob } from '../queue.js'; diff --git a/src/router/container-manager.ts b/src/router/container-manager.ts index d4ea8ba1..029a0be0 100644 --- a/src/router/container-manager.ts +++ b/src/router/container-manager.ts @@ -40,19 +40,19 @@ export { getActiveWorkers, } from './active-workers.js'; export { + scanAndCleanupOrphans, startOrphanCleanup, stopOrphanCleanup, - scanAndCleanupOrphans, } from './orphan-cleanup.js'; -export { - buildWorkerEnv, - extractProjectIdFromJob, -} from './worker-env.js'; export { getSnapshot, invalidateSnapshot, registerSnapshot, } from './snapshot-manager.js'; +export { + buildWorkerEnv, + extractProjectIdFromJob, +} from './worker-env.js'; const docker = new Docker(); diff --git a/src/router/platformClients/index.ts b/src/router/platformClients/index.ts index e0c5efe4..e9b4f9b9 100644 --- a/src/router/platformClients/index.ts +++ b/src/router/platformClients/index.ts @@ -8,12 +8,12 @@ * directory path. */ -export type { JiraCredentialsWithAuth, PlatformCommentClient, TrelloCredentials } from './types.js'; export { resolveGitHubHeaders, resolveJiraCredentials, resolveTrelloCredentials, } from './credentials.js'; -export { TrelloPlatformClient } from './trello.js'; export { GitHubPlatformClient } from './github.js'; -export { JiraPlatformClient, _resetJiraCloudIdCache } from './jira.js'; +export { _resetJiraCloudIdCache, JiraPlatformClient } from './jira.js'; +export { TrelloPlatformClient } from './trello.js'; +export type { JiraCredentialsWithAuth, PlatformCommentClient, TrelloCredentials } from './types.js'; diff --git a/src/router/platformClients/types.ts b/src/router/platformClients/types.ts index 50d91793..bb34cc3d 100644 --- a/src/router/platformClients/types.ts +++ b/src/router/platformClients/types.ts @@ -3,6 +3,7 @@ */ import type { JiraCredentials } from '../../jira/types.js'; + export type { TrelloCredentials } from '../../trello/types.js'; /** Extends JiraCredentials with a pre-computed Base64 Basic auth header value. */ diff --git a/src/router/reactions.ts b/src/router/reactions.ts index 7ea086bf..010f844d 100644 --- a/src/router/reactions.ts +++ b/src/router/reactions.ts @@ -9,14 +9,14 @@ */ import { getProjectGitHubToken } from '../config/projects.js'; -import { type PersonaIdentities, isCascadeBot } from '../github/personas.js'; +import { isCascadeBot, type PersonaIdentities } from '../github/personas.js'; import { trelloClient, withTrelloCredentials } from '../trello/client.js'; import type { ProjectConfig } from '../types/index.js'; import { logger } from '../utils/logging.js'; import { parseRepoFullName } from '../utils/repo.js'; import { - JiraPlatformClient, _resetJiraCloudIdCache, + JiraPlatformClient, resolveGitHubHeaders, resolveTrelloCredentials, } from './platformClients/index.js'; diff --git a/src/sentry/alerting-integration.ts b/src/sentry/alerting-integration.ts index ba2c5bb8..43cfc4d0 100644 --- a/src/sentry/alerting-integration.ts +++ b/src/sentry/alerting-integration.ts @@ -15,9 +15,9 @@ import { getIntegrationCredential } from '../config/provider.js'; import type { AlertingIntegration } from '../integrations/alerting.js'; import { - type SentryIntegrationConfig, getSentryIntegrationConfig, hasAlertingIntegration, + type SentryIntegrationConfig, } from './integration.js'; export class SentryAlertingIntegration implements AlertingIntegration { diff --git a/src/triggers/github/index.ts b/src/triggers/github/index.ts index 47060e2d..475d1dcd 100644 --- a/src/triggers/github/index.ts +++ b/src/triggers/github/index.ts @@ -6,8 +6,8 @@ export { PRMergedTrigger } from './pr-merged.js'; export { PROpenedTrigger } from './pr-opened.js'; export { PRReadyToMergeTrigger } from './pr-ready-to-merge.js'; export { PRReviewSubmittedTrigger } from './pr-review-submitted.js'; -export { ReviewRequestedTrigger } from './review-requested.js'; -export { processGitHubWebhook } from './webhook-handler.js'; export { registerGitHubTriggers } from './register.js'; +export { ReviewRequestedTrigger } from './review-requested.js'; export * from './types.js'; export * from './utils.js'; +export { processGitHubWebhook } from './webhook-handler.js'; diff --git a/src/triggers/github/pr-ready-to-merge.ts b/src/triggers/github/pr-ready-to-merge.ts index 0be98982..8fe74741 100644 --- a/src/triggers/github/pr-ready-to-merge.ts +++ b/src/triggers/github/pr-ready-to-merge.ts @@ -1,7 +1,7 @@ import { githubClient } from '../../github/client.js'; import { getPMProvider } from '../../pm/context.js'; -import { hasAutoLabel, resolveProjectPMConfig } from '../../pm/lifecycle.js'; import type { ProjectPMConfig } from '../../pm/lifecycle.js'; +import { hasAutoLabel, resolveProjectPMConfig } from '../../pm/lifecycle.js'; import type { PMProvider } from '../../pm/types.js'; import type { TriggerContext, TriggerHandler, TriggerResult } from '../../types/index.js'; import { logger } from '../../utils/logging.js'; diff --git a/src/triggers/index.ts b/src/triggers/index.ts index a9a45e9c..89ab4418 100644 --- a/src/triggers/index.ts +++ b/src/triggers/index.ts @@ -1,12 +1,12 @@ -export { type TriggerRegistry, createTriggerRegistry } from './registry.js'; +export { registerBuiltInTriggers } from './builtins.js'; +export { processGitHubWebhook } from './github/webhook-handler.js'; +export { processJiraWebhook } from './jira/webhook-handler.js'; +export { createTriggerRegistry, type TriggerRegistry } from './registry.js'; +export { processTrelloWebhook } from './trello/webhook-handler.js'; export type { + TrelloWebhookPayload, TriggerContext, TriggerHandler, TriggerResult, - TrelloWebhookPayload, } from './types.js'; export { isTrelloWebhookPayload } from './types.js'; -export { processTrelloWebhook } from './trello/webhook-handler.js'; -export { processGitHubWebhook } from './github/webhook-handler.js'; -export { processJiraWebhook } from './jira/webhook-handler.js'; -export { registerBuiltInTriggers } from './builtins.js'; diff --git a/src/triggers/jira/index.ts b/src/triggers/jira/index.ts index f577c40a..b5c39b0b 100644 --- a/src/triggers/jira/index.ts +++ b/src/triggers/jira/index.ts @@ -5,7 +5,7 @@ */ export { JiraCommentMentionTrigger } from './comment-mention.js'; -export { JiraStatusChangedTrigger } from './status-changed.js'; export { JiraReadyToProcessLabelTrigger } from './label-added.js'; -export { processJiraWebhook } from './webhook-handler.js'; export { registerJiraTriggers } from './register.js'; +export { JiraStatusChangedTrigger } from './status-changed.js'; +export { processJiraWebhook } from './webhook-handler.js'; diff --git a/src/triggers/shared/agent-execution.ts b/src/triggers/shared/agent-execution.ts index e347d0f9..156b66ef 100644 --- a/src/triggers/shared/agent-execution.ts +++ b/src/triggers/shared/agent-execution.ts @@ -6,9 +6,9 @@ import { updateRunPRNumber } from '../../db/repositories/runsRepository.js'; import { getJiraConfig, getTrelloConfig } from '../../pm/config.js'; import { getPMProvider } from '../../pm/context.js'; import { - PMLifecycleManager, createPMProvider, hasAutoLabel, + PMLifecycleManager, resolveProjectPMConfig, } from '../../pm/index.js'; import { checkTriggerEnabled } from '../../triggers/shared/trigger-check.js'; @@ -22,8 +22,8 @@ import { checkBudgetExceeded } from './budget.js'; import { triggerDebugAnalysis } from './debug-runner.js'; import { shouldTriggerDebug } from './debug-trigger.js'; import { - type ValidationResult, formatValidationErrors, + type ValidationResult, validateIntegrations, } from './integration-validation.js'; diff --git a/src/triggers/shared/agent-pm-poster.ts b/src/triggers/shared/agent-pm-poster.ts index 1e8c244e..cdecca9f 100644 --- a/src/triggers/shared/agent-pm-poster.ts +++ b/src/triggers/shared/agent-pm-poster.ts @@ -221,7 +221,7 @@ export async function postAgentOutputToPM( output: string, progressCommentId?: string, ): Promise { - if (!output || !output.trim()) { + if (!output?.trim()) { logger.warn('postAgentOutputToPM skipped: empty output', { workItemId, agentType }); return; } diff --git a/src/triggers/shared/trigger-check.ts b/src/triggers/shared/trigger-check.ts index 4f0914d0..38a29391 100644 --- a/src/triggers/shared/trigger-check.ts +++ b/src/triggers/shared/trigger-check.ts @@ -41,7 +41,7 @@ export async function checkTriggerEnabledWithParams( handlerName: string, ): Promise<{ enabled: boolean; parameters: Record }> { const config = await getResolvedTriggerConfig(projectId, agentType, triggerEvent); - if (!config || !config.enabled) { + if (!config?.enabled) { logger.info('Trigger disabled by config, skipping', { handler: handlerName, agentType, diff --git a/src/triggers/trello/index.ts b/src/triggers/trello/index.ts index 4b285da0..04806ebb 100644 --- a/src/triggers/trello/index.ts +++ b/src/triggers/trello/index.ts @@ -4,12 +4,12 @@ * For trigger registration use `registerTrelloTriggers` from `./register.js`. */ +export { TrelloCommentMentionTrigger } from './comment-mention.js'; +export { ReadyToProcessLabelTrigger } from './label-added.js'; +export { registerTrelloTriggers } from './register.js'; export { TrelloStatusChangedPlanningTrigger, TrelloStatusChangedSplittingTrigger, TrelloStatusChangedTodoTrigger, } from './status-changed.js'; -export { TrelloCommentMentionTrigger } from './comment-mention.js'; -export { ReadyToProcessLabelTrigger } from './label-added.js'; export { processTrelloWebhook } from './webhook-handler.js'; -export { registerTrelloTriggers } from './register.js'; diff --git a/src/triggers/trello/status-changed.ts b/src/triggers/trello/status-changed.ts index 2d837e69..9161db7c 100644 --- a/src/triggers/trello/status-changed.ts +++ b/src/triggers/trello/status-changed.ts @@ -3,7 +3,7 @@ import { invalidateSnapshot } from '../../router/snapshot-manager.js'; import { logger } from '../../utils/logging.js'; import { checkTriggerEnabled } from '../shared/trigger-check.js'; import type { TriggerContext, TriggerHandler, TriggerResult } from '../types.js'; -import { type TrelloWebhookPayload, isTrelloWebhookPayload } from './types.js'; +import { isTrelloWebhookPayload, type TrelloWebhookPayload } from './types.js'; // ============================================================================ // Status Changed Trigger Factory (Trello) diff --git a/src/triggers/types.ts b/src/triggers/types.ts index 570df297..f31e37f8 100644 --- a/src/triggers/types.ts +++ b/src/triggers/types.ts @@ -1,7 +1,6 @@ import type { TriggerContext, TriggerHandler, TriggerResult } from '../types/index.js'; -export type { TriggerContext, TriggerHandler, TriggerResult }; - // Re-export Trello types from their canonical location export type { TrelloWebhookPayload } from './trello/types.js'; export { isTrelloWebhookPayload } from './trello/types.js'; +export type { TriggerContext, TriggerHandler, TriggerResult }; diff --git a/src/utils/fileLogger.ts b/src/utils/fileLogger.ts index be270d9d..718ae4cb 100644 --- a/src/utils/fileLogger.ts +++ b/src/utils/fileLogger.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import { PassThrough } from 'node:stream'; import archiver from 'archiver'; -import { type LLMCallLogger, createLLMCallLogger } from './llmLogging.js'; +import { createLLMCallLogger, type LLMCallLogger } from './llmLogging.js'; import { getWorkspaceDir } from './repo.js'; export interface FileLogger { diff --git a/src/utils/index.ts b/src/utils/index.ts index de5a5b91..32901c79 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,16 +1,16 @@ -export { logger, setLogLevel, getLogLevel } from './logging.js'; +export { cleanupLogFile, createFileLogger, type FileLogger } from './fileLogger.js'; export { - startWatchdog, clearWatchdog, - setWatchdogCleanup, clearWatchdogCleanup, + setWatchdogCleanup, + startWatchdog, } from './lifecycle.js'; +export { getLogLevel, logger, setLogLevel } from './logging.js'; export { - createTempDir, - cloneRepo, cleanupTempDir, - runCommand, + cloneRepo, + createTempDir, getWorkspaceDir, parseRepoFullName, + runCommand, } from './repo.js'; -export { createFileLogger, cleanupLogFile, type FileLogger } from './fileLogger.js'; diff --git a/src/utils/llmLogging.ts b/src/utils/llmLogging.ts index 69284559..01647069 100644 --- a/src/utils/llmLogging.ts +++ b/src/utils/llmLogging.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; -import { type LLMMessage, extractMessageText } from 'llmist'; +import { extractMessageText, type LLMMessage } from 'llmist'; /** * Formats LLM messages as plain text for debugging. diff --git a/src/utils/logging.ts b/src/utils/logging.ts index cacf26f7..a8b53b35 100644 --- a/src/utils/logging.ts +++ b/src/utils/logging.ts @@ -1,5 +1,5 @@ -import { createLogger } from 'llmist'; import type { ILogObj, Logger } from 'llmist'; +import { createLogger } from 'llmist'; export const LOG_LEVELS: Record = { silly: 0, diff --git a/src/webhook/webhookHandlers.ts b/src/webhook/webhookHandlers.ts index c839f1c6..b5e9f00a 100644 --- a/src/webhook/webhookHandlers.ts +++ b/src/webhook/webhookHandlers.ts @@ -20,13 +20,13 @@ import { handleProcessingError, logSuccessfulWebhook } from './webhookLogging.js // Re-exports // --------------------------------------------------------------------------- -export type { ParseResult, WebhookHandlerConfig, WebhookLogOverrides } from './webhookTypes.js'; export { parseGitHubPayload, parseJiraPayload, parseSentryPayload, parseTrelloPayload, } from './webhookParsers.js'; +export type { ParseResult, WebhookHandlerConfig, WebhookLogOverrides } from './webhookTypes.js'; // --------------------------------------------------------------------------- // Types (local import for factory use) diff --git a/src/worker-entry.ts b/src/worker-entry.ts index 365a74a5..2072559e 100644 --- a/src/worker-entry.ts +++ b/src/worker-entry.ts @@ -21,11 +21,11 @@ import { loadConfig } from './config/provider.js'; import { getDb } from './db/client.js'; import { captureException, flush, setTag } from './sentry.js'; import { - type TriggerRegistry, createTriggerRegistry, processGitHubWebhook, processJiraWebhook, registerBuiltInTriggers, + type TriggerRegistry, } from './triggers/index.js'; import { processSentryWebhook } from './triggers/sentry/webhook-handler.js'; import { processTrelloWebhook } from './triggers/trello/webhook-handler.js'; diff --git a/tests/docker/claude-code-auth/verify-auth.ts b/tests/docker/claude-code-auth/verify-auth.ts index 1cea3e81..91c22dcf 100644 --- a/tests/docker/claude-code-auth/verify-auth.ts +++ b/tests/docker/claude-code-auth/verify-auth.ts @@ -7,7 +7,7 @@ import { join } from 'node:path'; * to verify that subscription auth works in a containerized environment. * The SDK picks up the token automatically from the environment. */ -import { type SDKResultMessage, query } from '@anthropic-ai/claude-agent-sdk'; +import { query, type SDKResultMessage } from '@anthropic-ai/claude-agent-sdk'; const token = process.env.CLAUDE_CODE_OAUTH_TOKEN; if (!token) { diff --git a/tests/integration/db/agentDefinitionsRepository.test.ts b/tests/integration/db/agentDefinitionsRepository.test.ts index a55ea72c..9f201dbb 100644 --- a/tests/integration/db/agentDefinitionsRepository.test.ts +++ b/tests/integration/db/agentDefinitionsRepository.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it } from 'vitest'; -import { AgentDefinitionSchema } from '../../../src/agents/definitions/schema.js'; import type { AgentDefinition } from '../../../src/agents/definitions/schema.js'; +import { AgentDefinitionSchema } from '../../../src/agents/definitions/schema.js'; import { deleteAgentDefinition, getAgentDefinition, diff --git a/tests/integration/db/agentTriggerConfigsRepository.test.ts b/tests/integration/db/agentTriggerConfigsRepository.test.ts index c8bae7c0..3f746d7d 100644 --- a/tests/integration/db/agentTriggerConfigsRepository.test.ts +++ b/tests/integration/db/agentTriggerConfigsRepository.test.ts @@ -444,7 +444,7 @@ describe('agentTriggerConfigsRepository (integration)', () => { flag: true, }; - const config = await upsertTriggerConfig({ + const _config = await upsertTriggerConfig({ projectId: 'test-project', agentType: 'review', triggerEvent: 'scm:check-suite-success', diff --git a/tests/integration/db/projectsRepository.test.ts b/tests/integration/db/projectsRepository.test.ts index 63789733..37159dc0 100644 --- a/tests/integration/db/projectsRepository.test.ts +++ b/tests/integration/db/projectsRepository.test.ts @@ -511,7 +511,7 @@ describe('projectsRepository (integration)', () => { describe('optional fields round-trip', () => { it('all nullable fields read back correctly when set', async () => { - const project = await createProject('test-org', { + const _project = await createProject('test-org', { id: 'all-fields-project', name: 'All Fields Project', repo: 'owner/all-fields', diff --git a/tests/integration/github-personas.test.ts b/tests/integration/github-personas.test.ts index c4cf9639..da39f07d 100644 --- a/tests/integration/github-personas.test.ts +++ b/tests/integration/github-personas.test.ts @@ -12,10 +12,10 @@ import { writeProjectCredential, } from '../../src/db/repositories/credentialsRepository.js'; import { - type PersonaIdentities, getPersonaForAgentType, getPersonaForLogin, isCascadeBot, + type PersonaIdentities, } from '../../src/github/personas.js'; import { PRReviewSubmittedTrigger } from '../../src/triggers/github/pr-review-submitted.js'; import { ReviewRequestedTrigger } from '../../src/triggers/github/review-requested.js'; diff --git a/tests/integration/helpers/seed.ts b/tests/integration/helpers/seed.ts index 8d92cb6f..47101e6b 100644 --- a/tests/integration/helpers/seed.ts +++ b/tests/integration/helpers/seed.ts @@ -64,12 +64,7 @@ export async function seedProject( * Seeds a project-scoped credential via the repository. */ export async function seedCredential( - overrides: { - projectId?: string; - name?: string; - envVarKey?: string; - value?: string; - } = {}, + overrides: { projectId?: string; name?: string; envVarKey?: string; value?: string } = {}, ) { const projectId = overrides.projectId ?? 'test-project'; const envVarKey = overrides.envVarKey ?? 'TEST_KEY'; @@ -114,10 +109,7 @@ export async function seedIntegrationCredential(overrides: { role?: string; credentialId: number; }) { - // For backward compatibility: look up the integration and write to project_credentials - const { removeIntegrationCredential } = await import( - '../../../src/db/repositories/integrationsRepository.js' - ); + // For backward compatibility. // The credentialId is no longer meaningful after legacy table removal. // This function is preserved to avoid breaking existing test seeds that call it. // Integration credentials are now stored in project_credentials by envVarKey. @@ -264,11 +256,7 @@ export async function seedWebhookLog( * Seeds a prompt partial row. */ export async function seedPromptPartial( - overrides: { - orgId?: string | null; - name?: string; - content?: string; - } = {}, + overrides: { orgId?: string | null; name?: string; content?: string } = {}, ) { const db = getDb(); const [row] = await db @@ -285,11 +273,7 @@ export async function seedPromptPartial( /** * Seeds a session for a user. */ -export async function seedSession(overrides: { - userId: string; - token?: string; - expiresAt?: Date; -}) { +export async function seedSession(overrides: { userId: string; token?: string; expiresAt?: Date }) { const db = getDb(); const futureDate = new Date(); futureDate.setDate(futureDate.getDate() + 30); diff --git a/tests/unit/agents/capabilities/resolver.test.ts b/tests/unit/agents/capabilities/resolver.test.ts index 2946378b..d03d8932 100644 --- a/tests/unit/agents/capabilities/resolver.test.ts +++ b/tests/unit/agents/capabilities/resolver.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; /** Create a mock class with the given name so constructor.name works in assertions */ function mockClass(name: string) { diff --git a/tests/unit/agents/definitions/contextSteps.test.ts b/tests/unit/agents/definitions/contextSteps.test.ts index 86602498..c14d2566 100644 --- a/tests/unit/agents/definitions/contextSteps.test.ts +++ b/tests/unit/agents/definitions/contextSteps.test.ts @@ -32,11 +32,11 @@ vi.mock('../../../../src/gadgets/pm/core/readWorkItem.js', () => ({ readWorkItemWithMedia: vi.fn(), })); +import type { FetchContextParams } from '../../../../src/agents/definitions/contextSteps.js'; import { fetchWorkItemStep, prepopulateTodosStep, } from '../../../../src/agents/definitions/contextSteps.js'; -import type { FetchContextParams } from '../../../../src/agents/definitions/contextSteps.js'; import { readWorkItemWithMedia } from '../../../../src/gadgets/pm/core/readWorkItem.js'; import { initTodoSession, saveTodos } from '../../../../src/gadgets/todo/storage.js'; import { getPMProviderOrNull } from '../../../../src/pm/index.js'; diff --git a/tests/unit/agents/definitions/pipelineSnapshot.test.ts b/tests/unit/agents/definitions/pipelineSnapshot.test.ts index cf31b457..06f8aae8 100644 --- a/tests/unit/agents/definitions/pipelineSnapshot.test.ts +++ b/tests/unit/agents/definitions/pipelineSnapshot.test.ts @@ -8,8 +8,8 @@ vi.mock('../../../../src/gadgets/pm/core/readWorkItem.js', () => ({ readWorkItem: vi.fn(), })); -import { fetchPipelineSnapshotStep } from '../../../../src/agents/definitions/contextSteps.js'; import type { FetchContextParams } from '../../../../src/agents/definitions/contextSteps.js'; +import { fetchPipelineSnapshotStep } from '../../../../src/agents/definitions/contextSteps.js'; import { readWorkItem } from '../../../../src/gadgets/pm/core/readWorkItem.js'; import { getPMProviderOrNull } from '../../../../src/pm/index.js'; import type { AgentInput, ProjectConfig } from '../../../../src/types/index.js'; diff --git a/tests/unit/agents/hooks.test.ts b/tests/unit/agents/hooks.test.ts index 528b2231..8be48094 100644 --- a/tests/unit/agents/hooks.test.ts +++ b/tests/unit/agents/hooks.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/utils/llmMetrics.js', () => ({ calculateCost: vi.fn().mockReturnValue(0.005), diff --git a/tests/unit/agents/registry.test.ts b/tests/unit/agents/registry.test.ts index 9f3068d2..f477a6e7 100644 --- a/tests/unit/agents/registry.test.ts +++ b/tests/unit/agents/registry.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; // Must mock engine modules before importing the registry vi.mock('../../../src/backends/adapter.js', () => ({ diff --git a/tests/unit/agents/shared/gadgets.test.ts b/tests/unit/agents/shared/gadgets.test.ts index 1c42bfe9..ee923be9 100644 --- a/tests/unit/agents/shared/gadgets.test.ts +++ b/tests/unit/agents/shared/gadgets.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; /** Create a mock class with the given name so constructor.name works in assertions */ function mockClass(name: string) { diff --git a/tests/unit/agents/shared/repository.test.ts b/tests/unit/agents/shared/repository.test.ts index 2ef2c95e..de02283c 100644 --- a/tests/unit/agents/shared/repository.test.ts +++ b/tests/unit/agents/shared/repository.test.ts @@ -69,12 +69,10 @@ beforeEach(() => { mockReaddirSync.mockReturnValue([]); mockWarmTypeScriptCache.mockResolvedValue(null); mockGetWorkspaceDir.mockReturnValue('/workspace'); - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.CASCADE_SNAPSHOT_REUSE; }); afterEach(() => { - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.CASCADE_SNAPSHOT_REUSE; }); @@ -471,7 +469,6 @@ describe('setupRepository — snapshot-reuse path', () => { }); it('does not enter snapshot path when CASCADE_SNAPSHOT_REUSE is absent', async () => { - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.CASCADE_SNAPSHOT_REUSE; const project = makeProject(); const log = makeLog(); diff --git a/tests/unit/agents/shared/runTracking.test.ts b/tests/unit/agents/shared/runTracking.test.ts index ef6fd9c1..8e0f5082 100644 --- a/tests/unit/agents/shared/runTracking.test.ts +++ b/tests/unit/agents/shared/runTracking.test.ts @@ -26,8 +26,8 @@ vi.mock('node:fs', () => ({ import fs from 'node:fs'; import { - type RunTrackingInput, finalizeEngineRun, + type RunTrackingInput, tryCompleteRun, tryCreateRun, tryStoreRunLogs, @@ -73,7 +73,6 @@ describe('tryCreateRun', () => { }); afterEach(() => { - // biome-ignore lint/performance/noDelete: Clean up test environment delete process.env.JOB_ID; }); @@ -102,7 +101,6 @@ describe('tryCreateRun', () => { }); it('does not call updateRunJobId when JOB_ID env var is not set', async () => { - // biome-ignore lint/performance/noDelete: Clean environment before test delete process.env.JOB_ID; mockUpdateRunJobId.mockClear(); diff --git a/tests/unit/agents/shared/syntheticCalls.test.ts b/tests/unit/agents/shared/syntheticCalls.test.ts index 98170ac9..28d3b1c0 100644 --- a/tests/unit/agents/shared/syntheticCalls.test.ts +++ b/tests/unit/agents/shared/syntheticCalls.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../../src/agents/utils/tracking.js', () => ({ recordSyntheticInvocationId: vi.fn(), diff --git a/tests/unit/agents/utils/agentLoop.test.ts b/tests/unit/agents/utils/agentLoop.test.ts index 0fddd69e..657afee0 100644 --- a/tests/unit/agents/utils/agentLoop.test.ts +++ b/tests/unit/agents/utils/agentLoop.test.ts @@ -48,7 +48,7 @@ import { const mockAddBreadcrumb = vi.mocked(addBreadcrumb); const mockConsumePendingSessionNotices = vi.mocked(consumePendingSessionNotices); const mockDisplayGadgetCall = vi.mocked(displayGadgetCall); -const mockDisplayGadgetResult = vi.mocked(displayGadgetResult); +const _mockDisplayGadgetResult = vi.mocked(displayGadgetResult); const mockDisplayLLMText = vi.mocked(displayLLMText); const mockWaitForEnter = vi.mocked(waitForEnter); const mockConsumeLoopAction = vi.mocked(consumeLoopAction); diff --git a/tests/unit/agents/utils/logging.test.ts b/tests/unit/agents/utils/logging.test.ts index 2f7bbd9d..8a8d49cb 100644 --- a/tests/unit/agents/utils/logging.test.ts +++ b/tests/unit/agents/utils/logging.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../../src/utils/logging.js', () => ({ logger: { diff --git a/tests/unit/agents/utils/setup.test.ts b/tests/unit/agents/utils/setup.test.ts index 677adb32..fb1d3501 100644 --- a/tests/unit/agents/utils/setup.test.ts +++ b/tests/unit/agents/utils/setup.test.ts @@ -11,9 +11,9 @@ vi.mock('../../../../src/utils/repo.js', () => ({ import { existsSync, readFileSync } from 'node:fs'; import { - LOG_LEVELS, getLogLevel, installDependencies, + LOG_LEVELS, readContextFiles, warmTypeScriptCache, } from '../../../../src/agents/utils/setup.js'; diff --git a/tests/unit/agents/utils/tracking.test.ts b/tests/unit/agents/utils/tracking.test.ts index ac06735a..aebb1a25 100644 --- a/tests/unit/agents/utils/tracking.test.ts +++ b/tests/unit/agents/utils/tracking.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it } from 'vitest'; import { - LOOP_THRESHOLDS, checkForLoopAndAdvance, consumeLoopAction, consumeLoopWarning, createTrackingContext, + LOOP_THRESHOLDS, recordGadgetCallForLoop, } from '../../../../src/agents/utils/tracking.js'; diff --git a/tests/unit/api/access-control.test.ts b/tests/unit/api/access-control.test.ts index 93aafa99..15dc4832 100644 --- a/tests/unit/api/access-control.test.ts +++ b/tests/unit/api/access-control.test.ts @@ -97,11 +97,10 @@ import { authRouter } from '../../../src/api/routers/auth.js'; import { organizationRouter } from '../../../src/api/routers/organization.js'; import { projectsRouter } from '../../../src/api/routers/projects.js'; import { - type TRPCContext, - type TRPCUser, adminProcedure, protectedProcedure, router, + type TRPCContext, } from '../../../src/api/trpc.js'; import { createMockUser } from '../../helpers/factories.js'; diff --git a/tests/unit/api/auth/logout.test.ts b/tests/unit/api/auth/logout.test.ts index 12ee0ae1..be9a6769 100644 --- a/tests/unit/api/auth/logout.test.ts +++ b/tests/unit/api/auth/logout.test.ts @@ -1,5 +1,5 @@ import { Hono } from 'hono'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; const mockDeleteSession = vi.fn(); diff --git a/tests/unit/api/auth/rateLimiter.test.ts b/tests/unit/api/auth/rateLimiter.test.ts index 9fbc8731..e2e6b646 100644 --- a/tests/unit/api/auth/rateLimiter.test.ts +++ b/tests/unit/api/auth/rateLimiter.test.ts @@ -1,12 +1,12 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { - MAX_ATTEMPTS, - WINDOW_MS, _resetForTesting, _runCleanup, checkRateLimit, + MAX_ATTEMPTS, rateLimitStore, recordSuccessfulLogin, + WINDOW_MS, } from '../../../../src/api/auth/rateLimiter.js'; describe('rateLimiter', () => { diff --git a/tests/unit/api/auth/session.test.ts b/tests/unit/api/auth/session.test.ts index 33abe190..1ba066b8 100644 --- a/tests/unit/api/auth/session.test.ts +++ b/tests/unit/api/auth/session.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; const mockGetSessionByToken = vi.fn(); const mockGetUserById = vi.fn(); diff --git a/tests/unit/api/routers/_shared/triggerTypes.test.ts b/tests/unit/api/routers/_shared/triggerTypes.test.ts index 8c704371..f2914175 100644 --- a/tests/unit/api/routers/_shared/triggerTypes.test.ts +++ b/tests/unit/api/routers/_shared/triggerTypes.test.ts @@ -130,7 +130,7 @@ describe('triggerTypes', () => { }); it('all triggers have required KnownTriggerEvent fields', () => { - for (const [category, triggers] of Object.entries(TRIGGER_REGISTRY)) { + for (const [_category, triggers] of Object.entries(TRIGGER_REGISTRY)) { for (const trigger of triggers) { expect(trigger.event).toBeTruthy(); expect(trigger.label).toBeTruthy(); diff --git a/tests/unit/api/routers/agentConfigs.test.ts b/tests/unit/api/routers/agentConfigs.test.ts index 6ebdadb0..561f8a6e 100644 --- a/tests/unit/api/routers/agentConfigs.test.ts +++ b/tests/unit/api/routers/agentConfigs.test.ts @@ -65,7 +65,7 @@ vi.mock('../../../../src/agents/definitions/index.js', () => ({ })); // Mock getDb for ownership checks -const { mockDbSelect, mockDbFrom, mockDbWhere, configureOwnership } = setupOwnershipCheckMock(); +const { mockDbSelect, mockDbFrom, mockDbWhere } = setupOwnershipCheckMock(); vi.mock('../../../../src/db/client.js', () => ({ getDb: () => ({ diff --git a/tests/unit/api/routers/agentTriggerConfigs.test.ts b/tests/unit/api/routers/agentTriggerConfigs.test.ts index 92c92082..b5d3ab9b 100644 --- a/tests/unit/api/routers/agentTriggerConfigs.test.ts +++ b/tests/unit/api/routers/agentTriggerConfigs.test.ts @@ -278,7 +278,7 @@ describe('agentTriggerConfigsRouter', () => { // ===================================================================== describe('bulkUpsert', () => { it('bulk upserts multiple trigger configs', async () => { - const configs = [ + const _configs = [ createMockConfig(), createMockConfig({ id: 2, triggerEvent: 'pm:label-added' }), ]; diff --git a/tests/unit/api/routers/organization.test.ts b/tests/unit/api/routers/organization.test.ts index 24587169..69a4f0ca 100644 --- a/tests/unit/api/routers/organization.test.ts +++ b/tests/unit/api/routers/organization.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockSuperAdmin, createMockUser } from '../../../helpers/factories.js'; import { createCallerFor, expectTRPCError } from '../../../helpers/trpcTestHarness.js'; diff --git a/tests/unit/api/routers/projects.test.ts b/tests/unit/api/routers/projects.test.ts index cfd1b1a3..732185e3 100644 --- a/tests/unit/api/routers/projects.test.ts +++ b/tests/unit/api/routers/projects.test.ts @@ -70,7 +70,7 @@ vi.mock('../../../../src/sentry.js', () => ({ })); // Mock getDb for ownership checks -const { mockDbSelect, mockDbFrom, mockDbWhere, configureOwnership } = setupOwnershipCheckMock(); +const { mockDbSelect, mockDbFrom, mockDbWhere } = setupOwnershipCheckMock(); vi.mock('../../../../src/db/client.js', () => ({ getDb: () => ({ diff --git a/tests/unit/api/routers/prompts.test.ts b/tests/unit/api/routers/prompts.test.ts index 58a4b076..f4ca89b6 100644 --- a/tests/unit/api/routers/prompts.test.ts +++ b/tests/unit/api/routers/prompts.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockSuperAdmin, createMockUser } from '../../../helpers/factories.js'; import { createCallerFor, expectTRPCError } from '../../../helpers/trpcTestHarness.js'; diff --git a/tests/unit/api/routers/runs.test.ts b/tests/unit/api/routers/runs.test.ts index eb1e3573..c249445d 100644 --- a/tests/unit/api/routers/runs.test.ts +++ b/tests/unit/api/routers/runs.test.ts @@ -57,7 +57,7 @@ vi.mock('../../../../src/db/repositories/runsRepository.js', () => ({ })); // Mock getDb for the inline org-access check in getById -const { mockDbSelect, mockDbFrom, mockDbWhere, configureOwnership } = setupOwnershipCheckMock(); +const { mockDbSelect, mockDbFrom, mockDbWhere } = setupOwnershipCheckMock(); vi.mock('../../../../src/db/client.js', () => ({ getDb: () => ({ diff --git a/tests/unit/api/routers/users.test.ts b/tests/unit/api/routers/users.test.ts index 5cd943e3..08c2bd0a 100644 --- a/tests/unit/api/routers/users.test.ts +++ b/tests/unit/api/routers/users.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { createMockSuperAdmin, createMockUser } from '../../../helpers/factories.js'; -import { createCallerFor, expectTRPCError } from '../../../helpers/trpcTestHarness.js'; +import { createCallerFor } from '../../../helpers/trpcTestHarness.js'; const { mockListOrgUsers, diff --git a/tests/unit/api/routers/webhookLogs.test.ts b/tests/unit/api/routers/webhookLogs.test.ts index f561dd44..f55e0458 100644 --- a/tests/unit/api/routers/webhookLogs.test.ts +++ b/tests/unit/api/routers/webhookLogs.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockSuperAdmin, createMockUser } from '../../../helpers/factories.js'; import { createCallerFor, expectTRPCError } from '../../../helpers/trpcTestHarness.js'; diff --git a/tests/unit/api/routers/webhooks.test.ts b/tests/unit/api/routers/webhooks.test.ts index 696c726b..5c170c6b 100644 --- a/tests/unit/api/routers/webhooks.test.ts +++ b/tests/unit/api/routers/webhooks.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockSuperAdmin, createMockUser } from '../../../helpers/factories.js'; import { createCallerFor, @@ -26,7 +26,7 @@ const { mockFetch: vi.fn(), })); -const { mockDbSelect, mockDbFrom, mockDbWhere, configureOwnership } = setupOwnershipCheckMock(); +const { mockDbSelect, mockDbFrom, mockDbWhere } = setupOwnershipCheckMock(); vi.mock('../../../../src/db/client.js', () => ({ getDb: () => ({ diff --git a/tests/unit/api/trpc.test.ts b/tests/unit/api/trpc.test.ts index f86cda96..7673b9b3 100644 --- a/tests/unit/api/trpc.test.ts +++ b/tests/unit/api/trpc.test.ts @@ -1,11 +1,11 @@ import { TRPCError } from '@trpc/server'; import { describe, expect, it } from 'vitest'; import { - type TRPCContext, adminProcedure, protectedProcedure, router, superAdminProcedure, + type TRPCContext, } from '../../../src/api/trpc.js'; // Create a minimal test router diff --git a/tests/unit/backends/accumulator.test.ts b/tests/unit/backends/accumulator.test.ts index 35e31a59..474125e7 100644 --- a/tests/unit/backends/accumulator.test.ts +++ b/tests/unit/backends/accumulator.test.ts @@ -8,8 +8,8 @@ import { COMPLETED_TASKS_MAX, ProgressAccumulator, RING_BUFFER_MAX, - TEXT_SNIPPETS_MAX, summarizeToolParams, + TEXT_SNIPPETS_MAX, } from '../../../src/backends/progressState/accumulator.js'; import { loadTodos } from '../../../src/gadgets/todo/storage.js'; diff --git a/tests/unit/backends/adapter.test.ts b/tests/unit/backends/adapter.test.ts index 99e3e524..cef03809 100644 --- a/tests/unit/backends/adapter.test.ts +++ b/tests/unit/backends/adapter.test.ts @@ -1,6 +1,6 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { mockAgentLoggerModule, mockCascadeEnvModule, @@ -120,7 +120,7 @@ import { cleanupLogFile, createFileLogger, } from '../../../src/utils/fileLogger.js'; -import { clearWatchdogCleanup, setWatchdogCleanup } from '../../../src/utils/lifecycle.js'; +import { clearWatchdogCleanup } from '../../../src/utils/lifecycle.js'; import { logger } from '../../../src/utils/logging.js'; import { cleanupTempDir } from '../../../src/utils/repo.js'; @@ -302,7 +302,7 @@ describe('executeWithEngine', () => { }); it('includes log buffer in result', async () => { - const loggerInstance = setupMocks(); + const _loggerInstance = setupMocks(); const engine = makeMockBackend(); vi.mocked(engine.execute).mockResolvedValue({ success: true, diff --git a/tests/unit/backends/agent-profiles.test.ts b/tests/unit/backends/agent-profiles.test.ts index 316ec008..89e3dc30 100644 --- a/tests/unit/backends/agent-profiles.test.ts +++ b/tests/unit/backends/agent-profiles.test.ts @@ -156,8 +156,11 @@ vi.mock('node:child_process', () => ({ })); import { execFileSync } from 'node:child_process'; -import { needsGitStateStopHooks } from '../../../src/agents/definitions/profiles.js'; -import { type AgentProfile, getAgentProfile } from '../../../src/agents/definitions/profiles.js'; +import { + type AgentProfile, + getAgentProfile, + needsGitStateStopHooks, +} from '../../../src/agents/definitions/profiles.js'; import { formatPRComments, formatPRDetails, @@ -172,7 +175,7 @@ import { resolveSquintDbPath } from '../../../src/utils/squintDb.js'; const mockExecFileSync = vi.mocked(execFileSync); const mockResolveSquintDbPath = vi.mocked(resolveSquintDbPath); -const mockReadWorkItem = vi.mocked(readWorkItem); +const _mockReadWorkItem = vi.mocked(readWorkItem); const mockReadWorkItemWithMedia = vi.mocked(readWorkItemWithMedia); const mockGithub = vi.mocked(githubClient); diff --git a/tests/unit/backends/claude-code-hooks.test.ts b/tests/unit/backends/claude-code-hooks.test.ts index 201ad14f..cf06da18 100644 --- a/tests/unit/backends/claude-code-hooks.test.ts +++ b/tests/unit/backends/claude-code-hooks.test.ts @@ -5,7 +5,7 @@ import type { PreToolUseHookInput, StopHookInput, } from '@anthropic-ai/claude-agent-sdk'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { buildHooks, buildPostToolUseFailureHooks, diff --git a/tests/unit/backends/claude-code-imagePrompt.test.ts b/tests/unit/backends/claude-code-imagePrompt.test.ts index 23c7af05..4c2ac335 100644 --- a/tests/unit/backends/claude-code-imagePrompt.test.ts +++ b/tests/unit/backends/claude-code-imagePrompt.test.ts @@ -1,4 +1,3 @@ -import type { SDKUserMessage } from '@anthropic-ai/claude-agent-sdk'; import type { ContentBlockParam } from '@anthropic-ai/sdk/resources'; import { describe, expect, it, vi } from 'vitest'; import type { ContextImage } from '../../../src/agents/contracts/index.js'; diff --git a/tests/unit/backends/claude-code.test.ts b/tests/unit/backends/claude-code.test.ts index 2d589fd0..c07a82a9 100644 --- a/tests/unit/backends/claude-code.test.ts +++ b/tests/unit/backends/claude-code.test.ts @@ -20,17 +20,17 @@ import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { query } from '@anthropic-ai/claude-agent-sdk'; import { - ClaudeCodeEngine, buildEnv, buildSystemPrompt, buildTaskPrompt, buildToolGuidance, + ClaudeCodeEngine, ensureOnboardingFlag, resolveClaudeModel, } from '../../../src/backends/claude-code/index.js'; import { - CLAUDE_CODE_MODELS, CLAUDE_CODE_MODEL_IDS, + CLAUDE_CODE_MODELS, DEFAULT_CLAUDE_CODE_MODEL, } from '../../../src/backends/claude-code/models.js'; import { resolveClaudeCodeSettings } from '../../../src/backends/claude-code/settings.js'; diff --git a/tests/unit/backends/codex.test.ts b/tests/unit/backends/codex.test.ts index f4db8b4c..a8e77ea4 100644 --- a/tests/unit/backends/codex.test.ts +++ b/tests/unit/backends/codex.test.ts @@ -41,8 +41,8 @@ vi.mock('../../../src/utils/logging.js', () => ({ import { buildEnv } from '../../../src/backends/codex/env.js'; import { - CodexEngine, buildArgs, + CodexEngine, extractErrorMessage, extractTextParts, extractToolCall, diff --git a/tests/unit/backends/githubPoster.test.ts b/tests/unit/backends/githubPoster.test.ts index 0e68bc5f..6aac0b44 100644 --- a/tests/unit/backends/githubPoster.test.ts +++ b/tests/unit/backends/githubPoster.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/github/client.js', () => ({ githubClient: { diff --git a/tests/unit/backends/nativeToolRuntime.test.ts b/tests/unit/backends/nativeToolRuntime.test.ts index bc152a68..81637de7 100644 --- a/tests/unit/backends/nativeToolRuntime.test.ts +++ b/tests/unit/backends/nativeToolRuntime.test.ts @@ -1,5 +1,5 @@ -import { constants, accessSync, existsSync, readFileSync } from 'node:fs'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { accessSync, constants, existsSync, readFileSync } from 'node:fs'; +import { afterEach, describe, expect, it, vi } from 'vitest'; import { buildNativeToolPath, @@ -71,7 +71,7 @@ describe('createNativeToolRuntimeArtifacts', () => { }); it('cleanup does not throw even if the directory was already removed', () => { - const { shimDir, cleanup } = createNativeToolRuntimeArtifacts(); + const { cleanup } = createNativeToolRuntimeArtifacts(); cleanupFns.push(cleanup); // Remove the directory manually first diff --git a/tests/unit/backends/opencode-stream.test.ts b/tests/unit/backends/opencode-stream.test.ts index d53e35e0..1c85fc7c 100644 --- a/tests/unit/backends/opencode-stream.test.ts +++ b/tests/unit/backends/opencode-stream.test.ts @@ -38,6 +38,7 @@ vi.mock('../../../src/backends/nativeToolRetry.js', () => ({ // ── Imports after mocks ────────────────────────────────────────────────────── +import type { OpenCodeStreamState } from '../../../src/backends/opencode/stream.js'; import { appendPartialOutput, getPartialOutput, @@ -46,7 +47,6 @@ import { handleSessionTerminalEvent, reportToolPart, } from '../../../src/backends/opencode/stream.js'; -import type { OpenCodeStreamState } from '../../../src/backends/opencode/stream.js'; import type { AgentExecutionPlan } from '../../../src/backends/types.js'; // ── Helpers ────────────────────────────────────────────────────────────────── @@ -757,11 +757,7 @@ describe('handlePermissionEvent', () => { }); function makePermissionEvent( - overrides: { - sessionID?: string; - permissionId?: string; - type?: string; - } = {}, + overrides: { sessionID?: string; permissionId?: string; type?: string } = {}, ) { return { type: 'permission.updated', diff --git a/tests/unit/backends/opencode.test.ts b/tests/unit/backends/opencode.test.ts index dbd085a3..95ac48ec 100644 --- a/tests/unit/backends/opencode.test.ts +++ b/tests/unit/backends/opencode.test.ts @@ -36,8 +36,8 @@ vi.mock('../../../src/utils/logging.js', () => ({ })); import { - OpenCodeEngine, buildPermissionConfig, + OpenCodeEngine, resolveOpenCodeModel, } from '../../../src/backends/opencode/index.js'; import { DEFAULT_OPENCODE_MODEL } from '../../../src/backends/opencode/models.js'; diff --git a/tests/unit/backends/pmPoster.test.ts b/tests/unit/backends/pmPoster.test.ts index 6bcf4154..e87defd0 100644 --- a/tests/unit/backends/pmPoster.test.ts +++ b/tests/unit/backends/pmPoster.test.ts @@ -30,11 +30,11 @@ vi.mock('../../../src/backends/progressState.js', () => ({ clearProgressCommentId: vi.fn(), })); +import { PMProgressPoster } from '../../../src/backends/progressState/pmPoster.js'; import { readProgressCommentId, writeProgressCommentId, } from '../../../src/backends/progressState.js'; -import { PMProgressPoster } from '../../../src/backends/progressState/pmPoster.js'; import type { PMProvider } from '../../../src/pm/index.js'; import { getPMProviderOrNull } from '../../../src/pm/index.js'; diff --git a/tests/unit/backends/postProcess.test.ts b/tests/unit/backends/postProcess.test.ts index 5310f3b4..f9a3ba5f 100644 --- a/tests/unit/backends/postProcess.test.ts +++ b/tests/unit/backends/postProcess.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/utils/logging.js', () => ({ logger: { diff --git a/tests/unit/backends/progressModel.test.ts b/tests/unit/backends/progressModel.test.ts index ad6ecdd9..3f5cbc32 100644 --- a/tests/unit/backends/progressModel.test.ts +++ b/tests/unit/backends/progressModel.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; const mockTextComplete = vi.fn(); vi.mock('llmist', async (importOriginal) => ({ @@ -32,7 +32,7 @@ vi.mock('../../../src/config/agentMessages.js', () => ({ })); import { LLMist } from 'llmist'; -import { type ProgressContext, callProgressModel } from '../../../src/backends/progressModel.js'; +import { callProgressModel, type ProgressContext } from '../../../src/backends/progressModel.js'; const MockLLMist = vi.mocked(LLMist); diff --git a/tests/unit/backends/progressState.test.ts b/tests/unit/backends/progressState.test.ts index dd97365d..8e61e21d 100644 --- a/tests/unit/backends/progressState.test.ts +++ b/tests/unit/backends/progressState.test.ts @@ -1,8 +1,8 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { - ENV_VAR_NAME, clearProgressCommentId, + ENV_VAR_NAME, readProgressCommentId, writeProgressCommentId, } from '../../../src/backends/progressState.js'; diff --git a/tests/unit/backends/registry.test.ts b/tests/unit/backends/registry.test.ts index 6a229a87..6e3c2933 100644 --- a/tests/unit/backends/registry.test.ts +++ b/tests/unit/backends/registry.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it } from 'vitest'; +import { describe, expect, it } from 'vitest'; import { getEngine, getRegisteredEngines, diff --git a/tests/unit/backends/secretBuilder.test.ts b/tests/unit/backends/secretBuilder.test.ts index 78ece655..af1eecea 100644 --- a/tests/unit/backends/secretBuilder.test.ts +++ b/tests/unit/backends/secretBuilder.test.ts @@ -11,8 +11,8 @@ vi.mock('../../../src/github/personas.js', () => ({ import type { AgentProfile } from '../../../src/agents/definitions/profiles.js'; import { ENV_VAR_NAME } from '../../../src/backends/progressState.js'; import { - GITHUB_ACK_COMMENT_ID_ENV_VAR, augmentProjectSecrets, + GITHUB_ACK_COMMENT_ID_ENV_VAR, injectGitHubAckCommentId, injectProgressCommentId, resolveGitHubToken, diff --git a/tests/unit/backends/shared-envBuilder.test.ts b/tests/unit/backends/shared-envBuilder.test.ts index 4ee29f9d..41441774 100644 --- a/tests/unit/backends/shared-envBuilder.test.ts +++ b/tests/unit/backends/shared-envBuilder.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { buildEngineEnv } from '../../../src/backends/shared/envBuilder.js'; import { SHARED_ALLOWED_ENV_EXACT, diff --git a/tests/unit/backends/shared-envFilter.test.ts b/tests/unit/backends/shared-envFilter.test.ts index 61ec6894..6f8e63be 100644 --- a/tests/unit/backends/shared-envFilter.test.ts +++ b/tests/unit/backends/shared-envFilter.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from 'vitest'; import { GITHUB_ACK_COMMENT_ID_ENV_VAR } from '../../../src/backends/secretBuilder.js'; import { + filterProcessEnv, SHARED_ALLOWED_ENV_EXACT, SHARED_ALLOWED_ENV_PREFIXES, SHARED_BLOCKED_ENV_EXACT, - filterProcessEnv, } from '../../../src/backends/shared/envFilter.js'; describe('filterProcessEnv (shared)', () => { diff --git a/tests/unit/backends/shared-llmCallLogger.test.ts b/tests/unit/backends/shared-llmCallLogger.test.ts index 301beda7..0094c0bd 100644 --- a/tests/unit/backends/shared-llmCallLogger.test.ts +++ b/tests/unit/backends/shared-llmCallLogger.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, describe, expect, it, vi } from 'vitest'; import type { LlmCallLogPayload } from '../../../src/backends/shared/llmCallLogger.js'; import { logLlmCall } from '../../../src/backends/shared/llmCallLogger.js'; diff --git a/tests/unit/backends/shared-nativeToolPrompts.test.ts b/tests/unit/backends/shared-nativeToolPrompts.test.ts index 135b13c5..ec11b7f8 100644 --- a/tests/unit/backends/shared-nativeToolPrompts.test.ts +++ b/tests/unit/backends/shared-nativeToolPrompts.test.ts @@ -1,6 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import type { ToolManifest } from '../../../src/agents/contracts/index.js'; -import type { ContextInjection } from '../../../src/agents/contracts/index.js'; +import type { ContextInjection, ToolManifest } from '../../../src/agents/contracts/index.js'; // Mock contextFiles module to avoid filesystem I/O vi.mock('../../../src/backends/shared/contextFiles.js', () => ({ diff --git a/tests/unit/backends/sidecarManager.test.ts b/tests/unit/backends/sidecarManager.test.ts index a8d94cb4..8a3bfcd9 100644 --- a/tests/unit/backends/sidecarManager.test.ts +++ b/tests/unit/backends/sidecarManager.test.ts @@ -2,7 +2,7 @@ import { existsSync, writeFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/gadgets/sessionState.js', () => ({ REVIEW_SIDECAR_ENV_VAR: 'CASCADE_REVIEW_SIDECAR_PATH', diff --git a/tests/unit/cli/cli-command-factory.test.ts b/tests/unit/cli/cli-command-factory.test.ts index eb2a4664..830a98c0 100644 --- a/tests/unit/cli/cli-command-factory.test.ts +++ b/tests/unit/cli/cli-command-factory.test.ts @@ -41,7 +41,7 @@ import { createCLICommand } from '../../../src/gadgets/shared/cliCommandFactory. import type { ToolDefinition } from '../../../src/gadgets/shared/toolDefinition.js'; /** Minimal oclif config to satisfy this.parse() */ -const mockConfig = { runHook: vi.fn().mockResolvedValue({ successes: [], failures: [] }) }; +const _mockConfig = { runHook: vi.fn().mockResolvedValue({ successes: [], failures: [] }) }; let tmpDir: string; diff --git a/tests/unit/cli/dashboard/client.test.ts b/tests/unit/cli/dashboard/client.test.ts index 1cfb4670..7399216a 100644 --- a/tests/unit/cli/dashboard/client.test.ts +++ b/tests/unit/cli/dashboard/client.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('@trpc/client', () => ({ createTRPCClient: vi.fn(() => ({ mock: 'client' })), diff --git a/tests/unit/cli/dashboard/prompts/prompts.test.ts b/tests/unit/cli/dashboard/prompts/prompts.test.ts index c27a4be4..c2150e33 100644 --- a/tests/unit/cli/dashboard/prompts/prompts.test.ts +++ b/tests/unit/cli/dashboard/prompts/prompts.test.ts @@ -26,8 +26,8 @@ vi.mock('node:fs', () => ({ readFileSync: vi.fn().mockReturnValue('template content'), })); -import PromptsDefaultPartial from '../../../../../src/cli/dashboard/prompts/default-partial.js'; import PromptsDefault from '../../../../../src/cli/dashboard/prompts/default.js'; +import PromptsDefaultPartial from '../../../../../src/cli/dashboard/prompts/default-partial.js'; import PromptsGetPartial from '../../../../../src/cli/dashboard/prompts/get-partial.js'; import PromptsListPartials from '../../../../../src/cli/dashboard/prompts/list-partials.js'; import PromptsResetPartial from '../../../../../src/cli/dashboard/prompts/reset-partial.js'; diff --git a/tests/unit/cli/dashboard/spinner.test.ts b/tests/unit/cli/dashboard/spinner.test.ts index 140dfab5..62a5c8c6 100644 --- a/tests/unit/cli/dashboard/spinner.test.ts +++ b/tests/unit/cli/dashboard/spinner.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; const mockOraInstance = { start: vi.fn().mockReturnThis(), diff --git a/tests/unit/cli/file-input-flags.test.ts b/tests/unit/cli/file-input-flags.test.ts index 45de6abd..70d40870 100644 --- a/tests/unit/cli/file-input-flags.test.ts +++ b/tests/unit/cli/file-input-flags.test.ts @@ -40,17 +40,16 @@ vi.mock('../../../src/gadgets/github/core/postPRComment.js', () => ({ postPRComment: vi.fn().mockResolvedValue({ id: 123 }), })); -import { createPR } from '../../../src/gadgets/github/core/createPR.js'; -import { postPRComment } from '../../../src/gadgets/github/core/postPRComment.js'; -import { createWorkItem } from '../../../src/gadgets/pm/core/createWorkItem.js'; -import { postComment } from '../../../src/gadgets/pm/core/postComment.js'; -import { updateWorkItem } from '../../../src/gadgets/pm/core/updateWorkItem.js'; - import CreateWorkItem from '../../../src/cli/pm/create-work-item.js'; import PostComment from '../../../src/cli/pm/post-comment.js'; import UpdateWorkItem from '../../../src/cli/pm/update-work-item.js'; import CreatePR from '../../../src/cli/scm/create-pr.js'; import PostPRComment from '../../../src/cli/scm/post-pr-comment.js'; +import { createPR } from '../../../src/gadgets/github/core/createPR.js'; +import { postPRComment } from '../../../src/gadgets/github/core/postPRComment.js'; +import { createWorkItem } from '../../../src/gadgets/pm/core/createWorkItem.js'; +import { postComment } from '../../../src/gadgets/pm/core/postComment.js'; +import { updateWorkItem } from '../../../src/gadgets/pm/core/updateWorkItem.js'; let tmpDir: string; diff --git a/tests/unit/cli/pm/pm-commands.test.ts b/tests/unit/cli/pm/pm-commands.test.ts index 32dfd25e..91b3dcd8 100644 --- a/tests/unit/cli/pm/pm-commands.test.ts +++ b/tests/unit/cli/pm/pm-commands.test.ts @@ -59,14 +59,6 @@ vi.mock('../../../../src/gadgets/pm/core/postComment.js', () => ({ postComment: vi.fn().mockResolvedValue({ id: 'comment-1' }), })); -import { createWorkItem } from '../../../../src/gadgets/pm/core/createWorkItem.js'; -import { deleteChecklistItem } from '../../../../src/gadgets/pm/core/deleteChecklistItem.js'; -import { listWorkItems } from '../../../../src/gadgets/pm/core/listWorkItems.js'; -import { moveWorkItem } from '../../../../src/gadgets/pm/core/moveWorkItem.js'; -import { postComment } from '../../../../src/gadgets/pm/core/postComment.js'; -import { readWorkItem } from '../../../../src/gadgets/pm/core/readWorkItem.js'; -import { updateChecklistItem } from '../../../../src/gadgets/pm/core/updateChecklistItem.js'; - import CreateWorkItem from '../../../../src/cli/pm/create-work-item.js'; import DeleteChecklistItem from '../../../../src/cli/pm/delete-checklist-item.js'; import ListWorkItems from '../../../../src/cli/pm/list-work-items.js'; @@ -74,6 +66,13 @@ import MoveWorkItem from '../../../../src/cli/pm/move-work-item.js'; import PostComment from '../../../../src/cli/pm/post-comment.js'; import ReadWorkItem from '../../../../src/cli/pm/read-work-item.js'; import UpdateChecklistItem from '../../../../src/cli/pm/update-checklist-item.js'; +import { createWorkItem } from '../../../../src/gadgets/pm/core/createWorkItem.js'; +import { deleteChecklistItem } from '../../../../src/gadgets/pm/core/deleteChecklistItem.js'; +import { listWorkItems } from '../../../../src/gadgets/pm/core/listWorkItems.js'; +import { moveWorkItem } from '../../../../src/gadgets/pm/core/moveWorkItem.js'; +import { postComment } from '../../../../src/gadgets/pm/core/postComment.js'; +import { readWorkItem } from '../../../../src/gadgets/pm/core/readWorkItem.js'; +import { updateChecklistItem } from '../../../../src/gadgets/pm/core/updateChecklistItem.js'; /** Create a fresh minimal oclif config to satisfy this.parse() in each test */ function makeMockConfig() { diff --git a/tests/unit/cli/scm/scm-commands.test.ts b/tests/unit/cli/scm/scm-commands.test.ts index e8918ee3..36636de9 100644 --- a/tests/unit/cli/scm/scm-commands.test.ts +++ b/tests/unit/cli/scm/scm-commands.test.ts @@ -63,15 +63,6 @@ vi.mock('../../../../src/gadgets/github/core/updatePRComment.js', () => ({ updatePRComment: vi.fn().mockResolvedValue({ id: 300, body: 'Updated' }), })); -import { getCIRunLogs } from '../../../../src/gadgets/github/core/getCIRunLogs.js'; -import { getPRChecks } from '../../../../src/gadgets/github/core/getPRChecks.js'; -import { getPRComments } from '../../../../src/gadgets/github/core/getPRComments.js'; -import { getPRDetails } from '../../../../src/gadgets/github/core/getPRDetails.js'; -import { getPRDiff } from '../../../../src/gadgets/github/core/getPRDiff.js'; -import { postPRComment } from '../../../../src/gadgets/github/core/postPRComment.js'; -import { replyToReviewComment } from '../../../../src/gadgets/github/core/replyToReviewComment.js'; -import { updatePRComment } from '../../../../src/gadgets/github/core/updatePRComment.js'; - import GetCIRunLogs from '../../../../src/cli/scm/get-ci-run-logs.js'; import GetPRChecks from '../../../../src/cli/scm/get-pr-checks.js'; import GetPRComments from '../../../../src/cli/scm/get-pr-comments.js'; @@ -80,6 +71,14 @@ import GetPRDiff from '../../../../src/cli/scm/get-pr-diff.js'; import PostPRComment from '../../../../src/cli/scm/post-pr-comment.js'; import ReplyToReviewComment from '../../../../src/cli/scm/reply-to-review-comment.js'; import UpdatePRComment from '../../../../src/cli/scm/update-pr-comment.js'; +import { getCIRunLogs } from '../../../../src/gadgets/github/core/getCIRunLogs.js'; +import { getPRChecks } from '../../../../src/gadgets/github/core/getPRChecks.js'; +import { getPRComments } from '../../../../src/gadgets/github/core/getPRComments.js'; +import { getPRDetails } from '../../../../src/gadgets/github/core/getPRDetails.js'; +import { getPRDiff } from '../../../../src/gadgets/github/core/getPRDiff.js'; +import { postPRComment } from '../../../../src/gadgets/github/core/postPRComment.js'; +import { replyToReviewComment } from '../../../../src/gadgets/github/core/replyToReviewComment.js'; +import { updatePRComment } from '../../../../src/gadgets/github/core/updatePRComment.js'; /** Create a fresh minimal oclif config to satisfy this.parse() in each test */ function makeMockConfig() { diff --git a/tests/unit/config/agentMessages.test.ts b/tests/unit/config/agentMessages.test.ts index 231f37ba..477b28a1 100644 --- a/tests/unit/config/agentMessages.test.ts +++ b/tests/unit/config/agentMessages.test.ts @@ -11,11 +11,11 @@ vi.mock('../../../src/agents/definitions/index.js', () => ({ })); import { + _resetAgentMessages, AGENT_LABELS, AGENT_ROLE_HINTS, - INITIAL_MESSAGES, - _resetAgentMessages, getAgentLabel, + INITIAL_MESSAGES, initAgentMessages, } from '../../../src/config/agentMessages.js'; diff --git a/tests/unit/config/integrationRoles.test.ts b/tests/unit/config/integrationRoles.test.ts index 8132e14c..42ee7882 100644 --- a/tests/unit/config/integrationRoles.test.ts +++ b/tests/unit/config/integrationRoles.test.ts @@ -1,11 +1,11 @@ import { afterEach, describe, expect, it } from 'vitest'; import { + getCredentialRoles, type IntegrationCategory, type IntegrationProvider, PROVIDER_CATEGORY, PROVIDER_CREDENTIAL_ROLES, - getCredentialRoles, registerCredentialRoles, } from '../../../src/config/integrationRoles.js'; @@ -28,7 +28,7 @@ describe.concurrent('PROVIDER_CATEGORY', () => { it('maps all known providers to valid categories', () => { const validCategories: IntegrationCategory[] = ['pm', 'scm', 'alerting']; - for (const [provider, category] of Object.entries(PROVIDER_CATEGORY)) { + for (const [_provider, category] of Object.entries(PROVIDER_CATEGORY)) { expect(validCategories).toContain(category); } }); diff --git a/tests/unit/config/projects.test.ts b/tests/unit/config/projects.test.ts index 6fb99e6c..06b1a295 100644 --- a/tests/unit/config/projects.test.ts +++ b/tests/unit/config/projects.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; // Mock the DB repositories vi.mock('../../../src/db/repositories/configRepository.js', () => ({ diff --git a/tests/unit/config/provider.test.ts b/tests/unit/config/provider.test.ts index 40b60011..35e0a815 100644 --- a/tests/unit/config/provider.test.ts +++ b/tests/unit/config/provider.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, describe, expect, it, vi } from 'vitest'; // Mock DB repositories first (must be before imports) vi.mock('../../../src/db/repositories/configRepository.js', () => ({ diff --git a/tests/unit/config/rateLimits.test.ts b/tests/unit/config/rateLimits.test.ts index f90f1f26..d6df07bb 100644 --- a/tests/unit/config/rateLimits.test.ts +++ b/tests/unit/config/rateLimits.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import { MODEL_RATE_LIMITS, getRateLimitForModel } from '../../../src/config/rateLimits.js'; +import { getRateLimitForModel, MODEL_RATE_LIMITS } from '../../../src/config/rateLimits.js'; describe.concurrent('config/rateLimits', () => { describe('getRateLimitForModel', () => { @@ -101,7 +101,7 @@ describe.concurrent('config/rateLimits', () => { }); it('safety margin is between 0 and 1', () => { - for (const [modelId, config] of Object.entries(MODEL_RATE_LIMITS)) { + for (const [_modelId, config] of Object.entries(MODEL_RATE_LIMITS)) { expect(config.safetyMargin).toBeGreaterThan(0); expect(config.safetyMargin).toBeLessThanOrEqual(1); } diff --git a/tests/unit/config/reviewConfig.test.ts b/tests/unit/config/reviewConfig.test.ts index 280fbd3d..c544f38b 100644 --- a/tests/unit/config/reviewConfig.test.ts +++ b/tests/unit/config/reviewConfig.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest'; import { - REVIEW_FILE_CONTENT_TOKEN_LIMIT, estimateTokens, + REVIEW_FILE_CONTENT_TOKEN_LIMIT, } from '../../../src/config/reviewConfig.js'; describe.concurrent('config/reviewConfig', () => { diff --git a/tests/unit/config/statusUpdateConfig.test.ts b/tests/unit/config/statusUpdateConfig.test.ts index 7cae819d..1470e21c 100644 --- a/tests/unit/config/statusUpdateConfig.test.ts +++ b/tests/unit/config/statusUpdateConfig.test.ts @@ -1,4 +1,4 @@ -import { afterEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { getAgentLabel } from '../../../src/config/agentMessages.js'; import { diff --git a/tests/unit/db/client.test.ts b/tests/unit/db/client.test.ts index a2cc6e44..63f22275 100644 --- a/tests/unit/db/client.test.ts +++ b/tests/unit/db/client.test.ts @@ -32,10 +32,10 @@ vi.mock('node:fs', () => ({ // ── Imports (after mocks) ───────────────────────────────────────────────────── import { - DatabaseContext, _setTestDb, closeDb, createDatabaseContext, + DatabaseContext, getDb, setDefaultDatabaseContext, } from '../../../src/db/client.js'; diff --git a/tests/unit/db/crypto.test.ts b/tests/unit/db/crypto.test.ts index 68edac00..5bdc0b9c 100644 --- a/tests/unit/db/crypto.test.ts +++ b/tests/unit/db/crypto.test.ts @@ -1,5 +1,5 @@ import { randomBytes } from 'node:crypto'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { decryptCredential, encryptCredential, diff --git a/tests/unit/db/repositories/configMapper.test.ts b/tests/unit/db/repositories/configMapper.test.ts index 42e0bbc2..e422ebf2 100644 --- a/tests/unit/db/repositories/configMapper.test.ts +++ b/tests/unit/db/repositories/configMapper.test.ts @@ -2,10 +2,10 @@ import { describe, expect, it } from 'vitest'; import { type AgentConfigRow, - type IntegrationRow, - type MapProjectInput, buildAgentMaps, extractIntegrationConfigs, + type IntegrationRow, + type MapProjectInput, mapProjectRow, orUndefined, } from '../../../../src/db/repositories/configMapper.js'; diff --git a/tests/unit/db/repositories/configRepository.test.ts b/tests/unit/db/repositories/configRepository.test.ts index 16231957..58481daa 100644 --- a/tests/unit/db/repositories/configRepository.test.ts +++ b/tests/unit/db/repositories/configRepository.test.ts @@ -1,4 +1,4 @@ -import { afterEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { mockDbClientModule, mockGetDb } from '../../../helpers/sharedMocks.js'; vi.mock('../../../../src/db/client.js', () => mockDbClientModule); diff --git a/tests/unit/db/repositories/runStatsRepository.test.ts b/tests/unit/db/repositories/runStatsRepository.test.ts index 4e11bace..432fd0d4 100644 --- a/tests/unit/db/repositories/runStatsRepository.test.ts +++ b/tests/unit/db/repositories/runStatsRepository.test.ts @@ -50,8 +50,6 @@ vi.mock('../../../../src/db/repositories/joinHelpers.js', () => ({ buildAgentRunWorkItemJoin: () => 'mock-join-condition', })); -import { mockGetDb } from '../../../helpers/sharedMocks.js'; - import { type AggregatedProjectStats, getProjectWorkStats, @@ -61,6 +59,7 @@ import { listProjectsForOrg, listRuns, } from '../../../../src/db/repositories/runStatsRepository.js'; +import { mockGetDb } from '../../../helpers/sharedMocks.js'; // ============================================================================ // Test helper diff --git a/tests/unit/db/repositories/runsRepository-concurrency.test.ts b/tests/unit/db/repositories/runsRepository-concurrency.test.ts index 744b631b..4e97fd00 100644 --- a/tests/unit/db/repositories/runsRepository-concurrency.test.ts +++ b/tests/unit/db/repositories/runsRepository-concurrency.test.ts @@ -79,8 +79,6 @@ vi.mock('../../../../src/db/repositories/runStatsRepository.js', () => ({ getProjectWorkStatsAggregated: vi.fn(), })); -import { mockGetDb } from '../../../helpers/sharedMocks.js'; - import { cancelRunById, countActiveRuns, @@ -88,6 +86,7 @@ import { failOrphanedRunFallback, hasActiveRunForWorkItem, } from '../../../../src/db/repositories/runsRepository.js'; +import { mockGetDb } from '../../../helpers/sharedMocks.js'; // ============================================================================ // Test helpers diff --git a/tests/unit/db/repositories/runsRepository.dashboard.test.ts b/tests/unit/db/repositories/runsRepository.dashboard.test.ts index 3cf1d2f8..3a0332fa 100644 --- a/tests/unit/db/repositories/runsRepository.dashboard.test.ts +++ b/tests/unit/db/repositories/runsRepository.dashboard.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; const mockSelect = vi.fn(); diff --git a/tests/unit/db/repositories/webhookLogsRepository.test.ts b/tests/unit/db/repositories/webhookLogsRepository.test.ts index 4fc55c43..8d6a203a 100644 --- a/tests/unit/db/repositories/webhookLogsRepository.test.ts +++ b/tests/unit/db/repositories/webhookLogsRepository.test.ts @@ -1,5 +1,4 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; -import { createMockDbWithGetDb } from '../../../helpers/mockDb.js'; import { mockDbClientModule } from '../../../helpers/sharedMocks.js'; vi.mock('../../../../src/db/client.js', () => mockDbClientModule); @@ -22,8 +21,6 @@ vi.mock('../../../../src/db/schema/index.js', () => ({ }, })); -import { mockGetDb } from '../../../helpers/sharedMocks.js'; - import { getWebhookLogById, getWebhookLogStats, @@ -31,6 +28,7 @@ import { listWebhookLogs, pruneWebhookLogs, } from '../../../../src/db/repositories/webhookLogsRepository.js'; +import { mockGetDb } from '../../../helpers/sharedMocks.js'; // Helper to build a chainable mock db function buildMockDb() { diff --git a/tests/unit/gadgets/astGrep.test.ts b/tests/unit/gadgets/astGrep.test.ts index 34634707..508aa051 100644 --- a/tests/unit/gadgets/astGrep.test.ts +++ b/tests/unit/gadgets/astGrep.test.ts @@ -54,7 +54,6 @@ vi.mock('../../../src/gadgets/shared/postEditChecks.js', () => ({ import { AstGrep } from '../../../src/gadgets/AstGrep.js'; import { assertFileRead } from '../../../src/gadgets/readTracking.js'; import { getSessionState } from '../../../src/gadgets/sessionState.js'; -import { validatePath } from '../../../src/gadgets/shared/pathValidation.js'; import { runPostEditChecks } from '../../../src/gadgets/shared/postEditChecks.js'; const mockGetSessionState = vi.mocked(getSessionState); diff --git a/tests/unit/gadgets/github.test.ts b/tests/unit/gadgets/github.test.ts index 5ea792fe..66c530f6 100644 --- a/tests/unit/gadgets/github.test.ts +++ b/tests/unit/gadgets/github.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { mockGitHubClientModule } from '../../helpers/sharedMocks.js'; // Mock session state @@ -37,7 +37,7 @@ function mockRunCommand( args?: string[], ) => Promise<{ stdout: string; stderr: string; exitCode: number }>, ) { - vi.mocked(runCommand).mockImplementation(async (cmd, args, cwd) => { + vi.mocked(runCommand).mockImplementation(async (cmd, args, _cwd) => { // Auto-detect owner/repo from git remote if (args?.[0] === 'remote') { return { stdout: REMOTE_URL, stderr: '', exitCode: 0 }; diff --git a/tests/unit/gadgets/github/core/createPR.test.ts b/tests/unit/gadgets/github/core/createPR.test.ts index edb73a48..ca4f490b 100644 --- a/tests/unit/gadgets/github/core/createPR.test.ts +++ b/tests/unit/gadgets/github/core/createPR.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../../../src/github/client.js', () => ({ githubClient: { @@ -54,7 +54,7 @@ describe('detectOwnerRepo (tested through createPR)', () => { htmlUrl: 'https://github.com/test-owner/test-repo/pull/1', } as Awaited>); - const result = await createPR({ + const _result = await createPR({ title: 'Test', body: 'Body', head: 'feat', @@ -152,7 +152,7 @@ describe('detectOwnerRepo (tested through createPR)', () => { describe('stageAndCommit (tested through createPR)', () => { it('stages tracked changes and commits', async () => { const calls: string[][] = []; - mockRunCommand.mockImplementation(async (cmd, args) => { + mockRunCommand.mockImplementation(async (_cmd, args) => { calls.push(args || []); if (args?.[0] === 'remote') { return { stdout: HTTPS_URL, stderr: '', exitCode: 0 }; @@ -189,7 +189,7 @@ describe('stageAndCommit (tested through createPR)', () => { it('stages untracked files individually', async () => { const calls: string[][] = []; - mockRunCommand.mockImplementation(async (cmd, args) => { + mockRunCommand.mockImplementation(async (_cmd, args) => { calls.push(args || []); if (args?.[0] === 'remote') { return { stdout: HTTPS_URL, stderr: '', exitCode: 0 }; @@ -226,7 +226,7 @@ describe('stageAndCommit (tested through createPR)', () => { it('skips commit when nothing staged', async () => { const calls: string[][] = []; - mockRunCommand.mockImplementation(async (cmd, args) => { + mockRunCommand.mockImplementation(async (_cmd, args) => { calls.push(args || []); if (args?.[0] === 'remote') { return { stdout: HTTPS_URL, stderr: '', exitCode: 0 }; @@ -280,7 +280,7 @@ describe('stageAndCommit (tested through createPR)', () => { describe('pushBranch (tested through createPR)', () => { it('pushes with -u origin flag', async () => { const calls: string[][] = []; - mockGitCommands((cmd, args) => { + mockGitCommands((_cmd, args) => { calls.push(args || []); if (args?.[0] === 'status' && args?.[1] === '--porcelain') { return { stdout: '', stderr: '', exitCode: 0 }; @@ -320,7 +320,7 @@ describe('pushBranch (tested through createPR)', () => { describe('verifyBranchOnRemote (tested through createPR)', () => { it('throws when branch not on remote', async () => { - mockGitCommands((cmd, args) => { + mockGitCommands((_cmd, args) => { if (args?.[0] === 'ls-remote') { return { stdout: '', stderr: '', exitCode: 0 }; // empty = not found } @@ -342,7 +342,7 @@ describe('verifyBranchOnRemote (tested through createPR)', () => { describe('createPR', () => { function setupSuccessfulGitCommands() { - mockGitCommands((cmd, args) => { + mockGitCommands((_cmd, args) => { if (args?.[0] === 'status' && args?.[1] === '--porcelain') { return { stdout: '', stderr: '', exitCode: 0 }; } @@ -355,7 +355,7 @@ describe('createPR', () => { it('commits and pushes by default', async () => { const calls: string[][] = []; - mockRunCommand.mockImplementation(async (cmd, args) => { + mockRunCommand.mockImplementation(async (_cmd, args) => { calls.push(args || []); if (args?.[0] === 'remote') return { stdout: HTTPS_URL, stderr: '', exitCode: 0 }; if (args?.[0] === 'status' && args?.[1] === '--porcelain') @@ -379,7 +379,7 @@ describe('createPR', () => { it('skips commit when commit=false', async () => { const calls: string[][] = []; - mockRunCommand.mockImplementation(async (cmd, args) => { + mockRunCommand.mockImplementation(async (_cmd, args) => { calls.push(args || []); if (args?.[0] === 'remote') return { stdout: HTTPS_URL, stderr: '', exitCode: 0 }; if (args?.[0] === 'ls-remote') @@ -400,7 +400,7 @@ describe('createPR', () => { it('skips push when push=false', async () => { const calls: string[][] = []; - mockRunCommand.mockImplementation(async (cmd, args) => { + mockRunCommand.mockImplementation(async (_cmd, args) => { calls.push(args || []); if (args?.[0] === 'remote') return { stdout: HTTPS_URL, stderr: '', exitCode: 0 }; if (args?.[0] === 'ls-remote') @@ -499,7 +499,7 @@ describe('createPR', () => { it('uses custom commitMessage when provided', async () => { const calls: string[][] = []; - mockRunCommand.mockImplementation(async (cmd, args) => { + mockRunCommand.mockImplementation(async (_cmd, args) => { calls.push(args || []); if (args?.[0] === 'remote') return { stdout: HTTPS_URL, stderr: '', exitCode: 0 }; if (args?.[0] === 'status' && args?.[1] === '--porcelain') diff --git a/tests/unit/gadgets/github/core/misc.test.ts b/tests/unit/gadgets/github/core/misc.test.ts index 774d27dd..6ada4343 100644 --- a/tests/unit/gadgets/github/core/misc.test.ts +++ b/tests/unit/gadgets/github/core/misc.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../../../src/github/client.js', () => ({ githubClient: { diff --git a/tests/unit/gadgets/pm/core/addChecklist.test.ts b/tests/unit/gadgets/pm/core/addChecklist.test.ts index db59eeb1..f18b2961 100644 --- a/tests/unit/gadgets/pm/core/addChecklist.test.ts +++ b/tests/unit/gadgets/pm/core/addChecklist.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockPMProvider } from '../../../../helpers/mockPMProvider.js'; diff --git a/tests/unit/gadgets/pm/core/createWorkItem.test.ts b/tests/unit/gadgets/pm/core/createWorkItem.test.ts index 4196cea8..3ad63ae3 100644 --- a/tests/unit/gadgets/pm/core/createWorkItem.test.ts +++ b/tests/unit/gadgets/pm/core/createWorkItem.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockPMProvider } from '../../../../helpers/mockPMProvider.js'; diff --git a/tests/unit/gadgets/pm/core/deleteChecklistItem.test.ts b/tests/unit/gadgets/pm/core/deleteChecklistItem.test.ts index cd3c84f9..d3168616 100644 --- a/tests/unit/gadgets/pm/core/deleteChecklistItem.test.ts +++ b/tests/unit/gadgets/pm/core/deleteChecklistItem.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockPMProvider } from '../../../../helpers/mockPMProvider.js'; diff --git a/tests/unit/gadgets/pm/core/listWorkItems.test.ts b/tests/unit/gadgets/pm/core/listWorkItems.test.ts index 33bc5f1f..144e9747 100644 --- a/tests/unit/gadgets/pm/core/listWorkItems.test.ts +++ b/tests/unit/gadgets/pm/core/listWorkItems.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockPMProvider } from '../../../../helpers/mockPMProvider.js'; diff --git a/tests/unit/gadgets/pm/core/moveWorkItem.test.ts b/tests/unit/gadgets/pm/core/moveWorkItem.test.ts index ec721a0c..6a28a580 100644 --- a/tests/unit/gadgets/pm/core/moveWorkItem.test.ts +++ b/tests/unit/gadgets/pm/core/moveWorkItem.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockPMProvider } from '../../../../helpers/mockPMProvider.js'; diff --git a/tests/unit/gadgets/pm/core/readWorkItem.test.ts b/tests/unit/gadgets/pm/core/readWorkItem.test.ts index ba1f5238..eb88cfaf 100644 --- a/tests/unit/gadgets/pm/core/readWorkItem.test.ts +++ b/tests/unit/gadgets/pm/core/readWorkItem.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockPMProvider } from '../../../../helpers/mockPMProvider.js'; diff --git a/tests/unit/gadgets/pm/core/updateChecklistItem.test.ts b/tests/unit/gadgets/pm/core/updateChecklistItem.test.ts index 7065812e..99619a59 100644 --- a/tests/unit/gadgets/pm/core/updateChecklistItem.test.ts +++ b/tests/unit/gadgets/pm/core/updateChecklistItem.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockPMProvider } from '../../../../helpers/mockPMProvider.js'; diff --git a/tests/unit/gadgets/pm/core/updateWorkItem.test.ts b/tests/unit/gadgets/pm/core/updateWorkItem.test.ts index 21291f25..6a28eb65 100644 --- a/tests/unit/gadgets/pm/core/updateWorkItem.test.ts +++ b/tests/unit/gadgets/pm/core/updateWorkItem.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { createMockPMProvider } from '../../../../helpers/mockPMProvider.js'; diff --git a/tests/unit/gadgets/session/core/finish.test.ts b/tests/unit/gadgets/session/core/finish.test.ts index f38f8f34..f41729d4 100644 --- a/tests/unit/gadgets/session/core/finish.test.ts +++ b/tests/unit/gadgets/session/core/finish.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../../../src/github/client.js', () => ({ githubClient: { diff --git a/tests/unit/gadgets/sessionState.test.ts b/tests/unit/gadgets/sessionState.test.ts index 758b1360..05b54888 100644 --- a/tests/unit/gadgets/sessionState.test.ts +++ b/tests/unit/gadgets/sessionState.test.ts @@ -12,7 +12,6 @@ vi.mock('../../../src/github/client.js', () => ({ })); import { - SessionState, clearInitialComment, createSessionState, deleteInitialComment, @@ -26,6 +25,7 @@ import { recordInitialComment, recordPRCreation, recordReviewSubmission, + SessionState, setDefaultSessionState, } from '../../../src/gadgets/sessionState.js'; diff --git a/tests/unit/gadgets/shared/factories.test.ts b/tests/unit/gadgets/shared/factories.test.ts index 0d84de97..79ea8492 100644 --- a/tests/unit/gadgets/shared/factories.test.ts +++ b/tests/unit/gadgets/shared/factories.test.ts @@ -38,9 +38,9 @@ import { createCLICommand, } from '../../../../src/gadgets/shared/cliCommandFactory.js'; import { - type GadgetCoreFn, buildZodSchema, createGadgetClass, + type GadgetCoreFn, } from '../../../../src/gadgets/shared/gadgetFactory.js'; import { generateToolManifest } from '../../../../src/gadgets/shared/manifestGenerator.js'; import type { ToolDefinition } from '../../../../src/gadgets/shared/toolDefinition.js'; diff --git a/tests/unit/gadgets/shared/pathValidation.test.ts b/tests/unit/gadgets/shared/pathValidation.test.ts index 2a285939..08f6d584 100644 --- a/tests/unit/gadgets/shared/pathValidation.test.ts +++ b/tests/unit/gadgets/shared/pathValidation.test.ts @@ -16,7 +16,7 @@ vi.mock('../../../../src/utils/repo.js', () => ({ import { validatePath } from '../../../../src/gadgets/shared/pathValidation.js'; describe('validatePath', () => { - const originalCwd = process.cwd(); + const _originalCwd = process.cwd(); beforeEach(() => { vi.resetAllMocks(); diff --git a/tests/unit/gadgets/tmux.test.ts b/tests/unit/gadgets/tmux.test.ts index 5626d043..91a213a3 100644 --- a/tests/unit/gadgets/tmux.test.ts +++ b/tests/unit/gadgets/tmux.test.ts @@ -1,17 +1,17 @@ import { resolve } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; -import { - Tmux, - consumePendingSessionNotices, - resolveWorkingDirectory, - validateGitCommand, -} from '../../../src/gadgets/tmux.js'; import { sanitizeSessionName, sleep, stripAnsi, unescapeOutput, } from '../../../src/gadgets/tmux/utils.js'; +import { + consumePendingSessionNotices, + resolveWorkingDirectory, + Tmux, + validateGitCommand, +} from '../../../src/gadgets/tmux.js'; describe('Tmux Gadget', () => { describe('resolveWorkingDirectory', () => { diff --git a/tests/unit/gadgets/tmux/TmuxControlClient.test.ts b/tests/unit/gadgets/tmux/TmuxControlClient.test.ts index edb9a872..430a2fef 100644 --- a/tests/unit/gadgets/tmux/TmuxControlClient.test.ts +++ b/tests/unit/gadgets/tmux/TmuxControlClient.test.ts @@ -1,5 +1,5 @@ import { EventEmitter } from 'node:events'; -import { type MockInstance, afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, beforeEach, describe, expect, it, type MockInstance, vi } from 'vitest'; import { EXIT_MARKER_PREFIX, EXIT_MARKER_SUFFIX } from '../../../../src/gadgets/tmux/constants.js'; // ─── Mock readline ───────────────────────────────────────────────────────────── diff --git a/tests/unit/gadgets/tmux/TmuxGadget.test.ts b/tests/unit/gadgets/tmux/TmuxGadget.test.ts index 3431f809..3fc44581 100644 --- a/tests/unit/gadgets/tmux/TmuxGadget.test.ts +++ b/tests/unit/gadgets/tmux/TmuxGadget.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { CommandFailedError } from '../../../../src/gadgets/tmux/errors.js'; // ─── Mock the control client module ─────────────────────────────────────────── diff --git a/tests/unit/gadgets/todo-storage.test.ts b/tests/unit/gadgets/todo-storage.test.ts index e0538751..67503ccb 100644 --- a/tests/unit/gadgets/todo-storage.test.ts +++ b/tests/unit/gadgets/todo-storage.test.ts @@ -13,13 +13,13 @@ vi.mock('../../../src/utils/repo.js', () => ({ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; import { - type Todo, formatTodoList, getNextId, getSessionId, initTodoSession, loadTodos, saveTodos, + type Todo, } from '../../../src/gadgets/todo/storage.js'; describe('todo storage', () => { diff --git a/tests/unit/gadgets/todo.test.ts b/tests/unit/gadgets/todo.test.ts index 1e709da1..a93e3d10 100644 --- a/tests/unit/gadgets/todo.test.ts +++ b/tests/unit/gadgets/todo.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { TodoUpdateStatus } from '../../../src/gadgets/todo/TodoUpdateStatus.js'; import { TodoUpsert } from '../../../src/gadgets/todo/TodoUpsert.js'; @@ -20,7 +20,7 @@ vi.mock('../../../src/gadgets/todo/storage.js', () => { }), getNextId: vi.fn((existingTodos) => { const maxId = existingTodos.reduce( - (max: number, t: { id: string }) => Math.max(max, Number.parseInt(t.id) || 0), + (max: number, t: { id: string }) => Math.max(max, Number.parseInt(t.id, 10) || 0), 0, ); return String(maxId + 1); diff --git a/tests/unit/gadgets/todo/todoDelete.test.ts b/tests/unit/gadgets/todo/todoDelete.test.ts index 8d50f9ce..5ea64fc2 100644 --- a/tests/unit/gadgets/todo/todoDelete.test.ts +++ b/tests/unit/gadgets/todo/todoDelete.test.ts @@ -6,8 +6,8 @@ vi.mock('../../../../src/gadgets/todo/storage.js', () => ({ formatTodoList: vi.fn(), })); -import { TodoDelete } from '../../../../src/gadgets/todo/TodoDelete.js'; import { formatTodoList, loadTodos, saveTodos } from '../../../../src/gadgets/todo/storage.js'; +import { TodoDelete } from '../../../../src/gadgets/todo/TodoDelete.js'; const mockLoadTodos = vi.mocked(loadTodos); const mockSaveTodos = vi.mocked(saveTodos); diff --git a/tests/unit/github/client.test.ts b/tests/unit/github/client.test.ts index 113fab38..d434d47d 100644 --- a/tests/unit/github/client.test.ts +++ b/tests/unit/github/client.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; // Mock Octokit before importing client const mockPulls = { @@ -52,14 +52,13 @@ vi.mock('../../../src/utils/logging.js', () => ({ }, })); +import { Octokit } from '@octokit/rest'; import { getGitHubUserForToken, githubClient, withGitHubToken, } from '../../../src/github/client.js'; -import { Octokit } from '@octokit/rest'; - describe('githubClient', () => { describe('getClient throws without scope', () => { it('throws when no withGitHubToken scope is active', async () => { @@ -808,7 +807,7 @@ describe('githubClient', () => { }); }); - it('falls back to Run #${id} when run name is null', async () => { + it('falls back to Run # when run name is null', async () => { mockActions.listWorkflowRunsForRepo.mockResolvedValue({ data: { workflow_runs: [{ id: 99, name: null, conclusion: 'failure' }], diff --git a/tests/unit/github/integration.test.ts b/tests/unit/github/integration.test.ts index ecff1f21..23760389 100644 --- a/tests/unit/github/integration.test.ts +++ b/tests/unit/github/integration.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; // --------------------------------------------------------------------------- // Mocks diff --git a/tests/unit/github/personas.test.ts b/tests/unit/github/personas.test.ts index 1b54958f..bbe33812 100644 --- a/tests/unit/github/personas.test.ts +++ b/tests/unit/github/personas.test.ts @@ -20,6 +20,7 @@ vi.mock('../../../src/utils/logging.js', () => ({ import { getIntegrationCredential } from '../../../src/config/provider.js'; import { getGitHubUserForToken } from '../../../src/github/client.js'; +import type { PersonaIdentities } from '../../../src/github/personas.js'; import { _resetPersonaIdentityCache, getPersonaForAgentType, @@ -28,7 +29,6 @@ import { isCascadeBot, resolvePersonaIdentities, } from '../../../src/github/personas.js'; -import type { PersonaIdentities } from '../../../src/github/personas.js'; describe('personas', () => { beforeEach(() => { diff --git a/tests/unit/instrument.test.ts b/tests/unit/instrument.test.ts index 039b39ad..7ff07db6 100644 --- a/tests/unit/instrument.test.ts +++ b/tests/unit/instrument.test.ts @@ -15,18 +15,13 @@ describe('instrument (Sentry init)', () => { }); afterEach(() => { - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.SENTRY_DSN; - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.SENTRY_ENVIRONMENT; - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.SENTRY_RELEASE; - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.SENTRY_TRACES_SAMPLE_RATE; }); it('does NOT call Sentry.init when SENTRY_DSN is unset', async () => { - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.SENTRY_DSN; await import('../../src/instrument.js'); expect(mockInit).not.toHaveBeenCalled(); @@ -49,7 +44,6 @@ describe('instrument (Sentry init)', () => { it('falls back to NODE_ENV for environment', async () => { process.env.SENTRY_DSN = 'https://fake@sentry.io/123'; - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.SENTRY_ENVIRONMENT; const originalNodeEnv = process.env.NODE_ENV; process.env.NODE_ENV = 'test'; @@ -67,7 +61,6 @@ describe('instrument (Sentry init)', () => { it('defaults tracesSampleRate to 0.1', async () => { process.env.SENTRY_DSN = 'https://fake@sentry.io/123'; - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.SENTRY_TRACES_SAMPLE_RATE; await import('../../src/instrument.js'); expect(mockInit).toHaveBeenCalledWith(expect.objectContaining({ tracesSampleRate: 0.1 })); diff --git a/tests/unit/pm/context.test.ts b/tests/unit/pm/context.test.ts index fd9b95d5..d47bed03 100644 --- a/tests/unit/pm/context.test.ts +++ b/tests/unit/pm/context.test.ts @@ -171,7 +171,7 @@ describe('pm/context', () => { await withPMProvider(innerProvider, async () => { throw new Error('Inner error'); }); - } catch (error) { + } catch (_error) { // Expected error } diff --git a/tests/unit/pm/media.test.ts b/tests/unit/pm/media.test.ts index b7f7a062..cf095a73 100644 --- a/tests/unit/pm/media.test.ts +++ b/tests/unit/pm/media.test.ts @@ -1,11 +1,11 @@ import { afterEach, describe, expect, it, vi } from 'vitest'; import { - MAX_IMAGES_PER_WORK_ITEM, - MAX_IMAGE_SIZE_BYTES, downloadMedia, extractMarkdownImages, filterImageMedia, isImageMimeType, + MAX_IMAGE_SIZE_BYTES, + MAX_IMAGES_PER_WORK_ITEM, resolveJiraMediaUrls, } from '../../../src/pm/media.js'; import type { MediaReference } from '../../../src/pm/types.js'; diff --git a/tests/unit/queue/cancel.test.ts b/tests/unit/queue/cancel.test.ts index be1f3706..296b4eb4 100644 --- a/tests/unit/queue/cancel.test.ts +++ b/tests/unit/queue/cancel.test.ts @@ -90,7 +90,6 @@ describe('publishCancelCommand', () => { it('throws an error when REDIS_URL is not set', async () => { const saved = process.env.REDIS_URL; - // biome-ignore lint/performance/noDelete: need to fully remove the key delete process.env.REDIS_URL; try { @@ -298,7 +297,6 @@ describe('subscribeToCancelCommands', () => { it('throws an error when REDIS_URL is not set', async () => { const saved = process.env.REDIS_URL; - // biome-ignore lint/performance/noDelete: need to fully remove the key delete process.env.REDIS_URL; try { diff --git a/tests/unit/queue/client.test.ts b/tests/unit/queue/client.test.ts index 9058d86f..67e8018f 100644 --- a/tests/unit/queue/client.test.ts +++ b/tests/unit/queue/client.test.ts @@ -172,7 +172,6 @@ describe('getQueue error handling', () => { it('throws an error when REDIS_URL is not set', async () => { // Ensure REDIS_URL is not present in the environment const saved = process.env.REDIS_URL; - // biome-ignore lint/performance/noDelete: need to fully remove the key so !redisUrl is true delete process.env.REDIS_URL; try { diff --git a/tests/unit/router/ackMessageGenerator.test.ts b/tests/unit/router/ackMessageGenerator.test.ts index 25a5f89c..eddc22cb 100644 --- a/tests/unit/router/ackMessageGenerator.test.ts +++ b/tests/unit/router/ackMessageGenerator.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; // Mock heavy imports before importing the module under test const mockTextComplete = vi.fn(); diff --git a/tests/unit/router/adapters/github.test.ts b/tests/unit/router/adapters/github.test.ts index 029c2aa0..a7a92407 100644 --- a/tests/unit/router/adapters/github.test.ts +++ b/tests/unit/router/adapters/github.test.ts @@ -83,8 +83,8 @@ import { resolveGitHubTokenForAckByAgent, } from '../../../../src/router/acknowledgments.js'; import { GitHubRouterAdapter, injectEventType } from '../../../../src/router/adapters/github.js'; -import { loadProjectConfig } from '../../../../src/router/config.js'; import type { RouterProjectConfig } from '../../../../src/router/config.js'; +import { loadProjectConfig } from '../../../../src/router/config.js'; import { extractPRNumber } from '../../../../src/router/notifications.js'; import { addEyesReactionToPR } from '../../../../src/router/pre-actions.js'; import type { GitHubJob } from '../../../../src/router/queue.js'; diff --git a/tests/unit/router/adapters/jira.test.ts b/tests/unit/router/adapters/jira.test.ts index e207f7c4..775c9459 100644 --- a/tests/unit/router/adapters/jira.test.ts +++ b/tests/unit/router/adapters/jira.test.ts @@ -44,8 +44,8 @@ vi.mock('../../../../src/jira/client.js', () => ({ import { postJiraAck, resolveJiraBotAccountId } from '../../../../src/router/acknowledgments.js'; import { JiraRouterAdapter } from '../../../../src/router/adapters/jira.js'; -import { loadProjectConfig } from '../../../../src/router/config.js'; import type { RouterProjectConfig } from '../../../../src/router/config.js'; +import { loadProjectConfig } from '../../../../src/router/config.js'; import { resolveJiraCredentials } from '../../../../src/router/platformClients/index.js'; import { sendAcknowledgeReaction } from '../../../../src/router/reactions.js'; import type { TriggerRegistry } from '../../../../src/triggers/registry.js'; diff --git a/tests/unit/router/adapters/sentry.test.ts b/tests/unit/router/adapters/sentry.test.ts index a45054c5..9ffd17e2 100644 --- a/tests/unit/router/adapters/sentry.test.ts +++ b/tests/unit/router/adapters/sentry.test.ts @@ -8,8 +8,8 @@ vi.mock('../../../../src/router/config.js', () => ({ })); import { SentryRouterAdapter } from '../../../../src/router/adapters/sentry.js'; -import { loadProjectConfig } from '../../../../src/router/config.js'; import type { RouterProjectConfig } from '../../../../src/router/config.js'; +import { loadProjectConfig } from '../../../../src/router/config.js'; import type { SentryJob } from '../../../../src/router/queue.js'; import type { TriggerRegistry } from '../../../../src/triggers/registry.js'; diff --git a/tests/unit/router/adapters/trello.test.ts b/tests/unit/router/adapters/trello.test.ts index ed44a7a6..57e2945a 100644 --- a/tests/unit/router/adapters/trello.test.ts +++ b/tests/unit/router/adapters/trello.test.ts @@ -46,8 +46,8 @@ vi.mock('../../../../src/router/trello.js', () => ({ import { postTrelloAck } from '../../../../src/router/acknowledgments.js'; import { TrelloRouterAdapter } from '../../../../src/router/adapters/trello.js'; -import { loadProjectConfig } from '../../../../src/router/config.js'; import type { RouterProjectConfig } from '../../../../src/router/config.js'; +import { loadProjectConfig } from '../../../../src/router/config.js'; import { resolveTrelloCredentials } from '../../../../src/router/platformClients/index.js'; import { sendAcknowledgeReaction } from '../../../../src/router/reactions.js'; import { isCardInTriggerList, isSelfAuthoredTrelloComment } from '../../../../src/router/trello.js'; diff --git a/tests/unit/router/config.test.ts b/tests/unit/router/config.test.ts index 6911d975..9699447e 100644 --- a/tests/unit/router/config.test.ts +++ b/tests/unit/router/config.test.ts @@ -17,11 +17,7 @@ vi.mock('../../../src/config/configCache.js', () => ({ })); import { loadConfig } from '../../../src/config/provider.js'; -import { - _resetProjectConfigCache, - loadProjectConfig, - routerConfig, -} from '../../../src/router/config.js'; +import { routerConfig } from '../../../src/router/config.js'; const mockLoadConfig = vi.mocked(loadConfig); diff --git a/tests/unit/router/platformClients.test.ts b/tests/unit/router/platformClients.test.ts index 0291ccf7..c2612b95 100644 --- a/tests/unit/router/platformClients.test.ts +++ b/tests/unit/router/platformClients.test.ts @@ -31,10 +31,10 @@ vi.mock('../../../src/utils/logging.js', () => ({ import { findProjectById, getIntegrationCredential } from '../../../src/config/provider.js'; import { - TrelloPlatformClient, resolveGitHubHeaders, resolveJiraCredentials, resolveTrelloCredentials, + TrelloPlatformClient, } from '../../../src/router/platformClients/index.js'; import { logger } from '../../../src/utils/logging.js'; diff --git a/tests/unit/router/snapshot-manager.test.ts b/tests/unit/router/snapshot-manager.test.ts index 5195aea3..ed334d57 100644 --- a/tests/unit/router/snapshot-manager.test.ts +++ b/tests/unit/router/snapshot-manager.test.ts @@ -243,7 +243,7 @@ describe('snapshot-manager', () => { it('evicts expired snapshots by TTL', () => { const snap1 = registerSnapshot('proj-1', 'card-1', 'img-1:latest'); - const snap2 = registerSnapshot('proj-1', 'card-2', 'img-2:latest'); + const _snap2 = registerSnapshot('proj-1', 'card-2', 'img-2:latest'); // Backdate snap1 so it's expired snap1.createdAt = new Date(Date.now() - 2000); diff --git a/tests/unit/router/trello.test.ts b/tests/unit/router/trello.test.ts index 01a6335d..1812caab 100644 --- a/tests/unit/router/trello.test.ts +++ b/tests/unit/router/trello.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/utils/logging.js', () => ({ logger: { diff --git a/tests/unit/router/webhook-processor.test.ts b/tests/unit/router/webhook-processor.test.ts index 6ab0e16c..55109284 100644 --- a/tests/unit/router/webhook-processor.test.ts +++ b/tests/unit/router/webhook-processor.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/utils/logging.js', () => ({ logger: { @@ -29,8 +29,8 @@ import { isDuplicateAction, markActionProcessed } from '../../../src/router/acti import { checkAgentTypeConcurrency } from '../../../src/router/agent-type-lock.js'; import type { RouterProjectConfig } from '../../../src/router/config.js'; import type { RouterPlatformAdapter } from '../../../src/router/platform-adapter.js'; -import { addJob } from '../../../src/router/queue.js'; import type { CascadeJob } from '../../../src/router/queue.js'; +import { addJob } from '../../../src/router/queue.js'; import { processRouterWebhook } from '../../../src/router/webhook-processor.js'; import { isWorkItemLocked, markWorkItemEnqueued } from '../../../src/router/work-item-lock.js'; import type { TriggerRegistry } from '../../../src/triggers/registry.js'; diff --git a/tests/unit/router/work-item-lock.test.ts b/tests/unit/router/work-item-lock.test.ts index c3ec6450..e45af74f 100644 --- a/tests/unit/router/work-item-lock.test.ts +++ b/tests/unit/router/work-item-lock.test.ts @@ -12,8 +12,6 @@ vi.mock('../../../src/router/config.js', () => ({ import { countActiveRuns } from '../../../src/db/repositories/runsRepository.js'; import { - MAX_SAME_TYPE_PER_WORK_ITEM, - MAX_WORK_ITEM_CONCURRENCY, clearAllWorkItemLocks, clearWorkItemEnqueued, isWorkItemLocked, diff --git a/tests/unit/sentry.test.ts b/tests/unit/sentry.test.ts index a371d538..3f882627 100644 --- a/tests/unit/sentry.test.ts +++ b/tests/unit/sentry.test.ts @@ -24,7 +24,6 @@ describe('sentry wrappers', () => { beforeEach(async () => { vi.resetModules(); - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.SENTRY_DSN; sentry = await import('../../src/sentry.js'); }); @@ -65,7 +64,6 @@ describe('sentry wrappers', () => { }); afterEach(() => { - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.SENTRY_DSN; }); diff --git a/tests/unit/trello/client.test.ts b/tests/unit/trello/client.test.ts index d11d6de1..22c5f8f0 100644 --- a/tests/unit/trello/client.test.ts +++ b/tests/unit/trello/client.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/utils/logging.js', () => ({ logger: { @@ -41,7 +41,6 @@ vi.mock('trello.js', () => ({ })), })); -import { TrelloClient } from 'trello.js'; import { trelloClient, withTrelloCredentials } from '../../../src/trello/client.js'; describe('trelloClient', () => { @@ -469,7 +468,7 @@ describe('trelloClient', () => { }); it('handles missing fields gracefully', async () => { - const fetchSpy = vi + const _fetchSpy = vi .spyOn(globalThis, 'fetch') .mockResolvedValue(new Response(JSON.stringify([{}, { id: 'b1' }]), { status: 200 })); diff --git a/tests/unit/triggers/agent-execution.test.ts b/tests/unit/triggers/agent-execution.test.ts index 9991c28b..dbefbcf8 100644 --- a/tests/unit/triggers/agent-execution.test.ts +++ b/tests/unit/triggers/agent-execution.test.ts @@ -54,9 +54,9 @@ import { runAgent } from '../../../src/agents/registry.js'; import { getJiraConfig, getTrelloConfig } from '../../../src/pm/config.js'; import { getPMProvider } from '../../../src/pm/context.js'; import { - PMLifecycleManager, createPMProvider, hasAutoLabel, + PMLifecycleManager, resolveProjectPMConfig, } from '../../../src/pm/index.js'; import { runAgentExecutionPipeline } from '../../../src/triggers/shared/agent-execution.js'; diff --git a/tests/unit/triggers/agent-result-handler.test.ts b/tests/unit/triggers/agent-result-handler.test.ts index 63dd0560..83263f88 100644 --- a/tests/unit/triggers/agent-result-handler.test.ts +++ b/tests/unit/triggers/agent-result-handler.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/pm/index.js', () => ({ getPMProvider: vi.fn(), diff --git a/tests/unit/triggers/budget.test.ts b/tests/unit/triggers/budget.test.ts index 92aa37dc..530ea803 100644 --- a/tests/unit/triggers/budget.test.ts +++ b/tests/unit/triggers/budget.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/pm/index.js', () => ({ getPMProvider: vi.fn(), diff --git a/tests/unit/triggers/builtins.test.ts b/tests/unit/triggers/builtins.test.ts index 8a200107..3425a031 100644 --- a/tests/unit/triggers/builtins.test.ts +++ b/tests/unit/triggers/builtins.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; // Mock all trigger imports vi.mock('../../../src/triggers/github/check-suite-failure.js', () => ({ diff --git a/tests/unit/triggers/check-suite-failure.test.ts b/tests/unit/triggers/check-suite-failure.test.ts index e777b7a8..782e0150 100644 --- a/tests/unit/triggers/check-suite-failure.test.ts +++ b/tests/unit/triggers/check-suite-failure.test.ts @@ -11,6 +11,7 @@ vi.mock('../../../src/triggers/shared/trigger-check.js', () => mockTriggerCheckM vi.mock('../../../src/github/client.js', () => mockGitHubClientModule); +import { githubClient } from '../../../src/github/client.js'; import { CheckSuiteFailureTrigger, resetFixAttempts, @@ -19,11 +20,10 @@ import type { TriggerContext } from '../../../src/triggers/types.js'; import { createCheckSuitePayload, createMockProject } from '../../helpers/factories.js'; import { mockPersonaIdentities } from '../../helpers/mockPersonas.js'; -import { githubClient } from '../../../src/github/client.js'; - vi.mock('../../../src/db/repositories/prWorkItemsRepository.js', () => ({ lookupWorkItemForPR: vi.fn(), })); + import { lookupWorkItemForPR } from '../../../src/db/repositories/prWorkItemsRepository.js'; import { checkTriggerEnabled } from '../../../src/triggers/shared/trigger-check.js'; diff --git a/tests/unit/triggers/check-suite-success.test.ts b/tests/unit/triggers/check-suite-success.test.ts index aa36b955..b5390c5f 100644 --- a/tests/unit/triggers/check-suite-success.test.ts +++ b/tests/unit/triggers/check-suite-success.test.ts @@ -11,6 +11,7 @@ vi.mock('../../../src/triggers/shared/trigger-check.js', () => mockTriggerCheckM vi.mock('../../../src/github/client.js', () => mockGitHubClientModule); +import { githubClient } from '../../../src/github/client.js'; import { CheckSuiteSuccessTrigger, recentlyDispatched, @@ -21,8 +22,6 @@ import type { TriggerContext } from '../../../src/triggers/types.js'; import { createCheckSuitePayload, createMockProject } from '../../helpers/factories.js'; import { mockPersonaIdentities } from '../../helpers/mockPersonas.js'; -import { githubClient } from '../../../src/github/client.js'; - vi.mock('../../../src/db/repositories/prWorkItemsRepository.js', () => ({ lookupWorkItemForPR: vi.fn(), })); diff --git a/tests/unit/triggers/debug-runner.test.ts b/tests/unit/triggers/debug-runner.test.ts index a049ea27..44513d8d 100644 --- a/tests/unit/triggers/debug-runner.test.ts +++ b/tests/unit/triggers/debug-runner.test.ts @@ -49,6 +49,7 @@ import { } from '../../../src/triggers/shared/debug-status.js'; const mockPMProvider = { addComment: vi.fn() }; + import type { CascadeConfig } from '../../../src/types/index.js'; import { createMockProject } from '../../helpers/factories.js'; diff --git a/tests/unit/triggers/debug-trigger.test.ts b/tests/unit/triggers/debug-trigger.test.ts index c4018802..38f17c67 100644 --- a/tests/unit/triggers/debug-trigger.test.ts +++ b/tests/unit/triggers/debug-trigger.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/db/repositories/runsRepository.js', () => ({ getRunById: vi.fn(), diff --git a/tests/unit/triggers/github-integration.test.ts b/tests/unit/triggers/github-integration.test.ts index 8deac69f..584c2ce5 100644 --- a/tests/unit/triggers/github-integration.test.ts +++ b/tests/unit/triggers/github-integration.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('../../../src/config/provider.js', () => ({ loadProjectConfigByRepo: vi.fn(), diff --git a/tests/unit/triggers/github-pr-comment-mention.test.ts b/tests/unit/triggers/github-pr-comment-mention.test.ts index 9f268b42..02749b94 100644 --- a/tests/unit/triggers/github-pr-comment-mention.test.ts +++ b/tests/unit/triggers/github-pr-comment-mention.test.ts @@ -37,11 +37,7 @@ import { PRCommentMentionTrigger } from '../../../src/triggers/github/pr-comment import { checkTriggerEnabled } from '../../../src/triggers/shared/trigger-check.js'; import type { TriggerContext } from '../../../src/triggers/types.js'; import { createMockProject } from '../../helpers/factories.js'; -import { - IMPLEMENTER_USERNAME, - REVIEWER_USERNAME, - mockPersonaIdentities, -} from '../../helpers/mockPersonas.js'; +import { IMPLEMENTER_USERNAME, mockPersonaIdentities } from '../../helpers/mockPersonas.js'; const HUMAN_USERNAME = 'alice-human'; const CARD_SHORT_ID = 'abc123card'; diff --git a/tests/unit/triggers/pr-merged.test.ts b/tests/unit/triggers/pr-merged.test.ts index 89d2eb67..7b7a62b4 100644 --- a/tests/unit/triggers/pr-merged.test.ts +++ b/tests/unit/triggers/pr-merged.test.ts @@ -54,15 +54,14 @@ vi.mock('../../../src/router/snapshot-manager.js', () => ({ // Register PM integrations in the registry import '../../../src/pm/index.js'; -import { PRMergedTrigger } from '../../../src/triggers/github/pr-merged.js'; -import type { TriggerContext } from '../../../src/triggers/types.js'; -import { createMockProject } from '../../helpers/factories.js'; - import { lookupWorkItemForPR } from '../../../src/db/repositories/prWorkItemsRepository.js'; import { githubClient } from '../../../src/github/client.js'; +import { PRMergedTrigger } from '../../../src/triggers/github/pr-merged.js'; import { isPipelineAtCapacity } from '../../../src/triggers/shared/backlog-check.js'; import { isLifecycleTriggerEnabled } from '../../../src/triggers/shared/lifecycle-check.js'; import { checkTriggerEnabled } from '../../../src/triggers/shared/trigger-check.js'; +import type { TriggerContext } from '../../../src/triggers/types.js'; +import { createMockProject } from '../../helpers/factories.js'; describe('PRMergedTrigger', () => { const trigger = new PRMergedTrigger(); diff --git a/tests/unit/triggers/pr-opened.test.ts b/tests/unit/triggers/pr-opened.test.ts index ca6f2b82..7e9dcfe0 100644 --- a/tests/unit/triggers/pr-opened.test.ts +++ b/tests/unit/triggers/pr-opened.test.ts @@ -12,6 +12,7 @@ import { createMockProject } from '../../helpers/factories.js'; vi.mock('../../../src/db/repositories/prWorkItemsRepository.js', () => ({ lookupWorkItemForPR: vi.fn(), })); + import { lookupWorkItemForPR } from '../../../src/db/repositories/prWorkItemsRepository.js'; import { checkTriggerEnabledWithParams } from '../../../src/triggers/shared/trigger-check.js'; diff --git a/tests/unit/triggers/pr-ready-to-merge.test.ts b/tests/unit/triggers/pr-ready-to-merge.test.ts index ed973916..dc930042 100644 --- a/tests/unit/triggers/pr-ready-to-merge.test.ts +++ b/tests/unit/triggers/pr-ready-to-merge.test.ts @@ -40,7 +40,10 @@ vi.mock('../../../src/db/repositories/prWorkItemsRepository.js', () => ({ // Register PM integrations in the registry import '../../../src/pm/index.js'; +import { lookupWorkItemForPR } from '../../../src/db/repositories/prWorkItemsRepository.js'; +import { githubClient } from '../../../src/github/client.js'; import { PRReadyToMergeTrigger } from '../../../src/triggers/github/pr-ready-to-merge.js'; +import { isLifecycleTriggerEnabled } from '../../../src/triggers/shared/lifecycle-check.js'; import type { TriggerContext } from '../../../src/triggers/types.js'; import { createCheckSuitePayload, @@ -48,10 +51,6 @@ import { createReviewPayload, } from '../../helpers/factories.js'; -import { lookupWorkItemForPR } from '../../../src/db/repositories/prWorkItemsRepository.js'; -import { githubClient } from '../../../src/github/client.js'; -import { isLifecycleTriggerEnabled } from '../../../src/triggers/shared/lifecycle-check.js'; - describe('PRReadyToMergeTrigger', () => { const trigger = new PRReadyToMergeTrigger(); diff --git a/tests/unit/triggers/pr-review-submitted.test.ts b/tests/unit/triggers/pr-review-submitted.test.ts index d9749e64..8cc91c29 100644 --- a/tests/unit/triggers/pr-review-submitted.test.ts +++ b/tests/unit/triggers/pr-review-submitted.test.ts @@ -13,6 +13,7 @@ import { mockPersonaIdentities } from '../../helpers/mockPersonas.js'; vi.mock('../../../src/db/repositories/prWorkItemsRepository.js', () => ({ lookupWorkItemForPR: vi.fn(), })); + import { lookupWorkItemForPR } from '../../../src/db/repositories/prWorkItemsRepository.js'; import { checkTriggerEnabled } from '../../../src/triggers/shared/trigger-check.js'; diff --git a/tests/unit/triggers/review-requested.test.ts b/tests/unit/triggers/review-requested.test.ts index f505c517..6998a891 100644 --- a/tests/unit/triggers/review-requested.test.ts +++ b/tests/unit/triggers/review-requested.test.ts @@ -14,6 +14,7 @@ import { mockPersonaIdentities } from '../../helpers/mockPersonas.js'; vi.mock('../../../src/db/repositories/prWorkItemsRepository.js', () => ({ lookupWorkItemForPR: vi.fn(), })); + import { lookupWorkItemForPR } from '../../../src/db/repositories/prWorkItemsRepository.js'; import { checkTriggerEnabled } from '../../../src/triggers/shared/trigger-check.js'; diff --git a/tests/unit/triggers/shared/agent-pm-poster.test.ts b/tests/unit/triggers/shared/agent-pm-poster.test.ts index 4bb9f5b9..cf2de8ec 100644 --- a/tests/unit/triggers/shared/agent-pm-poster.test.ts +++ b/tests/unit/triggers/shared/agent-pm-poster.test.ts @@ -32,10 +32,10 @@ vi.mock('../../../../src/utils/logging.js', () => ({ })); import { - PM_SUMMARY_AGENT_TYPES, formatAgentOutputForPM, formatReviewForPM, isOutputBasedAgent, + PM_SUMMARY_AGENT_TYPES, postAgentOutputToPM, postReviewToPM, } from '../../../../src/triggers/shared/agent-pm-poster.js'; diff --git a/tests/unit/utils/llmLogging.test.ts b/tests/unit/utils/llmLogging.test.ts index 971e13da..a7ade3b2 100644 --- a/tests/unit/utils/llmLogging.test.ts +++ b/tests/unit/utils/llmLogging.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; vi.mock('node:fs', () => ({ default: { diff --git a/tests/unit/utils/logging.test.ts b/tests/unit/utils/logging.test.ts index 958df256..271245de 100644 --- a/tests/unit/utils/logging.test.ts +++ b/tests/unit/utils/logging.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest'; -import { LOG_LEVELS, getLogLevel, logger, setLogLevel } from '../../../src/utils/logging.js'; +import { getLogLevel, LOG_LEVELS, logger, setLogLevel } from '../../../src/utils/logging.js'; /** * Tests for setLogLevel and getLogLevel in utils/logging.ts. diff --git a/tests/unit/utils/safeOperation.test.ts b/tests/unit/utils/safeOperation.test.ts index d9390840..b9f41f10 100644 --- a/tests/unit/utils/safeOperation.test.ts +++ b/tests/unit/utils/safeOperation.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { safeOperation, silentOperation } from '../../../src/utils/safeOperation.js'; vi.mock('../../../src/utils/logging.js', () => ({ diff --git a/tests/unit/utils/webhookLogger.test.ts b/tests/unit/utils/webhookLogger.test.ts index 2e2cb75a..3d5caf4b 100644 --- a/tests/unit/utils/webhookLogger.test.ts +++ b/tests/unit/utils/webhookLogger.test.ts @@ -13,7 +13,7 @@ import { insertWebhookLog, pruneWebhookLogs, } from '../../../src/db/repositories/webhookLogsRepository.js'; -import { type WebhookLogInput, logWebhookCall } from '../../../src/utils/webhookLogger.js'; +import { logWebhookCall, type WebhookLogInput } from '../../../src/utils/webhookLogger.js'; const mockInsertWebhookLog = vi.mocked(insertWebhookLog); const mockPruneWebhookLogs = vi.mocked(pruneWebhookLogs); diff --git a/tests/unit/web/pm-wizard-state.test.ts b/tests/unit/web/pm-wizard-state.test.ts index d8710074..c7ff9fce 100644 --- a/tests/unit/web/pm-wizard-state.test.ts +++ b/tests/unit/web/pm-wizard-state.test.ts @@ -1,20 +1,19 @@ import { describe, expect, it } from 'vitest'; - +import type { + WizardAction, + WizardState, +} from '../../../web/src/components/projects/pm-wizard-state.js'; import { - INITIAL_JIRA_LABELS, areCredentialsReady, buildEditState, createInitialState, + INITIAL_JIRA_LABELS, isStep1Complete, isStep2Complete, isStep3Complete, isStep4Complete, wizardReducer, } from '../../../web/src/components/projects/pm-wizard-state.js'; -import type { - WizardAction, - WizardState, -} from '../../../web/src/components/projects/pm-wizard-state.js'; // ============================================================================ // createInitialState diff --git a/tests/unit/web/project-navigation.test.ts b/tests/unit/web/project-navigation.test.ts index b54c1e46..b4e28e5c 100644 --- a/tests/unit/web/project-navigation.test.ts +++ b/tests/unit/web/project-navigation.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest'; import { DEFAULT_PROJECT_SECTION, - PROJECT_SECTIONS, isProjectActive, isSectionActive, + PROJECT_SECTIONS, resolveDefaultProjectPath, } from '../../../web/src/lib/project-sections.js'; diff --git a/tests/unit/web/triggerAgentMapping.test.ts b/tests/unit/web/triggerAgentMapping.test.ts index 4fff2ba0..b11e6c24 100644 --- a/tests/unit/web/triggerAgentMapping.test.ts +++ b/tests/unit/web/triggerAgentMapping.test.ts @@ -3,8 +3,8 @@ import { AGENT_LABELS, ALL_AGENT_TYPES, CATEGORY_LABELS, - LIFECYCLE_TRIGGERS, getTriggerValue, + LIFECYCLE_TRIGGERS, setTriggerValue, } from '../../../web/src/lib/trigger-agent-mapping.js'; diff --git a/tests/unit/webhook/webhookHandlers.test.ts b/tests/unit/webhook/webhookHandlers.test.ts index b6d18d3c..fcace855 100644 --- a/tests/unit/webhook/webhookHandlers.test.ts +++ b/tests/unit/webhook/webhookHandlers.test.ts @@ -1,5 +1,5 @@ import { Hono } from 'hono'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; // Must mock heavy imports BEFORE importing the module under test vi.mock('../../../src/utils/index.js', () => ({ diff --git a/tests/unit/webhook/webhookLogging.test.ts b/tests/unit/webhook/webhookLogging.test.ts index 368f182e..6e960dbd 100644 --- a/tests/unit/webhook/webhookLogging.test.ts +++ b/tests/unit/webhook/webhookLogging.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; // Must mock heavy imports BEFORE importing the module under test vi.mock('../../../src/utils/webhookLogger.js', () => ({ diff --git a/tests/unit/worker-entry.test.ts b/tests/unit/worker-entry.test.ts index 8d2bc352..13f9072e 100644 --- a/tests/unit/worker-entry.test.ts +++ b/tests/unit/worker-entry.test.ts @@ -91,15 +91,15 @@ import { triggerManualRun, triggerRetryRun } from '../../src/triggers/shared/man import { processTrelloWebhook } from '../../src/triggers/trello/webhook-handler.js'; import { type DebugAnalysisJobData, + dispatchJob, type GitHubJobData, type JiraJobData, type ManualRunJobData, + main, + processDashboardJob, type RetryRunJobData, type SentryJobData, type TrelloJobData, - dispatchJob, - main, - processDashboardJob, } from '../../src/worker-entry.js'; // ── dispatchJob routing tests ───────────────────────────────────────────────── @@ -519,11 +519,8 @@ describe('main() - environment variable validation', () => { afterEach(() => { exitSpy.mockRestore(); - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.JOB_ID; - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.JOB_TYPE; - // biome-ignore lint/performance/noDelete: process.env requires delete to truly unset delete process.env.JOB_DATA; }); diff --git a/tools/rotate-credential-key.ts b/tools/rotate-credential-key.ts index 6b41f653..9cc0649c 100644 --- a/tools/rotate-credential-key.ts +++ b/tools/rotate-credential-key.ts @@ -63,7 +63,7 @@ async function main() { .from(projectCredentials); let rotated = 0; - const skipped = 0; + const _skipped = 0; for (const cred of allCreds) { // Decrypt with current key (handles both encrypted and plaintext) diff --git a/tools/seed-config-from-json.ts b/tools/seed-config-from-json.ts index 07f1d26d..b3c95492 100644 --- a/tools/seed-config-from-json.ts +++ b/tools/seed-config-from-json.ts @@ -15,7 +15,7 @@ import { sql } from 'drizzle-orm'; import type { z } from 'zod'; import { type CascadeConfigSchema, validateConfig } from '../src/config/schema.js'; import { closeDb, getDb } from '../src/db/client.js'; -import { agentConfigs, projectIntegrations, projects } from '../src/db/schema/index.js'; +import { projectIntegrations, projects } from '../src/db/schema/index.js'; type CascadeConfig = z.infer; type ProjectConfig = CascadeConfig['projects'][number]; diff --git a/web/src/app.tsx b/web/src/app.tsx index efdb5386..b443c3fd 100644 --- a/web/src/app.tsx +++ b/web/src/app.tsx @@ -1,5 +1,5 @@ import { QueryClientProvider } from '@tanstack/react-query'; -import { RouterProvider, createRouter } from '@tanstack/react-router'; +import { createRouter, RouterProvider } from '@tanstack/react-router'; import { ThemeProvider } from 'next-themes'; import { Toaster } from './components/ui/sonner.js'; import { queryClient } from './lib/query-client.js'; diff --git a/web/src/components/debug/debug-analysis.tsx b/web/src/components/debug/debug-analysis.tsx index f2d619e4..89dfcdda 100644 --- a/web/src/components/debug/debug-analysis.tsx +++ b/web/src/components/debug/debug-analysis.tsx @@ -1,8 +1,8 @@ -import { Button } from '@/components/ui/button.js'; -import { trpc, trpcClient } from '@/lib/trpc.js'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect, useRef } from 'react'; import ReactMarkdown from 'react-markdown'; +import { Button } from '@/components/ui/button.js'; +import { trpc, trpcClient } from '@/lib/trpc.js'; interface DebugAnalysisProps { runId: string; diff --git a/web/src/components/global/organization-form-dialog.tsx b/web/src/components/global/organization-form-dialog.tsx index 66d9a474..51a017c6 100644 --- a/web/src/components/global/organization-form-dialog.tsx +++ b/web/src/components/global/organization-form-dialog.tsx @@ -1,9 +1,9 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useEffect, useState } from 'react'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog.js'; import { Input } from '@/components/ui/input.js'; import { Label } from '@/components/ui/label.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { useEffect, useState } from 'react'; function slugify(name: string): string { return name @@ -34,7 +34,9 @@ export function OrganizationFormDialog({ setId(organization.id); setIdManual(true); } else { - resetForm(); + setName(''); + setId(''); + setIdManual(false); } }, [organization]); diff --git a/web/src/components/layout/breadcrumbs.tsx b/web/src/components/layout/breadcrumbs.tsx index 8d714152..a3637182 100644 --- a/web/src/components/layout/breadcrumbs.tsx +++ b/web/src/components/layout/breadcrumbs.tsx @@ -1,8 +1,8 @@ -import { PROJECT_SECTIONS } from '@/lib/project-sections.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { Link, useRouterState } from '@tanstack/react-router'; import { ChevronRight } from 'lucide-react'; +import { PROJECT_SECTIONS } from '@/lib/project-sections.js'; +import { trpc } from '@/lib/trpc.js'; interface Segment { label: string; @@ -127,7 +127,7 @@ export function Breadcrumbs() { {segments.map((segment, i) => { const isLast = i === segments.length - 1; return ( - + {i > 0 && } {isLast || !segment.href ? ( { const { bg, text } = getToolStyle(tc.name); return ( + // biome-ignore lint/suspicious/noArrayIndexKey: tool calls have no unique ID; index is stable for this read-only list {tc.name} diff --git a/web/src/components/logs/log-viewer.tsx b/web/src/components/logs/log-viewer.tsx index 008aa2a7..ad9a793c 100644 --- a/web/src/components/logs/log-viewer.tsx +++ b/web/src/components/logs/log-viewer.tsx @@ -1,7 +1,7 @@ -import { trpc } from '@/lib/trpc.js'; -import { cn } from '@/lib/utils.js'; import { useQuery } from '@tanstack/react-query'; import { useState } from 'react'; +import { trpc } from '@/lib/trpc.js'; +import { cn } from '@/lib/utils.js'; interface LogViewerProps { runId: string; diff --git a/web/src/components/projects/agent-prompt-overrides.tsx b/web/src/components/projects/agent-prompt-overrides.tsx index 94770753..b61b57f0 100644 --- a/web/src/components/projects/agent-prompt-overrides.tsx +++ b/web/src/components/projects/agent-prompt-overrides.tsx @@ -1,3 +1,5 @@ +import { useMutation, useQuery } from '@tanstack/react-query'; +import { useEffect, useState } from 'react'; import { PromptSectionTab, ValidationStatus, @@ -10,8 +12,6 @@ import { ReferencePanel } from '@/components/settings/prompt-editor.js'; */ import { Badge } from '@/components/ui/badge.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQuery } from '@tanstack/react-query'; -import { useEffect, useState } from 'react'; interface AgentPromptOverridesProps { projectId: string; @@ -255,7 +255,7 @@ type BadgeType = 'custom' | 'inherited' | 'default'; function getInheritanceBadge({ projectOverride, globalPrompt, - defaultPrompt, + defaultPrompt: _defaultPrompt, }: { projectOverride: string | null; globalPrompt: string | null; diff --git a/web/src/components/projects/integration-form.tsx b/web/src/components/projects/integration-form.tsx index 8e520258..cc69f51e 100644 --- a/web/src/components/projects/integration-form.tsx +++ b/web/src/components/projects/integration-form.tsx @@ -1,7 +1,3 @@ -import { Input } from '@/components/ui/input.js'; -import { Label } from '@/components/ui/label.js'; -import { API_URL } from '@/lib/api.js'; -import { trpc, trpcClient } from '@/lib/trpc.js'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { AlertCircle, @@ -15,6 +11,10 @@ import { Trash2, } from 'lucide-react'; import { useEffect, useState } from 'react'; +import { Input } from '@/components/ui/input.js'; +import { Label } from '@/components/ui/label.js'; +import { API_URL } from '@/lib/api.js'; +import { trpc, trpcClient } from '@/lib/trpc.js'; import { PMWizard } from './pm-wizard.js'; import { ProjectSecretField } from './project-secret-field.js'; @@ -308,13 +308,7 @@ interface SCMTabProject { branchPrefix?: string | null; } -function SCMTab({ - projectId, - project, -}: { - projectId: string; - project?: SCMTabProject; -}) { +function SCMTab({ projectId, project }: { projectId: string; project?: SCMTabProject }) { const queryClient = useQueryClient(); // Project-level SCM fields diff --git a/web/src/components/projects/pm-wizard-common-steps.tsx b/web/src/components/projects/pm-wizard-common-steps.tsx index 330ff73a..2c97c272 100644 --- a/web/src/components/projects/pm-wizard-common-steps.tsx +++ b/web/src/components/projects/pm-wizard-common-steps.tsx @@ -2,7 +2,7 @@ * Provider-agnostic step renderer components for PMWizard: * WebhookStep and SaveStep. */ -import { Label } from '@/components/ui/label.js'; + import type { UseMutationResult } from '@tanstack/react-query'; import { AlertCircle, @@ -16,6 +16,7 @@ import { Trash2, } from 'lucide-react'; import { useState } from 'react'; +import { Label } from '@/components/ui/label.js'; import type { WizardState } from './pm-wizard-state.js'; // ============================================================================ diff --git a/web/src/components/projects/pm-wizard-hooks.ts b/web/src/components/projects/pm-wizard-hooks.ts index 45b138b9..591ea0f8 100644 --- a/web/src/components/projects/pm-wizard-hooks.ts +++ b/web/src/components/projects/pm-wizard-hooks.ts @@ -2,10 +2,11 @@ * Custom hooks for PM Wizard mutations and side-effects. * Each hook encapsulates one concern to keep the main orchestrator thin. */ -import { API_URL } from '@/lib/api.js'; -import { trpc, trpcClient } from '@/lib/trpc.js'; + import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useEffect } from 'react'; +import { API_URL } from '@/lib/api.js'; +import { trpc, trpcClient } from '@/lib/trpc.js'; import type { WizardAction, WizardState } from './pm-wizard-state.js'; // ============================================================================ diff --git a/web/src/components/projects/pm-wizard-jira-steps.tsx b/web/src/components/projects/pm-wizard-jira-steps.tsx index cdd5042f..66205219 100644 --- a/web/src/components/projects/pm-wizard-jira-steps.tsx +++ b/web/src/components/projects/pm-wizard-jira-steps.tsx @@ -1,11 +1,12 @@ /** * JIRA-specific step renderer components for PMWizard. */ + +import type { UseMutationResult } from '@tanstack/react-query'; +import { Loader2, Plus } from 'lucide-react'; import { Button } from '@/components/ui/button.js'; import { Input } from '@/components/ui/input.js'; import { Label } from '@/components/ui/label.js'; -import type { UseMutationResult } from '@tanstack/react-query'; -import { Loader2, Plus } from 'lucide-react'; import type { WizardAction, WizardState } from './pm-wizard-state.js'; import { FieldMappingRow, SearchableSelect } from './wizard-shared.js'; diff --git a/web/src/components/projects/pm-wizard-trello-steps.tsx b/web/src/components/projects/pm-wizard-trello-steps.tsx index d381f370..22aa072b 100644 --- a/web/src/components/projects/pm-wizard-trello-steps.tsx +++ b/web/src/components/projects/pm-wizard-trello-steps.tsx @@ -1,13 +1,14 @@ /** * Trello-specific step renderer components for PMWizard. */ -import { Button } from '@/components/ui/button.js'; -import { Input } from '@/components/ui/input.js'; -import { Label } from '@/components/ui/label.js'; + import type { UseMutationResult } from '@tanstack/react-query'; import { CheckCircle2, Loader2, Plus } from 'lucide-react'; import { useEffect, useRef, useState } from 'react'; import { toast } from 'sonner'; +import { Button } from '@/components/ui/button.js'; +import { Input } from '@/components/ui/input.js'; +import { Label } from '@/components/ui/label.js'; import type { WizardAction, WizardState } from './pm-wizard-state.js'; import { FieldMappingRow, SearchableSelect } from './wizard-shared.js'; diff --git a/web/src/components/projects/pm-wizard.tsx b/web/src/components/projects/pm-wizard.tsx index 763d3c3e..3fab7918 100644 --- a/web/src/components/projects/pm-wizard.tsx +++ b/web/src/components/projects/pm-wizard.tsx @@ -1,8 +1,8 @@ -import { Label } from '@/components/ui/label.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { CheckCircle, Globe, Loader2, XCircle } from 'lucide-react'; import { useEffect, useReducer, useRef, useState } from 'react'; +import { Label } from '@/components/ui/label.js'; +import { trpc } from '@/lib/trpc.js'; import { SaveStep, WebhookStep } from './pm-wizard-common-steps.js'; import { useJiraCustomFieldCreation, diff --git a/web/src/components/projects/project-agent-configs.tsx b/web/src/components/projects/project-agent-configs.tsx index abf302bd..be9d3ede 100644 --- a/web/src/components/projects/project-agent-configs.tsx +++ b/web/src/components/projects/project-agent-configs.tsx @@ -1,3 +1,7 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { AlertTriangle, ArrowLeft, ChevronRight, Trash2 } from 'lucide-react'; +import { useEffect, useMemo, useRef, useState } from 'react'; +import { toast } from 'sonner'; import { engineCredentialKeys } from '@/components/projects/engine-secrets.js'; import { EngineSettingsFields } from '@/components/settings/engine-settings-fields.js'; import { ModelField } from '@/components/settings/model-field.js'; @@ -46,10 +50,6 @@ import { type TriggerParameterValue, } from '@/lib/trigger-agent-mapping.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { AlertTriangle, ArrowLeft, ChevronRight, Trash2 } from 'lucide-react'; -import { useEffect, useMemo, useRef, useState } from 'react'; -import { toast } from 'sonner'; import { AgentPromptOverrides } from './agent-prompt-overrides.js'; interface AgentConfig { diff --git a/web/src/components/projects/project-form-dialog.tsx b/web/src/components/projects/project-form-dialog.tsx index 993981fe..fd3b67c4 100644 --- a/web/src/components/projects/project-form-dialog.tsx +++ b/web/src/components/projects/project-form-dialog.tsx @@ -1,9 +1,9 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useState } from 'react'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog.js'; import { Input } from '@/components/ui/input.js'; import { Label } from '@/components/ui/label.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { useState } from 'react'; function slugify(name: string): string { return name diff --git a/web/src/components/projects/project-general-form.tsx b/web/src/components/projects/project-general-form.tsx index 700d6f09..5ee43b5d 100644 --- a/web/src/components/projects/project-general-form.tsx +++ b/web/src/components/projects/project-general-form.tsx @@ -1,3 +1,8 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { useNavigate } from '@tanstack/react-router'; +import { HelpCircle } from 'lucide-react'; +import { useMemo, useState } from 'react'; +import { toast } from 'sonner'; import { ProjectSecretField } from '@/components/projects/project-secret-field.js'; import { useProjectUpdate } from '@/components/projects/use-project-update.js'; import { OpenRouterModelCombobox } from '@/components/settings/openrouter-model-combobox.js'; @@ -21,11 +26,6 @@ import { TooltipTrigger, } from '@/components/ui/tooltip.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { useNavigate } from '@tanstack/react-router'; -import { HelpCircle } from 'lucide-react'; -import { useMemo, useState } from 'react'; -import { toast } from 'sonner'; interface Project { id: string; diff --git a/web/src/components/projects/project-harness-form.tsx b/web/src/components/projects/project-harness-form.tsx index e6370e0a..b895cc35 100644 --- a/web/src/components/projects/project-harness-form.tsx +++ b/web/src/components/projects/project-harness-form.tsx @@ -1,3 +1,6 @@ +import { useQuery } from '@tanstack/react-query'; +import { HelpCircle } from 'lucide-react'; +import { useState } from 'react'; import { ENGINE_SECRETS } from '@/components/projects/engine-secrets.js'; import { ProjectSecretField } from '@/components/projects/project-secret-field.js'; import { useProjectUpdate } from '@/components/projects/use-project-update.js'; @@ -22,9 +25,6 @@ import { TooltipTrigger, } from '@/components/ui/tooltip.js'; import { trpc } from '@/lib/trpc.js'; -import { useQuery } from '@tanstack/react-query'; -import { HelpCircle } from 'lucide-react'; -import { useState } from 'react'; interface Project { id: string; diff --git a/web/src/components/projects/project-lifecycle-automations.tsx b/web/src/components/projects/project-lifecycle-automations.tsx index 7ce5d507..05650674 100644 --- a/web/src/components/projects/project-lifecycle-automations.tsx +++ b/web/src/components/projects/project-lifecycle-automations.tsx @@ -1,8 +1,8 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { useEffect, useMemo, useRef, useState } from 'react'; import { TriggerToggles } from '@/components/shared/trigger-toggles.js'; import { LIFECYCLE_TRIGGERS } from '@/lib/trigger-agent-mapping.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { useEffect, useMemo, useRef, useState } from 'react'; export function ProjectLifecycleAutomations({ projectId }: { projectId: string }) { const queryClient = useQueryClient(); @@ -21,7 +21,10 @@ export function ProjectLifecycleAutomations({ projectId }: { projectId: string } mutationFn: ({ category, triggers, - }: { category: 'pm' | 'scm'; triggers: Record }) => + }: { + category: 'pm' | 'scm'; + triggers: Record; + }) => trpcClient.projects.integrations.updateTriggers.mutate({ projectId, category, diff --git a/web/src/components/projects/project-secret-field.tsx b/web/src/components/projects/project-secret-field.tsx index 8e834ec6..cd1c58f5 100644 --- a/web/src/components/projects/project-secret-field.tsx +++ b/web/src/components/projects/project-secret-field.tsx @@ -2,13 +2,14 @@ * Reusable project-scoped secret input field. * Write-only — shows masked metadata when configured, never exposes plaintext. */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { CheckCircle, Loader2, Trash2, XCircle } from 'lucide-react'; +import { useState } from 'react'; import { Badge } from '@/components/ui/badge.js'; import { Input } from '@/components/ui/input.js'; import { Label } from '@/components/ui/label.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { CheckCircle, Loader2, Trash2, XCircle } from 'lucide-react'; -import { useState } from 'react'; export interface ProjectCredentialMeta { envVarKey: string; diff --git a/web/src/components/projects/project-work-table.tsx b/web/src/components/projects/project-work-table.tsx index 8f8bb7d4..8b224367 100644 --- a/web/src/components/projects/project-work-table.tsx +++ b/web/src/components/projects/project-work-table.tsx @@ -1,8 +1,7 @@ -import { agentTypeLabel, getAgentColor } from '@/lib/chart-colors.js'; -import { formatCostSummary } from '@/lib/utils.js'; import { useNavigate } from '@tanstack/react-router'; -import { Link } from '@tanstack/react-router'; import { ClipboardList, ExternalLink, GitPullRequest } from 'lucide-react'; +import { agentTypeLabel, getAgentColor } from '@/lib/chart-colors.js'; +import { formatCostSummary } from '@/lib/utils.js'; import { WorkItemDurationBar } from './work-item-duration-bar.js'; interface WorkItemRun { diff --git a/web/src/components/projects/projects-table.tsx b/web/src/components/projects/projects-table.tsx index eb9576be..cb2f101d 100644 --- a/web/src/components/projects/projects-table.tsx +++ b/web/src/components/projects/projects-table.tsx @@ -1,3 +1,7 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useNavigate } from '@tanstack/react-router'; +import { FolderGit2, Trash2 } from 'lucide-react'; +import { useState } from 'react'; import { AlertDialog, AlertDialogAction, @@ -18,10 +22,6 @@ import { TableRow, } from '@/components/ui/table.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { useNavigate } from '@tanstack/react-router'; -import { FolderGit2, Trash2 } from 'lucide-react'; -import { useState } from 'react'; interface Project { id: string; diff --git a/web/src/components/projects/use-project-update.ts b/web/src/components/projects/use-project-update.ts index 9d175003..dfcd324c 100644 --- a/web/src/components/projects/use-project-update.ts +++ b/web/src/components/projects/use-project-update.ts @@ -1,5 +1,5 @@ -import { trpc, trpcClient } from '@/lib/trpc.js'; import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { trpc, trpcClient } from '@/lib/trpc.js'; type ProjectUpdateInput = Parameters[0]; diff --git a/web/src/components/projects/wizard-shared.tsx b/web/src/components/projects/wizard-shared.tsx index 1b2510f1..fae858b3 100644 --- a/web/src/components/projects/wizard-shared.tsx +++ b/web/src/components/projects/wizard-shared.tsx @@ -2,9 +2,10 @@ * Shared wizard UI components used across pm-wizard and email-wizard. * Extracted to eliminate ~250 lines of verbatim duplication. */ -import { Input } from '@/components/ui/input.js'; + import { AlertCircle, Check, ChevronDown, ChevronRight, Loader2, RefreshCw } from 'lucide-react'; import { useState } from 'react'; +import { Input } from '@/components/ui/input.js'; // ============================================================================ // WizardStep Shell diff --git a/web/src/components/runs/cancel-run-button.tsx b/web/src/components/runs/cancel-run-button.tsx index 0bd83c6b..89f5135d 100644 --- a/web/src/components/runs/cancel-run-button.tsx +++ b/web/src/components/runs/cancel-run-button.tsx @@ -1,3 +1,6 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { CheckCircle, Loader2, Square } from 'lucide-react'; +import { useEffect, useState } from 'react'; import { AlertDialog, AlertDialogAction, @@ -10,9 +13,6 @@ import { } from '@/components/ui/alert-dialog.js'; import { Button } from '@/components/ui/button.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { CheckCircle, Loader2, Square } from 'lucide-react'; -import { useEffect, useState } from 'react'; interface CancelRunButtonProps { runId: string; @@ -51,68 +51,64 @@ export function CancelRunButton({ runId, status }: CancelRunButtonProps) { } return ( - <> - - - - {showSuccess && !cancelMutation.isPending && ( - Cancelled - )} - {cancelMutation.isError && !showSuccess && ( - - {cancelMutation.error instanceof Error - ? `Error: ${cancelMutation.error.message}` - : 'Failed'} - + + + + {showSuccess && !cancelMutation.isPending && ( + Cancelled + )} + {cancelMutation.isError && !showSuccess && ( + + {cancelMutation.error instanceof Error + ? `Error: ${cancelMutation.error.message}` + : 'Failed'} + + )} + - - - Cancel Run - - This will terminate the worker container. Are you sure? - - - - Cancel - { - cancelMutation.mutate(); - }} - className="bg-destructive text-destructive-foreground hover:bg-destructive/90" - > - Terminate - - - - - + + + Cancel Run + + This will terminate the worker container. Are you sure? + + + + Cancel + { + cancelMutation.mutate(); + }} + className="bg-destructive text-destructive-foreground hover:bg-destructive/90" + > + Terminate + + + + ); } diff --git a/web/src/components/runs/project-work-duration-chart.tsx b/web/src/components/runs/project-work-duration-chart.tsx index b841abac..ee2577ca 100644 --- a/web/src/components/runs/project-work-duration-chart.tsx +++ b/web/src/components/runs/project-work-duration-chart.tsx @@ -1,6 +1,3 @@ -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card.js'; -import { agentTypeLabel, getAgentColor } from '@/lib/chart-colors.js'; -import { formatDuration } from '@/lib/utils.js'; import { Bar, BarChart, @@ -12,6 +9,9 @@ import { XAxis, YAxis, } from 'recharts'; +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card.js'; +import { agentTypeLabel, getAgentColor } from '@/lib/chart-colors.js'; +import { formatDuration } from '@/lib/utils.js'; interface AgentTypeBreakdown { agentType: string; diff --git a/web/src/components/runs/retry-run-button.tsx b/web/src/components/runs/retry-run-button.tsx index 36538846..0d9c8b45 100644 --- a/web/src/components/runs/retry-run-button.tsx +++ b/web/src/components/runs/retry-run-button.tsx @@ -1,7 +1,7 @@ -import { Button } from '@/components/ui/button.js'; -import { trpc, trpcClient } from '@/lib/trpc.js'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { RefreshCw } from 'lucide-react'; +import { Button } from '@/components/ui/button.js'; +import { trpc, trpcClient } from '@/lib/trpc.js'; interface RetryRunButtonProps { runId: string; diff --git a/web/src/components/runs/run-filters.tsx b/web/src/components/runs/run-filters.tsx index 20a6fe76..82dd92e0 100644 --- a/web/src/components/runs/run-filters.tsx +++ b/web/src/components/runs/run-filters.tsx @@ -1,5 +1,5 @@ -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; +import { trpc } from '@/lib/trpc.js'; interface RunFiltersProps { projectId: string; diff --git a/web/src/components/runs/run-summary-card.tsx b/web/src/components/runs/run-summary-card.tsx index becd9c43..27eff33c 100644 --- a/web/src/components/runs/run-summary-card.tsx +++ b/web/src/components/runs/run-summary-card.tsx @@ -1,8 +1,8 @@ -import { useElapsedTime } from '@/lib/useElapsedTime.js'; -import { formatCost, formatDuration } from '@/lib/utils.js'; import { Link } from '@tanstack/react-router'; import { ExternalLink } from 'lucide-react'; import { useState } from 'react'; +import { useElapsedTime } from '@/lib/useElapsedTime.js'; +import { formatCost, formatDuration } from '@/lib/utils.js'; const OUTPUT_COLLAPSE_THRESHOLD = 500; diff --git a/web/src/components/runs/runs-table.tsx b/web/src/components/runs/runs-table.tsx index 8ee46f18..ab03823b 100644 --- a/web/src/components/runs/runs-table.tsx +++ b/web/src/components/runs/runs-table.tsx @@ -1,6 +1,6 @@ -import { formatCost, formatRelativeTime } from '@/lib/utils.js'; import { Link } from '@tanstack/react-router'; import { Activity, ExternalLink } from 'lucide-react'; +import { formatCost, formatRelativeTime } from '@/lib/utils.js'; import { CancelRunButton } from './cancel-run-button.js'; import { LiveDuration } from './live-duration.js'; import { RetryRunButton } from './retry-run-button.js'; diff --git a/web/src/components/runs/trigger-run-dialog.tsx b/web/src/components/runs/trigger-run-dialog.tsx index c69796b6..814c58da 100644 --- a/web/src/components/runs/trigger-run-dialog.tsx +++ b/web/src/components/runs/trigger-run-dialog.tsx @@ -1,3 +1,5 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { useCallback, useState } from 'react'; import { Button } from '@/components/ui/button.js'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog.js'; import { Input } from '@/components/ui/input.js'; @@ -10,8 +12,6 @@ import { SelectValue, } from '@/components/ui/select.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { useCallback, useState } from 'react'; // Keep in sync with AgentType in src/types/index.ts const agentTypes = [ diff --git a/web/src/components/runs/work-item-cost-chart.tsx b/web/src/components/runs/work-item-cost-chart.tsx index f756a95f..630efe36 100644 --- a/web/src/components/runs/work-item-cost-chart.tsx +++ b/web/src/components/runs/work-item-cost-chart.tsx @@ -1,7 +1,7 @@ +import { Cell, Label, Legend, Pie, PieChart, ResponsiveContainer, Tooltip } from 'recharts'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card.js'; import { agentTypeLabel, getAgentColor } from '@/lib/chart-colors.js'; import { formatCostSummary } from '@/lib/utils.js'; -import { Cell, Label, Legend, Pie, PieChart, ResponsiveContainer, Tooltip } from 'recharts'; interface WorkItemRun { id: string; diff --git a/web/src/components/runs/work-item-runs-table.tsx b/web/src/components/runs/work-item-runs-table.tsx index 8c7cc252..9f49baca 100644 --- a/web/src/components/runs/work-item-runs-table.tsx +++ b/web/src/components/runs/work-item-runs-table.tsx @@ -1,5 +1,5 @@ -import { formatCost, formatRelativeTime } from '@/lib/utils.js'; import { Link } from '@tanstack/react-router'; +import { formatCost, formatRelativeTime } from '@/lib/utils.js'; import { CancelRunButton } from './cancel-run-button.js'; import { LiveDuration } from './live-duration.js'; import { RetryRunButton } from './retry-run-button.js'; diff --git a/web/src/components/settings/agent-config-form-dialog.tsx b/web/src/components/settings/agent-config-form-dialog.tsx index 89f9fda1..60f7277b 100644 --- a/web/src/components/settings/agent-config-form-dialog.tsx +++ b/web/src/components/settings/agent-config-form-dialog.tsx @@ -1,3 +1,6 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { Link } from '@tanstack/react-router'; +import { useState } from 'react'; import { EngineSettingsFields } from '@/components/settings/engine-settings-fields.js'; import { ModelField } from '@/components/settings/model-field.js'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog.js'; @@ -11,9 +14,6 @@ import { SelectValue, } from '@/components/ui/select.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { Link } from '@tanstack/react-router'; -import { useState } from 'react'; import type { AgentConfig } from './agent-configs-table.js'; diff --git a/web/src/components/settings/agent-configs-table.tsx b/web/src/components/settings/agent-configs-table.tsx index 3c4d05f7..d38a6f5e 100644 --- a/web/src/components/settings/agent-configs-table.tsx +++ b/web/src/components/settings/agent-configs-table.tsx @@ -1,3 +1,6 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { Pencil, Trash2 } from 'lucide-react'; +import { useState } from 'react'; import { AlertDialog, AlertDialogAction, @@ -17,9 +20,6 @@ import { TableRow, } from '@/components/ui/table.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { Pencil, Trash2 } from 'lucide-react'; -import { useState } from 'react'; import { AgentConfigFormDialog } from './agent-config-form-dialog.js'; export interface AgentConfig { diff --git a/web/src/components/settings/agent-definition-editor.tsx b/web/src/components/settings/agent-definition-editor.tsx index 27d6e4a6..dd78efac 100644 --- a/web/src/components/settings/agent-definition-editor.tsx +++ b/web/src/components/settings/agent-definition-editor.tsx @@ -1,9 +1,9 @@ +import { useQuery } from '@tanstack/react-query'; import { Input } from '@/components/ui/input.js'; import { Label } from '@/components/ui/label.js'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs.js'; import { Textarea } from '@/components/ui/textarea.js'; import { trpc } from '@/lib/trpc.js'; -import { useQuery } from '@tanstack/react-query'; import { PromptsPanel } from './agent-definition-prompts.js'; import { CapabilitiesSection, diff --git a/web/src/components/settings/agent-definition-prompts.tsx b/web/src/components/settings/agent-definition-prompts.tsx index 6dee0632..0f62a894 100644 --- a/web/src/components/settings/agent-definition-prompts.tsx +++ b/web/src/components/settings/agent-definition-prompts.tsx @@ -3,10 +3,11 @@ * Extracted from agent-definition-editor.tsx — handles all prompt editing * functionality as a self-contained module with its own queries and mutations. */ -import { Badge } from '@/components/ui/badge.js'; -import { trpc, trpcClient } from '@/lib/trpc.js'; + import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect, useState } from 'react'; +import { Badge } from '@/components/ui/badge.js'; +import { trpc, trpcClient } from '@/lib/trpc.js'; import { ReferencePanel } from './prompt-editor.js'; // ───────────────────────────────────────────────────────────────────────────── diff --git a/web/src/components/settings/agent-definition-sections.tsx b/web/src/components/settings/agent-definition-sections.tsx index 4ed308d6..9ec99675 100644 --- a/web/src/components/settings/agent-definition-sections.tsx +++ b/web/src/components/settings/agent-definition-sections.tsx @@ -17,9 +17,9 @@ import { type AgentDefinition, CAPABILITY_GROUPS, type Capability, + deepSet, type SchemaData, Toggle, - deepSet, } from './agent-definition-shared.js'; // ───────────────────────────────────────────────────────────────────────────── diff --git a/web/src/components/settings/agent-definition-shared.tsx b/web/src/components/settings/agent-definition-shared.tsx index 5793f673..ffa9b6a9 100644 --- a/web/src/components/settings/agent-definition-shared.tsx +++ b/web/src/components/settings/agent-definition-shared.tsx @@ -3,6 +3,9 @@ * Extracted from agent-definition-editor.tsx to serve as the foundational leaf * of the import graph — this file must NOT import from any sibling agent-definition-* file. */ + +import type { inferRouterOutputs } from '@trpc/server'; +import { Info } from 'lucide-react'; import type { AppRouter } from '@/../../src/api/router.js'; import type { KnownTriggerEvent } from '@/../../src/api/routers/_shared/triggerTypes.js'; import { Badge } from '@/components/ui/badge.js'; @@ -12,8 +15,6 @@ import { TooltipProvider, TooltipTrigger, } from '@/components/ui/tooltip.js'; -import type { inferRouterOutputs } from '@trpc/server'; -import { Info } from 'lucide-react'; // ───────────────────────────────────────────────────────────────────────────── // Type aliases diff --git a/web/src/components/settings/agent-definition-table.tsx b/web/src/components/settings/agent-definition-table.tsx index dd6fd776..c80d41b1 100644 --- a/web/src/components/settings/agent-definition-table.tsx +++ b/web/src/components/settings/agent-definition-table.tsx @@ -1,3 +1,6 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { inferRouterOutputs } from '@trpc/server'; +import { Pencil, RotateCcw, Trash2 } from 'lucide-react'; import type { AppRouter } from '@/../../src/api/router.js'; import { Badge } from '@/components/ui/badge.js'; import { @@ -9,9 +12,6 @@ import { TableRow, } from '@/components/ui/table.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import type { inferRouterOutputs } from '@trpc/server'; -import { Pencil, RotateCcw, Trash2 } from 'lucide-react'; type RouterOutput = inferRouterOutputs; type DefinitionRow = RouterOutput['agentDefinitions']['list'][number]; diff --git a/web/src/components/settings/model-field.tsx b/web/src/components/settings/model-field.tsx index f6aa2772..5af512dc 100644 --- a/web/src/components/settings/model-field.tsx +++ b/web/src/components/settings/model-field.tsx @@ -1,3 +1,4 @@ +import { useQuery } from '@tanstack/react-query'; import { OpenRouterModelCombobox } from '@/components/settings/openrouter-model-combobox.js'; import { Input } from '@/components/ui/input.js'; import { @@ -8,7 +9,6 @@ import { SelectValue, } from '@/components/ui/select.js'; import { trpc } from '@/lib/trpc.js'; -import { useQuery } from '@tanstack/react-query'; interface ModelFieldProps { value: string; diff --git a/web/src/components/settings/openrouter-model-combobox.tsx b/web/src/components/settings/openrouter-model-combobox.tsx index e296ce2d..bc8ee957 100644 --- a/web/src/components/settings/openrouter-model-combobox.tsx +++ b/web/src/components/settings/openrouter-model-combobox.tsx @@ -1,9 +1,9 @@ +import { useQuery } from '@tanstack/react-query'; import type { ComboboxOption } from '@/components/ui/combobox.js'; import { Combobox } from '@/components/ui/combobox.js'; import { Input } from '@/components/ui/input.js'; -import { OPENROUTER_PREFIX, addPrefix, modelDetail, modelGroup } from '@/lib/openrouter-utils.js'; +import { addPrefix, modelDetail, modelGroup, OPENROUTER_PREFIX } from '@/lib/openrouter-utils.js'; import { trpc } from '@/lib/trpc.js'; -import { useQuery } from '@tanstack/react-query'; interface OpenRouterModelComboboxProps { projectId: string; diff --git a/web/src/components/settings/org-form.tsx b/web/src/components/settings/org-form.tsx index ab88cd76..db4e10d8 100644 --- a/web/src/components/settings/org-form.tsx +++ b/web/src/components/settings/org-form.tsx @@ -1,8 +1,8 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { useEffect, useState } from 'react'; import { Input } from '@/components/ui/input.js'; import { Label } from '@/components/ui/label.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { useEffect, useState } from 'react'; export function OrgForm() { const queryClient = useQueryClient(); diff --git a/web/src/components/settings/prompt-editor.tsx b/web/src/components/settings/prompt-editor.tsx index aefb0caa..28f953d2 100644 --- a/web/src/components/settings/prompt-editor.tsx +++ b/web/src/components/settings/prompt-editor.tsx @@ -1,8 +1,8 @@ -import { Badge } from '@/components/ui/badge.js'; -import { trpc, trpcClient } from '@/lib/trpc.js'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { ChevronDown, ChevronRight } from 'lucide-react'; import { useEffect, useState } from 'react'; +import { Badge } from '@/components/ui/badge.js'; +import { trpc, trpcClient } from '@/lib/trpc.js'; interface PromptEditorProps { target: { name: string }; @@ -13,7 +13,7 @@ export function PromptEditor({ target, onClose }: PromptEditorProps) { return ; } -function PartialEditor({ name, onClose }: { name: string; onClose: () => void }) { +function PartialEditor({ name, onClose: _onClose }: { name: string; onClose: () => void }) { const queryClient = useQueryClient(); const [content, setContent] = useState(''); const [validationStatus, setValidationStatus] = useState(null); diff --git a/web/src/components/settings/useDefinitionEditor.ts b/web/src/components/settings/useDefinitionEditor.ts index f29e8b4e..6c960726 100644 --- a/web/src/components/settings/useDefinitionEditor.ts +++ b/web/src/components/settings/useDefinitionEditor.ts @@ -3,9 +3,10 @@ * agent definition editor. Extracted from agent-definition-editor.tsx to keep * the main component as a thin orchestrator. */ -import { trpc, trpcClient } from '@/lib/trpc.js'; + import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useState } from 'react'; +import { trpc, trpcClient } from '@/lib/trpc.js'; import { type AgentDefinition, type DefinitionRow, diff --git a/web/src/components/settings/user-form-dialog.tsx b/web/src/components/settings/user-form-dialog.tsx index 8632c9c6..cccfddd0 100644 --- a/web/src/components/settings/user-form-dialog.tsx +++ b/web/src/components/settings/user-form-dialog.tsx @@ -1,9 +1,9 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useState } from 'react'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog.js'; import { Input } from '@/components/ui/input.js'; import { Label } from '@/components/ui/label.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { useState } from 'react'; interface User { id: string; diff --git a/web/src/components/settings/users-table.tsx b/web/src/components/settings/users-table.tsx index 66097441..629b5b8a 100644 --- a/web/src/components/settings/users-table.tsx +++ b/web/src/components/settings/users-table.tsx @@ -1,3 +1,6 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { Pencil, Trash2 } from 'lucide-react'; +import { useState } from 'react'; import { AlertDialog, AlertDialogAction, @@ -18,9 +21,6 @@ import { TableRow, } from '@/components/ui/table.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { Pencil, Trash2 } from 'lucide-react'; -import { useState } from 'react'; import { UserFormDialog } from './user-form-dialog.js'; interface User { diff --git a/web/src/components/shared/trigger-toggles.tsx b/web/src/components/shared/trigger-toggles.tsx index 6c9576dc..0323e8bb 100644 --- a/web/src/components/shared/trigger-toggles.tsx +++ b/web/src/components/shared/trigger-toggles.tsx @@ -1,5 +1,5 @@ import { Label } from '@/components/ui/label.js'; -import { type TriggerDef, getTriggerValue, setTriggerValue } from '@/lib/trigger-agent-mapping.js'; +import { getTriggerValue, setTriggerValue, type TriggerDef } from '@/lib/trigger-agent-mapping.js'; export type { TriggerDef }; diff --git a/web/src/components/ui/badge.tsx b/web/src/components/ui/badge.tsx index 5967b1ed..06916808 100644 --- a/web/src/components/ui/badge.tsx +++ b/web/src/components/ui/badge.tsx @@ -1,4 +1,4 @@ -import { type VariantProps, cva } from 'class-variance-authority'; +import { cva, type VariantProps } from 'class-variance-authority'; import { Slot } from 'radix-ui'; import type * as React from 'react'; diff --git a/web/src/components/ui/button.tsx b/web/src/components/ui/button.tsx index 469e41b7..c305fa12 100644 --- a/web/src/components/ui/button.tsx +++ b/web/src/components/ui/button.tsx @@ -1,4 +1,4 @@ -import { type VariantProps, cva } from 'class-variance-authority'; +import { cva, type VariantProps } from 'class-variance-authority'; import { Slot } from 'radix-ui'; import type * as React from 'react'; diff --git a/web/src/components/ui/card.tsx b/web/src/components/ui/card.tsx index 273b28d9..7891723c 100644 --- a/web/src/components/ui/card.tsx +++ b/web/src/components/ui/card.tsx @@ -72,4 +72,4 @@ function CardFooter({ className, ...props }: React.ComponentProps<'div'>) { ); } -export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent }; +export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }; diff --git a/web/src/components/ui/combobox.tsx b/web/src/components/ui/combobox.tsx index ab8dd6aa..787fccb6 100644 --- a/web/src/components/ui/combobox.tsx +++ b/web/src/components/ui/combobox.tsx @@ -1,9 +1,9 @@ -import { Button } from '@/components/ui/button.js'; -import { cn } from '@/lib/utils.js'; import { Command as CommandPrimitive } from 'cmdk'; import { Check, ChevronsUpDown } from 'lucide-react'; import { Popover as PopoverPrimitive } from 'radix-ui'; import * as React from 'react'; +import { Button } from '@/components/ui/button.js'; +import { cn } from '@/lib/utils.js'; export interface ComboboxOption { value: string; diff --git a/web/src/components/ui/form.tsx b/web/src/components/ui/form.tsx index eb0b6c40..9de28481 100644 --- a/web/src/components/ui/form.tsx +++ b/web/src/components/ui/form.tsx @@ -139,12 +139,12 @@ function FormMessage({ className, ...props }: React.ComponentProps<'p'>) { } export { - useFormField, Form, - FormItem, - FormLabel, FormControl, FormDescription, - FormMessage, FormField, + FormItem, + FormLabel, + FormMessage, + useFormField, }; diff --git a/web/src/components/ui/table.tsx b/web/src/components/ui/table.tsx index 53a7a71e..41ada581 100644 --- a/web/src/components/ui/table.tsx +++ b/web/src/components/ui/table.tsx @@ -89,4 +89,4 @@ function TableCaption({ className, ...props }: React.ComponentProps<'caption'>) ); } -export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption }; +export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow }; diff --git a/web/src/components/ui/tabs.tsx b/web/src/components/ui/tabs.tsx index 178dd818..cc369e28 100644 --- a/web/src/components/ui/tabs.tsx +++ b/web/src/components/ui/tabs.tsx @@ -1,6 +1,6 @@ 'use client'; -import { type VariantProps, cva } from 'class-variance-authority'; +import { cva, type VariantProps } from 'class-variance-authority'; import { Tabs as TabsPrimitive } from 'radix-ui'; import type * as React from 'react'; @@ -78,4 +78,4 @@ function TabsContent({ className, ...props }: React.ComponentProps(null); const isAdmin = me?.role === 'superadmin'; const initialized = useRef(false); diff --git a/web/src/lib/trigger-agent-mapping.ts b/web/src/lib/trigger-agent-mapping.ts index d2526d2f..0c7fbe1a 100644 --- a/web/src/lib/trigger-agent-mapping.ts +++ b/web/src/lib/trigger-agent-mapping.ts @@ -3,14 +3,14 @@ * Uses definition-based triggers from the API via agentTriggerConfigs.getProjectTriggersView. */ -// Re-export shared types for convenience -export { TRIGGER_CATEGORY_LABELS as CATEGORY_LABELS } from '../../../src/api/routers/_shared/triggerTypes.js'; export type { + ProjectTriggersView, ResolvedTrigger, TriggerParameterDef, TriggerParameterValue, - ProjectTriggersView, } from '../../../src/api/routers/_shared/triggerTypes.js'; +// Re-export shared types for convenience +export { TRIGGER_CATEGORY_LABELS as CATEGORY_LABELS } from '../../../src/api/routers/_shared/triggerTypes.js'; // ============================================================================ // Types diff --git a/web/src/routes/__root.tsx b/web/src/routes/__root.tsx index d3570ad6..be6ca882 100644 --- a/web/src/routes/__root.tsx +++ b/web/src/routes/__root.tsx @@ -1,13 +1,13 @@ +import { useQuery } from '@tanstack/react-query'; +import { createRootRoute, Outlet, redirect, useRouterState } from '@tanstack/react-router'; +import { Menu } from 'lucide-react'; +import { useState } from 'react'; import { Header } from '@/components/layout/header.js'; import { MobileSidebar } from '@/components/layout/mobile-sidebar.js'; import { Sidebar } from '@/components/layout/sidebar.js'; import { OrgProvider } from '@/lib/org-context.js'; import { queryClient } from '@/lib/query-client.js'; import { trpc } from '@/lib/trpc.js'; -import { useQuery } from '@tanstack/react-query'; -import { Outlet, createRootRoute, redirect, useRouterState } from '@tanstack/react-router'; -import { Menu } from 'lucide-react'; -import { useState } from 'react'; function RootLayout() { const routerState = useRouterState(); diff --git a/web/src/routes/global/definitions.tsx b/web/src/routes/global/definitions.tsx index 4ceb8b25..c0f48198 100644 --- a/web/src/routes/global/definitions.tsx +++ b/web/src/routes/global/definitions.tsx @@ -1,6 +1,10 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { createRoute } from '@tanstack/react-router'; +import { ArrowLeft, Pencil, Trash2 } from 'lucide-react'; +import { useState } from 'react'; import { AgentDefinitionEditor } from '@/components/settings/agent-definition-editor.js'; -import { AgentDefinitionsTable } from '@/components/settings/agent-definition-table.js'; import type { DefinitionRow } from '@/components/settings/agent-definition-table.js'; +import { AgentDefinitionsTable } from '@/components/settings/agent-definition-table.js'; import { PromptEditor } from '@/components/settings/prompt-editor.js'; import { Badge } from '@/components/ui/badge.js'; import { @@ -12,10 +16,6 @@ import { TableRow, } from '@/components/ui/table.js'; import { trpc, trpcClient } from '@/lib/trpc.js'; -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { createRoute } from '@tanstack/react-router'; -import { ArrowLeft, Pencil, Trash2 } from 'lucide-react'; -import { useState } from 'react'; import { rootRoute } from '../__root.js'; type Tab = 'definitions' | 'partials'; diff --git a/web/src/routes/global/organizations.tsx b/web/src/routes/global/organizations.tsx index 9b426280..0467d03f 100644 --- a/web/src/routes/global/organizations.tsx +++ b/web/src/routes/global/organizations.tsx @@ -1,10 +1,10 @@ -import { OrganizationFormDialog } from '@/components/global/organization-form-dialog.js'; -import { OrganizationsTable } from '@/components/global/organizations-table.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { createRoute } from '@tanstack/react-router'; import { Plus } from 'lucide-react'; import { useState } from 'react'; +import { OrganizationFormDialog } from '@/components/global/organization-form-dialog.js'; +import { OrganizationsTable } from '@/components/global/organizations-table.js'; +import { trpc } from '@/lib/trpc.js'; import { rootRoute } from '../__root.js'; interface Organization { diff --git a/web/src/routes/global/runs.tsx b/web/src/routes/global/runs.tsx index 0c182844..b23f9510 100644 --- a/web/src/routes/global/runs.tsx +++ b/web/src/routes/global/runs.tsx @@ -1,9 +1,9 @@ -import { RunFilters } from '@/components/runs/run-filters.js'; -import { RunsTable } from '@/components/runs/runs-table.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { createRoute, useNavigate, useSearch } from '@tanstack/react-router'; import { z } from 'zod'; +import { RunFilters } from '@/components/runs/run-filters.js'; +import { RunsTable } from '@/components/runs/runs-table.js'; +import { trpc } from '@/lib/trpc.js'; import { rootRoute } from '../__root.js'; const searchSchema = z.object({ diff --git a/web/src/routes/global/webhook-logs.tsx b/web/src/routes/global/webhook-logs.tsx index 6ac5437f..61b6c71f 100644 --- a/web/src/routes/global/webhook-logs.tsx +++ b/web/src/routes/global/webhook-logs.tsx @@ -1,10 +1,10 @@ -import { WebhookLogDetailDialog } from '@/components/webhooklogs/webhooklog-detail-dialog.js'; -import { WebhookLogsTable } from '@/components/webhooklogs/webhooklogs-table.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { createRoute, useNavigate, useSearch } from '@tanstack/react-router'; import { useState } from 'react'; import { z } from 'zod'; +import { WebhookLogDetailDialog } from '@/components/webhooklogs/webhooklog-detail-dialog.js'; +import { WebhookLogsTable } from '@/components/webhooklogs/webhooklogs-table.js'; +import { trpc } from '@/lib/trpc.js'; import { rootRoute } from '../__root.js'; const searchSchema = z.object({ diff --git a/web/src/routes/index.tsx b/web/src/routes/index.tsx index 6e05afa2..d35f19ed 100644 --- a/web/src/routes/index.tsx +++ b/web/src/routes/index.tsx @@ -1,13 +1,13 @@ -import { RunFilters } from '@/components/runs/run-filters.js'; -import { RunsTable } from '@/components/runs/runs-table.js'; -import { TriggerRunDialog } from '@/components/runs/trigger-run-dialog.js'; -import { Button } from '@/components/ui/button.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { createRoute, useNavigate, useSearch } from '@tanstack/react-router'; import { Play } from 'lucide-react'; import { useState } from 'react'; import { z } from 'zod'; +import { RunFilters } from '@/components/runs/run-filters.js'; +import { RunsTable } from '@/components/runs/runs-table.js'; +import { TriggerRunDialog } from '@/components/runs/trigger-run-dialog.js'; +import { Button } from '@/components/ui/button.js'; +import { trpc } from '@/lib/trpc.js'; import { rootRoute } from './__root.js'; const searchSchema = z.object({ diff --git a/web/src/routes/login.tsx b/web/src/routes/login.tsx index 83a12345..a8cc608a 100644 --- a/web/src/routes/login.tsx +++ b/web/src/routes/login.tsx @@ -1,7 +1,7 @@ -import { trpc } from '@/lib/trpc.js'; import { useQueryClient } from '@tanstack/react-query'; import { createRoute, useNavigate } from '@tanstack/react-router'; import { useState } from 'react'; +import { trpc } from '@/lib/trpc.js'; import { API_URL } from '../lib/api.js'; import { rootRoute } from './__root.js'; diff --git a/web/src/routes/projects/$projectId.agent-configs.tsx b/web/src/routes/projects/$projectId.agent-configs.tsx index 33555a60..a50c27f0 100644 --- a/web/src/routes/projects/$projectId.agent-configs.tsx +++ b/web/src/routes/projects/$projectId.agent-configs.tsx @@ -1,5 +1,5 @@ -import { ProjectAgentConfigs } from '@/components/projects/project-agent-configs.js'; import { createRoute } from '@tanstack/react-router'; +import { ProjectAgentConfigs } from '@/components/projects/project-agent-configs.js'; import { projectDetailRoute } from './$projectId.js'; function ProjectAgentConfigsPage() { diff --git a/web/src/routes/projects/$projectId.general.tsx b/web/src/routes/projects/$projectId.general.tsx index eb95efae..36326ee9 100644 --- a/web/src/routes/projects/$projectId.general.tsx +++ b/web/src/routes/projects/$projectId.general.tsx @@ -1,7 +1,7 @@ -import { ProjectGeneralForm } from '@/components/projects/project-general-form.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { createRoute } from '@tanstack/react-router'; +import { ProjectGeneralForm } from '@/components/projects/project-general-form.js'; +import { trpc } from '@/lib/trpc.js'; import { projectDetailRoute } from './$projectId.js'; function ProjectGeneralPage() { diff --git a/web/src/routes/projects/$projectId.harness.tsx b/web/src/routes/projects/$projectId.harness.tsx index 9a86e4eb..09af7158 100644 --- a/web/src/routes/projects/$projectId.harness.tsx +++ b/web/src/routes/projects/$projectId.harness.tsx @@ -1,7 +1,7 @@ -import { ProjectHarnessForm } from '@/components/projects/project-harness-form.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { createRoute } from '@tanstack/react-router'; +import { ProjectHarnessForm } from '@/components/projects/project-harness-form.js'; +import { trpc } from '@/lib/trpc.js'; import { projectDetailRoute } from './$projectId.js'; function ProjectHarnessPage() { diff --git a/web/src/routes/projects/$projectId.integrations.tsx b/web/src/routes/projects/$projectId.integrations.tsx index 91f82611..d425dfbb 100644 --- a/web/src/routes/projects/$projectId.integrations.tsx +++ b/web/src/routes/projects/$projectId.integrations.tsx @@ -1,5 +1,5 @@ -import { IntegrationForm } from '@/components/projects/integration-form.js'; import { createRoute } from '@tanstack/react-router'; +import { IntegrationForm } from '@/components/projects/integration-form.js'; import { projectDetailRoute } from './$projectId.js'; function ProjectIntegrationsPage() { diff --git a/web/src/routes/projects/$projectId.lifecycle.tsx b/web/src/routes/projects/$projectId.lifecycle.tsx index a7246039..54288ea0 100644 --- a/web/src/routes/projects/$projectId.lifecycle.tsx +++ b/web/src/routes/projects/$projectId.lifecycle.tsx @@ -1,5 +1,5 @@ -import { ProjectLifecycleAutomations } from '@/components/projects/project-lifecycle-automations.js'; import { createRoute } from '@tanstack/react-router'; +import { ProjectLifecycleAutomations } from '@/components/projects/project-lifecycle-automations.js'; import { projectDetailRoute } from './$projectId.js'; function ProjectLifecyclePage() { diff --git a/web/src/routes/projects/$projectId.stats.tsx b/web/src/routes/projects/$projectId.stats.tsx index 88bec42b..f4a603fe 100644 --- a/web/src/routes/projects/$projectId.stats.tsx +++ b/web/src/routes/projects/$projectId.stats.tsx @@ -1,12 +1,12 @@ -import { StatsFiltersBar } from '@/components/projects/stats-filters.js'; +import { useQuery } from '@tanstack/react-query'; +import { createRoute } from '@tanstack/react-router'; +import { useMemo, useState } from 'react'; import type { StatsFilters } from '@/components/projects/stats-filters.js'; +import { StatsFiltersBar } from '@/components/projects/stats-filters.js'; import { StatsSummary } from '@/components/projects/stats-summary.js'; import { ProjectWorkDurationChart } from '@/components/runs/project-work-duration-chart.js'; import { WorkItemCostChart } from '@/components/runs/work-item-cost-chart.js'; import { trpc } from '@/lib/trpc.js'; -import { useQuery } from '@tanstack/react-query'; -import { createRoute } from '@tanstack/react-router'; -import { useMemo, useState } from 'react'; import { projectDetailRoute } from './$projectId.js'; export function computeDateFrom(timeRange: string): string | undefined { diff --git a/web/src/routes/projects/$projectId.tsx b/web/src/routes/projects/$projectId.tsx index 6eb0ceb4..400b19b6 100644 --- a/web/src/routes/projects/$projectId.tsx +++ b/web/src/routes/projects/$projectId.tsx @@ -1,4 +1,4 @@ -import { Outlet, createRoute, redirect } from '@tanstack/react-router'; +import { createRoute, Outlet, redirect } from '@tanstack/react-router'; import { rootRoute } from '../__root.js'; function ProjectShellPage() { diff --git a/web/src/routes/projects/$projectId.work.tsx b/web/src/routes/projects/$projectId.work.tsx index 6836aacd..8e8c5122 100644 --- a/web/src/routes/projects/$projectId.work.tsx +++ b/web/src/routes/projects/$projectId.work.tsx @@ -1,8 +1,8 @@ -import { ProjectWorkTable } from '@/components/projects/project-work-table.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { createRoute } from '@tanstack/react-router'; import { useState } from 'react'; +import { ProjectWorkTable } from '@/components/projects/project-work-table.js'; +import { trpc } from '@/lib/trpc.js'; import { projectDetailRoute } from './$projectId.js'; const WORK_PAGE_SIZE = 50; diff --git a/web/src/routes/projects/index.tsx b/web/src/routes/projects/index.tsx index b10e9bb5..b7753716 100644 --- a/web/src/routes/projects/index.tsx +++ b/web/src/routes/projects/index.tsx @@ -1,9 +1,9 @@ -import { ProjectFormDialog } from '@/components/projects/project-form-dialog.js'; -import { ProjectsTable } from '@/components/projects/projects-table.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { createRoute } from '@tanstack/react-router'; import { useState } from 'react'; +import { ProjectFormDialog } from '@/components/projects/project-form-dialog.js'; +import { ProjectsTable } from '@/components/projects/projects-table.js'; +import { trpc } from '@/lib/trpc.js'; import { rootRoute } from '../__root.js'; function ProjectsListPage() { diff --git a/web/src/routes/prs/$projectId.$prNumber.tsx b/web/src/routes/prs/$projectId.$prNumber.tsx index f6bd76c6..d32b327d 100644 --- a/web/src/routes/prs/$projectId.$prNumber.tsx +++ b/web/src/routes/prs/$projectId.$prNumber.tsx @@ -1,10 +1,10 @@ +import { useQuery } from '@tanstack/react-query'; +import { createRoute } from '@tanstack/react-router'; +import { ExternalLink } from 'lucide-react'; import { WorkItemCostChart } from '@/components/runs/work-item-cost-chart.js'; import { WorkItemDurationChart } from '@/components/runs/work-item-duration-chart.js'; import { WorkItemRunsTable } from '@/components/runs/work-item-runs-table.js'; import { trpc } from '@/lib/trpc.js'; -import { useQuery } from '@tanstack/react-query'; -import { createRoute } from '@tanstack/react-router'; -import { ExternalLink } from 'lucide-react'; import { rootRoute } from '../__root.js'; function PRRunsPage() { diff --git a/web/src/routes/runs/$runId.tsx b/web/src/routes/runs/$runId.tsx index 338b7ed5..b3790aaa 100644 --- a/web/src/routes/runs/$runId.tsx +++ b/web/src/routes/runs/$runId.tsx @@ -1,3 +1,7 @@ +import { useQuery } from '@tanstack/react-query'; +import { createRoute, Link } from '@tanstack/react-router'; +import { FileText, GitPullRequest } from 'lucide-react'; +import { useState } from 'react'; import { DebugAnalysis } from '@/components/debug/debug-analysis.js'; import { LlmCallList } from '@/components/llm-calls/llm-call-list.js'; import { LogViewer } from '@/components/logs/log-viewer.js'; @@ -7,10 +11,6 @@ import { RunStatusBadge } from '@/components/runs/run-status-badge.js'; import { RunSummaryCard } from '@/components/runs/run-summary-card.js'; import { trpc } from '@/lib/trpc.js'; import { cn } from '@/lib/utils.js'; -import { useQuery } from '@tanstack/react-query'; -import { Link, createRoute } from '@tanstack/react-router'; -import { FileText, GitPullRequest } from 'lucide-react'; -import { useState } from 'react'; import { rootRoute } from '../__root.js'; type Tab = 'overview' | 'logs' | 'llm-calls' | 'debug'; diff --git a/web/src/routes/settings/general.tsx b/web/src/routes/settings/general.tsx index 5defa8d1..c575244c 100644 --- a/web/src/routes/settings/general.tsx +++ b/web/src/routes/settings/general.tsx @@ -1,5 +1,5 @@ -import { OrgForm } from '@/components/settings/org-form.js'; import { createRoute } from '@tanstack/react-router'; +import { OrgForm } from '@/components/settings/org-form.js'; import { rootRoute } from '../__root.js'; function GeneralSettingsPage() { diff --git a/web/src/routes/settings/users.tsx b/web/src/routes/settings/users.tsx index ec2f741a..88a61021 100644 --- a/web/src/routes/settings/users.tsx +++ b/web/src/routes/settings/users.tsx @@ -1,9 +1,9 @@ -import { UserFormDialog } from '@/components/settings/user-form-dialog.js'; -import { UsersTable } from '@/components/settings/users-table.js'; -import { trpc } from '@/lib/trpc.js'; import { useQuery } from '@tanstack/react-query'; import { createRoute } from '@tanstack/react-router'; import { useState } from 'react'; +import { UserFormDialog } from '@/components/settings/user-form-dialog.js'; +import { UsersTable } from '@/components/settings/users-table.js'; +import { trpc } from '@/lib/trpc.js'; import { rootRoute } from '../__root.js'; function UsersPage() { diff --git a/web/src/routes/work-items/$projectId.$workItemId.tsx b/web/src/routes/work-items/$projectId.$workItemId.tsx index 8ce121e3..9b1d487f 100644 --- a/web/src/routes/work-items/$projectId.$workItemId.tsx +++ b/web/src/routes/work-items/$projectId.$workItemId.tsx @@ -1,10 +1,10 @@ +import { useQuery } from '@tanstack/react-query'; +import { createRoute } from '@tanstack/react-router'; +import { ExternalLink } from 'lucide-react'; import { WorkItemCostChart } from '@/components/runs/work-item-cost-chart.js'; import { WorkItemDurationChart } from '@/components/runs/work-item-duration-chart.js'; import { WorkItemRunsTable } from '@/components/runs/work-item-runs-table.js'; import { trpc } from '@/lib/trpc.js'; -import { useQuery } from '@tanstack/react-query'; -import { createRoute } from '@tanstack/react-router'; -import { ExternalLink } from 'lucide-react'; import { rootRoute } from '../__root.js'; function WorkItemRunsPage() {