diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 4f77ac03b..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: CI - -on: - push: - branches: [main, acp, feature/*] - pull_request: - branches: [main] - -env: - BUN_CONFIG_REGISTRY: https://registry.npmjs.org/ - -jobs: - ci: - runs-on: macos-latest - - steps: - - uses: actions/checkout@v4 - - - uses: oven-sh/setup-bun@v2 - with: - bun-version: '1.3.14' - - - name: Replace mirror URLs - run: sed -i '' 's|registry.npmmirror.com|registry.npmjs.org|g' bun.lock - - - name: Install dependencies - env: - CLAUDE_CODE_SKIP_CHROME_MCP_SETUP: '1' - run: bun install --frozen-lockfile - - - name: Test - run: | - set +e - bun test --isolate > /tmp/ci-test.log 2>&1 - TEST_EXIT=$? - FAILS=$(grep -oE '[0-9]+ fail' /tmp/ci-test.log | tail -1 | grep -oE '[0-9]+') - if [ -z "$FAILS" ]; then FAILS=0; fi - echo "Failures: $FAILS (baseline: 0) | bun test exit: $TEST_EXIT" - # Show last 30 lines of test output - tail -30 /tmp/ci-test.log - if [ "$FAILS" -le 0 ]; then - echo "✅ Test baseline OK" - else - echo "❌ Test regressions detected" - exit 1 - fi - - - name: Build - run: bun run build --no-splitting diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index f0e81cfdb..000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: "CodeQL Analysis" - -on: - push: - branches: [main] - pull_request: - branches: [main] - schedule: - - cron: '30 3 * * 1' # 每周一 03:30 UTC - workflow_dispatch: # 手动触发 - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - security-events: write - actions: read - contents: read - - strategy: - fail-fast: false - matrix: - language: ['javascript-typescript'] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Install dependencies - env: - CLAUDE_CODE_SKIP_CHROME_MCP_SETUP: '1' - run: bun install - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - queries: security-extended - - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/release-rcs.yml b/.github/workflows/release-rcs.yml deleted file mode 100644 index d441b2169..000000000 --- a/.github/workflows/release-rcs.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Release RCS Docker Image - -on: - push: - tags: - - 'rcs-v*' - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository_owner }}/remote-control-server - -jobs: - build-and-push: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v4 - - - name: Login to GHCR - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Extract version - id: version - run: echo "VERSION=${GITHUB_REF_NAME#rcs-v}" >> "$GITHUB_OUTPUT" - - - name: Generate tags - id: tags - run: | - VERSION="${{ steps.version.outputs.VERSION }}" - IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" - TAGS="${IMAGE}:${VERSION}" - IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" - if [ -n "$MAJOR" ] && [ -n "$MINOR" ]; then - TAGS="${TAGS},${IMAGE}:${MAJOR}.${MINOR}" - fi - TAGS="${TAGS},${IMAGE}:latest" - echo "tags=$TAGS" >> "$GITHUB_OUTPUT" - - - name: Build Docker image - uses: docker/build-push-action@v5 - with: - context: . - file: packages/remote-control-server/Dockerfile - push: false - load: true - tags: ${{ steps.tags.outputs.tags }} - build-args: VERSION=${{ steps.version.outputs.VERSION }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Verify image - run: | - IMAGE_TAG=$(echo "${{ steps.tags.outputs.tags }}" | cut -d',' -f1) - docker run -d --name rcs-test -p 3000:3000 "$IMAGE_TAG" - sleep 5 - curl -sf http://localhost:3000/health || { docker logs rcs-test; exit 1; } - docker stop rcs-test - docker rm rcs-test - - - name: Push Docker image - run: | - IFS=',' read -ra TAGS <<< "${{ steps.tags.outputs.tags }}" - for TAG in "${TAGS[@]}"; do - docker push "$TAG" - done diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml deleted file mode 100644 index 40985fe2a..000000000 --- a/.github/workflows/update-contributors.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Update Contributors - -on: - push: - branches: - - main - schedule: - - cron: '0 0 * * *' # 每天更新一次 - -permissions: - contents: write - -jobs: - update: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - uses: jaywcjlove/github-action-contributors@main - with: - token: ${{ secrets.GITHUB_TOKEN }} - output: "contributors.svg" - repository: ${{ github.repository }} - - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: "docs: update contributors" - file_pattern: "contributors.svg" - branch: main diff --git a/YYMa <2942204237@qq.com> b/YYMa <2942204237@qq.com> new file mode 100644 index 000000000..e69de29bb diff --git a/src/bootstrap/src/entrypoints/agentSdkTypes.ts b/src/bootstrap/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 8491988f8..000000000 --- a/src/bootstrap/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HookEvent = any; -export type ModelUsage = any; diff --git a/src/bootstrap/src/tools/AgentTool/agentColorManager.ts b/src/bootstrap/src/tools/AgentTool/agentColorManager.ts deleted file mode 100644 index b1a565c12..000000000 --- a/src/bootstrap/src/tools/AgentTool/agentColorManager.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AgentColorName = any; diff --git a/src/bootstrap/src/types/hooks.ts b/src/bootstrap/src/types/hooks.ts deleted file mode 100644 index ee7a626db..000000000 --- a/src/bootstrap/src/types/hooks.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HookCallbackMatcher = any; diff --git a/src/bootstrap/src/types/ids.ts b/src/bootstrap/src/types/ids.ts deleted file mode 100644 index 34291796d..000000000 --- a/src/bootstrap/src/types/ids.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SessionId = any; diff --git a/src/bootstrap/src/utils/crypto.ts b/src/bootstrap/src/utils/crypto.ts deleted file mode 100644 index 61e51b7c0..000000000 --- a/src/bootstrap/src/utils/crypto.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type randomUUID = any; diff --git a/src/bootstrap/src/utils/model/modelStrings.ts b/src/bootstrap/src/utils/model/modelStrings.ts deleted file mode 100644 index d632b76bf..000000000 --- a/src/bootstrap/src/utils/model/modelStrings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ModelStrings = any; diff --git a/src/bootstrap/src/utils/settings/settingsCache.ts b/src/bootstrap/src/utils/settings/settingsCache.ts deleted file mode 100644 index 818a7b15c..000000000 --- a/src/bootstrap/src/utils/settings/settingsCache.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type resetSettingsCache = any; diff --git a/src/bootstrap/src/utils/signal.ts b/src/bootstrap/src/utils/signal.ts deleted file mode 100644 index 7c6732c50..000000000 --- a/src/bootstrap/src/utils/signal.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type createSignal = any; diff --git a/src/cli/handlers/ant.ts b/src/cli/handlers/ant.ts deleted file mode 100644 index 74e53359f..000000000 --- a/src/cli/handlers/ant.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type { Command } from '@commander-js/extra-typings'; - -export {}; -export const logHandler: (logId: string | number | undefined) => Promise = (async () => {}) as (logId: string | number | undefined) => Promise; -export const errorHandler: (num: number | undefined) => Promise = (async () => {}) as (num: number | undefined) => Promise; -export const exportHandler: (source: string, outputFile: string) => Promise = (async () => {}) as (source: string, outputFile: string) => Promise; -export const taskCreateHandler: (subject: string, opts: { description?: string; list?: string }) => Promise = (async () => {}) as (subject: string, opts: { description?: string; list?: string }) => Promise; -export const taskListHandler: (opts: { list?: string; pending?: boolean; json?: boolean }) => Promise = (async () => {}) as (opts: { list?: string; pending?: boolean; json?: boolean }) => Promise; -export const taskGetHandler: (id: string, opts: { list?: string }) => Promise = (async () => {}) as (id: string, opts: { list?: string }) => Promise; -export const taskUpdateHandler: (id: string, opts: { list?: string; status?: string; subject?: string; description?: string; owner?: string; clearOwner?: boolean }) => Promise = (async () => {}) as (id: string, opts: { list?: string; status?: string; subject?: string; description?: string; owner?: string; clearOwner?: boolean }) => Promise; -export const taskDirHandler: (opts: { list?: string }) => Promise = (async () => {}) as (opts: { list?: string }) => Promise; -export const completionHandler: (shell: string, opts: { output?: string }, program: Command) => Promise = (async () => {}) as (shell: string, opts: { output?: string }, program: Command) => Promise; diff --git a/src/cli/handlers/templateJobs.ts b/src/cli/handlers/templateJobs.ts deleted file mode 100644 index aefb23217..000000000 --- a/src/cli/handlers/templateJobs.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const templatesMain: (args: string[]) => Promise = () => Promise.resolve(); diff --git a/src/cli/src/QueryEngine.ts b/src/cli/src/QueryEngine.ts deleted file mode 100644 index 4771549b4..000000000 --- a/src/cli/src/QueryEngine.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ask = any; diff --git a/src/cli/src/cli/handlers/auth.ts b/src/cli/src/cli/handlers/auth.ts deleted file mode 100644 index c420d9446..000000000 --- a/src/cli/src/cli/handlers/auth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type installOAuthTokens = any; diff --git a/src/cli/src/cli/remoteIO.ts b/src/cli/src/cli/remoteIO.ts deleted file mode 100644 index 0fc9133a5..000000000 --- a/src/cli/src/cli/remoteIO.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type RemoteIO = any; diff --git a/src/cli/src/cli/structuredIO.ts b/src/cli/src/cli/structuredIO.ts deleted file mode 100644 index 00c29d618..000000000 --- a/src/cli/src/cli/structuredIO.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type StructuredIO = any; diff --git a/src/cli/src/commands/context/context-noninteractive.ts b/src/cli/src/commands/context/context-noninteractive.ts deleted file mode 100644 index 08e0c07c7..000000000 --- a/src/cli/src/commands/context/context-noninteractive.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type collectContextData = any; diff --git a/src/cli/src/entrypoints/agentSdkTypes.ts b/src/cli/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 4ac970c6e..000000000 --- a/src/cli/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SDKStatus = any; -export type ModelInfo = any; -export type SDKMessage = any; -export type SDKUserMessage = any; -export type SDKUserMessageReplay = any; -export type PermissionResult = any; -export type McpServerConfigForProcessTransport = any; -export type McpServerStatus = any; -export type RewindFilesResult = any; -export type HookEvent = any; -export type HookInput = any; -export type HookJSONOutput = any; -export type PermissionUpdate = any; diff --git a/src/cli/src/entrypoints/sdk/controlSchemas.ts b/src/cli/src/entrypoints/sdk/controlSchemas.ts deleted file mode 100644 index 886758286..000000000 --- a/src/cli/src/entrypoints/sdk/controlSchemas.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SDKControlElicitationResponseSchema = any; diff --git a/src/cli/src/entrypoints/sdk/controlTypes.ts b/src/cli/src/entrypoints/sdk/controlTypes.ts deleted file mode 100644 index e78800ea8..000000000 --- a/src/cli/src/entrypoints/sdk/controlTypes.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type StdoutMessage = any; -export type SDKControlInitializeRequest = any; -export type SDKControlInitializeResponse = any; -export type SDKControlRequest = any; -export type SDKControlResponse = any; -export type SDKControlMcpSetServersResponse = any; -export type SDKControlReloadPluginsResponse = any; -export type StdinMessage = any; diff --git a/src/cli/src/hooks/useCanUseTool.ts b/src/cli/src/hooks/useCanUseTool.ts deleted file mode 100644 index 056468f12..000000000 --- a/src/cli/src/hooks/useCanUseTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type CanUseToolFn = any; diff --git a/src/cli/src/services/PromptSuggestion/promptSuggestion.ts b/src/cli/src/services/PromptSuggestion/promptSuggestion.ts deleted file mode 100644 index 29070743b..000000000 --- a/src/cli/src/services/PromptSuggestion/promptSuggestion.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type tryGenerateSuggestion = any; -export type logSuggestionOutcome = any; -export type logSuggestionSuppressed = any; -export type PromptVariant = any; diff --git a/src/cli/src/services/analytics/index.ts b/src/cli/src/services/analytics/index.ts deleted file mode 100644 index ce0a9a827..000000000 --- a/src/cli/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; diff --git a/src/cli/src/services/api/grove.ts b/src/cli/src/services/api/grove.ts deleted file mode 100644 index 5a12d8ce5..000000000 --- a/src/cli/src/services/api/grove.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isQualifiedForGrove = any; -export type checkGroveForNonInteractive = any; diff --git a/src/cli/src/services/api/logging.ts b/src/cli/src/services/api/logging.ts deleted file mode 100644 index 2676d9ab3..000000000 --- a/src/cli/src/services/api/logging.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type EMPTY_USAGE = any; diff --git a/src/cli/src/services/claudeAiLimits.ts b/src/cli/src/services/claudeAiLimits.ts deleted file mode 100644 index 5d55387cb..000000000 --- a/src/cli/src/services/claudeAiLimits.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type statusListeners = any; -export type ClaudeAILimits = any; diff --git a/src/cli/src/services/mcp/auth.ts b/src/cli/src/services/mcp/auth.ts deleted file mode 100644 index dd96658d0..000000000 --- a/src/cli/src/services/mcp/auth.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type performMCPOAuthFlow = any; -export type revokeServerTokens = any; diff --git a/src/cli/src/services/mcp/channelAllowlist.ts b/src/cli/src/services/mcp/channelAllowlist.ts deleted file mode 100644 index 3bae533e2..000000000 --- a/src/cli/src/services/mcp/channelAllowlist.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isChannelAllowlisted = any; -export type isChannelsEnabled = any; diff --git a/src/cli/src/services/mcp/channelNotification.ts b/src/cli/src/services/mcp/channelNotification.ts deleted file mode 100644 index 2068b3ea8..000000000 --- a/src/cli/src/services/mcp/channelNotification.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ChannelMessageNotificationSchema = any; -export type gateChannelServer = any; -export type wrapChannelMessage = any; -export type findChannelEntry = any; diff --git a/src/cli/src/services/mcp/client.ts b/src/cli/src/services/mcp/client.ts deleted file mode 100644 index 845c793d7..000000000 --- a/src/cli/src/services/mcp/client.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type setupSdkMcpClients = any; -export type connectToServer = any; -export type clearServerCache = any; -export type fetchToolsForClient = any; -export type areMcpConfigsEqual = any; -export type reconnectMcpServerImpl = any; diff --git a/src/cli/src/services/mcp/config.ts b/src/cli/src/services/mcp/config.ts deleted file mode 100644 index edc224ea5..000000000 --- a/src/cli/src/services/mcp/config.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type filterMcpServersByPolicy = any; -export type getMcpConfigByName = any; -export type isMcpServerDisabled = any; -export type setMcpServerEnabled = any; -export type getAllMcpConfigs = any; diff --git a/src/cli/src/services/mcp/elicitationHandler.ts b/src/cli/src/services/mcp/elicitationHandler.ts deleted file mode 100644 index 2b791775c..000000000 --- a/src/cli/src/services/mcp/elicitationHandler.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type runElicitationHooks = any; -export type runElicitationResultHooks = any; diff --git a/src/cli/src/services/mcp/utils.ts b/src/cli/src/services/mcp/utils.ts deleted file mode 100644 index d77aad08e..000000000 --- a/src/cli/src/services/mcp/utils.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type commandBelongsToServer = any; -export type filterToolsByServer = any; diff --git a/src/cli/src/services/mcp/vscodeSdkMcp.ts b/src/cli/src/services/mcp/vscodeSdkMcp.ts deleted file mode 100644 index acf5f2d9d..000000000 --- a/src/cli/src/services/mcp/vscodeSdkMcp.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type setupVscodeSdkMcp = any; diff --git a/src/cli/src/services/oauth/index.ts b/src/cli/src/services/oauth/index.ts deleted file mode 100644 index 81adfa1dc..000000000 --- a/src/cli/src/services/oauth/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type OAuthService = any; diff --git a/src/cli/src/services/policyLimits/index.ts b/src/cli/src/services/policyLimits/index.ts deleted file mode 100644 index 887817d1a..000000000 --- a/src/cli/src/services/policyLimits/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isPolicyAllowed = any; diff --git a/src/cli/src/services/remoteManagedSettings/index.ts b/src/cli/src/services/remoteManagedSettings/index.ts deleted file mode 100644 index c062fff71..000000000 --- a/src/cli/src/services/remoteManagedSettings/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type waitForRemoteManagedSettingsToLoad = any; diff --git a/src/cli/src/services/settingsSync/index.ts b/src/cli/src/services/settingsSync/index.ts deleted file mode 100644 index 2974be7d5..000000000 --- a/src/cli/src/services/settingsSync/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type downloadUserSettings = any; -export type redownloadUserSettings = any; diff --git a/src/cli/src/state/AppStateStore.ts b/src/cli/src/state/AppStateStore.ts deleted file mode 100644 index caf2928ae..000000000 --- a/src/cli/src/state/AppStateStore.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AppState = any; diff --git a/src/cli/src/state/onChangeAppState.ts b/src/cli/src/state/onChangeAppState.ts deleted file mode 100644 index 676171dd6..000000000 --- a/src/cli/src/state/onChangeAppState.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type externalMetadataToAppState = any; diff --git a/src/cli/src/tools.ts b/src/cli/src/tools.ts deleted file mode 100644 index ce74ff75d..000000000 --- a/src/cli/src/tools.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type assembleToolPool = any; -export type filterToolsByDenyRules = any; diff --git a/src/cli/src/utils/auth.ts b/src/cli/src/utils/auth.ts deleted file mode 100644 index 3322df66f..000000000 --- a/src/cli/src/utils/auth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getAccountInformation = any; diff --git a/src/cli/src/utils/autoUpdater.ts b/src/cli/src/utils/autoUpdater.ts deleted file mode 100644 index 5241e3992..000000000 --- a/src/cli/src/utils/autoUpdater.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getLatestVersion = any; -export type InstallStatus = any; -export type installGlobalPackage = any; diff --git a/src/cli/src/utils/awsAuthStatusManager.ts b/src/cli/src/utils/awsAuthStatusManager.ts deleted file mode 100644 index d0ba68cc8..000000000 --- a/src/cli/src/utils/awsAuthStatusManager.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AwsAuthStatusManager = any; diff --git a/src/cli/src/utils/betas.ts b/src/cli/src/utils/betas.ts deleted file mode 100644 index 3e452b4d5..000000000 --- a/src/cli/src/utils/betas.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type modelSupportsAutoMode = any; diff --git a/src/cli/src/utils/cleanupRegistry.ts b/src/cli/src/utils/cleanupRegistry.ts deleted file mode 100644 index 4cbbdec8f..000000000 --- a/src/cli/src/utils/cleanupRegistry.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type registerCleanup = any; diff --git a/src/cli/src/utils/combinedAbortSignal.ts b/src/cli/src/utils/combinedAbortSignal.ts deleted file mode 100644 index 603e78f81..000000000 --- a/src/cli/src/utils/combinedAbortSignal.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type createCombinedAbortSignal = any; diff --git a/src/cli/src/utils/commandLifecycle.ts b/src/cli/src/utils/commandLifecycle.ts deleted file mode 100644 index d2f254135..000000000 --- a/src/cli/src/utils/commandLifecycle.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type notifyCommandLifecycle = any; diff --git a/src/cli/src/utils/commitAttribution.ts b/src/cli/src/utils/commitAttribution.ts deleted file mode 100644 index 4ee7a474d..000000000 --- a/src/cli/src/utils/commitAttribution.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type incrementPromptCount = any; diff --git a/src/cli/src/utils/completionCache.ts b/src/cli/src/utils/completionCache.ts deleted file mode 100644 index 1989a7093..000000000 --- a/src/cli/src/utils/completionCache.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type regenerateCompletionCache = any; diff --git a/src/cli/src/utils/config.ts b/src/cli/src/utils/config.ts deleted file mode 100644 index 12caa8ef9..000000000 --- a/src/cli/src/utils/config.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getGlobalConfig = any; -export type InstallMethod = any; -export type saveGlobalConfig = any; diff --git a/src/cli/src/utils/conversationRecovery.ts b/src/cli/src/utils/conversationRecovery.ts deleted file mode 100644 index 76a469ddc..000000000 --- a/src/cli/src/utils/conversationRecovery.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type loadConversationForResume = any; -export type TurnInterruptionState = any; diff --git a/src/cli/src/utils/cwd.ts b/src/cli/src/utils/cwd.ts deleted file mode 100644 index 76c192ed8..000000000 --- a/src/cli/src/utils/cwd.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getCwd = any; diff --git a/src/cli/src/utils/diagLogs.ts b/src/cli/src/utils/diagLogs.ts deleted file mode 100644 index 35f6099b5..000000000 --- a/src/cli/src/utils/diagLogs.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logForDiagnosticsNoPII = any; -export type withDiagnosticsTiming = any; diff --git a/src/cli/src/utils/doctorDiagnostic.ts b/src/cli/src/utils/doctorDiagnostic.ts deleted file mode 100644 index 02bff9d33..000000000 --- a/src/cli/src/utils/doctorDiagnostic.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getDoctorDiagnostic = any; diff --git a/src/cli/src/utils/effort.ts b/src/cli/src/utils/effort.ts deleted file mode 100644 index 323def36c..000000000 --- a/src/cli/src/utils/effort.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type modelSupportsEffort = any; -export type modelSupportsMaxEffort = any; -export type EFFORT_LEVELS = any; -export type resolveAppliedEffort = any; diff --git a/src/cli/src/utils/fastMode.ts b/src/cli/src/utils/fastMode.ts deleted file mode 100644 index e67ddafc1..000000000 --- a/src/cli/src/utils/fastMode.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isFastModeAvailable = any; -export type isFastModeEnabled = any; -export type isFastModeSupportedByModel = any; -export type getFastModeState = any; diff --git a/src/cli/src/utils/fileHistory.ts b/src/cli/src/utils/fileHistory.ts deleted file mode 100644 index d925e9f9e..000000000 --- a/src/cli/src/utils/fileHistory.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type fileHistoryRewind = any; -export type fileHistoryCanRestore = any; -export type fileHistoryEnabled = any; -export type fileHistoryGetDiffStats = any; diff --git a/src/cli/src/utils/filePersistence/filePersistence.ts b/src/cli/src/utils/filePersistence/filePersistence.ts deleted file mode 100644 index 57d7cf708..000000000 --- a/src/cli/src/utils/filePersistence/filePersistence.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type executeFilePersistence = any; diff --git a/src/cli/src/utils/fileStateCache.ts b/src/cli/src/utils/fileStateCache.ts deleted file mode 100644 index eca7afcd2..000000000 --- a/src/cli/src/utils/fileStateCache.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type createFileStateCacheWithSizeLimit = any; -export type mergeFileStateCaches = any; -export type READ_FILE_STATE_CACHE_SIZE = any; diff --git a/src/cli/src/utils/forkedAgent.ts b/src/cli/src/utils/forkedAgent.ts deleted file mode 100644 index fa626eedd..000000000 --- a/src/cli/src/utils/forkedAgent.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getLastCacheSafeParams = any; diff --git a/src/cli/src/utils/gracefulShutdown.ts b/src/cli/src/utils/gracefulShutdown.ts deleted file mode 100644 index c7e6f98bb..000000000 --- a/src/cli/src/utils/gracefulShutdown.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type gracefulShutdown = any; -export type gracefulShutdownSync = any; -export type isShuttingDown = any; diff --git a/src/cli/src/utils/headlessProfiler.ts b/src/cli/src/utils/headlessProfiler.ts deleted file mode 100644 index 3028607aa..000000000 --- a/src/cli/src/utils/headlessProfiler.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type headlessProfilerStartTurn = any; -export type headlessProfilerCheckpoint = any; -export type logHeadlessProfilerTurn = any; diff --git a/src/cli/src/utils/hooks.ts b/src/cli/src/utils/hooks.ts deleted file mode 100644 index 28c15cff6..000000000 --- a/src/cli/src/utils/hooks.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type executeNotificationHooks = any; diff --git a/src/cli/src/utils/hooks/AsyncHookRegistry.ts b/src/cli/src/utils/hooks/AsyncHookRegistry.ts deleted file mode 100644 index eca6e2fbc..000000000 --- a/src/cli/src/utils/hooks/AsyncHookRegistry.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type finalizePendingAsyncHooks = any; diff --git a/src/cli/src/utils/hooks/hookEvents.ts b/src/cli/src/utils/hooks/hookEvents.ts deleted file mode 100644 index 88419b696..000000000 --- a/src/cli/src/utils/hooks/hookEvents.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type registerHookEventHandler = any; diff --git a/src/cli/src/utils/idleTimeout.ts b/src/cli/src/utils/idleTimeout.ts deleted file mode 100644 index 0b3bf81e9..000000000 --- a/src/cli/src/utils/idleTimeout.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type createIdleTimeoutManager = any; diff --git a/src/cli/src/utils/json.ts b/src/cli/src/utils/json.ts deleted file mode 100644 index d9646ab1f..000000000 --- a/src/cli/src/utils/json.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type safeParseJSON = any; diff --git a/src/cli/src/utils/localInstaller.ts b/src/cli/src/utils/localInstaller.ts deleted file mode 100644 index e51976252..000000000 --- a/src/cli/src/utils/localInstaller.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type installOrUpdateClaudePackage = any; -export type localInstallationExists = any; diff --git a/src/cli/src/utils/log.ts b/src/cli/src/utils/log.ts deleted file mode 100644 index 989e1cdb7..000000000 --- a/src/cli/src/utils/log.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getInMemoryErrors = any; -export type logError = any; -export type logMCPDebug = any; diff --git a/src/cli/src/utils/messages/mappers.ts b/src/cli/src/utils/messages/mappers.ts deleted file mode 100644 index 94ac2ac78..000000000 --- a/src/cli/src/utils/messages/mappers.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type toInternalMessages = any; -export type toSDKRateLimitInfo = any; diff --git a/src/cli/src/utils/model/modelOptions.ts b/src/cli/src/utils/model/modelOptions.ts deleted file mode 100644 index b95242f35..000000000 --- a/src/cli/src/utils/model/modelOptions.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getModelOptions = any; diff --git a/src/cli/src/utils/model/modelStrings.ts b/src/cli/src/utils/model/modelStrings.ts deleted file mode 100644 index ad029ac9b..000000000 --- a/src/cli/src/utils/model/modelStrings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ensureModelStringsInitialized = any; diff --git a/src/cli/src/utils/model/providers.ts b/src/cli/src/utils/model/providers.ts deleted file mode 100644 index df87a41b4..000000000 --- a/src/cli/src/utils/model/providers.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getAPIProvider = any; diff --git a/src/cli/src/utils/nativeInstaller/index.ts b/src/cli/src/utils/nativeInstaller/index.ts deleted file mode 100644 index 397e06654..000000000 --- a/src/cli/src/utils/nativeInstaller/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type installLatest = any; -export type removeInstalledSymlink = any; diff --git a/src/cli/src/utils/nativeInstaller/packageManagers.ts b/src/cli/src/utils/nativeInstaller/packageManagers.ts deleted file mode 100644 index e73db3d9b..000000000 --- a/src/cli/src/utils/nativeInstaller/packageManagers.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getPackageManager = any; diff --git a/src/cli/src/utils/permissions/PermissionPromptToolResultSchema.ts b/src/cli/src/utils/permissions/PermissionPromptToolResultSchema.ts deleted file mode 100644 index ab281b487..000000000 --- a/src/cli/src/utils/permissions/PermissionPromptToolResultSchema.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type outputSchema = any; -export type permissionPromptToolResultToPermissionDecision = any; -export type Output = any; diff --git a/src/cli/src/utils/permissions/PermissionResult.ts b/src/cli/src/utils/permissions/PermissionResult.ts deleted file mode 100644 index e09cead08..000000000 --- a/src/cli/src/utils/permissions/PermissionResult.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PermissionDecision = any; -export type PermissionDecisionReason = any; diff --git a/src/cli/src/utils/permissions/permissionSetup.ts b/src/cli/src/utils/permissions/permissionSetup.ts deleted file mode 100644 index b669de315..000000000 --- a/src/cli/src/utils/permissions/permissionSetup.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isAutoModeGateEnabled = any; -export type getAutoModeUnavailableNotification = any; -export type getAutoModeUnavailableReason = any; -export type isBypassPermissionsModeDisabled = any; -export type transitionPermissionMode = any; diff --git a/src/cli/src/utils/permissions/permissions.ts b/src/cli/src/utils/permissions/permissions.ts deleted file mode 100644 index e8f8477e9..000000000 --- a/src/cli/src/utils/permissions/permissions.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type hasPermissionsToUseTool = any; diff --git a/src/cli/src/utils/plugins/pluginIdentifier.ts b/src/cli/src/utils/plugins/pluginIdentifier.ts deleted file mode 100644 index a6ca96949..000000000 --- a/src/cli/src/utils/plugins/pluginIdentifier.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type parsePluginIdentifier = any; diff --git a/src/cli/src/utils/process.ts b/src/cli/src/utils/process.ts deleted file mode 100644 index f3fc51827..000000000 --- a/src/cli/src/utils/process.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type writeToStdout = any; -export type registerProcessOutputErrorHandlers = any; diff --git a/src/cli/src/utils/queryContext.ts b/src/cli/src/utils/queryContext.ts deleted file mode 100644 index 258dfa1b8..000000000 --- a/src/cli/src/utils/queryContext.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type buildSideQuestionFallbackParams = any; diff --git a/src/cli/src/utils/queryHelpers.ts b/src/cli/src/utils/queryHelpers.ts deleted file mode 100644 index 39a3af855..000000000 --- a/src/cli/src/utils/queryHelpers.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PermissionPromptTool = any; -export type extractReadFilesFromMessages = any; diff --git a/src/cli/src/utils/queryProfiler.ts b/src/cli/src/utils/queryProfiler.ts deleted file mode 100644 index dd554afb0..000000000 --- a/src/cli/src/utils/queryProfiler.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type startQueryProfile = any; -export type logQueryProfileReport = any; diff --git a/src/cli/src/utils/sandbox/sandbox-adapter.ts b/src/cli/src/utils/sandbox/sandbox-adapter.ts deleted file mode 100644 index edebe2640..000000000 --- a/src/cli/src/utils/sandbox/sandbox-adapter.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SandboxManager = any; diff --git a/src/cli/src/utils/sessionRestore.ts b/src/cli/src/utils/sessionRestore.ts deleted file mode 100644 index 8b6aebfd1..000000000 --- a/src/cli/src/utils/sessionRestore.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type restoreAgentFromSession = any; -export type restoreSessionStateFromLog = any; diff --git a/src/cli/src/utils/sessionStart.ts b/src/cli/src/utils/sessionStart.ts deleted file mode 100644 index 3bd206870..000000000 --- a/src/cli/src/utils/sessionStart.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type processSessionStartHooks = any; -export type processSetupHooks = any; -export type takeInitialUserMessage = any; diff --git a/src/cli/src/utils/sessionStorage.ts b/src/cli/src/utils/sessionStorage.ts deleted file mode 100644 index 52b0f4d80..000000000 --- a/src/cli/src/utils/sessionStorage.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type hydrateRemoteSession = any; -export type hydrateFromCCRv2InternalEvents = any; -export type resetSessionFilePointer = any; -export type doesMessageExistInSession = any; -export type findUnresolvedToolUse = any; -export type recordAttributionSnapshot = any; -export type saveAgentSetting = any; -export type saveMode = any; -export type saveAiGeneratedTitle = any; -export type restoreSessionMetadata = any; diff --git a/src/cli/src/utils/sessionTitle.ts b/src/cli/src/utils/sessionTitle.ts deleted file mode 100644 index 3675a2811..000000000 --- a/src/cli/src/utils/sessionTitle.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type generateSessionTitle = any; diff --git a/src/cli/src/utils/sessionUrl.ts b/src/cli/src/utils/sessionUrl.ts deleted file mode 100644 index a416c74b9..000000000 --- a/src/cli/src/utils/sessionUrl.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type parseSessionIdentifier = any; diff --git a/src/cli/src/utils/sideQuestion.ts b/src/cli/src/utils/sideQuestion.ts deleted file mode 100644 index 1282d133e..000000000 --- a/src/cli/src/utils/sideQuestion.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type runSideQuestion = any; diff --git a/src/cli/src/utils/streamJsonStdoutGuard.ts b/src/cli/src/utils/streamJsonStdoutGuard.ts deleted file mode 100644 index 05236b55e..000000000 --- a/src/cli/src/utils/streamJsonStdoutGuard.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type installStreamJsonStdoutGuard = any; diff --git a/src/cli/src/utils/streamlinedTransform.ts b/src/cli/src/utils/streamlinedTransform.ts deleted file mode 100644 index 439c126e0..000000000 --- a/src/cli/src/utils/streamlinedTransform.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type createStreamlinedTransformer = any; diff --git a/src/cli/src/utils/thinking.ts b/src/cli/src/utils/thinking.ts deleted file mode 100644 index 451decd5e..000000000 --- a/src/cli/src/utils/thinking.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ThinkingConfig = any; -export type modelSupportsAdaptiveThinking = any; diff --git a/src/cli/src/utils/toolPool.ts b/src/cli/src/utils/toolPool.ts deleted file mode 100644 index 66c7603a6..000000000 --- a/src/cli/src/utils/toolPool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type mergeAndFilterTools = any; diff --git a/src/cli/src/utils/workloadContext.ts b/src/cli/src/utils/workloadContext.ts deleted file mode 100644 index c80322f82..000000000 --- a/src/cli/src/utils/workloadContext.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type runWithWorkload = any; -export type WORKLOAD_CRON = any; diff --git a/src/cli/transports/src/entrypoints/sdk/controlTypes.ts b/src/cli/transports/src/entrypoints/sdk/controlTypes.ts deleted file mode 100644 index 513ee706d..000000000 --- a/src/cli/transports/src/entrypoints/sdk/controlTypes.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type StdoutMessage = any; -export type SDKPartialAssistantMessage = any; diff --git a/src/commands/fork/index.ts b/src/commands/fork/index.ts deleted file mode 100644 index 29ae6094c..000000000 --- a/src/commands/fork/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -const _default: Record = {}; -export default _default; diff --git a/src/commands/ide/src/services/analytics/index.ts b/src/commands/ide/src/services/analytics/index.ts deleted file mode 100644 index 60402f927..000000000 --- a/src/commands/ide/src/services/analytics/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; diff --git a/src/commands/install-github-app/src/services/analytics/index.ts b/src/commands/install-github-app/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/commands/install-github-app/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/commands/install-github-app/src/utils/config.ts b/src/commands/install-github-app/src/utils/config.ts deleted file mode 100644 index 507e64a40..000000000 --- a/src/commands/install-github-app/src/utils/config.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type saveGlobalConfig = any; diff --git a/src/commands/peers/index.ts b/src/commands/peers/index.ts deleted file mode 100644 index 29ae6094c..000000000 --- a/src/commands/peers/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -const _default: Record = {}; -export default _default; diff --git a/src/commands/plugin/src/services/analytics/index.ts b/src/commands/plugin/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/commands/plugin/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/commands/reset-limits/index.ts b/src/commands/reset-limits/index.ts deleted file mode 100644 index 1b034263a..000000000 --- a/src/commands/reset-limits/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated stub — replace with real implementation -const stub = { isEnabled: () => false, isHidden: true, name: 'stub' }; -export const resetLimits = stub; -export const resetLimitsNonInteractive = stub; diff --git a/src/commands/src/commands.ts b/src/commands/src/commands.ts deleted file mode 100644 index 8552dd207..000000000 --- a/src/commands/src/commands.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type CommandResultDisplay = any; diff --git a/src/commands/src/services/analytics/index.ts b/src/commands/src/services/analytics/index.ts deleted file mode 100644 index 60402f927..000000000 --- a/src/commands/src/services/analytics/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; diff --git a/src/commands/terminalSetup/src/utils/theme.ts b/src/commands/terminalSetup/src/utils/theme.ts deleted file mode 100644 index 62c7ea83c..000000000 --- a/src/commands/terminalSetup/src/utils/theme.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ThemeName = any; diff --git a/src/commands/workflows/index.ts b/src/commands/workflows/index.ts deleted file mode 100644 index 29ae6094c..000000000 --- a/src/commands/workflows/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -const _default: Record = {}; -export default _default; diff --git a/src/components/FeedbackSurvey/src/hooks/useDynamicConfig.ts b/src/components/FeedbackSurvey/src/hooks/useDynamicConfig.ts deleted file mode 100644 index 5657e8465..000000000 --- a/src/components/FeedbackSurvey/src/hooks/useDynamicConfig.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useDynamicConfig = any; diff --git a/src/components/FeedbackSurvey/src/services/analytics/config.ts b/src/components/FeedbackSurvey/src/services/analytics/config.ts deleted file mode 100644 index 5ce8a06db..000000000 --- a/src/components/FeedbackSurvey/src/services/analytics/config.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isFeedbackSurveyDisabled = any; diff --git a/src/components/FeedbackSurvey/src/services/analytics/index.ts b/src/components/FeedbackSurvey/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/components/FeedbackSurvey/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/components/FeedbackSurvey/useFrustrationDetection.ts b/src/components/FeedbackSurvey/useFrustrationDetection.ts deleted file mode 100644 index b2f028a34..000000000 --- a/src/components/FeedbackSurvey/useFrustrationDetection.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Auto-generated stub — replace with real implementation -export function useFrustrationDetection( - _messages: unknown[], - _isLoading: boolean, - _hasActivePrompt: boolean, - _otherSurveyOpen: boolean, -): { state: 'closed' | 'open'; handleTranscriptSelect: () => void } { - return { state: 'closed', handleTranscriptSelect: () => {} }; -} diff --git a/src/components/HelpV2/src/hooks/useExitOnCtrlCDWithKeybindings.ts b/src/components/HelpV2/src/hooks/useExitOnCtrlCDWithKeybindings.ts deleted file mode 100644 index 38810d68c..000000000 --- a/src/components/HelpV2/src/hooks/useExitOnCtrlCDWithKeybindings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useExitOnCtrlCDWithKeybindings = any; diff --git a/src/components/HelpV2/src/keybindings/useShortcutDisplay.ts b/src/components/HelpV2/src/keybindings/useShortcutDisplay.ts deleted file mode 100644 index 351fb3f9e..000000000 --- a/src/components/HelpV2/src/keybindings/useShortcutDisplay.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useShortcutDisplay = any; diff --git a/src/components/LogoV2/src/services/api/dumpPrompts.ts b/src/components/LogoV2/src/services/api/dumpPrompts.ts deleted file mode 100644 index bba0c3d9a..000000000 --- a/src/components/LogoV2/src/services/api/dumpPrompts.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getDumpPromptsPath = any; diff --git a/src/components/LogoV2/src/utils/config.ts b/src/components/LogoV2/src/utils/config.ts deleted file mode 100644 index 7cf15deca..000000000 --- a/src/components/LogoV2/src/utils/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getGlobalConfig = any; -export type saveGlobalConfig = any; diff --git a/src/components/LogoV2/src/utils/sandbox/sandbox-adapter.ts b/src/components/LogoV2/src/utils/sandbox/sandbox-adapter.ts deleted file mode 100644 index edebe2640..000000000 --- a/src/components/LogoV2/src/utils/sandbox/sandbox-adapter.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SandboxManager = any; diff --git a/src/components/LogoV2/src/utils/settings/settings.ts b/src/components/LogoV2/src/utils/settings/settings.ts deleted file mode 100644 index 7765101ae..000000000 --- a/src/components/LogoV2/src/utils/settings/settings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getInitialSettings = any; diff --git a/src/components/LogoV2/src/utils/startupProfiler.ts b/src/components/LogoV2/src/utils/startupProfiler.ts deleted file mode 100644 index 16c5c6e4a..000000000 --- a/src/components/LogoV2/src/utils/startupProfiler.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getStartupPerfLogPath = any; -export type isDetailedProfilingEnabled = any; diff --git a/src/components/LogoV2/src/utils/systemTheme.ts b/src/components/LogoV2/src/utils/systemTheme.ts deleted file mode 100644 index c69869078..000000000 --- a/src/components/LogoV2/src/utils/systemTheme.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type resolveThemeSetting = any; diff --git a/src/components/PromptInput/src/context/notifications.ts b/src/components/PromptInput/src/context/notifications.ts deleted file mode 100644 index 8db063f70..000000000 --- a/src/components/PromptInput/src/context/notifications.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type Notification = any; -export type useNotifications = any; diff --git a/src/components/PromptInput/src/hooks/useArrowKeyHistory.ts b/src/components/PromptInput/src/hooks/useArrowKeyHistory.ts deleted file mode 100644 index 943c7404f..000000000 --- a/src/components/PromptInput/src/hooks/useArrowKeyHistory.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HistoryMode = any; diff --git a/src/components/PromptInput/src/hooks/useCommandQueue.ts b/src/components/PromptInput/src/hooks/useCommandQueue.ts deleted file mode 100644 index ef6e2c885..000000000 --- a/src/components/PromptInput/src/hooks/useCommandQueue.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useCommandQueue = any; diff --git a/src/components/PromptInput/src/hooks/useIdeAtMentioned.ts b/src/components/PromptInput/src/hooks/useIdeAtMentioned.ts deleted file mode 100644 index c0d005f12..000000000 --- a/src/components/PromptInput/src/hooks/useIdeAtMentioned.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type IDEAtMentioned = any; -export type useIdeAtMentioned = any; diff --git a/src/components/PromptInput/src/services/analytics/index.ts b/src/components/PromptInput/src/services/analytics/index.ts deleted file mode 100644 index ce0a9a827..000000000 --- a/src/components/PromptInput/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; diff --git a/src/components/PromptInput/src/state/AppState.ts b/src/components/PromptInput/src/state/AppState.ts deleted file mode 100644 index 46a69cf69..000000000 --- a/src/components/PromptInput/src/state/AppState.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAppState = any; -export type useAppStateStore = any; -export type AppState = any; -export type useSetAppState = any; diff --git a/src/components/PromptInput/src/state/AppStateStore.ts b/src/components/PromptInput/src/state/AppStateStore.ts deleted file mode 100644 index f27111408..000000000 --- a/src/components/PromptInput/src/state/AppStateStore.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FooterItem = any; diff --git a/src/components/PromptInput/src/tools/AgentTool/agentColorManager.ts b/src/components/PromptInput/src/tools/AgentTool/agentColorManager.ts deleted file mode 100644 index e2c6f578c..000000000 --- a/src/components/PromptInput/src/tools/AgentTool/agentColorManager.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AGENT_COLOR_TO_THEME_COLOR = any; -export type AGENT_COLORS = any; -export type AgentColorName = any; diff --git a/src/components/PromptInput/src/utils/config.ts b/src/components/PromptInput/src/utils/config.ts deleted file mode 100644 index 7e541740c..000000000 --- a/src/components/PromptInput/src/utils/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getGlobalConfig = any; -export type PastedContent = any; diff --git a/src/components/PromptInput/src/utils/cwd.ts b/src/components/PromptInput/src/utils/cwd.ts deleted file mode 100644 index 76c192ed8..000000000 --- a/src/components/PromptInput/src/utils/cwd.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getCwd = any; diff --git a/src/components/PromptInput/src/utils/exampleCommands.ts b/src/components/PromptInput/src/utils/exampleCommands.ts deleted file mode 100644 index c6ce8c5e9..000000000 --- a/src/components/PromptInput/src/utils/exampleCommands.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getExampleCommandFromCache = any; diff --git a/src/components/PromptInput/src/utils/platform.ts b/src/components/PromptInput/src/utils/platform.ts deleted file mode 100644 index b6686f812..000000000 --- a/src/components/PromptInput/src/utils/platform.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getPlatform = any; diff --git a/src/components/PromptInput/src/utils/teammate.ts b/src/components/PromptInput/src/utils/teammate.ts deleted file mode 100644 index fb30f2184..000000000 --- a/src/components/PromptInput/src/utils/teammate.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getTeammateColor = any; diff --git a/src/components/PromptInput/src/utils/theme.ts b/src/components/PromptInput/src/utils/theme.ts deleted file mode 100644 index c6999a678..000000000 --- a/src/components/PromptInput/src/utils/theme.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type Theme = any; diff --git a/src/components/Settings/src/commands/extra-usage/index.ts b/src/components/Settings/src/commands/extra-usage/index.ts deleted file mode 100644 index 981d9a598..000000000 --- a/src/components/Settings/src/commands/extra-usage/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type extraUsage = any; diff --git a/src/components/Settings/src/constants/outputStyles.ts b/src/components/Settings/src/constants/outputStyles.ts deleted file mode 100644 index 42c1edbfa..000000000 --- a/src/components/Settings/src/constants/outputStyles.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type DEFAULT_OUTPUT_STYLE_NAME = any; diff --git a/src/components/Settings/src/cost-tracker.ts b/src/components/Settings/src/cost-tracker.ts deleted file mode 100644 index 135cea9b7..000000000 --- a/src/components/Settings/src/cost-tracker.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type formatCost = any; diff --git a/src/components/Settings/src/services/analytics/index.ts b/src/components/Settings/src/services/analytics/index.ts deleted file mode 100644 index ce0a9a827..000000000 --- a/src/components/Settings/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; diff --git a/src/components/Settings/src/utils/auth.ts b/src/components/Settings/src/utils/auth.ts deleted file mode 100644 index d7b41ce38..000000000 --- a/src/components/Settings/src/utils/auth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getSubscriptionType = any; diff --git a/src/components/StructuredDiff/src/utils/theme.ts b/src/components/StructuredDiff/src/utils/theme.ts deleted file mode 100644 index 62c7ea83c..000000000 --- a/src/components/StructuredDiff/src/utils/theme.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ThemeName = any; diff --git a/src/components/TrustDialog/src/services/analytics/index.ts b/src/components/TrustDialog/src/services/analytics/index.ts deleted file mode 100644 index 60402f927..000000000 --- a/src/components/TrustDialog/src/services/analytics/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; diff --git a/src/components/TrustDialog/src/utils/permissions/PermissionRule.ts b/src/components/TrustDialog/src/utils/permissions/PermissionRule.ts deleted file mode 100644 index 349593ae4..000000000 --- a/src/components/TrustDialog/src/utils/permissions/PermissionRule.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PermissionRule = any; diff --git a/src/components/TrustDialog/src/utils/settings/settings.ts b/src/components/TrustDialog/src/utils/settings/settings.ts deleted file mode 100644 index 76099c0ec..000000000 --- a/src/components/TrustDialog/src/utils/settings/settings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getSettingsForSource = any; diff --git a/src/components/agents/SnapshotUpdateDialog.ts b/src/components/agents/SnapshotUpdateDialog.ts deleted file mode 100644 index a23511b4d..000000000 --- a/src/components/agents/SnapshotUpdateDialog.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type React from 'react'; -import type { AgentMemoryScope } from '@claude-code-best/builtin-tools/tools/AgentTool/agentMemory.js'; - -export {}; -export const SnapshotUpdateDialog: React.FC<{ - agentType: string; - scope: AgentMemoryScope; - snapshotTimestamp: string; - onComplete: (choice: 'merge' | 'keep' | 'replace') => void; - onCancel: () => void; -}> = (() => null); -export const buildMergePrompt: (agentType: string, scope: AgentMemoryScope) => string = (() => ''); diff --git a/src/components/agents/new-agent-creation/wizard-steps/src/services/analytics/index.ts b/src/components/agents/new-agent-creation/wizard-steps/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/components/agents/new-agent-creation/wizard-steps/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/components/agents/new-agent-creation/wizard-steps/src/state/AppState.ts b/src/components/agents/new-agent-creation/wizard-steps/src/state/AppState.ts deleted file mode 100644 index 93788b82c..000000000 --- a/src/components/agents/new-agent-creation/wizard-steps/src/state/AppState.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useSetAppState = any; diff --git a/src/components/agents/src/context.ts b/src/components/agents/src/context.ts deleted file mode 100644 index 3ce849ca0..000000000 --- a/src/components/agents/src/context.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getUserContext = any; diff --git a/src/components/agents/src/services/api/claude.ts b/src/components/agents/src/services/api/claude.ts deleted file mode 100644 index b02c1424c..000000000 --- a/src/components/agents/src/services/api/claude.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type queryModelWithoutStreaming = any; diff --git a/src/components/agents/src/services/mcp/utils.ts b/src/components/agents/src/services/mcp/utils.ts deleted file mode 100644 index 3bd1bb388..000000000 --- a/src/components/agents/src/services/mcp/utils.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isMcpTool = any; diff --git a/src/components/agents/src/state/AppState.ts b/src/components/agents/src/state/AppState.ts deleted file mode 100644 index 93788b82c..000000000 --- a/src/components/agents/src/state/AppState.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useSetAppState = any; diff --git a/src/components/agents/src/tools/AgentTool/agentToolUtils.ts b/src/components/agents/src/tools/AgentTool/agentToolUtils.ts deleted file mode 100644 index 1a95f5b3f..000000000 --- a/src/components/agents/src/tools/AgentTool/agentToolUtils.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type filterToolsForAgent = any; diff --git a/src/components/agents/src/tools/BashTool/BashTool.ts b/src/components/agents/src/tools/BashTool/BashTool.ts deleted file mode 100644 index 7a3ea3cc5..000000000 --- a/src/components/agents/src/tools/BashTool/BashTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type BashTool = any; diff --git a/src/components/agents/src/tools/FileReadTool/FileReadTool.ts b/src/components/agents/src/tools/FileReadTool/FileReadTool.ts deleted file mode 100644 index b9ca41b17..000000000 --- a/src/components/agents/src/tools/FileReadTool/FileReadTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FileReadTool = any; diff --git a/src/components/agents/src/tools/GlobTool/GlobTool.ts b/src/components/agents/src/tools/GlobTool/GlobTool.ts deleted file mode 100644 index a411d3dd7..000000000 --- a/src/components/agents/src/tools/GlobTool/GlobTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type GlobTool = any; diff --git a/src/components/agents/src/tools/GrepTool/GrepTool.ts b/src/components/agents/src/tools/GrepTool/GrepTool.ts deleted file mode 100644 index 0ed073688..000000000 --- a/src/components/agents/src/tools/GrepTool/GrepTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type GrepTool = any; diff --git a/src/components/agents/src/tools/ListMcpResourcesTool/ListMcpResourcesTool.ts b/src/components/agents/src/tools/ListMcpResourcesTool/ListMcpResourcesTool.ts deleted file mode 100644 index 17b103d50..000000000 --- a/src/components/agents/src/tools/ListMcpResourcesTool/ListMcpResourcesTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ListMcpResourcesTool = any; diff --git a/src/components/agents/src/tools/NotebookEditTool/NotebookEditTool.ts b/src/components/agents/src/tools/NotebookEditTool/NotebookEditTool.ts deleted file mode 100644 index 9ebe8c2b0..000000000 --- a/src/components/agents/src/tools/NotebookEditTool/NotebookEditTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type NotebookEditTool = any; diff --git a/src/components/agents/src/tools/ReadMcpResourceTool/ReadMcpResourceTool.ts b/src/components/agents/src/tools/ReadMcpResourceTool/ReadMcpResourceTool.ts deleted file mode 100644 index bee0f9bdd..000000000 --- a/src/components/agents/src/tools/ReadMcpResourceTool/ReadMcpResourceTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ReadMcpResourceTool = any; diff --git a/src/components/agents/src/tools/TaskOutputTool/TaskOutputTool.ts b/src/components/agents/src/tools/TaskOutputTool/TaskOutputTool.ts deleted file mode 100644 index f77e9dbfb..000000000 --- a/src/components/agents/src/tools/TaskOutputTool/TaskOutputTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type TaskOutputTool = any; diff --git a/src/components/agents/src/tools/TaskStopTool/TaskStopTool.ts b/src/components/agents/src/tools/TaskStopTool/TaskStopTool.ts deleted file mode 100644 index 0a069d4d0..000000000 --- a/src/components/agents/src/tools/TaskStopTool/TaskStopTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type TaskStopTool = any; diff --git a/src/components/agents/src/tools/TodoWriteTool/TodoWriteTool.ts b/src/components/agents/src/tools/TodoWriteTool/TodoWriteTool.ts deleted file mode 100644 index ce5e439e1..000000000 --- a/src/components/agents/src/tools/TodoWriteTool/TodoWriteTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type TodoWriteTool = any; diff --git a/src/components/agents/src/tools/TungstenTool/TungstenTool.ts b/src/components/agents/src/tools/TungstenTool/TungstenTool.ts deleted file mode 100644 index e86bbfbe8..000000000 --- a/src/components/agents/src/tools/TungstenTool/TungstenTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type TungstenTool = any; diff --git a/src/components/agents/src/tools/WebFetchTool/WebFetchTool.ts b/src/components/agents/src/tools/WebFetchTool/WebFetchTool.ts deleted file mode 100644 index 97d4995f7..000000000 --- a/src/components/agents/src/tools/WebFetchTool/WebFetchTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type WebFetchTool = any; diff --git a/src/components/agents/src/tools/WebSearchTool/WebSearchTool.ts b/src/components/agents/src/tools/WebSearchTool/WebSearchTool.ts deleted file mode 100644 index 606345335..000000000 --- a/src/components/agents/src/tools/WebSearchTool/WebSearchTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type WebSearchTool = any; diff --git a/src/components/agents/src/utils/settings/managedPath.ts b/src/components/agents/src/utils/settings/managedPath.ts deleted file mode 100644 index 1214f262c..000000000 --- a/src/components/agents/src/utils/settings/managedPath.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getManagedFilePath = any; diff --git a/src/components/design-system/Divider.tsx b/src/components/design-system/Divider.tsx deleted file mode 100644 index a5b7f0e88..000000000 --- a/src/components/design-system/Divider.tsx +++ /dev/null @@ -1 +0,0 @@ -export { Divider } from '@anthropic/ink' diff --git a/src/components/design-system/FuzzyPicker.tsx b/src/components/design-system/FuzzyPicker.tsx deleted file mode 100644 index c034335e9..000000000 --- a/src/components/design-system/FuzzyPicker.tsx +++ /dev/null @@ -1 +0,0 @@ -export { FuzzyPicker } from '@anthropic/ink' diff --git a/src/components/design-system/LoadingState.tsx b/src/components/design-system/LoadingState.tsx deleted file mode 100644 index 71dbdaa40..000000000 --- a/src/components/design-system/LoadingState.tsx +++ /dev/null @@ -1 +0,0 @@ -export { LoadingState } from '@anthropic/ink' diff --git a/src/components/design-system/Pane.tsx b/src/components/design-system/Pane.tsx deleted file mode 100644 index 12eb3ed55..000000000 --- a/src/components/design-system/Pane.tsx +++ /dev/null @@ -1 +0,0 @@ -export { Pane } from '@anthropic/ink' diff --git a/src/components/design-system/ProgressBar.tsx b/src/components/design-system/ProgressBar.tsx deleted file mode 100644 index 6aacc6129..000000000 --- a/src/components/design-system/ProgressBar.tsx +++ /dev/null @@ -1 +0,0 @@ -export { ProgressBar } from '@anthropic/ink' diff --git a/src/components/design-system/Ratchet.tsx b/src/components/design-system/Ratchet.tsx deleted file mode 100644 index 5aaab3289..000000000 --- a/src/components/design-system/Ratchet.tsx +++ /dev/null @@ -1 +0,0 @@ -export { Ratchet } from '@anthropic/ink' diff --git a/src/components/design-system/StatusIcon.tsx b/src/components/design-system/StatusIcon.tsx deleted file mode 100644 index 962ea1ba6..000000000 --- a/src/components/design-system/StatusIcon.tsx +++ /dev/null @@ -1 +0,0 @@ -export { StatusIcon } from '@anthropic/ink' diff --git a/src/components/design-system/Tabs.tsx b/src/components/design-system/Tabs.tsx deleted file mode 100644 index e11de0a6b..000000000 --- a/src/components/design-system/Tabs.tsx +++ /dev/null @@ -1 +0,0 @@ -export { Tab, Tabs, useTabHeaderFocus, useTabsWidth } from '@anthropic/ink' diff --git a/src/components/design-system/ThemeProvider.tsx b/src/components/design-system/ThemeProvider.tsx deleted file mode 100644 index 9d9bc9f66..000000000 --- a/src/components/design-system/ThemeProvider.tsx +++ /dev/null @@ -1 +0,0 @@ -export { ThemeProvider, usePreviewTheme, useTheme, useThemeSetting } from '@anthropic/ink' diff --git a/src/components/design-system/ThemedBox.tsx b/src/components/design-system/ThemedBox.tsx deleted file mode 100644 index 30059f318..000000000 --- a/src/components/design-system/ThemedBox.tsx +++ /dev/null @@ -1 +0,0 @@ -export { Box as default } from '@anthropic/ink' diff --git a/src/components/design-system/color.ts b/src/components/design-system/color.ts deleted file mode 100644 index 56c8612de..000000000 --- a/src/components/design-system/color.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { type ColorType, colorize, type Color } from '@anthropic/ink' -import { getTheme, type Theme, type ThemeName } from '../../utils/theme.js' - -/** - * Curried theme-aware color function. Resolves theme keys to raw color - * values before delegating to the ink renderer's colorize. - */ -export function color( - c: keyof Theme | Color | undefined, - theme: ThemeName, - type: ColorType = 'foreground', -): (text: string) => string { - return text => { - if (!c) { - return text - } - // Raw color values bypass theme lookup - if ( - c.startsWith('rgb(') || - c.startsWith('#') || - c.startsWith('ansi256(') || - c.startsWith('ansi:') - ) { - return colorize(text, c, type) - } - // Theme key lookup - return colorize(text, getTheme(theme)[c as keyof Theme], type) - } -} diff --git a/src/components/grove/src/services/analytics/index.ts b/src/components/grove/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/components/grove/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/components/hooks/src/entrypoints/agentSdkTypes.ts b/src/components/hooks/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 2ad98a3ad..000000000 --- a/src/components/hooks/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HookEvent = any; diff --git a/src/components/hooks/src/state/AppState.ts b/src/components/hooks/src/state/AppState.ts deleted file mode 100644 index cbb9746b4..000000000 --- a/src/components/hooks/src/state/AppState.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAppState = any; -export type useAppStateStore = any; diff --git a/src/components/hooks/src/utils/hooks/hooksConfigManager.ts b/src/components/hooks/src/utils/hooks/hooksConfigManager.ts deleted file mode 100644 index 33a2e63cc..000000000 --- a/src/components/hooks/src/utils/hooks/hooksConfigManager.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HookEventMetadata = any; diff --git a/src/components/mcp/src/services/analytics/index.ts b/src/components/mcp/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/components/mcp/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/components/mcp/src/services/mcp/config.ts b/src/components/mcp/src/services/mcp/config.ts deleted file mode 100644 index 05cc41c4c..000000000 --- a/src/components/mcp/src/services/mcp/config.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getMcpConfigsByScope = any; diff --git a/src/components/mcp/src/services/mcp/utils.ts b/src/components/mcp/src/services/mcp/utils.ts deleted file mode 100644 index e6cf8a737..000000000 --- a/src/components/mcp/src/services/mcp/utils.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type describeMcpConfigFilePath = any; -export type getScopeLabel = any; diff --git a/src/components/messages/SnipBoundaryMessage.ts b/src/components/messages/SnipBoundaryMessage.ts deleted file mode 100644 index 898e2d09c..000000000 --- a/src/components/messages/SnipBoundaryMessage.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const SnipBoundaryMessage: (props: Record) => null = () => null; diff --git a/src/components/messages/UserCrossSessionMessage.ts b/src/components/messages/UserCrossSessionMessage.ts deleted file mode 100644 index 5b86d7802..000000000 --- a/src/components/messages/UserCrossSessionMessage.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const UserCrossSessionMessage: (props: Record) => null = () => null; diff --git a/src/components/messages/UserForkBoilerplateMessage.ts b/src/components/messages/UserForkBoilerplateMessage.ts deleted file mode 100644 index 8d79de68f..000000000 --- a/src/components/messages/UserForkBoilerplateMessage.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const UserForkBoilerplateMessage: (props: Record) => null = () => null; diff --git a/src/components/messages/UserGitHubWebhookMessage.ts b/src/components/messages/UserGitHubWebhookMessage.ts deleted file mode 100644 index 6ed1e016f..000000000 --- a/src/components/messages/UserGitHubWebhookMessage.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const UserGitHubWebhookMessage: (props: Record) => null = () => null; diff --git a/src/components/messages/UserToolResultMessage/src/components/InterruptedByUser.ts b/src/components/messages/UserToolResultMessage/src/components/InterruptedByUser.ts deleted file mode 100644 index b98ac191d..000000000 --- a/src/components/messages/UserToolResultMessage/src/components/InterruptedByUser.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type InterruptedByUser = any; diff --git a/src/components/messages/UserToolResultMessage/src/components/Markdown.ts b/src/components/messages/UserToolResultMessage/src/components/Markdown.ts deleted file mode 100644 index 44bbabff4..000000000 --- a/src/components/messages/UserToolResultMessage/src/components/Markdown.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type Markdown = any; diff --git a/src/components/messages/UserToolResultMessage/src/components/MessageResponse.ts b/src/components/messages/UserToolResultMessage/src/components/MessageResponse.ts deleted file mode 100644 index cc1c024e1..000000000 --- a/src/components/messages/UserToolResultMessage/src/components/MessageResponse.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type MessageResponse = any; diff --git a/src/components/messages/UserToolResultMessage/src/components/SentryErrorBoundary.ts b/src/components/messages/UserToolResultMessage/src/components/SentryErrorBoundary.ts deleted file mode 100644 index 6c2e95bfc..000000000 --- a/src/components/messages/UserToolResultMessage/src/components/SentryErrorBoundary.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SentryErrorBoundary = any; diff --git a/src/components/messages/src/commands/extra-usage/index.ts b/src/components/messages/src/commands/extra-usage/index.ts deleted file mode 100644 index 981d9a598..000000000 --- a/src/components/messages/src/commands/extra-usage/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type extraUsage = any; diff --git a/src/components/messages/src/entrypoints/agentSdkTypes.ts b/src/components/messages/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 2ad98a3ad..000000000 --- a/src/components/messages/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HookEvent = any; diff --git a/src/components/messages/src/hooks/useTerminalSize.ts b/src/components/messages/src/hooks/useTerminalSize.ts deleted file mode 100644 index 4a0ef3ea3..000000000 --- a/src/components/messages/src/hooks/useTerminalSize.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useTerminalSize = any; diff --git a/src/components/messages/src/services/api/errorUtils.ts b/src/components/messages/src/services/api/errorUtils.ts deleted file mode 100644 index b931a01ac..000000000 --- a/src/components/messages/src/services/api/errorUtils.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type formatAPIError = any; diff --git a/src/components/messages/src/services/claudeAiLimitsHook.ts b/src/components/messages/src/services/claudeAiLimitsHook.ts deleted file mode 100644 index 617852958..000000000 --- a/src/components/messages/src/services/claudeAiLimitsHook.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useClaudeAiLimits = any; diff --git a/src/components/messages/src/services/compact/compact.ts b/src/components/messages/src/services/compact/compact.ts deleted file mode 100644 index 628b299f4..000000000 --- a/src/components/messages/src/services/compact/compact.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ERROR_MESSAGE_USER_ABORT = any; diff --git a/src/components/messages/src/services/rateLimitMessages.ts b/src/components/messages/src/services/rateLimitMessages.ts deleted file mode 100644 index 3bad4ecc1..000000000 --- a/src/components/messages/src/services/rateLimitMessages.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isRateLimitErrorMessage = any; diff --git a/src/components/messages/src/services/rateLimitMocking.ts b/src/components/messages/src/services/rateLimitMocking.ts deleted file mode 100644 index dcb1004a0..000000000 --- a/src/components/messages/src/services/rateLimitMocking.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type shouldProcessMockLimits = any; diff --git a/src/components/messages/src/utils/auth.ts b/src/components/messages/src/utils/auth.ts deleted file mode 100644 index 4a25a2f83..000000000 --- a/src/components/messages/src/utils/auth.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getRateLimitTier = any; -export type getSubscriptionType = any; -export type isClaudeAISubscriber = any; diff --git a/src/components/messages/src/utils/billing.ts b/src/components/messages/src/utils/billing.ts deleted file mode 100644 index fd3cae2d7..000000000 --- a/src/components/messages/src/utils/billing.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type hasClaudeAiBillingAccess = any; diff --git a/src/components/messages/src/utils/theme.ts b/src/components/messages/src/utils/theme.ts deleted file mode 100644 index 6c2dc45a6..000000000 --- a/src/components/messages/src/utils/theme.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ThemeName = any; -export type Theme = any; diff --git a/src/components/permissions/ExitPlanModePermissionRequest/src/context/notifications.ts b/src/components/permissions/ExitPlanModePermissionRequest/src/context/notifications.ts deleted file mode 100644 index 82956e65a..000000000 --- a/src/components/permissions/ExitPlanModePermissionRequest/src/context/notifications.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useNotifications = any; diff --git a/src/components/permissions/ExitPlanModePermissionRequest/src/services/analytics/index.ts b/src/components/permissions/ExitPlanModePermissionRequest/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/components/permissions/ExitPlanModePermissionRequest/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/components/permissions/ExitPlanModePermissionRequest/src/state/AppState.ts b/src/components/permissions/ExitPlanModePermissionRequest/src/state/AppState.ts deleted file mode 100644 index f1e2aa661..000000000 --- a/src/components/permissions/ExitPlanModePermissionRequest/src/state/AppState.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAppState = any; -export type useAppStateStore = any; -export type useSetAppState = any; diff --git a/src/components/permissions/FileEditPermissionRequest/src/components/FileEditToolDiff.ts b/src/components/permissions/FileEditPermissionRequest/src/components/FileEditToolDiff.ts deleted file mode 100644 index d6d114f60..000000000 --- a/src/components/permissions/FileEditPermissionRequest/src/components/FileEditToolDiff.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FileEditToolDiff = any; diff --git a/src/components/permissions/MonitorPermissionRequest/MonitorPermissionRequest.ts b/src/components/permissions/MonitorPermissionRequest/MonitorPermissionRequest.ts deleted file mode 100644 index ea96e4e48..000000000 --- a/src/components/permissions/MonitorPermissionRequest/MonitorPermissionRequest.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const MonitorPermissionRequest: (props: Record) => null = () => null; diff --git a/src/components/permissions/ReviewArtifactPermissionRequest/ReviewArtifactPermissionRequest.ts b/src/components/permissions/ReviewArtifactPermissionRequest/ReviewArtifactPermissionRequest.ts deleted file mode 100644 index a812ebe9d..000000000 --- a/src/components/permissions/ReviewArtifactPermissionRequest/ReviewArtifactPermissionRequest.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const ReviewArtifactPermissionRequest: (props: Record) => null = () => null; diff --git a/src/components/permissions/SedEditPermissionRequest/src/components/FileEditToolDiff.ts b/src/components/permissions/SedEditPermissionRequest/src/components/FileEditToolDiff.ts deleted file mode 100644 index d6d114f60..000000000 --- a/src/components/permissions/SedEditPermissionRequest/src/components/FileEditToolDiff.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FileEditToolDiff = any; diff --git a/src/components/permissions/SedEditPermissionRequest/src/utils/cwd.ts b/src/components/permissions/SedEditPermissionRequest/src/utils/cwd.ts deleted file mode 100644 index 76c192ed8..000000000 --- a/src/components/permissions/SedEditPermissionRequest/src/utils/cwd.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getCwd = any; diff --git a/src/components/permissions/SedEditPermissionRequest/src/utils/fileRead.ts b/src/components/permissions/SedEditPermissionRequest/src/utils/fileRead.ts deleted file mode 100644 index 69d200068..000000000 --- a/src/components/permissions/SedEditPermissionRequest/src/utils/fileRead.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type detectEncodingForResolvedPath = any; diff --git a/src/components/permissions/SedEditPermissionRequest/src/utils/fsOperations.ts b/src/components/permissions/SedEditPermissionRequest/src/utils/fsOperations.ts deleted file mode 100644 index d30ccea0a..000000000 --- a/src/components/permissions/SedEditPermissionRequest/src/utils/fsOperations.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getFsImplementation = any; diff --git a/src/components/permissions/SkillPermissionRequest/src/utils/log.ts b/src/components/permissions/SkillPermissionRequest/src/utils/log.ts deleted file mode 100644 index cf30e90da..000000000 --- a/src/components/permissions/SkillPermissionRequest/src/utils/log.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logError = any; diff --git a/src/components/permissions/rules/src/state/AppState.ts b/src/components/permissions/rules/src/state/AppState.ts deleted file mode 100644 index cc3978f9a..000000000 --- a/src/components/permissions/rules/src/state/AppState.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAppState = any; -export type useSetAppState = any; diff --git a/src/components/permissions/rules/src/utils/permissions/PermissionUpdate.ts b/src/components/permissions/rules/src/utils/permissions/PermissionUpdate.ts deleted file mode 100644 index 9d49451cb..000000000 --- a/src/components/permissions/rules/src/utils/permissions/PermissionUpdate.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type applyPermissionUpdate = any; -export type persistPermissionUpdate = any; diff --git a/src/components/permissions/rules/src/utils/permissions/PermissionUpdateSchema.ts b/src/components/permissions/rules/src/utils/permissions/PermissionUpdateSchema.ts deleted file mode 100644 index 7f663cb14..000000000 --- a/src/components/permissions/rules/src/utils/permissions/PermissionUpdateSchema.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PermissionUpdateDestination = any; diff --git a/src/components/permissions/src/services/analytics/index.ts b/src/components/permissions/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/components/permissions/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/components/permissions/src/services/analytics/metadata.ts b/src/components/permissions/src/services/analytics/metadata.ts deleted file mode 100644 index 807602756..000000000 --- a/src/components/permissions/src/services/analytics/metadata.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type sanitizeToolNameForAnalytics = any; diff --git a/src/components/permissions/src/tools/BashTool/BashTool.ts b/src/components/permissions/src/tools/BashTool/BashTool.ts deleted file mode 100644 index 7a3ea3cc5..000000000 --- a/src/components/permissions/src/tools/BashTool/BashTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type BashTool = any; diff --git a/src/components/permissions/src/tools/EnterPlanModeTool/EnterPlanModeTool.ts b/src/components/permissions/src/tools/EnterPlanModeTool/EnterPlanModeTool.ts deleted file mode 100644 index c4d43e44a..000000000 --- a/src/components/permissions/src/tools/EnterPlanModeTool/EnterPlanModeTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type EnterPlanModeTool = any; diff --git a/src/components/permissions/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts b/src/components/permissions/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts deleted file mode 100644 index f9708d2b3..000000000 --- a/src/components/permissions/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ExitPlanModeV2Tool = any; diff --git a/src/components/permissions/src/utils/bash/commands.ts b/src/components/permissions/src/utils/bash/commands.ts deleted file mode 100644 index 8886e5cc6..000000000 --- a/src/components/permissions/src/utils/bash/commands.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type splitCommand_DEPRECATED = any; diff --git a/src/components/permissions/src/utils/permissions/PermissionResult.ts b/src/components/permissions/src/utils/permissions/PermissionResult.ts deleted file mode 100644 index 7958ed68e..000000000 --- a/src/components/permissions/src/utils/permissions/PermissionResult.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PermissionDecisionReason = any; -export type PermissionResult = any; diff --git a/src/components/permissions/src/utils/permissions/PermissionUpdate.ts b/src/components/permissions/src/utils/permissions/PermissionUpdate.ts deleted file mode 100644 index 5779475d9..000000000 --- a/src/components/permissions/src/utils/permissions/PermissionUpdate.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type extractRules = any; -export type hasRules = any; diff --git a/src/components/permissions/src/utils/sandbox/sandbox-adapter.ts b/src/components/permissions/src/utils/sandbox/sandbox-adapter.ts deleted file mode 100644 index 5dd1d93d7..000000000 --- a/src/components/permissions/src/utils/sandbox/sandbox-adapter.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type NetworkHostPattern = any; -export type shouldAllowManagedSandboxDomainsOnly = any; -export type SandboxManager = any; diff --git a/src/components/src/commands.ts b/src/components/src/commands.ts deleted file mode 100644 index 8552dd207..000000000 --- a/src/components/src/commands.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type CommandResultDisplay = any; diff --git a/src/components/src/components/shell/OutputLine.ts b/src/components/src/components/shell/OutputLine.ts deleted file mode 100644 index 9c5093c9a..000000000 --- a/src/components/src/components/shell/OutputLine.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type stripUnderlineAnsi = any; diff --git a/src/components/src/hooks/useExitOnCtrlCDWithKeybindings.ts b/src/components/src/hooks/useExitOnCtrlCDWithKeybindings.ts deleted file mode 100644 index 38810d68c..000000000 --- a/src/components/src/hooks/useExitOnCtrlCDWithKeybindings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useExitOnCtrlCDWithKeybindings = any; diff --git a/src/components/src/hooks/useTerminalSize.ts b/src/components/src/hooks/useTerminalSize.ts deleted file mode 100644 index 4a0ef3ea3..000000000 --- a/src/components/src/hooks/useTerminalSize.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useTerminalSize = any; diff --git a/src/components/src/services/analytics/firstPartyEventLogger.ts b/src/components/src/services/analytics/firstPartyEventLogger.ts deleted file mode 100644 index 3387d83a1..000000000 --- a/src/components/src/services/analytics/firstPartyEventLogger.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEventTo1P = any; diff --git a/src/components/src/services/analytics/index.ts b/src/components/src/services/analytics/index.ts deleted file mode 100644 index ce0a9a827..000000000 --- a/src/components/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; diff --git a/src/components/src/state/AppState.ts b/src/components/src/state/AppState.ts deleted file mode 100644 index cc3978f9a..000000000 --- a/src/components/src/state/AppState.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAppState = any; -export type useSetAppState = any; diff --git a/src/components/src/tools/FileWriteTool/FileWriteTool.ts b/src/components/src/tools/FileWriteTool/FileWriteTool.ts deleted file mode 100644 index 50716571f..000000000 --- a/src/components/src/tools/FileWriteTool/FileWriteTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type Output = any; diff --git a/src/components/src/utils/background/remote/preconditions.ts b/src/components/src/utils/background/remote/preconditions.ts deleted file mode 100644 index 4c7df781f..000000000 --- a/src/components/src/utils/background/remote/preconditions.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type checkIsGitClean = any; -export type checkNeedsClaudeAiLogin = any; diff --git a/src/components/src/utils/conversationRecovery.ts b/src/components/src/utils/conversationRecovery.ts deleted file mode 100644 index ecd18bdac..000000000 --- a/src/components/src/utils/conversationRecovery.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type TeleportRemoteResponse = any; diff --git a/src/components/src/utils/cwd.ts b/src/components/src/utils/cwd.ts deleted file mode 100644 index 76c192ed8..000000000 --- a/src/components/src/utils/cwd.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getCwd = any; diff --git a/src/components/src/utils/envDynamic.ts b/src/components/src/utils/envDynamic.ts deleted file mode 100644 index f97791718..000000000 --- a/src/components/src/utils/envDynamic.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type envDynamic = any; diff --git a/src/components/src/utils/fastMode.ts b/src/components/src/utils/fastMode.ts deleted file mode 100644 index cf4c9c15a..000000000 --- a/src/components/src/utils/fastMode.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FAST_MODE_MODEL_DISPLAY = any; -export type isFastModeAvailable = any; -export type isFastModeCooldown = any; -export type isFastModeEnabled = any; diff --git a/src/components/src/utils/fileHistory.ts b/src/components/src/utils/fileHistory.ts deleted file mode 100644 index d3a0a3eb9..000000000 --- a/src/components/src/utils/fileHistory.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type DiffStats = any; -export type fileHistoryCanRestore = any; -export type fileHistoryEnabled = any; -export type fileHistoryGetDiffStats = any; diff --git a/src/components/src/utils/gracefulShutdown.ts b/src/components/src/utils/gracefulShutdown.ts deleted file mode 100644 index 6b72be424..000000000 --- a/src/components/src/utils/gracefulShutdown.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type gracefulShutdown = any; -export type gracefulShutdownSync = any; diff --git a/src/components/src/utils/log.ts b/src/components/src/utils/log.ts deleted file mode 100644 index cf30e90da..000000000 --- a/src/components/src/utils/log.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logError = any; diff --git a/src/components/src/utils/permissions/PermissionMode.ts b/src/components/src/utils/permissions/PermissionMode.ts deleted file mode 100644 index 1bc6199f9..000000000 --- a/src/components/src/utils/permissions/PermissionMode.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PermissionMode = any; diff --git a/src/components/src/utils/platform.ts b/src/components/src/utils/platform.ts deleted file mode 100644 index b6686f812..000000000 --- a/src/components/src/utils/platform.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getPlatform = any; diff --git a/src/components/src/utils/process.ts b/src/components/src/utils/process.ts deleted file mode 100644 index 4fde4749b..000000000 --- a/src/components/src/utils/process.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type writeToStdout = any; diff --git a/src/components/src/utils/sandbox/sandbox-ui-utils.ts b/src/components/src/utils/sandbox/sandbox-ui-utils.ts deleted file mode 100644 index f514e53a9..000000000 --- a/src/components/src/utils/sandbox/sandbox-ui-utils.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type removeSandboxViolationTags = any; diff --git a/src/components/src/utils/theme.ts b/src/components/src/utils/theme.ts deleted file mode 100644 index c6999a678..000000000 --- a/src/components/src/utils/theme.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type Theme = any; diff --git a/src/components/tasks/MonitorMcpDetailDialog.ts b/src/components/tasks/MonitorMcpDetailDialog.ts deleted file mode 100644 index fca5d572b..000000000 --- a/src/components/tasks/MonitorMcpDetailDialog.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const MonitorMcpDetailDialog: (props: Record) => null = () => null; diff --git a/src/components/tasks/WorkflowDetailDialog.ts b/src/components/tasks/WorkflowDetailDialog.ts deleted file mode 100644 index 34509d08e..000000000 --- a/src/components/tasks/WorkflowDetailDialog.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const WorkflowDetailDialog: (props: Record) => null = () => null; diff --git a/src/components/tasks/src/Task.ts b/src/components/tasks/src/Task.ts deleted file mode 100644 index cd6d817c8..000000000 --- a/src/components/tasks/src/Task.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type TaskStatus = any; diff --git a/src/components/tasks/src/coordinator/coordinatorMode.ts b/src/components/tasks/src/coordinator/coordinatorMode.ts deleted file mode 100644 index 1879d10cd..000000000 --- a/src/components/tasks/src/coordinator/coordinatorMode.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isCoordinatorMode = any; diff --git a/src/components/tasks/src/entrypoints/agentSdkTypes.ts b/src/components/tasks/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index d4bdb4fb4..000000000 --- a/src/components/tasks/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SDKMessage = any; diff --git a/src/components/tasks/src/hooks/useTerminalSize.ts b/src/components/tasks/src/hooks/useTerminalSize.ts deleted file mode 100644 index 4a0ef3ea3..000000000 --- a/src/components/tasks/src/hooks/useTerminalSize.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useTerminalSize = any; diff --git a/src/components/tasks/src/ink/stringWidth.ts b/src/components/tasks/src/ink/stringWidth.ts deleted file mode 100644 index aa33710c8..000000000 --- a/src/components/tasks/src/ink/stringWidth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type stringWidth = any; diff --git a/src/components/tasks/src/state/AppState.ts b/src/components/tasks/src/state/AppState.ts deleted file mode 100644 index cc3978f9a..000000000 --- a/src/components/tasks/src/state/AppState.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAppState = any; -export type useSetAppState = any; diff --git a/src/components/tasks/src/state/teammateViewHelpers.ts b/src/components/tasks/src/state/teammateViewHelpers.ts deleted file mode 100644 index 197123737..000000000 --- a/src/components/tasks/src/state/teammateViewHelpers.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type enterTeammateView = any; -export type exitTeammateView = any; diff --git a/src/components/tasks/src/tasks/DreamTask/DreamTask.ts b/src/components/tasks/src/tasks/DreamTask/DreamTask.ts deleted file mode 100644 index 1bb986a93..000000000 --- a/src/components/tasks/src/tasks/DreamTask/DreamTask.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Type re-exports for DreamTask — bridges the component tree to the task registry. -// The real implementation lives in src/tasks/DreamTask/DreamTask.ts. -// Note: Currently unused — BackgroundTasksDialog.tsx imports directly from -// src/tasks/DreamTask/DreamTask.js. Kept for decompilation completeness. - -export type { DreamTaskState, DreamPhase, DreamTurn } from '../../../../../tasks/DreamTask/DreamTask.js' -export { isDreamTask, registerDreamTask, addDreamTurn, completeDreamTask, failDreamTask, DreamTask } from '../../../../../tasks/DreamTask/DreamTask.js' diff --git a/src/components/tasks/src/tasks/InProcessTeammateTask/InProcessTeammateTask.ts b/src/components/tasks/src/tasks/InProcessTeammateTask/InProcessTeammateTask.ts deleted file mode 100644 index 58a3fc93d..000000000 --- a/src/components/tasks/src/tasks/InProcessTeammateTask/InProcessTeammateTask.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type InProcessTeammateTask = any; diff --git a/src/components/tasks/src/tasks/LocalAgentTask/LocalAgentTask.ts b/src/components/tasks/src/tasks/LocalAgentTask/LocalAgentTask.ts deleted file mode 100644 index ecfe9aad9..000000000 --- a/src/components/tasks/src/tasks/LocalAgentTask/LocalAgentTask.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isPanelAgentTask = any; -export type LocalAgentTaskState = any; -export type LocalAgentTask = any; diff --git a/src/components/tasks/src/tasks/LocalShellTask/LocalShellTask.ts b/src/components/tasks/src/tasks/LocalShellTask/LocalShellTask.ts deleted file mode 100644 index 169ad065d..000000000 --- a/src/components/tasks/src/tasks/LocalShellTask/LocalShellTask.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type LocalShellTask = any; diff --git a/src/components/tasks/src/tasks/LocalShellTask/guards.ts b/src/components/tasks/src/tasks/LocalShellTask/guards.ts deleted file mode 100644 index baf4fdb8f..000000000 --- a/src/components/tasks/src/tasks/LocalShellTask/guards.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type LocalShellTaskState = any; diff --git a/src/components/tasks/src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts b/src/components/tasks/src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts deleted file mode 100644 index 655d5da82..000000000 --- a/src/components/tasks/src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; diff --git a/src/components/tasks/src/tasks/MonitorMcpTask/MonitorMcpTask.ts b/src/components/tasks/src/tasks/MonitorMcpTask/MonitorMcpTask.ts deleted file mode 100644 index e7f7d4e85..000000000 --- a/src/components/tasks/src/tasks/MonitorMcpTask/MonitorMcpTask.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type MonitorMcpTaskState = any; diff --git a/src/components/tasks/src/tasks/RemoteAgentTask/RemoteAgentTask.ts b/src/components/tasks/src/tasks/RemoteAgentTask/RemoteAgentTask.ts deleted file mode 100644 index 5c1366343..000000000 --- a/src/components/tasks/src/tasks/RemoteAgentTask/RemoteAgentTask.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type RemoteAgentTaskState = any; -export type RemoteAgentTask = any; diff --git a/src/components/tasks/src/tasks/pillLabel.ts b/src/components/tasks/src/tasks/pillLabel.ts deleted file mode 100644 index e72c9424e..000000000 --- a/src/components/tasks/src/tasks/pillLabel.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getPillLabel = any; -export type pillNeedsCta = any; diff --git a/src/components/tasks/src/types/utils.ts b/src/components/tasks/src/types/utils.ts deleted file mode 100644 index 655d5da82..000000000 --- a/src/components/tasks/src/types/utils.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; diff --git a/src/components/tasks/src/utils/collapseReadSearch.ts b/src/components/tasks/src/utils/collapseReadSearch.ts deleted file mode 100644 index 137b5d428..000000000 --- a/src/components/tasks/src/utils/collapseReadSearch.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type summarizeRecentActivities = any; diff --git a/src/constants/src/commands.ts b/src/constants/src/commands.ts deleted file mode 100644 index e358f0755..000000000 --- a/src/constants/src/commands.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getSkillToolCommands = any; diff --git a/src/constants/src/tools/AgentTool/built-in/exploreAgent.ts b/src/constants/src/tools/AgentTool/built-in/exploreAgent.ts deleted file mode 100644 index 7ec141a4e..000000000 --- a/src/constants/src/tools/AgentTool/built-in/exploreAgent.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type EXPLORE_AGENT = any; -export type EXPLORE_AGENT_MIN_QUERIES = any; diff --git a/src/constants/src/tools/AgentTool/builtInAgents.ts b/src/constants/src/tools/AgentTool/builtInAgents.ts deleted file mode 100644 index 8358c0b6b..000000000 --- a/src/constants/src/tools/AgentTool/builtInAgents.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type areExplorePlanAgentsEnabled = any; diff --git a/src/constants/src/tools/GlobTool/prompt.ts b/src/constants/src/tools/GlobTool/prompt.ts deleted file mode 100644 index 060caf29c..000000000 --- a/src/constants/src/tools/GlobTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type GLOB_TOOL_NAME = any; diff --git a/src/constants/src/tools/GrepTool/prompt.ts b/src/constants/src/tools/GrepTool/prompt.ts deleted file mode 100644 index 08b8a8d29..000000000 --- a/src/constants/src/tools/GrepTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type GREP_TOOL_NAME = any; diff --git a/src/context/src/state/AppState.ts b/src/context/src/state/AppState.ts deleted file mode 100644 index 5237ca451..000000000 --- a/src/context/src/state/AppState.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAppStateStore = any; -export type useSetAppState = any; diff --git a/src/coordinator/workerAgent.ts b/src/coordinator/workerAgent.ts deleted file mode 100644 index 94e31b842..000000000 --- a/src/coordinator/workerAgent.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -import type { AgentDefinition } from '@claude-code-best/builtin-tools/tools/AgentTool/loadAgentsDir.js'; -export const getCoordinatorAgents: () => AgentDefinition[] = () => []; diff --git a/src/entrypoints/sdk/controlTypes.js b/src/entrypoints/sdk/controlTypes.js deleted file mode 100644 index 6d5ce13c7..000000000 --- a/src/entrypoints/sdk/controlTypes.js +++ /dev/null @@ -1,8 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type StdoutMessage = any; -export type SDKControlInitializeRequest = any; -export type SDKControlInitializeResponse = any; -export type SDKControlMcpSetServersResponse = any; -export type SDKControlReloadPluginsResponse = any; -export type StdinMessage = any; -export type SDKPartialAssistantMessage = any; diff --git a/src/entrypoints/sdk/runtimeTypes.js b/src/entrypoints/sdk/runtimeTypes.js deleted file mode 100644 index 9ce95c99b..000000000 --- a/src/entrypoints/sdk/runtimeTypes.js +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type EffortLevel = 'low' | 'medium' | 'high' | 'max'; diff --git a/src/entrypoints/src/state/AppStateStore.ts b/src/entrypoints/src/state/AppStateStore.ts deleted file mode 100644 index 1d4f082ab..000000000 --- a/src/entrypoints/src/state/AppStateStore.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getDefaultAppState = any; diff --git a/src/environment-runner/main.ts b/src/environment-runner/main.ts deleted file mode 100644 index d38434218..000000000 --- a/src/environment-runner/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const environmentRunnerMain: (args: string[]) => Promise = () => Promise.resolve(); diff --git a/src/hooks/fileSuggestions.ts b/src/hooks/fileSuggestions.ts deleted file mode 100644 index 10522e877..000000000 --- a/src/hooks/fileSuggestions.ts +++ /dev/null @@ -1,812 +0,0 @@ -import { statSync } from 'fs' -import ignore from 'ignore' -import * as path from 'path' -import { - CLAUDE_CONFIG_DIRECTORIES, - loadMarkdownFilesForSubdir, -} from 'src/utils/markdownConfigLoader.js' -import type { SuggestionItem } from '../components/PromptInput/PromptInputFooterSuggestions.js' -import { - CHUNK_MS, - FileIndex, - yieldToEventLoop, -} from '../native-ts/file-index/index.js' -import { logEvent } from '../services/analytics/index.js' -import type { FileSuggestionCommandInput } from '../types/fileSuggestion.js' -import { getGlobalConfig } from '../utils/config.js' -import { getCwd } from '../utils/cwd.js' -import { logForDebugging } from '../utils/debug.js' -import { errorMessage } from '../utils/errors.js' -import { execFileNoThrowWithCwd } from '../utils/execFileNoThrow.js' -import { getFsImplementation } from '../utils/fsOperations.js' -import { findGitRoot, gitExe } from '../utils/git.js' -import { - createBaseHookInput, - executeFileSuggestionCommand, -} from '../utils/hooks.js' -import { logError } from '../utils/log.js' -import { expandPath } from '../utils/path.js' -import { ripGrep } from '../utils/ripgrep.js' -import { getInitialSettings } from '../utils/settings/settings.js' -import { createSignal } from '../utils/signal.js' - -// Lazily constructed singleton -let fileIndex: FileIndex | null = null - -function getFileIndex(): FileIndex { - if (!fileIndex) { - fileIndex = new FileIndex() - } - return fileIndex -} - -let fileListRefreshPromise: Promise | null = null -// Signal fired when an in-progress index build completes. Lets the -// typeahead UI re-run its last search so partial results upgrade to full. -const indexBuildComplete = createSignal() -export const onIndexBuildComplete = indexBuildComplete.subscribe -let cacheGeneration = 0 - -// Background fetch for untracked files -let untrackedFetchPromise: Promise | null = null - -// Store tracked files so we can rebuild index with untracked -let cachedTrackedFiles: string[] = [] -// Store config files so mergeUntrackedIntoNormalizedCache preserves them -let cachedConfigFiles: string[] = [] -// Store tracked directories so mergeUntrackedIntoNormalizedCache doesn't -// recompute ~270k path.dirname() calls on each merge -let cachedTrackedDirs: string[] = [] - -// Cache for .ignore/.rgignore patterns (keyed by repoRoot:cwd) -let ignorePatternsCache: ReturnType | null = null -let ignorePatternsCacheKey: string | null = null - -// Throttle state for background refresh. .git/index mtime triggers an -// immediate refresh when tracked files change (add/checkout/commit/rm). -// The time floor still refreshes every 5s to pick up untracked files, -// which don't bump the index. -let lastRefreshMs = 0 -let lastGitIndexMtime: number | null = null - -// Signatures of the path lists loaded into the Rust index. Two separate -// signatures because the two loadFromFileList call sites use differently -// structured arrays — a shared signature would ping-pong and never match. -// Skips nucleo.restart() when git ls-files returns an unchanged list -// (e.g. `git add` of an already-tracked file bumps index mtime but not the list). -let loadedTrackedSignature: string | null = null -let loadedMergedSignature: string | null = null - -/** - * Clear all file suggestion caches. - * Call this when resuming a session to ensure fresh file discovery. - */ -export function clearFileSuggestionCaches(): void { - fileIndex = null - fileListRefreshPromise = null - cacheGeneration++ - untrackedFetchPromise = null - cachedTrackedFiles = [] - cachedConfigFiles = [] - cachedTrackedDirs = [] - indexBuildComplete.clear() - ignorePatternsCache = null - ignorePatternsCacheKey = null - lastRefreshMs = 0 - lastGitIndexMtime = null - loadedTrackedSignature = null - loadedMergedSignature = null -} - -/** - * Content hash of a path list. A length|first|last sample misses renames of - * middle files (same length, same endpoints → stale entry stuck in nucleo). - * - * Samples every Nth path (plus length). On a 346k-path list this hashes ~700 - * paths instead of 14MB — enough to catch git operations (checkout, rebase, - * add/rm) while running in <1ms. A single mid-list rename that happens to - * fall between samples will miss the rebuild, but the 5s refresh floor picks - * it up on the next cycle. - */ -export function pathListSignature(paths: string[]): string { - const n = paths.length - const stride = Math.max(1, Math.floor(n / 500)) - let h = 0x811c9dc5 | 0 - for (let i = 0; i < n; i += stride) { - const p = paths[i]! - for (let j = 0; j < p.length; j++) { - h = ((h ^ p.charCodeAt(j)) * 0x01000193) | 0 - } - h = (h * 0x01000193) | 0 - } - // Stride starts at 0 (first path always hashed); explicitly include last - // so single-file add/rm at the tail is caught - if (n > 0) { - const last = paths[n - 1]! - for (let j = 0; j < last.length; j++) { - h = ((h ^ last.charCodeAt(j)) * 0x01000193) | 0 - } - } - return `${n}:${(h >>> 0).toString(16)}` -} - -/** - * Stat .git/index to detect git state changes without spawning git ls-files. - * Returns null for worktrees (.git is a file → ENOTDIR), fresh repos with no - * index yet (ENOENT), and non-git dirs — caller falls back to time throttle. - */ -function getGitIndexMtime(): number | null { - const repoRoot = findGitRoot(getCwd()) - if (!repoRoot) return null - try { - // eslint-disable-next-line custom-rules/no-sync-fs -- mtimeMs is the operation here, not a pre-check. findGitRoot above already stat-walks synchronously; one more stat is marginal vs spawning git ls-files on every keystroke. Async would force startBackgroundCacheRefresh to become async, breaking the synchronous fileListRefreshPromise contract at the cold-start await site. - return statSync(path.join(repoRoot, '.git', 'index')).mtimeMs - } catch { - return null - } -} - -/** - * Normalize git paths relative to originalCwd - */ -function normalizeGitPaths( - files: string[], - repoRoot: string, - originalCwd: string, -): string[] { - if (originalCwd === repoRoot) { - return files - } - return files.map(f => { - const absolutePath = path.join(repoRoot, f) - return path.relative(originalCwd, absolutePath) - }) -} - -/** - * Merge already-normalized untracked files into the cache - */ -async function mergeUntrackedIntoNormalizedCache( - normalizedUntracked: string[], -): Promise { - if (normalizedUntracked.length === 0) return - if (!fileIndex || cachedTrackedFiles.length === 0) return - - const untrackedDirs = await getDirectoryNamesAsync(normalizedUntracked) - const allPaths = [ - ...cachedTrackedFiles, - ...cachedConfigFiles, - ...cachedTrackedDirs, - ...normalizedUntracked, - ...untrackedDirs, - ] - const sig = pathListSignature(allPaths) - if (sig === loadedMergedSignature) { - logForDebugging( - `[FileIndex] skipped index rebuild — merged paths unchanged`, - ) - return - } - await fileIndex.loadFromFileListAsync(allPaths).done - loadedMergedSignature = sig - logForDebugging( - `[FileIndex] rebuilt index with ${cachedTrackedFiles.length} tracked + ${normalizedUntracked.length} untracked files`, - ) -} - -/** - * Load ripgrep-specific ignore patterns from .ignore or .rgignore files - * Returns an ignore instance if patterns were found, null otherwise - * Results are cached per repoRoot:cwd combination - */ -async function loadRipgrepIgnorePatterns( - repoRoot: string, - cwd: string, -): Promise | null> { - const cacheKey = `${repoRoot}:${cwd}` - - // Return cached result if available - if (ignorePatternsCacheKey === cacheKey) { - return ignorePatternsCache - } - - const fs = getFsImplementation() - const ignoreFiles = ['.ignore', '.rgignore'] - const directories = [...new Set([repoRoot, cwd])] - - const ig = ignore() - let hasPatterns = false - - const paths = directories.flatMap(dir => - ignoreFiles.map(f => path.join(dir, f)), - ) - const contents = await Promise.all( - paths.map(p => fs.readFile(p, { encoding: 'utf8' }).catch(() => null)), - ) - for (const [i, content] of contents.entries()) { - if (content === null) continue - ig.add(content) - hasPatterns = true - logForDebugging(`[FileIndex] loaded ignore patterns from ${paths[i]}`) - } - - const result = hasPatterns ? ig : null - ignorePatternsCache = result - ignorePatternsCacheKey = cacheKey - - return result -} - -/** - * Get files using git ls-files (much faster than ripgrep for git repos) - * Returns tracked files immediately, fetches untracked in background - * @param respectGitignore If true, excludes gitignored files from untracked results - * - * Note: Unlike ripgrep --follow, git ls-files doesn't follow symlinks. - * This is intentional as git tracks symlinks as symlinks. - */ -async function getFilesUsingGit( - abortSignal: AbortSignal, - respectGitignore: boolean, -): Promise { - const startTime = Date.now() - logForDebugging(`[FileIndex] getFilesUsingGit called`) - - // Check if we're in a git repo. findGitRoot is LRU-memoized per path. - const cwd = getCwd() - const repoRoot = findGitRoot(cwd) - if (!repoRoot) { - logForDebugging(`[FileIndex] not a git repo, returning null`) - return null - } - - try { - // Get tracked files (fast - reads from git index) - // Run from repoRoot so paths are relative to repo root, not CWD - const lsFilesStart = Date.now() - const trackedResult = await execFileNoThrowWithCwd( - gitExe(), - ['-c', 'core.quotepath=false', 'ls-files', '--recurse-submodules'], - { timeout: 5000, abortSignal, cwd: repoRoot }, - ) - logForDebugging( - `[FileIndex] git ls-files (tracked) took ${Date.now() - lsFilesStart}ms`, - ) - - if (trackedResult.code !== 0) { - logForDebugging( - `[FileIndex] git ls-files failed (code=${trackedResult.code}, stderr=${trackedResult.stderr}), falling back to ripgrep`, - ) - return null - } - - const trackedFiles = trackedResult.stdout.trim().split('\n').filter(Boolean) - - // Normalize paths relative to the current working directory - let normalizedTracked = normalizeGitPaths(trackedFiles, repoRoot, cwd) - - // Apply .ignore/.rgignore patterns if present (faster than falling back to ripgrep) - const ignorePatterns = await loadRipgrepIgnorePatterns(repoRoot, cwd) - if (ignorePatterns) { - const beforeCount = normalizedTracked.length - normalizedTracked = ignorePatterns.filter(normalizedTracked) - logForDebugging( - `[FileIndex] applied ignore patterns: ${beforeCount} -> ${normalizedTracked.length} files`, - ) - } - - // Cache tracked files for later merge with untracked - cachedTrackedFiles = normalizedTracked - - const duration = Date.now() - startTime - logForDebugging( - `[FileIndex] git ls-files: ${normalizedTracked.length} tracked files in ${duration}ms`, - ) - - logEvent('tengu_file_suggestions_git_ls_files', { - file_count: normalizedTracked.length, - tracked_count: normalizedTracked.length, - untracked_count: 0, - duration_ms: duration, - }) - - // Start background fetch for untracked files (don't await) - if (!untrackedFetchPromise) { - const untrackedArgs = respectGitignore - ? [ - '-c', - 'core.quotepath=false', - 'ls-files', - '--others', - '--exclude-standard', - ] - : ['-c', 'core.quotepath=false', 'ls-files', '--others'] - - const generation = cacheGeneration - untrackedFetchPromise = execFileNoThrowWithCwd(gitExe(), untrackedArgs, { - timeout: 10000, - cwd: repoRoot, - }) - .then(async untrackedResult => { - if (generation !== cacheGeneration) { - return // Cache was cleared; don't merge stale untracked files - } - if (untrackedResult.code === 0) { - const rawUntrackedFiles = untrackedResult.stdout - .trim() - .split('\n') - .filter(Boolean) - - // Normalize paths BEFORE applying ignore patterns (consistent with tracked files) - let normalizedUntracked = normalizeGitPaths( - rawUntrackedFiles, - repoRoot, - cwd, - ) - - // Apply .ignore/.rgignore patterns to normalized untracked files - const ignorePatterns = await loadRipgrepIgnorePatterns( - repoRoot, - cwd, - ) - if (ignorePatterns && normalizedUntracked.length > 0) { - const beforeCount = normalizedUntracked.length - normalizedUntracked = ignorePatterns.filter(normalizedUntracked) - logForDebugging( - `[FileIndex] applied ignore patterns to untracked: ${beforeCount} -> ${normalizedUntracked.length} files`, - ) - } - - logForDebugging( - `[FileIndex] background untracked fetch: ${normalizedUntracked.length} files`, - ) - // Pass already-normalized files directly to merge function - void mergeUntrackedIntoNormalizedCache(normalizedUntracked) - } - }) - .catch(error => { - logForDebugging( - `[FileIndex] background untracked fetch failed: ${error}`, - ) - }) - .finally(() => { - untrackedFetchPromise = null - }) - } - - return normalizedTracked - } catch (error) { - logForDebugging(`[FileIndex] git ls-files error: ${errorMessage(error)}`) - return null - } -} - -/** - * This function collects all parent directories for each file path - * and returns a list of unique directory names with a trailing separator. - * For example, if the input is ['src/index.js', 'src/utils/helpers.js'], - * the output will be ['src/', 'src/utils/']. - * @param files An array of file paths - * @returns An array of unique directory names with a trailing separator - */ -export function getDirectoryNames(files: string[]): string[] { - const directoryNames = new Set() - collectDirectoryNames(files, 0, files.length, directoryNames) - return [...directoryNames].map(d => d + path.sep) -} - -/** - * Async variant: yields every ~10k files so 270k+ file lists don't block - * the main thread for >10ms at a time. - */ -export async function getDirectoryNamesAsync( - files: string[], -): Promise { - const directoryNames = new Set() - // Time-based chunking: yield after CHUNK_MS of work so slow machines get - // smaller chunks and stay responsive. - let chunkStart = performance.now() - for (let i = 0; i < files.length; i++) { - collectDirectoryNames(files, i, i + 1, directoryNames) - if ((i & 0xff) === 0xff && performance.now() - chunkStart > CHUNK_MS) { - await yieldToEventLoop() - chunkStart = performance.now() - } - } - return [...directoryNames].map(d => d + path.sep) -} - -function collectDirectoryNames( - files: string[], - start: number, - end: number, - out: Set, -): void { - for (let i = start; i < end; i++) { - let currentDir = path.dirname(files[i]!) - // Early exit if we've already processed this directory and all its parents. - // Root detection: path.dirname returns its input at the root (fixed point), - // so we stop when dirname stops changing. Checking this before add() keeps - // the root out of the result set (matching the old path.parse().root guard). - // This avoids path.parse() which allocates a 5-field object per file. - while (currentDir !== '.' && !out.has(currentDir)) { - const parent = path.dirname(currentDir) - if (parent === currentDir) break - out.add(currentDir) - currentDir = parent - } - } -} - -/** - * Gets additional files from Claude config directories - */ -async function getClaudeConfigFiles(cwd: string): Promise { - const markdownFileArrays = await Promise.all( - CLAUDE_CONFIG_DIRECTORIES.map(subdir => - loadMarkdownFilesForSubdir(subdir, cwd), - ), - ) - return markdownFileArrays.flatMap(markdownFiles => - markdownFiles.map(f => f.filePath), - ) -} - -/** - * Gets project files using git ls-files (fast) or ripgrep (fallback) - */ -async function getProjectFiles( - abortSignal: AbortSignal, - respectGitignore: boolean, -): Promise { - logForDebugging( - `[FileIndex] getProjectFiles called, respectGitignore=${respectGitignore}`, - ) - - // Try git ls-files first (much faster for git repos) - const gitFiles = await getFilesUsingGit(abortSignal, respectGitignore) - if (gitFiles !== null) { - logForDebugging( - `[FileIndex] using git ls-files result (${gitFiles.length} files)`, - ) - return gitFiles - } - - // Fall back to ripgrep - logForDebugging( - `[FileIndex] git ls-files returned null, falling back to ripgrep`, - ) - const startTime = Date.now() - const rgArgs = [ - '--files', - '--follow', - '--hidden', - '--glob', - '!.git/', - '--glob', - '!.svn/', - '--glob', - '!.hg/', - '--glob', - '!.bzr/', - '--glob', - '!.jj/', - '--glob', - '!.sl/', - ] - if (!respectGitignore) { - rgArgs.push('--no-ignore-vcs') - } - - const files = await ripGrep(rgArgs, '.', abortSignal) - const relativePaths = files.map(f => path.relative(getCwd(), f)) - - const duration = Date.now() - startTime - logForDebugging( - `[FileIndex] ripgrep: ${relativePaths.length} files in ${duration}ms`, - ) - - logEvent('tengu_file_suggestions_ripgrep', { - file_count: relativePaths.length, - duration_ms: duration, - }) - - return relativePaths -} - -/** - * Gets both files and their directory paths for providing path suggestions - * Uses git ls-files for git repos (fast) or ripgrep as fallback - * Returns a FileIndex populated for fast fuzzy search - */ -export async function getPathsForSuggestions(): Promise { - const signal = AbortSignal.timeout(10_000) - const index = getFileIndex() - - try { - // Check project settings first, then fall back to global config - const projectSettings = getInitialSettings() - const globalConfig = getGlobalConfig() - const respectGitignore = - projectSettings.respectGitignore ?? globalConfig.respectGitignore ?? true - - const cwd = getCwd() - const [projectFiles, configFiles] = await Promise.all([ - getProjectFiles(signal, respectGitignore), - getClaudeConfigFiles(cwd), - ]) - - // Cache for mergeUntrackedIntoNormalizedCache - cachedConfigFiles = configFiles - - const allFiles = [...projectFiles, ...configFiles] - const directories = await getDirectoryNamesAsync(allFiles) - cachedTrackedDirs = directories - const allPathsList = [...directories, ...allFiles] - - // Skip rebuild when the list is unchanged. This is the common case - // during a typing session — git ls-files returns the same output. - const sig = pathListSignature(allPathsList) - if (sig !== loadedTrackedSignature) { - // Await the full build so cold-start returns complete results. The - // build yields every ~4ms so the UI stays responsive — user can keep - // typing during the ~120ms wait without input lag. - await index.loadFromFileListAsync(allPathsList).done - loadedTrackedSignature = sig - // We just replaced the merged index with tracked-only data. Force - // the next untracked merge to rebuild even if its own sig matches. - loadedMergedSignature = null - } else { - logForDebugging( - `[FileIndex] skipped index rebuild — tracked paths unchanged`, - ) - } - } catch (error) { - logError(error) - } - - return index -} - -/** - * Finds the common prefix between two strings - */ -function findCommonPrefix(a: string, b: string): string { - const minLength = Math.min(a.length, b.length) - let i = 0 - while (i < minLength && a[i] === b[i]) { - i++ - } - return a.substring(0, i) -} - -/** - * Finds the longest common prefix among an array of suggestion items - */ -export function findLongestCommonPrefix(suggestions: SuggestionItem[]): string { - if (suggestions.length === 0) return '' - - const strings = suggestions.map(item => item.displayText) - let prefix = strings[0]! - for (let i = 1; i < strings.length; i++) { - const currentString = strings[i]! - prefix = findCommonPrefix(prefix, currentString) - if (prefix === '') return '' - } - return prefix -} - -/** - * Creates a file suggestion item - */ -function createFileSuggestionItem( - filePath: string, - score?: number, -): SuggestionItem { - return { - id: `file-${filePath}`, - displayText: filePath, - metadata: score !== undefined ? { score } : undefined, - } -} - -/** - * Find matching files and folders for a given query using the TS file index - */ -const MAX_SUGGESTIONS = 15 -function findMatchingFiles( - fileIndex: FileIndex, - partialPath: string, -): SuggestionItem[] { - const results = fileIndex.search(partialPath, MAX_SUGGESTIONS) - return results.map(result => - createFileSuggestionItem(result.path, result.score), - ) -} - -/** - * Starts a background refresh of the file index cache if not already in progress. - * - * Throttled: when a cache already exists, we skip the refresh unless git state - * has actually changed. This prevents every keystroke from spawning git ls-files - * and rebuilding the nucleo index. - */ -const REFRESH_THROTTLE_MS = 5_000 -export function startBackgroundCacheRefresh(): void { - if (fileListRefreshPromise) { - return - } - - // Throttle only when a cache exists — cold start must always populate. - // Refresh immediately when .git/index mtime changed (tracked files). - // Otherwise refresh at most once per 5s — this floor picks up new UNTRACKED - // files, which don't bump .git/index. The signature checks downstream skip - // the rebuild when the 5s refresh finds nothing actually changed. - const indexMtime = getGitIndexMtime() - if (fileIndex) { - const gitStateChanged = - indexMtime !== null && indexMtime !== lastGitIndexMtime - if (!gitStateChanged && Date.now() - lastRefreshMs < REFRESH_THROTTLE_MS) { - return - } - } - - const generation = cacheGeneration - const refreshStart = Date.now() - // Ensure the FileIndex singleton exists — it's progressively queryable - // via readyCount while the build runs. Callers searching early get partial - // results; indexBuildComplete fires after .done so they can re-search. - getFileIndex() - fileListRefreshPromise = getPathsForSuggestions() - .then(result => { - if (generation !== cacheGeneration) { - return result // Cache was cleared; don't overwrite with stale data - } - fileListRefreshPromise = null - indexBuildComplete.emit() - // Commit the start-time mtime observation on success. If git state - // changed mid-refresh, the next call will see the newer mtime and - // correctly refresh again. - lastGitIndexMtime = indexMtime - lastRefreshMs = Date.now() - logForDebugging( - `[FileIndex] cache refresh completed in ${Date.now() - refreshStart}ms`, - ) - return result - }) - .catch(error => { - logForDebugging( - `[FileIndex] Cache refresh failed: ${errorMessage(error)}`, - ) - logError(error) - if (generation === cacheGeneration) { - fileListRefreshPromise = null // Allow retry on next call - } - return getFileIndex() - }) -} - -/** - * Gets the top-level files and directories in the current working directory - * @returns Array of file/directory paths in the current directory - */ -async function getTopLevelPaths(): Promise { - const fs = getFsImplementation() - const cwd = getCwd() - - try { - const entries = await fs.readdir(cwd) - return entries.map(entry => { - const fullPath = path.join(cwd, entry.name) - const relativePath = path.relative(cwd, fullPath) - // Add trailing separator for directories - return entry.isDirectory() ? relativePath + path.sep : relativePath - }) - } catch (error) { - logError(error as Error) - return [] - } -} - -/** - * Generate file suggestions for the current input and cursor position - * @param partialPath The partial file path to match - * @param showOnEmpty Whether to show suggestions even if partialPath is empty (used for @ symbol) - */ -export async function generateFileSuggestions( - partialPath: string, - showOnEmpty = false, -): Promise { - // If input is empty and we don't want to show suggestions on empty, return nothing - if (!partialPath && !showOnEmpty) { - return [] - } - - // Use custom command directly if configured. We don't mix in our config files - // because the command returns pre-ranked results using its own search logic. - if (getInitialSettings().fileSuggestion?.type === 'command') { - const input: FileSuggestionCommandInput = { - ...createBaseHookInput(), - query: partialPath, - } - const results = await executeFileSuggestionCommand(input) - return results.slice(0, MAX_SUGGESTIONS).map(createFileSuggestionItem) - } - - // If the partial path is empty or just a dot, return current directory suggestions - if (partialPath === '' || partialPath === '.' || partialPath === './') { - const topLevelPaths = await getTopLevelPaths() - startBackgroundCacheRefresh() - return topLevelPaths.slice(0, MAX_SUGGESTIONS).map(createFileSuggestionItem) - } - - const startTime = Date.now() - - try { - // Kick a background refresh. The index is progressively queryable — - // searches during build return partial results from ready chunks, and - // the typeahead callback (setOnIndexBuildComplete) re-fires the search - // when the build finishes to upgrade partial → full. - const wasBuilding = fileListRefreshPromise !== null - startBackgroundCacheRefresh() - - // Handle both './' and '.\' - let normalizedPath = partialPath - const currentDirPrefix = '.' + path.sep - if (partialPath.startsWith(currentDirPrefix)) { - normalizedPath = partialPath.substring(2) - } - - // Handle tilde expansion for home directory - if (normalizedPath.startsWith('~')) { - normalizedPath = expandPath(normalizedPath) - } - - const matches = fileIndex - ? findMatchingFiles(fileIndex, normalizedPath) - : [] - - const duration = Date.now() - startTime - logForDebugging( - `[FileIndex] generateFileSuggestions: ${matches.length} results in ${duration}ms (${wasBuilding ? 'partial' : 'full'} index)`, - ) - logEvent('tengu_file_suggestions_query', { - duration_ms: duration, - cache_hit: !wasBuilding, - result_count: matches.length, - query_length: partialPath.length, - }) - - return matches - } catch (error) { - logError(error) - return [] - } -} - -/** - * Apply a file suggestion to the input - */ -export function applyFileSuggestion( - suggestion: string | SuggestionItem, - input: string, - partialPath: string, - startPos: number, - onInputChange: (value: string) => void, - setCursorOffset: (offset: number) => void, -): void { - // Extract suggestion text from string or SuggestionItem - const suggestionText = - typeof suggestion === 'string' ? suggestion : suggestion.displayText - - // Replace the partial path with the selected file path - const newInput = - input.substring(0, startPos) + - suggestionText + - input.substring(startPos + partialPath.length) - onInputChange(newInput) - - // Move cursor to end of the file path - const newCursorPos = startPos + suggestionText.length - setCursorOffset(newCursorPos) -} diff --git a/src/hooks/notifs/src/context/notifications.ts b/src/hooks/notifs/src/context/notifications.ts deleted file mode 100644 index 95d2759e1..000000000 --- a/src/hooks/notifs/src/context/notifications.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useNotifications = any; -export type Notification = any; diff --git a/src/hooks/notifs/src/services/claudeAiLimits.ts b/src/hooks/notifs/src/services/claudeAiLimits.ts deleted file mode 100644 index 4dceb08d6..000000000 --- a/src/hooks/notifs/src/services/claudeAiLimits.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getRateLimitWarning = any; -export type getUsingOverageText = any; diff --git a/src/hooks/notifs/src/services/claudeAiLimitsHook.ts b/src/hooks/notifs/src/services/claudeAiLimitsHook.ts deleted file mode 100644 index 617852958..000000000 --- a/src/hooks/notifs/src/services/claudeAiLimitsHook.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useClaudeAiLimits = any; diff --git a/src/hooks/notifs/src/services/oauth/getOauthProfile.ts b/src/hooks/notifs/src/services/oauth/getOauthProfile.ts deleted file mode 100644 index 3741d6442..000000000 --- a/src/hooks/notifs/src/services/oauth/getOauthProfile.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOauthProfileFromApiKey = any; diff --git a/src/hooks/notifs/src/state/AppState.ts b/src/hooks/notifs/src/state/AppState.ts deleted file mode 100644 index cc3978f9a..000000000 --- a/src/hooks/notifs/src/state/AppState.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAppState = any; -export type useSetAppState = any; diff --git a/src/hooks/notifs/src/utils/auth.ts b/src/hooks/notifs/src/utils/auth.ts deleted file mode 100644 index c473f1703..000000000 --- a/src/hooks/notifs/src/utils/auth.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getSubscriptionType = any; -export type isClaudeAISubscriber = any; diff --git a/src/hooks/notifs/src/utils/billing.ts b/src/hooks/notifs/src/utils/billing.ts deleted file mode 100644 index fd3cae2d7..000000000 --- a/src/hooks/notifs/src/utils/billing.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type hasClaudeAiBillingAccess = any; diff --git a/src/hooks/notifs/src/utils/bundledMode.ts b/src/hooks/notifs/src/utils/bundledMode.ts deleted file mode 100644 index d2d26c4ec..000000000 --- a/src/hooks/notifs/src/utils/bundledMode.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isInBundledMode = any; diff --git a/src/hooks/notifs/src/utils/config.ts b/src/hooks/notifs/src/utils/config.ts deleted file mode 100644 index a42d3c993..000000000 --- a/src/hooks/notifs/src/utils/config.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getGlobalConfig = any; -export type saveGlobalConfig = any; -export type GlobalConfig = any; diff --git a/src/hooks/notifs/src/utils/doctorDiagnostic.ts b/src/hooks/notifs/src/utils/doctorDiagnostic.ts deleted file mode 100644 index ed3809f04..000000000 --- a/src/hooks/notifs/src/utils/doctorDiagnostic.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getCurrentInstallationType = any; diff --git a/src/hooks/notifs/src/utils/fastMode.ts b/src/hooks/notifs/src/utils/fastMode.ts deleted file mode 100644 index 14189e5bd..000000000 --- a/src/hooks/notifs/src/utils/fastMode.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type CooldownReason = any; -export type isFastModeEnabled = any; -export type onCooldownExpired = any; -export type onCooldownTriggered = any; -export type onFastModeOverageRejection = any; -export type onOrgFastModeChanged = any; diff --git a/src/hooks/notifs/src/utils/ide.ts b/src/hooks/notifs/src/utils/ide.ts deleted file mode 100644 index 3903e6d4a..000000000 --- a/src/hooks/notifs/src/utils/ide.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type detectIDEs = any; -export type IDEExtensionInstallationStatus = any; -export type isJetBrainsIde = any; -export type isSupportedTerminal = any; diff --git a/src/hooks/notifs/src/utils/model/deprecation.ts b/src/hooks/notifs/src/utils/model/deprecation.ts deleted file mode 100644 index 2a5102d0a..000000000 --- a/src/hooks/notifs/src/utils/model/deprecation.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getModelDeprecationWarning = any; diff --git a/src/hooks/notifs/src/utils/nativeInstaller/index.ts b/src/hooks/notifs/src/utils/nativeInstaller/index.ts deleted file mode 100644 index 19088d1b0..000000000 --- a/src/hooks/notifs/src/utils/nativeInstaller/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type checkInstall = any; diff --git a/src/hooks/notifs/useAntOrgWarningNotification.ts b/src/hooks/notifs/useAntOrgWarningNotification.ts deleted file mode 100644 index b178afe8f..000000000 --- a/src/hooks/notifs/useAntOrgWarningNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated stub — replace with real implementation -export function useAntOrgWarningNotification(): void {} diff --git a/src/hooks/notifs/useAutoModeUnavailableNotification.ts b/src/hooks/notifs/useAutoModeUnavailableNotification.ts deleted file mode 100644 index 028a80cad..000000000 --- a/src/hooks/notifs/useAutoModeUnavailableNotification.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { feature } from 'bun:bundle' -import { useEffect, useRef } from 'react' -import { useNotifications } from 'src/context/notifications.js' -import { getIsRemoteMode } from '../../bootstrap/state.js' -import { useAppState } from '../../state/AppState.js' -import type { PermissionMode } from '../../utils/permissions/PermissionMode.js' -import { - getAutoModeUnavailableNotification, - getAutoModeUnavailableReason, -} from '../../utils/permissions/permissionSetup.js' -import { hasAutoModeOptIn } from '../../utils/settings/settings.js' - -/** - * Shows a one-shot notification when the shift-tab carousel wraps past where - * auto mode would have been. Covers all reasons (settings, circuit-breaker, - * org-allowlist). The startup case (defaultMode: auto silently downgraded) is - * handled by verifyAutoModeGateAccess → checkAndDisableAutoModeIfNeeded. - */ -export function useAutoModeUnavailableNotification(): void { - const { addNotification } = useNotifications() - const mode = useAppState(s => s.toolPermissionContext.mode) - const isAutoModeAvailable = useAppState( - s => s.toolPermissionContext.isAutoModeAvailable, - ) - const shownRef = useRef(false) - const prevModeRef = useRef(mode) - - useEffect(() => { - const prevMode = prevModeRef.current - prevModeRef.current = mode - - if (!feature('TRANSCRIPT_CLASSIFIER')) return - if (getIsRemoteMode()) return - if (shownRef.current) return - - const wrappedPastAutoSlot = - mode === 'default' && - prevMode !== 'default' && - prevMode !== 'auto' && - !isAutoModeAvailable && - hasAutoModeOptIn() - - if (!wrappedPastAutoSlot) return - - const reason = getAutoModeUnavailableReason() - if (!reason) return - - shownRef.current = true - addNotification({ - key: 'auto-mode-unavailable', - text: getAutoModeUnavailableNotification(reason), - color: 'warning', - priority: 'medium', - }) - }, [mode, isAutoModeAvailable, addNotification]) -} diff --git a/src/hooks/src/components/PromptInput/PromptInputFooterSuggestions.ts b/src/hooks/src/components/PromptInput/PromptInputFooterSuggestions.ts deleted file mode 100644 index d0fd674c7..000000000 --- a/src/hooks/src/components/PromptInput/PromptInputFooterSuggestions.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SuggestionItem = any; diff --git a/src/hooks/src/components/PromptInput/inputModes.ts b/src/hooks/src/components/PromptInput/inputModes.ts deleted file mode 100644 index 22713bb37..000000000 --- a/src/hooks/src/components/PromptInput/inputModes.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isInputModeCharacter = any; -export type getModeFromInput = any; diff --git a/src/hooks/src/context/notifications.ts b/src/hooks/src/context/notifications.ts deleted file mode 100644 index 82956e65a..000000000 --- a/src/hooks/src/context/notifications.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useNotifications = any; diff --git a/src/hooks/src/hooks/fileSuggestions.ts b/src/hooks/src/hooks/fileSuggestions.ts deleted file mode 100644 index 273e550e1..000000000 --- a/src/hooks/src/hooks/fileSuggestions.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type generateFileSuggestions = any; diff --git a/src/hooks/src/ink/components/TerminalSizeContext.ts b/src/hooks/src/ink/components/TerminalSizeContext.ts deleted file mode 100644 index c0d125b18..000000000 --- a/src/hooks/src/ink/components/TerminalSizeContext.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type TerminalSize = any; -export type TerminalSizeContext = any; diff --git a/src/hooks/src/services/analytics/index.ts b/src/hooks/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/hooks/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/hooks/src/services/analytics/metadata.ts b/src/hooks/src/services/analytics/metadata.ts deleted file mode 100644 index dd7c40970..000000000 --- a/src/hooks/src/services/analytics/metadata.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type sanitizeToolNameForAnalytics = any; -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; diff --git a/src/hooks/src/state/AppState.ts b/src/hooks/src/state/AppState.ts deleted file mode 100644 index f1e2aa661..000000000 --- a/src/hooks/src/state/AppState.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAppState = any; -export type useAppStateStore = any; -export type useSetAppState = any; diff --git a/src/hooks/src/tools/AgentTool/agentColorManager.ts b/src/hooks/src/tools/AgentTool/agentColorManager.ts deleted file mode 100644 index 83720443d..000000000 --- a/src/hooks/src/tools/AgentTool/agentColorManager.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getAgentColor = any; diff --git a/src/hooks/src/tools/AgentTool/loadAgentsDir.ts b/src/hooks/src/tools/AgentTool/loadAgentsDir.ts deleted file mode 100644 index 3fa66c4bb..000000000 --- a/src/hooks/src/tools/AgentTool/loadAgentsDir.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AgentDefinition = { name: string; [key: string]: unknown }; diff --git a/src/hooks/src/utils/conversationRecovery.ts b/src/hooks/src/utils/conversationRecovery.ts deleted file mode 100644 index ecd18bdac..000000000 --- a/src/hooks/src/utils/conversationRecovery.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type TeleportRemoteResponse = any; diff --git a/src/hooks/src/utils/fileRead.ts b/src/hooks/src/utils/fileRead.ts deleted file mode 100644 index 108536974..000000000 --- a/src/hooks/src/utils/fileRead.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type readFileSync = any; diff --git a/src/hooks/src/utils/log.ts b/src/hooks/src/utils/log.ts deleted file mode 100644 index cf30e90da..000000000 --- a/src/hooks/src/utils/log.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logError = any; diff --git a/src/hooks/src/utils/markdownConfigLoader.ts b/src/hooks/src/utils/markdownConfigLoader.ts deleted file mode 100644 index 2c3f2d06c..000000000 --- a/src/hooks/src/utils/markdownConfigLoader.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type CLAUDE_CONFIG_DIRECTORIES = any; -export type loadMarkdownFilesForSubdir = any; diff --git a/src/hooks/toolPermission/src/services/analytics/index.ts b/src/hooks/toolPermission/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/hooks/toolPermission/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/hooks/toolPermission/src/services/analytics/metadata.ts b/src/hooks/toolPermission/src/services/analytics/metadata.ts deleted file mode 100644 index 807602756..000000000 --- a/src/hooks/toolPermission/src/services/analytics/metadata.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type sanitizeToolNameForAnalytics = any; diff --git a/src/jobs/classifier.ts b/src/jobs/classifier.ts deleted file mode 100644 index 8cd26637e..000000000 --- a/src/jobs/classifier.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const classifyAndWriteState: (...args: unknown[]) => Promise = () => Promise.resolve(); diff --git a/src/memdir/memoryShapeTelemetry.ts b/src/memdir/memoryShapeTelemetry.ts deleted file mode 100644 index 60c31ac8d..000000000 --- a/src/memdir/memoryShapeTelemetry.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type { MemoryHeader } from './memoryScan.js'; -import type { MemoryScope } from '../utils/memoryFileDetection.js'; - -export {}; -export const logMemoryRecallShape: (memories: MemoryHeader[], selected: MemoryHeader[]) => void = (() => {}); -export const logMemoryWriteShape: (toolName: string, toolInput: Record, filePath: string, scope: MemoryScope) => void = (() => {}); diff --git a/src/migrations/migrateAutoUpdatesToSettings.ts b/src/migrations/migrateAutoUpdatesToSettings.ts deleted file mode 100644 index c541713b1..000000000 --- a/src/migrations/migrateAutoUpdatesToSettings.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { logEvent } from 'src/services/analytics/index.js' -import { getGlobalConfig, saveGlobalConfig } from '../utils/config.js' -import { logError } from '../utils/log.js' -import { - getSettingsForSource, - updateSettingsForSource, -} from '../utils/settings/settings.js' -/** - * Migration: Move user-set autoUpdates preference to settings.json env var - * Only migrates if user explicitly disabled auto-updates (not for protection) - * This preserves user intent while allowing native installations to auto-update - */ -export function migrateAutoUpdatesToSettings(): void { - const globalConfig = getGlobalConfig() - - // Only migrate if autoUpdates was explicitly set to false by user preference - // (not automatically for native protection) - if ( - globalConfig.autoUpdates !== false || - globalConfig.autoUpdatesProtectedForNative === true - ) { - return - } - - try { - const userSettings = getSettingsForSource('userSettings') || {} - - // Always set DISABLE_AUTOUPDATER to preserve user intent - // We need to overwrite even if it exists, to ensure the migration is complete - updateSettingsForSource('userSettings', { - ...userSettings, - env: { - ...userSettings.env, - DISABLE_AUTOUPDATER: '1', - }, - }) - - logEvent('tengu_migrate_autoupdates_to_settings', { - was_user_preference: true, - already_had_env_var: !!userSettings.env?.DISABLE_AUTOUPDATER, - }) - - // explicitly set, so this takes effect immediately - process.env.DISABLE_AUTOUPDATER = '1' - - // Remove autoUpdates from global config after successful migration - saveGlobalConfig(current => { - const { - autoUpdates: _, - autoUpdatesProtectedForNative: __, - ...updatedConfig - } = current - return updatedConfig - }) - } catch (error) { - logError(new Error(`Failed to migrate auto-updates: ${error}`)) - logEvent('tengu_migrate_autoupdates_error', { - has_error: true, - }) - } -} diff --git a/src/migrations/src/services/analytics/index.ts b/src/migrations/src/services/analytics/index.ts deleted file mode 100644 index 60402f927..000000000 --- a/src/migrations/src/services/analytics/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; diff --git a/src/native-ts/yoga-layout/enums.ts b/src/native-ts/yoga-layout/enums.ts deleted file mode 100644 index 8cbb6ecff..000000000 --- a/src/native-ts/yoga-layout/enums.ts +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Yoga enums — ported from yoga-layout/src/generated/YGEnums.ts - * Kept as `const` objects (not TS enums) per repo convention. - * Values match upstream exactly so callers don't change. - */ - -export const Align = { - Auto: 0, - FlexStart: 1, - Center: 2, - FlexEnd: 3, - Stretch: 4, - Baseline: 5, - SpaceBetween: 6, - SpaceAround: 7, - SpaceEvenly: 8, -} as const -export type Align = (typeof Align)[keyof typeof Align] - -export const BoxSizing = { - BorderBox: 0, - ContentBox: 1, -} as const -export type BoxSizing = (typeof BoxSizing)[keyof typeof BoxSizing] - -export const Dimension = { - Width: 0, - Height: 1, -} as const -export type Dimension = (typeof Dimension)[keyof typeof Dimension] - -export const Direction = { - Inherit: 0, - LTR: 1, - RTL: 2, -} as const -export type Direction = (typeof Direction)[keyof typeof Direction] - -export const Display = { - Flex: 0, - None: 1, - Contents: 2, -} as const -export type Display = (typeof Display)[keyof typeof Display] - -export const Edge = { - Left: 0, - Top: 1, - Right: 2, - Bottom: 3, - Start: 4, - End: 5, - Horizontal: 6, - Vertical: 7, - All: 8, -} as const -export type Edge = (typeof Edge)[keyof typeof Edge] - -export const Errata = { - None: 0, - StretchFlexBasis: 1, - AbsolutePositionWithoutInsetsExcludesPadding: 2, - AbsolutePercentAgainstInnerSize: 4, - All: 2147483647, - Classic: 2147483646, -} as const -export type Errata = (typeof Errata)[keyof typeof Errata] - -export const ExperimentalFeature = { - WebFlexBasis: 0, -} as const -export type ExperimentalFeature = - (typeof ExperimentalFeature)[keyof typeof ExperimentalFeature] - -export const FlexDirection = { - Column: 0, - ColumnReverse: 1, - Row: 2, - RowReverse: 3, -} as const -export type FlexDirection = (typeof FlexDirection)[keyof typeof FlexDirection] - -export const Gutter = { - Column: 0, - Row: 1, - All: 2, -} as const -export type Gutter = (typeof Gutter)[keyof typeof Gutter] - -export const Justify = { - FlexStart: 0, - Center: 1, - FlexEnd: 2, - SpaceBetween: 3, - SpaceAround: 4, - SpaceEvenly: 5, -} as const -export type Justify = (typeof Justify)[keyof typeof Justify] - -export const MeasureMode = { - Undefined: 0, - Exactly: 1, - AtMost: 2, -} as const -export type MeasureMode = (typeof MeasureMode)[keyof typeof MeasureMode] - -export const Overflow = { - Visible: 0, - Hidden: 1, - Scroll: 2, -} as const -export type Overflow = (typeof Overflow)[keyof typeof Overflow] - -export const PositionType = { - Static: 0, - Relative: 1, - Absolute: 2, -} as const -export type PositionType = (typeof PositionType)[keyof typeof PositionType] - -export const Unit = { - Undefined: 0, - Point: 1, - Percent: 2, - Auto: 3, -} as const -export type Unit = (typeof Unit)[keyof typeof Unit] - -export const Wrap = { - NoWrap: 0, - Wrap: 1, - WrapReverse: 2, -} as const -export type Wrap = (typeof Wrap)[keyof typeof Wrap] diff --git a/src/native-ts/yoga-layout/index.ts b/src/native-ts/yoga-layout/index.ts deleted file mode 100644 index 49b9602be..000000000 --- a/src/native-ts/yoga-layout/index.ts +++ /dev/null @@ -1,2578 +0,0 @@ -/** - * Pure-TypeScript port of yoga-layout (Meta's flexbox engine). - * - * This matches the `yoga-layout/load` API surface used by src/ink/layout/yoga.ts. - * The upstream C++ source is ~2500 lines in CalculateLayout.cpp alone; this port - * is a simplified single-pass flexbox implementation that covers the subset of - * features Ink actually uses: - * - flex-direction (row/column + reverse) - * - flex-grow / flex-shrink / flex-basis - * - align-items / align-self (stretch, flex-start, center, flex-end) - * - justify-content (all six values) - * - margin / padding / border / gap - * - width / height / min / max (point, percent, auto) - * - position: relative / absolute - * - display: flex / none - * - measure functions (for text nodes) - * - * Also implemented for spec parity (not used by Ink): - * - margin: auto (main + cross axis, overrides justify/align) - * - multi-pass flex clamping when children hit min/max constraints - * - flex-grow/shrink against container min/max when size is indefinite - * - * Also implemented for spec parity (not used by Ink): - * - flex-wrap: wrap / wrap-reverse (multi-line flex) - * - align-content (positions wrapped lines on cross axis) - * - * Also implemented for spec parity (not used by Ink): - * - display: contents (children lifted to grandparent, box removed) - * - * Also implemented for spec parity (not used by Ink): - * - baseline alignment (align-items/align-self: baseline) - * - * Not implemented (not used by Ink): - * - aspect-ratio - * - box-sizing: content-box - * - RTL direction (Ink always passes Direction.LTR) - * - * Upstream: https://github.com/facebook/yoga - */ - -import { - Align, - BoxSizing, - Dimension, - Direction, - Display, - Edge, - Errata, - ExperimentalFeature, - FlexDirection, - Gutter, - Justify, - MeasureMode, - Overflow, - PositionType, - Unit, - Wrap, -} from './enums.js' - -export { - Align, - BoxSizing, - Dimension, - Direction, - Display, - Edge, - Errata, - ExperimentalFeature, - FlexDirection, - Gutter, - Justify, - MeasureMode, - Overflow, - PositionType, - Unit, - Wrap, -} - -// -- -// Value types - -export type Value = { - unit: Unit - value: number -} - -const UNDEFINED_VALUE: Value = { unit: Unit.Undefined, value: NaN } -const AUTO_VALUE: Value = { unit: Unit.Auto, value: NaN } - -function pointValue(v: number): Value { - return { unit: Unit.Point, value: v } -} -function percentValue(v: number): Value { - return { unit: Unit.Percent, value: v } -} - -function resolveValue(v: Value, ownerSize: number): number { - switch (v.unit) { - case Unit.Point: - return v.value - case Unit.Percent: - return isNaN(ownerSize) ? NaN : (v.value * ownerSize) / 100 - default: - return NaN - } -} - -function isDefined(n: number): boolean { - return !isNaN(n) -} - -// NaN-safe equality for layout-cache input comparison -function sameFloat(a: number, b: number): boolean { - return a === b || (a !== a && b !== b) -} - -// -- -// Layout result (computed values) - -type Layout = { - left: number - top: number - width: number - height: number - // Computed per-edge values (resolved to physical edges) - border: [number, number, number, number] // left, top, right, bottom - padding: [number, number, number, number] - margin: [number, number, number, number] -} - -// -- -// Style (input values) - -type Style = { - direction: Direction - flexDirection: FlexDirection - justifyContent: Justify - alignItems: Align - alignSelf: Align - alignContent: Align - flexWrap: Wrap - overflow: Overflow - display: Display - positionType: PositionType - - flexGrow: number - flexShrink: number - flexBasis: Value - - // 9-edge arrays indexed by Edge enum - margin: Value[] - padding: Value[] - border: Value[] - position: Value[] - - // 3-gutter array indexed by Gutter enum - gap: Value[] - - width: Value - height: Value - minWidth: Value - minHeight: Value - maxWidth: Value - maxHeight: Value -} - -function defaultStyle(): Style { - return { - direction: Direction.Inherit, - flexDirection: FlexDirection.Column, - justifyContent: Justify.FlexStart, - alignItems: Align.Stretch, - alignSelf: Align.Auto, - alignContent: Align.FlexStart, - flexWrap: Wrap.NoWrap, - overflow: Overflow.Visible, - display: Display.Flex, - positionType: PositionType.Relative, - flexGrow: 0, - flexShrink: 0, - flexBasis: AUTO_VALUE, - margin: new Array(9).fill(UNDEFINED_VALUE), - padding: new Array(9).fill(UNDEFINED_VALUE), - border: new Array(9).fill(UNDEFINED_VALUE), - position: new Array(9).fill(UNDEFINED_VALUE), - gap: new Array(3).fill(UNDEFINED_VALUE), - width: AUTO_VALUE, - height: AUTO_VALUE, - minWidth: UNDEFINED_VALUE, - minHeight: UNDEFINED_VALUE, - maxWidth: UNDEFINED_VALUE, - maxHeight: UNDEFINED_VALUE, - } -} - -// -- -// Edge resolution — yoga's 9-edge model collapsed to 4 physical edges - -const EDGE_LEFT = 0 -const EDGE_TOP = 1 -const EDGE_RIGHT = 2 -const EDGE_BOTTOM = 3 - -function resolveEdge( - edges: Value[], - physicalEdge: number, - ownerSize: number, - // For margin/position we allow auto; for padding/border auto resolves to 0 - allowAuto = false, -): number { - // Precedence: specific edge > horizontal/vertical > all - let v = edges[physicalEdge]! - if (v.unit === Unit.Undefined) { - if (physicalEdge === EDGE_LEFT || physicalEdge === EDGE_RIGHT) { - v = edges[Edge.Horizontal]! - } else { - v = edges[Edge.Vertical]! - } - } - if (v.unit === Unit.Undefined) { - v = edges[Edge.All]! - } - // Start/End map to Left/Right for LTR (Ink is always LTR) - if (v.unit === Unit.Undefined) { - if (physicalEdge === EDGE_LEFT) v = edges[Edge.Start]! - if (physicalEdge === EDGE_RIGHT) v = edges[Edge.End]! - } - if (v.unit === Unit.Undefined) return 0 - if (v.unit === Unit.Auto) return allowAuto ? NaN : 0 - return resolveValue(v, ownerSize) -} - -function resolveEdgeRaw(edges: Value[], physicalEdge: number): Value { - let v = edges[physicalEdge]! - if (v.unit === Unit.Undefined) { - if (physicalEdge === EDGE_LEFT || physicalEdge === EDGE_RIGHT) { - v = edges[Edge.Horizontal]! - } else { - v = edges[Edge.Vertical]! - } - } - if (v.unit === Unit.Undefined) v = edges[Edge.All]! - if (v.unit === Unit.Undefined) { - if (physicalEdge === EDGE_LEFT) v = edges[Edge.Start]! - if (physicalEdge === EDGE_RIGHT) v = edges[Edge.End]! - } - return v -} - -function isMarginAuto(edges: Value[], physicalEdge: number): boolean { - return resolveEdgeRaw(edges, physicalEdge).unit === Unit.Auto -} - -// Setter helpers for the _hasAutoMargin / _hasPosition fast-path flags. -// Unit.Undefined = 0, Unit.Auto = 3. -function hasAnyAutoEdge(edges: Value[]): boolean { - for (let i = 0; i < 9; i++) if (edges[i]!.unit === 3) return true - return false -} -function hasAnyDefinedEdge(edges: Value[]): boolean { - for (let i = 0; i < 9; i++) if (edges[i]!.unit !== 0) return true - return false -} - -// Hot path: resolve all 4 physical edges in one pass, writing into `out`. -// Equivalent to calling resolveEdge() 4× with allowAuto=false, but hoists the -// shared fallback lookups (Horizontal/Vertical/All/Start/End) and avoids -// allocating a fresh 4-array on every layoutNode() call. -function resolveEdges4Into( - edges: Value[], - ownerSize: number, - out: [number, number, number, number], -): void { - // Hoist fallbacks once — the 4 per-edge chains share these reads. - const eH = edges[6]! // Edge.Horizontal - const eV = edges[7]! // Edge.Vertical - const eA = edges[8]! // Edge.All - const eS = edges[4]! // Edge.Start - const eE = edges[5]! // Edge.End - const pctDenom = isNaN(ownerSize) ? NaN : ownerSize / 100 - - // Left: edges[0] → Horizontal → All → Start - let v = edges[0]! - if (v.unit === 0) v = eH - if (v.unit === 0) v = eA - if (v.unit === 0) v = eS - out[0] = v.unit === 1 ? v.value : v.unit === 2 ? v.value * pctDenom : 0 - - // Top: edges[1] → Vertical → All - v = edges[1]! - if (v.unit === 0) v = eV - if (v.unit === 0) v = eA - out[1] = v.unit === 1 ? v.value : v.unit === 2 ? v.value * pctDenom : 0 - - // Right: edges[2] → Horizontal → All → End - v = edges[2]! - if (v.unit === 0) v = eH - if (v.unit === 0) v = eA - if (v.unit === 0) v = eE - out[2] = v.unit === 1 ? v.value : v.unit === 2 ? v.value * pctDenom : 0 - - // Bottom: edges[3] → Vertical → All - v = edges[3]! - if (v.unit === 0) v = eV - if (v.unit === 0) v = eA - out[3] = v.unit === 1 ? v.value : v.unit === 2 ? v.value * pctDenom : 0 -} - -// -- -// Axis helpers - -function isRow(dir: FlexDirection): boolean { - return dir === FlexDirection.Row || dir === FlexDirection.RowReverse -} -function isReverse(dir: FlexDirection): boolean { - return dir === FlexDirection.RowReverse || dir === FlexDirection.ColumnReverse -} -function crossAxis(dir: FlexDirection): FlexDirection { - return isRow(dir) ? FlexDirection.Column : FlexDirection.Row -} -function leadingEdge(dir: FlexDirection): number { - switch (dir) { - case FlexDirection.Row: - return EDGE_LEFT - case FlexDirection.RowReverse: - return EDGE_RIGHT - case FlexDirection.Column: - return EDGE_TOP - case FlexDirection.ColumnReverse: - return EDGE_BOTTOM - } -} -function trailingEdge(dir: FlexDirection): number { - switch (dir) { - case FlexDirection.Row: - return EDGE_RIGHT - case FlexDirection.RowReverse: - return EDGE_LEFT - case FlexDirection.Column: - return EDGE_BOTTOM - case FlexDirection.ColumnReverse: - return EDGE_TOP - } -} - -// -- -// Public types - -export type MeasureFunction = ( - width: number, - widthMode: MeasureMode, - height: number, - heightMode: MeasureMode, -) => { width: number; height: number } - -export type Size = { width: number; height: number } - -// -- -// Config - -export type Config = { - pointScaleFactor: number - errata: Errata - useWebDefaults: boolean - free(): void - isExperimentalFeatureEnabled(_: ExperimentalFeature): boolean - setExperimentalFeatureEnabled(_: ExperimentalFeature, __: boolean): void - setPointScaleFactor(factor: number): void - getErrata(): Errata - setErrata(errata: Errata): void - setUseWebDefaults(v: boolean): void -} - -function createConfig(): Config { - const config: Config = { - pointScaleFactor: 1, - errata: Errata.None, - useWebDefaults: false, - free() {}, - isExperimentalFeatureEnabled() { - return false - }, - setExperimentalFeatureEnabled() {}, - setPointScaleFactor(f) { - config.pointScaleFactor = f - }, - getErrata() { - return config.errata - }, - setErrata(e) { - config.errata = e - }, - setUseWebDefaults(v) { - config.useWebDefaults = v - }, - } - return config -} - -// -- -// Node implementation - -export class Node { - style: Style - layout: Layout - parent: Node | null - children: Node[] - measureFunc: MeasureFunction | null - config: Config - isDirty_: boolean - isReferenceBaseline_: boolean - - // Per-layout scratch (not public API) - _flexBasis = 0 - _mainSize = 0 - _crossSize = 0 - _lineIndex = 0 - // Fast-path flags maintained by style setters. Per CPU profile, the - // positioning loop calls isMarginAuto 6× and resolveEdgeRaw(position) 4× - // per child per layout pass — ~11k calls for the 1000-node bench, nearly - // all of which return false/undefined since most nodes have no auto - // margins and no position insets. These flags let us skip straight to - // the common case with a single branch. - _hasAutoMargin = false - _hasPosition = false - // Same pattern for the 3× resolveEdges4Into calls at the top of every - // layoutNode(). In the 1000-node bench ~67% of those calls operate on - // all-undefined edge arrays (most nodes have no border; only cols have - // padding; only leaf cells have margin) — a single-branch skip beats - // ~20 property reads + ~15 compares + 4 writes of zeros. - _hasPadding = false - _hasBorder = false - _hasMargin = false - // -- Dirty-flag layout cache. Mirrors upstream CalculateLayout.cpp's - // layoutNodeInternal: skip a subtree entirely when it's clean and we're - // asking the same question we cached the answer to. Two slots since - // each node typically sees a measure call (performLayout=false, from - // computeFlexBasis) followed by a layout call (performLayout=true) with - // different inputs per parent pass — a single slot thrashes. Re-layout - // bench (dirty one leaf, recompute root) went 2.7x→1.1x with this: - // clean siblings skip straight through, only the dirty chain recomputes. - _lW = NaN - _lH = NaN - _lWM: MeasureMode = 0 - _lHM: MeasureMode = 0 - _lOW = NaN - _lOH = NaN - _lFW = false - _lFH = false - // _hasL stores INPUTS early (before compute) but layout.width/height are - // mutated by the multi-entry cache and by subsequent compute calls with - // different inputs. Without storing OUTPUTS, a _hasL hit returns whatever - // layout.width/height happened to be left by the last call — the scrollbox - // vpH=33→2624 bug. Store + restore outputs like the multi-entry cache does. - _lOutW = NaN - _lOutH = NaN - _hasL = false - _mW = NaN - _mH = NaN - _mWM: MeasureMode = 0 - _mHM: MeasureMode = 0 - _mOW = NaN - _mOH = NaN - _mOutW = NaN - _mOutH = NaN - _hasM = false - // Cached computeFlexBasis result. For clean children, basis only depends - // on the container's inner dimensions — if those haven't changed, skip the - // layoutNode(performLayout=false) recursion entirely. This is the hot path - // for scroll: 500-message content container is dirty, its 499 clean - // children each get measured ~20× as the dirty chain's measure/layout - // passes cascade. Basis cache short-circuits at the child boundary. - _fbBasis = NaN - _fbOwnerW = NaN - _fbOwnerH = NaN - _fbAvailMain = NaN - _fbAvailCross = NaN - _fbCrossMode: MeasureMode = 0 - // Generation at which _fbBasis was written. Dirty nodes from a PREVIOUS - // generation have stale cache (subtree changed), but within the SAME - // generation the cache is fresh — the dirty chain's measure→layout - // cascade invokes computeFlexBasis ≥2^depth times per calculateLayout on - // fresh-mounted items, and the subtree doesn't change between calls. - // Gating on generation instead of isDirty_ lets fresh mounts (virtual - // scroll) cache-hit after first compute: 105k visits → ~10k. - _fbGen = -1 - // Multi-entry layout cache — stores (inputs → computed w,h) so hits with - // different inputs than _hasL can restore the right dimensions. Upstream - // yoga uses 16; 4 covers Ink's dirty-chain depth. Packed as flat arrays - // to avoid per-entry object allocs. Slot i uses indices [i*8, i*8+8) in - // _cIn (aW,aH,wM,hM,oW,oH,fW,fH) and [i*2, i*2+2) in _cOut (w,h). - _cIn: Float64Array | null = null - _cOut: Float64Array | null = null - _cGen = -1 - _cN = 0 - _cWr = 0 - - constructor(config?: Config) { - this.style = defaultStyle() - this.layout = { - left: 0, - top: 0, - width: 0, - height: 0, - border: [0, 0, 0, 0], - padding: [0, 0, 0, 0], - margin: [0, 0, 0, 0], - } - this.parent = null - this.children = [] - this.measureFunc = null - this.config = config ?? DEFAULT_CONFIG - this.isDirty_ = true - this.isReferenceBaseline_ = false - _yogaLiveNodes++ - } - - // -- Tree - - insertChild(child: Node, index: number): void { - child.parent = this - this.children.splice(index, 0, child) - this.markDirty() - } - removeChild(child: Node): void { - const idx = this.children.indexOf(child) - if (idx >= 0) { - this.children.splice(idx, 1) - child.parent = null - this.markDirty() - } - } - getChild(index: number): Node { - return this.children[index]! - } - getChildCount(): number { - return this.children.length - } - getParent(): Node | null { - return this.parent - } - - // -- Lifecycle - - free(): void { - this.parent = null - this.children = [] - this.measureFunc = null - this._cIn = null - this._cOut = null - _yogaLiveNodes-- - } - freeRecursive(): void { - for (const c of this.children) c.freeRecursive() - this.free() - } - reset(): void { - this.style = defaultStyle() - this.children = [] - this.parent = null - this.measureFunc = null - this.isDirty_ = true - this._hasAutoMargin = false - this._hasPosition = false - this._hasPadding = false - this._hasBorder = false - this._hasMargin = false - this._hasL = false - this._hasM = false - this._cN = 0 - this._cWr = 0 - this._fbBasis = NaN - } - - // -- Dirty tracking - - markDirty(): void { - this.isDirty_ = true - if (this.parent && !this.parent.isDirty_) this.parent.markDirty() - } - isDirty(): boolean { - return this.isDirty_ - } - hasNewLayout(): boolean { - return true - } - markLayoutSeen(): void {} - - // -- Measure function - - setMeasureFunc(fn: MeasureFunction | null): void { - this.measureFunc = fn - this.markDirty() - } - unsetMeasureFunc(): void { - this.measureFunc = null - this.markDirty() - } - - // -- Computed layout getters - - getComputedLeft(): number { - return this.layout.left - } - getComputedTop(): number { - return this.layout.top - } - getComputedWidth(): number { - return this.layout.width - } - getComputedHeight(): number { - return this.layout.height - } - getComputedRight(): number { - const p = this.parent - return p ? p.layout.width - this.layout.left - this.layout.width : 0 - } - getComputedBottom(): number { - const p = this.parent - return p ? p.layout.height - this.layout.top - this.layout.height : 0 - } - getComputedLayout(): { - left: number - top: number - right: number - bottom: number - width: number - height: number - } { - return { - left: this.layout.left, - top: this.layout.top, - right: this.getComputedRight(), - bottom: this.getComputedBottom(), - width: this.layout.width, - height: this.layout.height, - } - } - getComputedBorder(edge: Edge): number { - return this.layout.border[physicalEdge(edge)]! - } - getComputedPadding(edge: Edge): number { - return this.layout.padding[physicalEdge(edge)]! - } - getComputedMargin(edge: Edge): number { - return this.layout.margin[physicalEdge(edge)]! - } - - // -- Style setters: dimensions - - setWidth(v: number | 'auto' | string | undefined): void { - this.style.width = parseDimension(v) - this.markDirty() - } - setWidthPercent(v: number): void { - this.style.width = percentValue(v) - this.markDirty() - } - setWidthAuto(): void { - this.style.width = AUTO_VALUE - this.markDirty() - } - setHeight(v: number | 'auto' | string | undefined): void { - this.style.height = parseDimension(v) - this.markDirty() - } - setHeightPercent(v: number): void { - this.style.height = percentValue(v) - this.markDirty() - } - setHeightAuto(): void { - this.style.height = AUTO_VALUE - this.markDirty() - } - setMinWidth(v: number | string | undefined): void { - this.style.minWidth = parseDimension(v) - this.markDirty() - } - setMinWidthPercent(v: number): void { - this.style.minWidth = percentValue(v) - this.markDirty() - } - setMinHeight(v: number | string | undefined): void { - this.style.minHeight = parseDimension(v) - this.markDirty() - } - setMinHeightPercent(v: number): void { - this.style.minHeight = percentValue(v) - this.markDirty() - } - setMaxWidth(v: number | string | undefined): void { - this.style.maxWidth = parseDimension(v) - this.markDirty() - } - setMaxWidthPercent(v: number): void { - this.style.maxWidth = percentValue(v) - this.markDirty() - } - setMaxHeight(v: number | string | undefined): void { - this.style.maxHeight = parseDimension(v) - this.markDirty() - } - setMaxHeightPercent(v: number): void { - this.style.maxHeight = percentValue(v) - this.markDirty() - } - - // -- Style setters: flex - - setFlexDirection(dir: FlexDirection): void { - this.style.flexDirection = dir - this.markDirty() - } - setFlexGrow(v: number | undefined): void { - this.style.flexGrow = v ?? 0 - this.markDirty() - } - setFlexShrink(v: number | undefined): void { - this.style.flexShrink = v ?? 0 - this.markDirty() - } - setFlex(v: number | undefined): void { - if (v === undefined || isNaN(v)) { - this.style.flexGrow = 0 - this.style.flexShrink = 0 - } else if (v > 0) { - this.style.flexGrow = v - this.style.flexShrink = 1 - this.style.flexBasis = pointValue(0) - } else if (v < 0) { - this.style.flexGrow = 0 - this.style.flexShrink = -v - } else { - this.style.flexGrow = 0 - this.style.flexShrink = 0 - } - this.markDirty() - } - setFlexBasis(v: number | 'auto' | string | undefined): void { - this.style.flexBasis = parseDimension(v) - this.markDirty() - } - setFlexBasisPercent(v: number): void { - this.style.flexBasis = percentValue(v) - this.markDirty() - } - setFlexBasisAuto(): void { - this.style.flexBasis = AUTO_VALUE - this.markDirty() - } - setFlexWrap(wrap: Wrap): void { - this.style.flexWrap = wrap - this.markDirty() - } - - // -- Style setters: alignment - - setAlignItems(a: Align): void { - this.style.alignItems = a - this.markDirty() - } - setAlignSelf(a: Align): void { - this.style.alignSelf = a - this.markDirty() - } - setAlignContent(a: Align): void { - this.style.alignContent = a - this.markDirty() - } - setJustifyContent(j: Justify): void { - this.style.justifyContent = j - this.markDirty() - } - - // -- Style setters: display / position / overflow - - setDisplay(d: Display): void { - this.style.display = d - this.markDirty() - } - getDisplay(): Display { - return this.style.display - } - setPositionType(t: PositionType): void { - this.style.positionType = t - this.markDirty() - } - setPosition(edge: Edge, v: number | string | undefined): void { - this.style.position[edge] = parseDimension(v) - this._hasPosition = hasAnyDefinedEdge(this.style.position) - this.markDirty() - } - setPositionPercent(edge: Edge, v: number): void { - this.style.position[edge] = percentValue(v) - this._hasPosition = true - this.markDirty() - } - setPositionAuto(edge: Edge): void { - this.style.position[edge] = AUTO_VALUE - this._hasPosition = true - this.markDirty() - } - setOverflow(o: Overflow): void { - this.style.overflow = o - this.markDirty() - } - setDirection(d: Direction): void { - this.style.direction = d - this.markDirty() - } - setBoxSizing(_: BoxSizing): void { - // Not implemented — Ink doesn't use content-box - } - - // -- Style setters: spacing - - setMargin(edge: Edge, v: number | 'auto' | string | undefined): void { - const val = parseDimension(v) - this.style.margin[edge] = val - if (val.unit === Unit.Auto) this._hasAutoMargin = true - else this._hasAutoMargin = hasAnyAutoEdge(this.style.margin) - this._hasMargin = - this._hasAutoMargin || hasAnyDefinedEdge(this.style.margin) - this.markDirty() - } - setMarginPercent(edge: Edge, v: number): void { - this.style.margin[edge] = percentValue(v) - this._hasAutoMargin = hasAnyAutoEdge(this.style.margin) - this._hasMargin = true - this.markDirty() - } - setMarginAuto(edge: Edge): void { - this.style.margin[edge] = AUTO_VALUE - this._hasAutoMargin = true - this._hasMargin = true - this.markDirty() - } - setPadding(edge: Edge, v: number | string | undefined): void { - this.style.padding[edge] = parseDimension(v) - this._hasPadding = hasAnyDefinedEdge(this.style.padding) - this.markDirty() - } - setPaddingPercent(edge: Edge, v: number): void { - this.style.padding[edge] = percentValue(v) - this._hasPadding = true - this.markDirty() - } - setBorder(edge: Edge, v: number | undefined): void { - this.style.border[edge] = v === undefined ? UNDEFINED_VALUE : pointValue(v) - this._hasBorder = hasAnyDefinedEdge(this.style.border) - this.markDirty() - } - setGap(gutter: Gutter, v: number | string | undefined): void { - this.style.gap[gutter] = parseDimension(v) - this.markDirty() - } - setGapPercent(gutter: Gutter, v: number): void { - this.style.gap[gutter] = percentValue(v) - this.markDirty() - } - - // -- Style getters (partial — only what tests need) - - getFlexDirection(): FlexDirection { - return this.style.flexDirection - } - getJustifyContent(): Justify { - return this.style.justifyContent - } - getAlignItems(): Align { - return this.style.alignItems - } - getAlignSelf(): Align { - return this.style.alignSelf - } - getAlignContent(): Align { - return this.style.alignContent - } - getFlexGrow(): number { - return this.style.flexGrow - } - getFlexShrink(): number { - return this.style.flexShrink - } - getFlexBasis(): Value { - return this.style.flexBasis - } - getFlexWrap(): Wrap { - return this.style.flexWrap - } - getWidth(): Value { - return this.style.width - } - getHeight(): Value { - return this.style.height - } - getOverflow(): Overflow { - return this.style.overflow - } - getPositionType(): PositionType { - return this.style.positionType - } - getDirection(): Direction { - return this.style.direction - } - - // -- Unused API stubs (present for API parity) - - copyStyle(_: Node): void {} - setDirtiedFunc(_: unknown): void {} - unsetDirtiedFunc(): void {} - setIsReferenceBaseline(v: boolean): void { - this.isReferenceBaseline_ = v - this.markDirty() - } - isReferenceBaseline(): boolean { - return this.isReferenceBaseline_ - } - setAspectRatio(_: number | undefined): void {} - getAspectRatio(): number { - return NaN - } - setAlwaysFormsContainingBlock(_: boolean): void {} - - // -- Layout entry point - - calculateLayout( - ownerWidth: number | undefined, - ownerHeight: number | undefined, - _direction?: Direction, - ): void { - _yogaNodesVisited = 0 - _yogaMeasureCalls = 0 - _yogaCacheHits = 0 - _generation++ - const w = ownerWidth === undefined ? NaN : ownerWidth - const h = ownerHeight === undefined ? NaN : ownerHeight - layoutNode( - this, - w, - h, - isDefined(w) ? MeasureMode.Exactly : MeasureMode.Undefined, - isDefined(h) ? MeasureMode.Exactly : MeasureMode.Undefined, - w, - h, - true, - ) - // Root's own position = margin + position insets (yoga applies position - // to the root even without a parent container; this matters for rounding - // since the root's abs top/left seeds the pixel-grid walk). - const mar = this.layout.margin - const posL = resolveValue( - resolveEdgeRaw(this.style.position, EDGE_LEFT), - isDefined(w) ? w : 0, - ) - const posT = resolveValue( - resolveEdgeRaw(this.style.position, EDGE_TOP), - isDefined(w) ? w : 0, - ) - this.layout.left = mar[EDGE_LEFT] + (isDefined(posL) ? posL : 0) - this.layout.top = mar[EDGE_TOP] + (isDefined(posT) ? posT : 0) - roundLayout(this, this.config.pointScaleFactor, 0, 0) - } -} - -const DEFAULT_CONFIG = createConfig() - -const CACHE_SLOTS = 4 -function cacheWrite( - node: Node, - aW: number, - aH: number, - wM: MeasureMode, - hM: MeasureMode, - oW: number, - oH: number, - fW: boolean, - fH: boolean, - wasDirty: boolean, -): void { - if (!node._cIn) { - node._cIn = new Float64Array(CACHE_SLOTS * 8) - node._cOut = new Float64Array(CACHE_SLOTS * 2) - } - // First write after a dirty clears stale entries from before the dirty. - // _cGen < _generation means entries are from a previous calculateLayout; - // if wasDirty, the subtree changed since then → old dimensions invalid. - // Clean nodes' old entries stay — same subtree → same result for same - // inputs, so cross-generation caching works (the scroll hot path where - // 499 clean messages cache-hit while one dirty leaf recomputes). - if (wasDirty && node._cGen !== _generation) { - node._cN = 0 - node._cWr = 0 - } - // LRU write index wraps; _cN stays at CACHE_SLOTS so the read scan always - // checks all populated slots (not just those since last wrap). - const i = node._cWr++ % CACHE_SLOTS - if (node._cN < CACHE_SLOTS) node._cN = node._cWr - const o = i * 8 - const cIn = node._cIn - cIn[o] = aW - cIn[o + 1] = aH - cIn[o + 2] = wM - cIn[o + 3] = hM - cIn[o + 4] = oW - cIn[o + 5] = oH - cIn[o + 6] = fW ? 1 : 0 - cIn[o + 7] = fH ? 1 : 0 - node._cOut![i * 2] = node.layout.width - node._cOut![i * 2 + 1] = node.layout.height - node._cGen = _generation -} - -// Store computed layout.width/height into the single-slot cache output fields. -// _hasL/_hasM inputs are committed at the TOP of layoutNode (before compute); -// outputs must be committed HERE (after compute) so a cache hit can restore -// the correct dimensions. Without this, a _hasL hit returns whatever -// layout.width/height was left by the last call — which may be the intrinsic -// content height from a heightMode=Undefined measure pass rather than the -// constrained viewport height from the layout pass. That's the scrollbox -// vpH=33→2624 bug: scrollTop clamps to 0, viewport goes blank. -function commitCacheOutputs(node: Node, performLayout: boolean): void { - if (performLayout) { - node._lOutW = node.layout.width - node._lOutH = node.layout.height - } else { - node._mOutW = node.layout.width - node._mOutH = node.layout.height - } -} - -// -- -// Core flexbox algorithm - -// Profiling counters — reset per calculateLayout, read via getYogaCounters. -// Incremented on each calculateLayout(). Nodes stamp _fbGen/_cGen when -// their cache is written; a cache entry with gen === _generation was -// computed THIS pass and is fresh regardless of isDirty_ state. -let _generation = 0 -let _yogaNodesVisited = 0 -let _yogaMeasureCalls = 0 -let _yogaCacheHits = 0 -let _yogaLiveNodes = 0 -export function getYogaCounters(): { - visited: number - measured: number - cacheHits: number - live: number -} { - return { - visited: _yogaNodesVisited, - measured: _yogaMeasureCalls, - cacheHits: _yogaCacheHits, - live: _yogaLiveNodes, - } -} - -function layoutNode( - node: Node, - availableWidth: number, - availableHeight: number, - widthMode: MeasureMode, - heightMode: MeasureMode, - ownerWidth: number, - ownerHeight: number, - performLayout: boolean, - // When true, ignore style dimension on this axis — the flex container - // has already determined the main size (flex-basis + grow/shrink result). - forceWidth = false, - forceHeight = false, -): void { - _yogaNodesVisited++ - const style = node.style - const layout = node.layout - - // Dirty-flag skip: clean subtree + matching inputs → layout object already - // holds the answer. A cached layout result also satisfies a measure request - // (positions are a superset of dimensions); the reverse does not hold. - // Same-generation entries are fresh regardless of isDirty_ — they were - // computed THIS calculateLayout, the subtree hasn't changed since. - // Previous-generation entries need !isDirty_ (a dirty node's cache from - // before the dirty is stale). - // sameGen bypass only for MEASURE calls — a layout-pass cache hit would - // skip the child-positioning recursion (STEP 5), leaving children at - // stale positions. Measure calls only need w/h which the cache stores. - const sameGen = node._cGen === _generation && !performLayout - if (!node.isDirty_ || sameGen) { - if ( - !node.isDirty_ && - node._hasL && - node._lWM === widthMode && - node._lHM === heightMode && - node._lFW === forceWidth && - node._lFH === forceHeight && - sameFloat(node._lW, availableWidth) && - sameFloat(node._lH, availableHeight) && - sameFloat(node._lOW, ownerWidth) && - sameFloat(node._lOH, ownerHeight) - ) { - _yogaCacheHits++ - layout.width = node._lOutW - layout.height = node._lOutH - return - } - // Multi-entry cache: scan for matching inputs, restore cached w/h on hit. - // Covers the scroll case where a dirty ancestor's measure→layout cascade - // produces N>1 distinct input combos per clean child — the single _hasL - // slot thrashed, forcing full subtree recursion. With 500-message - // scrollbox and one dirty leaf, this took dirty-leaf relayout from - // 76k layoutNode calls (21.7×nodes) to 4k (1.2×nodes), 6.86ms → 550µs. - // Same-generation check covers fresh-mounted (dirty) nodes during - // virtual scroll — the dirty chain invokes them ≥2^depth times, first - // call writes cache, rest hit: 105k visits → ~10k for 1593-node tree. - if (node._cN > 0 && (sameGen || !node.isDirty_)) { - const cIn = node._cIn! - for (let i = 0; i < node._cN; i++) { - const o = i * 8 - if ( - cIn[o + 2] === widthMode && - cIn[o + 3] === heightMode && - cIn[o + 6] === (forceWidth ? 1 : 0) && - cIn[o + 7] === (forceHeight ? 1 : 0) && - sameFloat(cIn[o]!, availableWidth) && - sameFloat(cIn[o + 1]!, availableHeight) && - sameFloat(cIn[o + 4]!, ownerWidth) && - sameFloat(cIn[o + 5]!, ownerHeight) - ) { - layout.width = node._cOut![i * 2]! - layout.height = node._cOut![i * 2 + 1]! - _yogaCacheHits++ - return - } - } - } - if ( - !node.isDirty_ && - !performLayout && - node._hasM && - node._mWM === widthMode && - node._mHM === heightMode && - sameFloat(node._mW, availableWidth) && - sameFloat(node._mH, availableHeight) && - sameFloat(node._mOW, ownerWidth) && - sameFloat(node._mOH, ownerHeight) - ) { - layout.width = node._mOutW - layout.height = node._mOutH - _yogaCacheHits++ - return - } - } - // Commit cache inputs up front so every return path leaves a valid entry. - // Only clear isDirty_ on the LAYOUT pass — the measure pass (computeFlexBasis - // → layoutNode(performLayout=false)) runs before the layout pass in the same - // calculateLayout call. Clearing dirty during measure lets the subsequent - // layout pass hit the STALE _hasL cache from the previous calculateLayout - // (before children were inserted), so ScrollBox content height never grows - // and sticky-scroll never follows new content. A dirty node's _hasL entry is - // stale by definition — invalidate it so the layout pass recomputes. - const wasDirty = node.isDirty_ - if (performLayout) { - node._lW = availableWidth - node._lH = availableHeight - node._lWM = widthMode - node._lHM = heightMode - node._lOW = ownerWidth - node._lOH = ownerHeight - node._lFW = forceWidth - node._lFH = forceHeight - node._hasL = true - node.isDirty_ = false - // Previous approach cleared _cN here to prevent stale pre-dirty entries - // from hitting (long-continuous blank-screen bug). Now replaced by - // generation stamping: the cache check requires sameGen || !isDirty_, so - // previous-generation entries from a dirty node can't hit. Clearing here - // would wipe fresh same-generation entries from an earlier measure call, - // forcing recompute on the layout call. - if (wasDirty) node._hasM = false - } else { - node._mW = availableWidth - node._mH = availableHeight - node._mWM = widthMode - node._mHM = heightMode - node._mOW = ownerWidth - node._mOH = ownerHeight - node._hasM = true - // Don't clear isDirty_. For DIRTY nodes, invalidate _hasL so the upcoming - // performLayout=true call recomputes with the new child set (otherwise - // sticky-scroll never follows new content — the bug from 4557bc9f9c). - // Clean nodes keep _hasL: their layout from the previous generation is - // still valid, they're only here because an ancestor is dirty and called - // with different inputs than cached. - if (wasDirty) node._hasL = false - } - - // Resolve padding/border/margin against ownerWidth (yoga uses ownerWidth for %) - // Write directly into the pre-allocated layout arrays — avoids 3 allocs per - // layoutNode call and 12 resolveEdge calls (was the #1 hotspot per CPU profile). - // Skip entirely when no edges are set — the 4-write zero is cheaper than - // the ~20 reads + ~15 compares resolveEdges4Into does to produce zeros. - const pad = layout.padding - const bor = layout.border - const mar = layout.margin - if (node._hasPadding) resolveEdges4Into(style.padding, ownerWidth, pad) - else pad[0] = pad[1] = pad[2] = pad[3] = 0 - if (node._hasBorder) resolveEdges4Into(style.border, ownerWidth, bor) - else bor[0] = bor[1] = bor[2] = bor[3] = 0 - if (node._hasMargin) resolveEdges4Into(style.margin, ownerWidth, mar) - else mar[0] = mar[1] = mar[2] = mar[3] = 0 - - const paddingBorderWidth = pad[0] + pad[2] + bor[0] + bor[2] - const paddingBorderHeight = pad[1] + pad[3] + bor[1] + bor[3] - - // Resolve style dimensions - const styleWidth = forceWidth ? NaN : resolveValue(style.width, ownerWidth) - const styleHeight = forceHeight - ? NaN - : resolveValue(style.height, ownerHeight) - - // If style dimension is defined, it overrides the available size - let width = availableWidth - let height = availableHeight - let wMode = widthMode - let hMode = heightMode - if (isDefined(styleWidth)) { - width = styleWidth - wMode = MeasureMode.Exactly - } - if (isDefined(styleHeight)) { - height = styleHeight - hMode = MeasureMode.Exactly - } - - // Apply min/max constraints to the node's own dimensions - width = boundAxis(style, true, width, ownerWidth, ownerHeight) - height = boundAxis(style, false, height, ownerWidth, ownerHeight) - - // Measure-func leaf node - if (node.measureFunc && node.children.length === 0) { - const innerW = - wMode === MeasureMode.Undefined - ? NaN - : Math.max(0, width - paddingBorderWidth) - const innerH = - hMode === MeasureMode.Undefined - ? NaN - : Math.max(0, height - paddingBorderHeight) - _yogaMeasureCalls++ - const measured = node.measureFunc(innerW, wMode, innerH, hMode) - node.layout.width = - wMode === MeasureMode.Exactly - ? width - : boundAxis( - style, - true, - (measured.width ?? 0) + paddingBorderWidth, - ownerWidth, - ownerHeight, - ) - node.layout.height = - hMode === MeasureMode.Exactly - ? height - : boundAxis( - style, - false, - (measured.height ?? 0) + paddingBorderHeight, - ownerWidth, - ownerHeight, - ) - commitCacheOutputs(node, performLayout) - // Write cache even for dirty nodes — fresh-mounted items during virtual - // scroll are dirty on first layout, but the dirty chain's measure→layout - // cascade invokes them ≥2^depth times per calculateLayout. Writing here - // lets the 2nd+ calls hit cache (isDirty_ was cleared in the layout pass - // above). Measured: 105k visits → 10k for a 1593-node fresh-mount tree. - cacheWrite( - node, - availableWidth, - availableHeight, - widthMode, - heightMode, - ownerWidth, - ownerHeight, - forceWidth, - forceHeight, - wasDirty, - ) - return - } - - // Leaf node with no children and no measure func - if (node.children.length === 0) { - node.layout.width = - wMode === MeasureMode.Exactly - ? width - : boundAxis(style, true, paddingBorderWidth, ownerWidth, ownerHeight) - node.layout.height = - hMode === MeasureMode.Exactly - ? height - : boundAxis(style, false, paddingBorderHeight, ownerWidth, ownerHeight) - commitCacheOutputs(node, performLayout) - // Write cache even for dirty nodes — fresh-mounted items during virtual - // scroll are dirty on first layout, but the dirty chain's measure→layout - // cascade invokes them ≥2^depth times per calculateLayout. Writing here - // lets the 2nd+ calls hit cache (isDirty_ was cleared in the layout pass - // above). Measured: 105k visits → 10k for a 1593-node fresh-mount tree. - cacheWrite( - node, - availableWidth, - availableHeight, - widthMode, - heightMode, - ownerWidth, - ownerHeight, - forceWidth, - forceHeight, - wasDirty, - ) - return - } - - // Container with children — run flexbox algorithm - const mainAxis = style.flexDirection - const crossAx = crossAxis(mainAxis) - const isMainRow = isRow(mainAxis) - - const mainSize = isMainRow ? width : height - const crossSize = isMainRow ? height : width - const mainMode = isMainRow ? wMode : hMode - const crossMode = isMainRow ? hMode : wMode - const mainPadBorder = isMainRow ? paddingBorderWidth : paddingBorderHeight - const crossPadBorder = isMainRow ? paddingBorderHeight : paddingBorderWidth - - const innerMainSize = isDefined(mainSize) - ? Math.max(0, mainSize - mainPadBorder) - : NaN - const innerCrossSize = isDefined(crossSize) - ? Math.max(0, crossSize - crossPadBorder) - : NaN - - // Resolve gap - const gapMain = resolveGap( - style, - isMainRow ? Gutter.Column : Gutter.Row, - innerMainSize, - ) - - // Partition children into flow vs absolute. display:contents nodes are - // transparent — their children are lifted into the grandparent's child list - // (recursively), and the contents node itself gets zero layout. - const flowChildren: Node[] = [] - const absChildren: Node[] = [] - collectLayoutChildren(node, flowChildren, absChildren) - - // ownerW/H are the reference sizes for resolving children's percentage - // values. Per CSS, a % width resolves against the parent's content-box - // width. If this node's width is indefinite, children's % widths are also - // indefinite — do NOT fall through to the grandparent's size. - const ownerW = isDefined(width) ? width : NaN - const ownerH = isDefined(height) ? height : NaN - const isWrap = style.flexWrap !== Wrap.NoWrap - const gapCross = resolveGap( - style, - isMainRow ? Gutter.Row : Gutter.Column, - innerCrossSize, - ) - - // STEP 1: Compute flex-basis for each flow child and break into lines. - // Single-line (NoWrap) containers always get one line; multi-line containers - // break when accumulated basis+margin+gap exceeds innerMainSize. - for (const c of flowChildren) { - c._flexBasis = computeFlexBasis( - c, - mainAxis, - innerMainSize, - innerCrossSize, - crossMode, - ownerW, - ownerH, - ) - } - const lines: Node[][] = [] - if (!isWrap || !isDefined(innerMainSize) || flowChildren.length === 0) { - for (const c of flowChildren) c._lineIndex = 0 - lines.push(flowChildren) - } else { - // Line-break decisions use the min/max-clamped basis (flexbox spec §9.3.5: - // "hypothetical main size"), not the raw flex-basis. - let lineStart = 0 - let lineLen = 0 - for (let i = 0; i < flowChildren.length; i++) { - const c = flowChildren[i]! - const hypo = boundAxis(c.style, isMainRow, c._flexBasis, ownerW, ownerH) - const outer = Math.max(0, hypo) + childMarginForAxis(c, mainAxis, ownerW) - const withGap = i > lineStart ? gapMain : 0 - if (i > lineStart && lineLen + withGap + outer > innerMainSize) { - lines.push(flowChildren.slice(lineStart, i)) - lineStart = i - lineLen = outer - } else { - lineLen += withGap + outer - } - c._lineIndex = lines.length - } - lines.push(flowChildren.slice(lineStart)) - } - const lineCount = lines.length - const isBaseline = isBaselineLayout(node, flowChildren) - - // STEP 2+3: For each line, resolve flexible lengths and lay out children to - // measure cross sizes. Track per-line consumed main and max cross. - const lineConsumedMain: number[] = new Array(lineCount) - const lineCrossSizes: number[] = new Array(lineCount) - // Baseline layout tracks max ascent (baseline + leading margin) per line so - // baseline-aligned items can be positioned at maxAscent - childBaseline. - const lineMaxAscent: number[] = isBaseline ? new Array(lineCount).fill(0) : [] - let maxLineMain = 0 - let totalLinesCross = 0 - for (let li = 0; li < lineCount; li++) { - const line = lines[li]! - const lineGap = line.length > 1 ? gapMain * (line.length - 1) : 0 - let lineBasis = lineGap - for (const c of line) { - lineBasis += c._flexBasis + childMarginForAxis(c, mainAxis, ownerW) - } - // Resolve flexible lengths against available inner main. For indefinite - // containers with min/max, flex against the clamped size. - let availMain = innerMainSize - if (!isDefined(availMain)) { - const mainOwner = isMainRow ? ownerWidth : ownerHeight - const minM = resolveValue( - isMainRow ? style.minWidth : style.minHeight, - mainOwner, - ) - const maxM = resolveValue( - isMainRow ? style.maxWidth : style.maxHeight, - mainOwner, - ) - if (isDefined(maxM) && lineBasis > maxM - mainPadBorder) { - availMain = Math.max(0, maxM - mainPadBorder) - } else if (isDefined(minM) && lineBasis < minM - mainPadBorder) { - availMain = Math.max(0, minM - mainPadBorder) - } - } - resolveFlexibleLengths( - line, - availMain, - lineBasis, - isMainRow, - ownerW, - ownerH, - ) - - // Lay out each child in this line to measure cross - let lineCross = 0 - for (const c of line) { - const cStyle = c.style - const childAlign = - cStyle.alignSelf === Align.Auto ? style.alignItems : cStyle.alignSelf - const cMarginCross = childMarginForAxis(c, crossAx, ownerW) - let childCrossSize = NaN - let childCrossMode: MeasureMode = MeasureMode.Undefined - const resolvedCrossStyle = resolveValue( - isMainRow ? cStyle.height : cStyle.width, - isMainRow ? ownerH : ownerW, - ) - const crossLeadE = isMainRow ? EDGE_TOP : EDGE_LEFT - const crossTrailE = isMainRow ? EDGE_BOTTOM : EDGE_RIGHT - const hasCrossAutoMargin = - c._hasAutoMargin && - (isMarginAuto(cStyle.margin, crossLeadE) || - isMarginAuto(cStyle.margin, crossTrailE)) - // Single-line stretch goes directly to the container cross size. - // Multi-line wrap measures intrinsic cross (Undefined mode) so - // flex-grow grandchildren don't expand to the container — the line - // cross size is determined first, then items are re-stretched. - if (isDefined(resolvedCrossStyle)) { - childCrossSize = resolvedCrossStyle - childCrossMode = MeasureMode.Exactly - } else if ( - childAlign === Align.Stretch && - !hasCrossAutoMargin && - !isWrap && - isDefined(innerCrossSize) && - crossMode === MeasureMode.Exactly - ) { - childCrossSize = Math.max(0, innerCrossSize - cMarginCross) - childCrossMode = MeasureMode.Exactly - } else if (!isWrap && isDefined(innerCrossSize)) { - childCrossSize = Math.max(0, innerCrossSize - cMarginCross) - childCrossMode = MeasureMode.AtMost - } - const cw = isMainRow ? c._mainSize : childCrossSize - const ch = isMainRow ? childCrossSize : c._mainSize - layoutNode( - c, - cw, - ch, - isMainRow ? MeasureMode.Exactly : childCrossMode, - isMainRow ? childCrossMode : MeasureMode.Exactly, - ownerW, - ownerH, - performLayout, - isMainRow, - !isMainRow, - ) - c._crossSize = isMainRow ? c.layout.height : c.layout.width - lineCross = Math.max(lineCross, c._crossSize + cMarginCross) - } - // Baseline layout: line cross size must fit maxAscent + maxDescent of - // baseline-aligned children (yoga STEP 8). Only applies to row direction. - if (isBaseline) { - let maxAscent = 0 - let maxDescent = 0 - for (const c of line) { - if (resolveChildAlign(node, c) !== Align.Baseline) continue - const mTop = resolveEdge(c.style.margin, EDGE_TOP, ownerW) - const mBot = resolveEdge(c.style.margin, EDGE_BOTTOM, ownerW) - const ascent = calculateBaseline(c) + mTop - const descent = c.layout.height + mTop + mBot - ascent - if (ascent > maxAscent) maxAscent = ascent - if (descent > maxDescent) maxDescent = descent - } - lineMaxAscent[li] = maxAscent - if (maxAscent + maxDescent > lineCross) { - lineCross = maxAscent + maxDescent - } - } - // layoutNode(c) at line ~1117 above already resolved c.layout.margin[] via - // resolveEdges4Into with the same ownerW — read directly instead of - // re-resolving through childMarginForAxis → 2× resolveEdge. - const mainLead = leadingEdge(mainAxis) - const mainTrail = trailingEdge(mainAxis) - let consumed = lineGap - for (const c of line) { - const cm = c.layout.margin - consumed += c._mainSize + cm[mainLead]! + cm[mainTrail]! - } - lineConsumedMain[li] = consumed - lineCrossSizes[li] = lineCross - maxLineMain = Math.max(maxLineMain, consumed) - totalLinesCross += lineCross - } - const totalCrossGap = lineCount > 1 ? gapCross * (lineCount - 1) : 0 - totalLinesCross += totalCrossGap - - // STEP 4: Determine container dimensions. Per yoga's STEP 9, for both - // AtMost (FitContent) and Undefined (MaxContent) the node sizes to its - // content — AtMost is NOT a hard clamp, items may overflow the available - // space (CSS "fit-content" behavior). Only Scroll overflow clamps to the - // available size. Wrap containers that broke into multiple lines under - // AtMost fill the available main size since they wrapped at that boundary. - const isScroll = style.overflow === Overflow.Scroll - const contentMain = maxLineMain + mainPadBorder - const finalMainSize = - mainMode === MeasureMode.Exactly - ? mainSize - : mainMode === MeasureMode.AtMost && isScroll - ? Math.max(Math.min(mainSize, contentMain), mainPadBorder) - : isWrap && lineCount > 1 && mainMode === MeasureMode.AtMost - ? mainSize - : contentMain - const contentCross = totalLinesCross + crossPadBorder - const finalCrossSize = - crossMode === MeasureMode.Exactly - ? crossSize - : crossMode === MeasureMode.AtMost && isScroll - ? Math.max(Math.min(crossSize, contentCross), crossPadBorder) - : contentCross - node.layout.width = boundAxis( - style, - true, - isMainRow ? finalMainSize : finalCrossSize, - ownerWidth, - ownerHeight, - ) - node.layout.height = boundAxis( - style, - false, - isMainRow ? finalCrossSize : finalMainSize, - ownerWidth, - ownerHeight, - ) - commitCacheOutputs(node, performLayout) - // Write cache even for dirty nodes — fresh-mounted items during virtual scroll - cacheWrite( - node, - availableWidth, - availableHeight, - widthMode, - heightMode, - ownerWidth, - ownerHeight, - forceWidth, - forceHeight, - wasDirty, - ) - - if (!performLayout) return - - // STEP 5: Position lines (align-content) and children (justify-content + - // align-items + auto margins). - const actualInnerMain = - (isMainRow ? node.layout.width : node.layout.height) - mainPadBorder - const actualInnerCross = - (isMainRow ? node.layout.height : node.layout.width) - crossPadBorder - const mainLeadEdgePhys = leadingEdge(mainAxis) - const mainTrailEdgePhys = trailingEdge(mainAxis) - const crossLeadEdgePhys = isMainRow ? EDGE_TOP : EDGE_LEFT - const crossTrailEdgePhys = isMainRow ? EDGE_BOTTOM : EDGE_RIGHT - const reversed = isReverse(mainAxis) - const mainContainerSize = isMainRow ? node.layout.width : node.layout.height - const crossLead = pad[crossLeadEdgePhys]! + bor[crossLeadEdgePhys]! - - // Align-content: distribute free cross space among lines. Single-line - // containers use the full cross size for the one line (align-items handles - // positioning within it). - let lineCrossOffset = crossLead - let betweenLines = gapCross - const freeCross = actualInnerCross - totalLinesCross - if (lineCount === 1 && !isWrap && !isBaseline) { - lineCrossSizes[0] = actualInnerCross - } else { - const remCross = Math.max(0, freeCross) - switch (style.alignContent) { - case Align.FlexStart: - break - case Align.Center: - lineCrossOffset += freeCross / 2 - break - case Align.FlexEnd: - lineCrossOffset += freeCross - break - case Align.Stretch: - if (lineCount > 0 && remCross > 0) { - const add = remCross / lineCount - for (let i = 0; i < lineCount; i++) lineCrossSizes[i]! += add - } - break - case Align.SpaceBetween: - if (lineCount > 1) betweenLines += remCross / (lineCount - 1) - break - case Align.SpaceAround: - if (lineCount > 0) { - betweenLines += remCross / lineCount - lineCrossOffset += remCross / lineCount / 2 - } - break - case Align.SpaceEvenly: - if (lineCount > 0) { - betweenLines += remCross / (lineCount + 1) - lineCrossOffset += remCross / (lineCount + 1) - } - break - default: - break - } - } - - // For wrap-reverse, lines stack from the trailing cross edge. Walk lines in - // order but flip the cross position within the container. - const wrapReverse = style.flexWrap === Wrap.WrapReverse - const crossContainerSize = isMainRow ? node.layout.height : node.layout.width - let lineCrossPos = lineCrossOffset - for (let li = 0; li < lineCount; li++) { - const line = lines[li]! - const lineCross = lineCrossSizes[li]! - const consumedMain = lineConsumedMain[li]! - const n = line.length - - // Re-stretch children whose cross is auto and align is stretch, now that - // the line cross size is known. Needed for multi-line wrap (line cross - // wasn't known during initial measure) AND single-line when the container - // cross was not Exactly (initial stretch at ~line 1250 was skipped because - // innerCrossSize wasn't defined — the container sized to max child cross). - if (isWrap || crossMode !== MeasureMode.Exactly) { - for (const c of line) { - const cStyle = c.style - const childAlign = - cStyle.alignSelf === Align.Auto ? style.alignItems : cStyle.alignSelf - const crossStyleDef = isDefined( - resolveValue( - isMainRow ? cStyle.height : cStyle.width, - isMainRow ? ownerH : ownerW, - ), - ) - const hasCrossAutoMargin = - c._hasAutoMargin && - (isMarginAuto(cStyle.margin, crossLeadEdgePhys) || - isMarginAuto(cStyle.margin, crossTrailEdgePhys)) - if ( - childAlign === Align.Stretch && - !crossStyleDef && - !hasCrossAutoMargin - ) { - const cMarginCross = childMarginForAxis(c, crossAx, ownerW) - const target = Math.max(0, lineCross - cMarginCross) - if (c._crossSize !== target) { - const cw = isMainRow ? c._mainSize : target - const ch = isMainRow ? target : c._mainSize - layoutNode( - c, - cw, - ch, - MeasureMode.Exactly, - MeasureMode.Exactly, - ownerW, - ownerH, - performLayout, - isMainRow, - !isMainRow, - ) - c._crossSize = target - } - } - } - } - - // Justify-content + auto margins for this line - let mainOffset = pad[mainLeadEdgePhys]! + bor[mainLeadEdgePhys]! - let betweenMain = gapMain - let numAutoMarginsMain = 0 - for (const c of line) { - if (!c._hasAutoMargin) continue - if (isMarginAuto(c.style.margin, mainLeadEdgePhys)) numAutoMarginsMain++ - if (isMarginAuto(c.style.margin, mainTrailEdgePhys)) numAutoMarginsMain++ - } - const freeMain = actualInnerMain - consumedMain - const remainingMain = Math.max(0, freeMain) - const autoMarginMainSize = - numAutoMarginsMain > 0 && remainingMain > 0 - ? remainingMain / numAutoMarginsMain - : 0 - if (numAutoMarginsMain === 0) { - switch (style.justifyContent) { - case Justify.FlexStart: - break - case Justify.Center: - mainOffset += freeMain / 2 - break - case Justify.FlexEnd: - mainOffset += freeMain - break - case Justify.SpaceBetween: - if (n > 1) betweenMain += remainingMain / (n - 1) - break - case Justify.SpaceAround: - if (n > 0) { - betweenMain += remainingMain / n - mainOffset += remainingMain / n / 2 - } - break - case Justify.SpaceEvenly: - if (n > 0) { - betweenMain += remainingMain / (n + 1) - mainOffset += remainingMain / (n + 1) - } - break - } - } - - const effectiveLineCrossPos = wrapReverse - ? crossContainerSize - lineCrossPos - lineCross - : lineCrossPos - - let pos = mainOffset - for (const c of line) { - const cMargin = c.style.margin - // c.layout.margin[] was populated by resolveEdges4Into inside the - // layoutNode(c) call above (same ownerW). Read resolved values directly - // instead of re-running the edge fallback chain 4× via resolveEdge. - // Auto margins resolve to 0 in layout.margin, so autoMarginMainSize - // substitution still uses the isMarginAuto check against style. - const cLayoutMargin = c.layout.margin - let autoMainLead = false - let autoMainTrail = false - let autoCrossLead = false - let autoCrossTrail = false - let mMainLead: number - let mMainTrail: number - let mCrossLead: number - let mCrossTrail: number - if (c._hasAutoMargin) { - autoMainLead = isMarginAuto(cMargin, mainLeadEdgePhys) - autoMainTrail = isMarginAuto(cMargin, mainTrailEdgePhys) - autoCrossLead = isMarginAuto(cMargin, crossLeadEdgePhys) - autoCrossTrail = isMarginAuto(cMargin, crossTrailEdgePhys) - mMainLead = autoMainLead - ? autoMarginMainSize - : cLayoutMargin[mainLeadEdgePhys]! - mMainTrail = autoMainTrail - ? autoMarginMainSize - : cLayoutMargin[mainTrailEdgePhys]! - mCrossLead = autoCrossLead ? 0 : cLayoutMargin[crossLeadEdgePhys]! - mCrossTrail = autoCrossTrail ? 0 : cLayoutMargin[crossTrailEdgePhys]! - } else { - // Fast path: no auto margins — read resolved values directly. - mMainLead = cLayoutMargin[mainLeadEdgePhys]! - mMainTrail = cLayoutMargin[mainTrailEdgePhys]! - mCrossLead = cLayoutMargin[crossLeadEdgePhys]! - mCrossTrail = cLayoutMargin[crossTrailEdgePhys]! - } - - const mainPos = reversed - ? mainContainerSize - (pos + mMainLead) - c._mainSize - : pos + mMainLead - - const childAlign = - c.style.alignSelf === Align.Auto ? style.alignItems : c.style.alignSelf - let crossPos = effectiveLineCrossPos + mCrossLead - const crossFree = lineCross - c._crossSize - mCrossLead - mCrossTrail - if (autoCrossLead && autoCrossTrail) { - crossPos += Math.max(0, crossFree) / 2 - } else if (autoCrossLead) { - crossPos += Math.max(0, crossFree) - } else if (autoCrossTrail) { - // stays at leading - } else { - switch (childAlign) { - case Align.FlexStart: - case Align.Stretch: - if (wrapReverse) crossPos += crossFree - break - case Align.Center: - crossPos += crossFree / 2 - break - case Align.FlexEnd: - if (!wrapReverse) crossPos += crossFree - break - case Align.Baseline: - // Row direction only (isBaselineLayout checked this). Position so - // the child's baseline aligns with the line's max ascent. Per - // yoga: top = currentLead + maxAscent - childBaseline + leadingPosition. - if (isBaseline) { - crossPos = - effectiveLineCrossPos + - lineMaxAscent[li]! - - calculateBaseline(c) - } - break - default: - break - } - } - - // Relative position offsets. Fast path: no position insets set → - // skip 4× resolveEdgeRaw + 4× resolveValue + 4× isDefined. - let relX = 0 - let relY = 0 - if (c._hasPosition) { - const relLeft = resolveValue( - resolveEdgeRaw(c.style.position, EDGE_LEFT), - ownerW, - ) - const relRight = resolveValue( - resolveEdgeRaw(c.style.position, EDGE_RIGHT), - ownerW, - ) - const relTop = resolveValue( - resolveEdgeRaw(c.style.position, EDGE_TOP), - ownerW, - ) - const relBottom = resolveValue( - resolveEdgeRaw(c.style.position, EDGE_BOTTOM), - ownerW, - ) - relX = isDefined(relLeft) - ? relLeft - : isDefined(relRight) - ? -relRight - : 0 - relY = isDefined(relTop) - ? relTop - : isDefined(relBottom) - ? -relBottom - : 0 - } - - if (isMainRow) { - c.layout.left = mainPos + relX - c.layout.top = crossPos + relY - } else { - c.layout.left = crossPos + relX - c.layout.top = mainPos + relY - } - pos += c._mainSize + mMainLead + mMainTrail + betweenMain - } - lineCrossPos += lineCross + betweenLines - } - - // STEP 6: Absolute-positioned children - for (const c of absChildren) { - layoutAbsoluteChild( - node, - c, - node.layout.width, - node.layout.height, - pad, - bor, - ) - } -} - -function layoutAbsoluteChild( - parent: Node, - child: Node, - parentWidth: number, - parentHeight: number, - pad: [number, number, number, number], - bor: [number, number, number, number], -): void { - const cs = child.style - const posLeft = resolveEdgeRaw(cs.position, EDGE_LEFT) - const posRight = resolveEdgeRaw(cs.position, EDGE_RIGHT) - const posTop = resolveEdgeRaw(cs.position, EDGE_TOP) - const posBottom = resolveEdgeRaw(cs.position, EDGE_BOTTOM) - - const rLeft = resolveValue(posLeft, parentWidth) - const rRight = resolveValue(posRight, parentWidth) - const rTop = resolveValue(posTop, parentHeight) - const rBottom = resolveValue(posBottom, parentHeight) - - // Absolute children's percentage dimensions resolve against the containing - // block's padding-box (parent size minus border), per CSS §10.1. - const paddingBoxW = parentWidth - bor[0] - bor[2] - const paddingBoxH = parentHeight - bor[1] - bor[3] - let cw = resolveValue(cs.width, paddingBoxW) - let ch = resolveValue(cs.height, paddingBoxH) - - // If both left+right defined and width not, derive width - if (!isDefined(cw) && isDefined(rLeft) && isDefined(rRight)) { - cw = paddingBoxW - rLeft - rRight - } - if (!isDefined(ch) && isDefined(rTop) && isDefined(rBottom)) { - ch = paddingBoxH - rTop - rBottom - } - - layoutNode( - child, - cw, - ch, - isDefined(cw) ? MeasureMode.Exactly : MeasureMode.Undefined, - isDefined(ch) ? MeasureMode.Exactly : MeasureMode.Undefined, - paddingBoxW, - paddingBoxH, - true, - ) - - // Margin of absolute child (applied in addition to insets) - const mL = resolveEdge(cs.margin, EDGE_LEFT, parentWidth) - const mT = resolveEdge(cs.margin, EDGE_TOP, parentWidth) - const mR = resolveEdge(cs.margin, EDGE_RIGHT, parentWidth) - const mB = resolveEdge(cs.margin, EDGE_BOTTOM, parentWidth) - - const mainAxis = parent.style.flexDirection - const reversed = isReverse(mainAxis) - const mainRow = isRow(mainAxis) - const wrapReverse = parent.style.flexWrap === Wrap.WrapReverse - // alignSelf overrides alignItems for absolute children (same as flow items) - const alignment = - cs.alignSelf === Align.Auto ? parent.style.alignItems : cs.alignSelf - - // Position - let left: number - if (isDefined(rLeft)) { - left = bor[0] + rLeft + mL - } else if (isDefined(rRight)) { - left = parentWidth - bor[2] - rRight - child.layout.width - mR - } else if (mainRow) { - // Main axis — justify-content, flipped for reversed - const lead = pad[0] + bor[0] - const trail = parentWidth - pad[2] - bor[2] - left = reversed - ? trail - child.layout.width - mR - : justifyAbsolute( - parent.style.justifyContent, - lead, - trail, - child.layout.width, - ) + mL - } else { - left = - alignAbsolute( - alignment, - pad[0] + bor[0], - parentWidth - pad[2] - bor[2], - child.layout.width, - wrapReverse, - ) + mL - } - - let top: number - if (isDefined(rTop)) { - top = bor[1] + rTop + mT - } else if (isDefined(rBottom)) { - top = parentHeight - bor[3] - rBottom - child.layout.height - mB - } else if (mainRow) { - top = - alignAbsolute( - alignment, - pad[1] + bor[1], - parentHeight - pad[3] - bor[3], - child.layout.height, - wrapReverse, - ) + mT - } else { - const lead = pad[1] + bor[1] - const trail = parentHeight - pad[3] - bor[3] - top = reversed - ? trail - child.layout.height - mB - : justifyAbsolute( - parent.style.justifyContent, - lead, - trail, - child.layout.height, - ) + mT - } - - child.layout.left = left - child.layout.top = top -} - -function justifyAbsolute( - justify: Justify, - leadEdge: number, - trailEdge: number, - childSize: number, -): number { - switch (justify) { - case Justify.Center: - return leadEdge + (trailEdge - leadEdge - childSize) / 2 - case Justify.FlexEnd: - return trailEdge - childSize - default: - return leadEdge - } -} - -function alignAbsolute( - align: Align, - leadEdge: number, - trailEdge: number, - childSize: number, - wrapReverse: boolean, -): number { - // Wrap-reverse flips the cross axis: flex-start/stretch go to trailing, - // flex-end goes to leading (yoga's absoluteLayoutChild flips the align value - // when the containing block has wrap-reverse). - switch (align) { - case Align.Center: - return leadEdge + (trailEdge - leadEdge - childSize) / 2 - case Align.FlexEnd: - return wrapReverse ? leadEdge : trailEdge - childSize - default: - return wrapReverse ? trailEdge - childSize : leadEdge - } -} - -function computeFlexBasis( - child: Node, - mainAxis: FlexDirection, - availableMain: number, - availableCross: number, - crossMode: MeasureMode, - ownerWidth: number, - ownerHeight: number, -): number { - // Same-generation cache hit: basis was computed THIS calculateLayout, so - // it's fresh regardless of isDirty_. Covers both clean children (scrolling - // past unchanged messages) AND fresh-mounted dirty children (virtual - // scroll mounts new items — the dirty chain's measure→layout cascade - // invokes this ≥2^depth times, but the child's subtree doesn't change - // between calls within one calculateLayout). For clean children with - // cache from a PREVIOUS generation, also hit if inputs match — isDirty_ - // gates since a dirty child's previous-gen cache is stale. - const sameGen = child._fbGen === _generation - if ( - (sameGen || !child.isDirty_) && - child._fbCrossMode === crossMode && - sameFloat(child._fbOwnerW, ownerWidth) && - sameFloat(child._fbOwnerH, ownerHeight) && - sameFloat(child._fbAvailMain, availableMain) && - sameFloat(child._fbAvailCross, availableCross) - ) { - return child._fbBasis - } - const cs = child.style - const isMainRow = isRow(mainAxis) - - // Explicit flex-basis - const basis = resolveValue(cs.flexBasis, availableMain) - if (isDefined(basis)) { - const b = Math.max(0, basis) - child._fbBasis = b - child._fbOwnerW = ownerWidth - child._fbOwnerH = ownerHeight - child._fbAvailMain = availableMain - child._fbAvailCross = availableCross - child._fbCrossMode = crossMode - child._fbGen = _generation - return b - } - - // Style dimension on main axis - const mainStyleDim = isMainRow ? cs.width : cs.height - const mainOwner = isMainRow ? ownerWidth : ownerHeight - const resolved = resolveValue(mainStyleDim, mainOwner) - if (isDefined(resolved)) { - const b = Math.max(0, resolved) - child._fbBasis = b - child._fbOwnerW = ownerWidth - child._fbOwnerH = ownerHeight - child._fbAvailMain = availableMain - child._fbAvailCross = availableCross - child._fbCrossMode = crossMode - child._fbGen = _generation - return b - } - - // Need to measure the child to get its natural size - const crossStyleDim = isMainRow ? cs.height : cs.width - const crossOwner = isMainRow ? ownerHeight : ownerWidth - let crossConstraint = resolveValue(crossStyleDim, crossOwner) - let crossConstraintMode: MeasureMode = isDefined(crossConstraint) - ? MeasureMode.Exactly - : MeasureMode.Undefined - if (!isDefined(crossConstraint) && isDefined(availableCross)) { - crossConstraint = availableCross - crossConstraintMode = - crossMode === MeasureMode.Exactly && isStretchAlign(child) - ? MeasureMode.Exactly - : MeasureMode.AtMost - } - - // Upstream yoga (YGNodeComputeFlexBasisForChild) passes the available inner - // width with mode AtMost when the subtree will call a measure-func — so text - // nodes don't report unconstrained intrinsic width as flex-basis, which - // would force siblings to shrink and the text to wrap at the wrong width. - // Passing Undefined here made Ink's inside get - // width = intrinsic instead of available, dropping chars at wrap boundaries. - // - // Two constraints on when this applies: - // - Width only. Height is never constrained during basis measurement — - // column containers must measure children at natural height so - // scrollable content can overflow (constraining height clips ScrollBox). - // - Subtree has a measure-func. Pure layout subtrees (no measure-func) - // with flex-grow children would grow into the AtMost constraint, - // inflating the basis (breaks YGMinMaxDimensionTest flex_grow_in_at_most - // where a flexGrow:1 child should stay at basis 0, not grow to 100). - let mainConstraint = NaN - let mainConstraintMode: MeasureMode = MeasureMode.Undefined - if (isMainRow && isDefined(availableMain) && hasMeasureFuncInSubtree(child)) { - mainConstraint = availableMain - mainConstraintMode = MeasureMode.AtMost - } - - const mw = isMainRow ? mainConstraint : crossConstraint - const mh = isMainRow ? crossConstraint : mainConstraint - const mwMode = isMainRow ? mainConstraintMode : crossConstraintMode - const mhMode = isMainRow ? crossConstraintMode : mainConstraintMode - - layoutNode(child, mw, mh, mwMode, mhMode, ownerWidth, ownerHeight, false) - const b = isMainRow ? child.layout.width : child.layout.height - child._fbBasis = b - child._fbOwnerW = ownerWidth - child._fbOwnerH = ownerHeight - child._fbAvailMain = availableMain - child._fbAvailCross = availableCross - child._fbCrossMode = crossMode - child._fbGen = _generation - return b -} - -function hasMeasureFuncInSubtree(node: Node): boolean { - if (node.measureFunc) return true - for (const c of node.children) { - if (hasMeasureFuncInSubtree(c)) return true - } - return false -} - -function resolveFlexibleLengths( - children: Node[], - availableInnerMain: number, - totalFlexBasis: number, - isMainRow: boolean, - ownerW: number, - ownerH: number, -): void { - // Multi-pass flex distribution per CSS flexbox spec §9.7 "Resolving Flexible - // Lengths": distribute free space, detect min/max violations, freeze all - // violators, redistribute among unfrozen children. Repeat until stable. - const n = children.length - const frozen: boolean[] = new Array(n).fill(false) - const initialFree = isDefined(availableInnerMain) - ? availableInnerMain - totalFlexBasis - : 0 - // Freeze inflexible items at their clamped basis - for (let i = 0; i < n; i++) { - const c = children[i]! - const clamped = boundAxis(c.style, isMainRow, c._flexBasis, ownerW, ownerH) - const inflexible = - !isDefined(availableInnerMain) || - (initialFree >= 0 ? c.style.flexGrow === 0 : c.style.flexShrink === 0) - if (inflexible) { - c._mainSize = Math.max(0, clamped) - frozen[i] = true - } else { - c._mainSize = c._flexBasis - } - } - // Iteratively distribute until no violations. Free space is recomputed each - // pass: initial free space minus the delta frozen children consumed beyond - // (or below) their basis. - const unclamped: number[] = new Array(n) - for (let iter = 0; iter <= n; iter++) { - let frozenDelta = 0 - let totalGrow = 0 - let totalShrinkScaled = 0 - let unfrozenCount = 0 - for (let i = 0; i < n; i++) { - const c = children[i]! - if (frozen[i]) { - frozenDelta += c._mainSize - c._flexBasis - } else { - totalGrow += c.style.flexGrow - totalShrinkScaled += c.style.flexShrink * c._flexBasis - unfrozenCount++ - } - } - if (unfrozenCount === 0) break - let remaining = initialFree - frozenDelta - // Spec §9.7 step 4c: if sum of flex factors < 1, only distribute - // initialFree × sum, not the full remaining space (partial flex). - if (remaining > 0 && totalGrow > 0 && totalGrow < 1) { - const scaled = initialFree * totalGrow - if (scaled < remaining) remaining = scaled - } else if (remaining < 0 && totalShrinkScaled > 0) { - let totalShrink = 0 - for (let i = 0; i < n; i++) { - if (!frozen[i]) totalShrink += children[i]!.style.flexShrink - } - if (totalShrink < 1) { - const scaled = initialFree * totalShrink - if (scaled > remaining) remaining = scaled - } - } - // Compute targets + violations for all unfrozen children - let totalViolation = 0 - for (let i = 0; i < n; i++) { - if (frozen[i]) continue - const c = children[i]! - let t = c._flexBasis - if (remaining > 0 && totalGrow > 0) { - t += (remaining * c.style.flexGrow) / totalGrow - } else if (remaining < 0 && totalShrinkScaled > 0) { - t += - (remaining * (c.style.flexShrink * c._flexBasis)) / totalShrinkScaled - } - unclamped[i] = t - const clamped = Math.max( - 0, - boundAxis(c.style, isMainRow, t, ownerW, ownerH), - ) - c._mainSize = clamped - totalViolation += clamped - t - } - // Freeze per spec §9.7 step 5: if totalViolation is zero freeze all; if - // positive freeze min-violators; if negative freeze max-violators. - if (totalViolation === 0) break - let anyFrozen = false - for (let i = 0; i < n; i++) { - if (frozen[i]) continue - const v = children[i]!._mainSize - unclamped[i]! - if ((totalViolation > 0 && v > 0) || (totalViolation < 0 && v < 0)) { - frozen[i] = true - anyFrozen = true - } - } - if (!anyFrozen) break - } -} - -function isStretchAlign(child: Node): boolean { - const p = child.parent - if (!p) return false - const align = - child.style.alignSelf === Align.Auto - ? p.style.alignItems - : child.style.alignSelf - return align === Align.Stretch -} - -function resolveChildAlign(parent: Node, child: Node): Align { - return child.style.alignSelf === Align.Auto - ? parent.style.alignItems - : child.style.alignSelf -} - -// Baseline of a node per CSS Flexbox §8.5 / yoga's YGBaseline. Leaf nodes -// (no children) use their own height. Containers recurse into the first -// baseline-aligned child on the first line (or the first flow child if none -// are baseline-aligned), returning that child's baseline + its top offset. -function calculateBaseline(node: Node): number { - let baselineChild: Node | null = null - for (const c of node.children) { - if (c._lineIndex > 0) break - if (c.style.positionType === PositionType.Absolute) continue - if (c.style.display === Display.None) continue - if ( - resolveChildAlign(node, c) === Align.Baseline || - c.isReferenceBaseline_ - ) { - baselineChild = c - break - } - if (baselineChild === null) baselineChild = c - } - if (baselineChild === null) return node.layout.height - return calculateBaseline(baselineChild) + baselineChild.layout.top -} - -// A container uses baseline layout only for row direction, when either -// align-items is baseline or any flow child has align-self: baseline. -function isBaselineLayout(node: Node, flowChildren: Node[]): boolean { - if (!isRow(node.style.flexDirection)) return false - if (node.style.alignItems === Align.Baseline) return true - for (const c of flowChildren) { - if (c.style.alignSelf === Align.Baseline) return true - } - return false -} - -function childMarginForAxis( - child: Node, - axis: FlexDirection, - ownerWidth: number, -): number { - if (!child._hasMargin) return 0 - const lead = resolveEdge(child.style.margin, leadingEdge(axis), ownerWidth) - const trail = resolveEdge(child.style.margin, trailingEdge(axis), ownerWidth) - return lead + trail -} - -function resolveGap(style: Style, gutter: Gutter, ownerSize: number): number { - let v = style.gap[gutter]! - if (v.unit === Unit.Undefined) v = style.gap[Gutter.All]! - const r = resolveValue(v, ownerSize) - return isDefined(r) ? Math.max(0, r) : 0 -} - -function boundAxis( - style: Style, - isWidth: boolean, - value: number, - ownerWidth: number, - ownerHeight: number, -): number { - const minV = isWidth ? style.minWidth : style.minHeight - const maxV = isWidth ? style.maxWidth : style.maxHeight - const minU = minV.unit - const maxU = maxV.unit - // Fast path: no min/max constraints set. Per CPU profile this is the - // overwhelmingly common case (~32k calls/layout on the 1000-node bench, - // nearly all with undefined min/max) — skipping 2× resolveValue + 2× isNaN - // that always no-op. Unit.Undefined = 0. - if (minU === 0 && maxU === 0) return value - const owner = isWidth ? ownerWidth : ownerHeight - let v = value - // Inlined resolveValue: Unit.Point=1, Unit.Percent=2. `m === m` is !isNaN. - if (maxU === 1) { - if (v > maxV.value) v = maxV.value - } else if (maxU === 2) { - const m = (maxV.value * owner) / 100 - if (m === m && v > m) v = m - } - if (minU === 1) { - if (v < minV.value) v = minV.value - } else if (minU === 2) { - const m = (minV.value * owner) / 100 - if (m === m && v < m) v = m - } - return v -} - -function zeroLayoutRecursive(node: Node): void { - for (const c of node.children) { - c.layout.left = 0 - c.layout.top = 0 - c.layout.width = 0 - c.layout.height = 0 - // Invalidate layout cache — without this, unhide → calculateLayout finds - // the child clean (!isDirty_) with _hasL intact, hits the cache at line - // ~1086, restores stale _lOutW/_lOutH, and returns early — skipping the - // child-positioning recursion. Grandchildren stay at (0,0,0,0) from the - // zeroing above and render invisible. isDirty_=true also gates _cN and - // _fbBasis via their (sameGen || !isDirty_) checks — _cGen/_fbGen freeze - // during hide so sameGen is false on unhide. - c.isDirty_ = true - c._hasL = false - c._hasM = false - zeroLayoutRecursive(c) - } -} - -function collectLayoutChildren(node: Node, flow: Node[], abs: Node[]): void { - // Partition a node's children into flow and absolute lists, flattening - // display:contents subtrees so their children are laid out as direct - // children of this node (per CSS display:contents spec — the box is removed - // from the layout tree but its children remain, lifted to the grandparent). - for (const c of node.children) { - const disp = c.style.display - if (disp === Display.None) { - c.layout.left = 0 - c.layout.top = 0 - c.layout.width = 0 - c.layout.height = 0 - zeroLayoutRecursive(c) - } else if (disp === Display.Contents) { - c.layout.left = 0 - c.layout.top = 0 - c.layout.width = 0 - c.layout.height = 0 - // Recurse — nested display:contents lifts all the way up. The contents - // node's own margin/padding/position/dimensions are ignored. - collectLayoutChildren(c, flow, abs) - } else if (c.style.positionType === PositionType.Absolute) { - abs.push(c) - } else { - flow.push(c) - } - } -} - -function roundLayout( - node: Node, - scale: number, - absLeft: number, - absTop: number, -): void { - if (scale === 0) return - const l = node.layout - const nodeLeft = l.left - const nodeTop = l.top - const nodeWidth = l.width - const nodeHeight = l.height - - const absNodeLeft = absLeft + nodeLeft - const absNodeTop = absTop + nodeTop - - // Upstream YGRoundValueToPixelGrid: text nodes (has measureFunc) floor their - // positions so wrapped text never starts past its allocated column. Width - // uses ceil-if-fractional to avoid clipping the last glyph. Non-text nodes - // use standard round. Matches yoga's PixelGrid.cpp — without this, justify - // center/space-evenly positions are off-by-one vs WASM and flex-shrink - // overflow places siblings at the wrong column. - const isText = node.measureFunc !== null - l.left = roundValue(nodeLeft, scale, false, isText) - l.top = roundValue(nodeTop, scale, false, isText) - - // Width/height rounded via absolute edges to avoid cumulative drift - const absRight = absNodeLeft + nodeWidth - const absBottom = absNodeTop + nodeHeight - const hasFracW = !isWholeNumber(nodeWidth * scale) - const hasFracH = !isWholeNumber(nodeHeight * scale) - l.width = - roundValue(absRight, scale, isText && hasFracW, isText && !hasFracW) - - roundValue(absNodeLeft, scale, false, isText) - l.height = - roundValue(absBottom, scale, isText && hasFracH, isText && !hasFracH) - - roundValue(absNodeTop, scale, false, isText) - - for (const c of node.children) { - roundLayout(c, scale, absNodeLeft, absNodeTop) - } -} - -function isWholeNumber(v: number): boolean { - const frac = v - Math.floor(v) - return frac < 0.0001 || frac > 0.9999 -} - -function roundValue( - v: number, - scale: number, - forceCeil: boolean, - forceFloor: boolean, -): number { - let scaled = v * scale - let frac = scaled - Math.floor(scaled) - if (frac < 0) frac += 1 - // Float-epsilon tolerance matches upstream YGDoubleEqual (1e-4) - if (frac < 0.0001) { - scaled = Math.floor(scaled) - } else if (frac > 0.9999) { - scaled = Math.ceil(scaled) - } else if (forceCeil) { - scaled = Math.ceil(scaled) - } else if (forceFloor) { - scaled = Math.floor(scaled) - } else { - // Round half-up (>= 0.5 goes up), per upstream - scaled = Math.floor(scaled) + (frac >= 0.4999 ? 1 : 0) - } - return scaled / scale -} - -// -- -// Helpers - -function parseDimension(v: number | string | undefined): Value { - if (v === undefined) return UNDEFINED_VALUE - if (v === 'auto') return AUTO_VALUE - if (typeof v === 'number') { - // WASM yoga's YGFloatIsUndefined treats NaN and ±Infinity as undefined. - // Ink passes height={Infinity} (e.g. LogSelector maxHeight default) and - // expects it to mean "unconstrained" — storing it as a literal point value - // makes the node height Infinity and breaks all downstream layout. - return Number.isFinite(v) ? pointValue(v) : UNDEFINED_VALUE - } - if (typeof v === 'string' && v.endsWith('%')) { - return percentValue(parseFloat(v)) - } - const n = parseFloat(v) - return isNaN(n) ? UNDEFINED_VALUE : pointValue(n) -} - -function physicalEdge(edge: Edge): number { - switch (edge) { - case Edge.Left: - case Edge.Start: - return EDGE_LEFT - case Edge.Top: - return EDGE_TOP - case Edge.Right: - case Edge.End: - return EDGE_RIGHT - case Edge.Bottom: - return EDGE_BOTTOM - default: - return EDGE_LEFT - } -} - -// -- -// Module API matching yoga-layout/load - -export type Yoga = { - Config: { - create(): Config - destroy(config: Config): void - } - Node: { - create(config?: Config): Node - createDefault(): Node - createWithConfig(config: Config): Node - destroy(node: Node): void - } -} - -const YOGA_INSTANCE: Yoga = { - Config: { - create: createConfig, - destroy() {}, - }, - Node: { - create: (config?: Config) => new Node(config), - createDefault: () => new Node(), - createWithConfig: (config: Config) => new Node(config), - destroy() {}, - }, -} - -export function loadYoga(): Promise { - return Promise.resolve(YOGA_INSTANCE) -} - -export default YOGA_INSTANCE diff --git a/src/schemas/src/entrypoints/agentSdkTypes.ts b/src/schemas/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 264ee1cdd..000000000 --- a/src/schemas/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HOOK_EVENTS = any; -export type HookEvent = any; diff --git a/src/screens/src/cli/structuredIO.ts b/src/screens/src/cli/structuredIO.ts deleted file mode 100644 index 8e536b8a2..000000000 --- a/src/screens/src/cli/structuredIO.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SANDBOX_NETWORK_ACCESS_TOOL_NAME = any; diff --git a/src/screens/src/components/AutoModeOptInDialog.ts b/src/screens/src/components/AutoModeOptInDialog.ts deleted file mode 100644 index f441f7e57..000000000 --- a/src/screens/src/components/AutoModeOptInDialog.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AUTO_MODE_DESCRIPTION = any; diff --git a/src/screens/src/components/ClaudeCodeHint/PluginHintMenu.ts b/src/screens/src/components/ClaudeCodeHint/PluginHintMenu.ts deleted file mode 100644 index 2369289c7..000000000 --- a/src/screens/src/components/ClaudeCodeHint/PluginHintMenu.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PluginHintMenu = any; diff --git a/src/screens/src/components/DesktopUpsell/DesktopUpsellStartup.ts b/src/screens/src/components/DesktopUpsell/DesktopUpsellStartup.ts deleted file mode 100644 index fcb5dc73d..000000000 --- a/src/screens/src/components/DesktopUpsell/DesktopUpsellStartup.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type DesktopUpsellStartup = any; -export type shouldShowDesktopUpsellStartup = any; diff --git a/src/screens/src/components/FeedbackSurvey/FeedbackSurvey.ts b/src/screens/src/components/FeedbackSurvey/FeedbackSurvey.ts deleted file mode 100644 index 2466dd075..000000000 --- a/src/screens/src/components/FeedbackSurvey/FeedbackSurvey.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FeedbackSurvey = any; diff --git a/src/screens/src/components/FeedbackSurvey/useFeedbackSurvey.ts b/src/screens/src/components/FeedbackSurvey/useFeedbackSurvey.ts deleted file mode 100644 index dcff53ce8..000000000 --- a/src/screens/src/components/FeedbackSurvey/useFeedbackSurvey.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useFeedbackSurvey = any; diff --git a/src/screens/src/components/FeedbackSurvey/useMemorySurvey.ts b/src/screens/src/components/FeedbackSurvey/useMemorySurvey.ts deleted file mode 100644 index f7e0029db..000000000 --- a/src/screens/src/components/FeedbackSurvey/useMemorySurvey.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useMemorySurvey = any; diff --git a/src/screens/src/components/FeedbackSurvey/usePostCompactSurvey.ts b/src/screens/src/components/FeedbackSurvey/usePostCompactSurvey.ts deleted file mode 100644 index e81d32694..000000000 --- a/src/screens/src/components/FeedbackSurvey/usePostCompactSurvey.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type usePostCompactSurvey = any; diff --git a/src/screens/src/components/KeybindingWarnings.ts b/src/screens/src/components/KeybindingWarnings.ts deleted file mode 100644 index e57e1f78f..000000000 --- a/src/screens/src/components/KeybindingWarnings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type KeybindingWarnings = any; diff --git a/src/screens/src/components/LspRecommendation/LspRecommendationMenu.ts b/src/screens/src/components/LspRecommendation/LspRecommendationMenu.ts deleted file mode 100644 index 0628cdcb0..000000000 --- a/src/screens/src/components/LspRecommendation/LspRecommendationMenu.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type LspRecommendationMenu = any; diff --git a/src/screens/src/components/SandboxViolationExpandedView.ts b/src/screens/src/components/SandboxViolationExpandedView.ts deleted file mode 100644 index 4af5947d8..000000000 --- a/src/screens/src/components/SandboxViolationExpandedView.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SandboxViolationExpandedView = any; diff --git a/src/screens/src/components/mcp/McpParsingWarnings.ts b/src/screens/src/components/mcp/McpParsingWarnings.ts deleted file mode 100644 index ab05516ed..000000000 --- a/src/screens/src/components/mcp/McpParsingWarnings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type McpParsingWarnings = any; diff --git a/src/screens/src/components/messages/UserTextMessage.ts b/src/screens/src/components/messages/UserTextMessage.ts deleted file mode 100644 index 40106edbb..000000000 --- a/src/screens/src/components/messages/UserTextMessage.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type UserTextMessage = any; diff --git a/src/screens/src/components/permissions/SandboxPermissionRequest.ts b/src/screens/src/components/permissions/SandboxPermissionRequest.ts deleted file mode 100644 index bd5e216a4..000000000 --- a/src/screens/src/components/permissions/SandboxPermissionRequest.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SandboxPermissionRequest = any; diff --git a/src/screens/src/hooks/notifs/useAutoModeUnavailableNotification.ts b/src/screens/src/hooks/notifs/useAutoModeUnavailableNotification.ts deleted file mode 100644 index b240eb3f5..000000000 --- a/src/screens/src/hooks/notifs/useAutoModeUnavailableNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAutoModeUnavailableNotification = any; diff --git a/src/screens/src/hooks/notifs/useCanSwitchToExistingSubscription.ts b/src/screens/src/hooks/notifs/useCanSwitchToExistingSubscription.ts deleted file mode 100644 index 7a4814cec..000000000 --- a/src/screens/src/hooks/notifs/useCanSwitchToExistingSubscription.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useCanSwitchToExistingSubscription = any; diff --git a/src/screens/src/hooks/notifs/useDeprecationWarningNotification.ts b/src/screens/src/hooks/notifs/useDeprecationWarningNotification.ts deleted file mode 100644 index c919ed0d7..000000000 --- a/src/screens/src/hooks/notifs/useDeprecationWarningNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useDeprecationWarningNotification = any; diff --git a/src/screens/src/hooks/notifs/useFastModeNotification.ts b/src/screens/src/hooks/notifs/useFastModeNotification.ts deleted file mode 100644 index 2d8192243..000000000 --- a/src/screens/src/hooks/notifs/useFastModeNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useFastModeNotification = any; diff --git a/src/screens/src/hooks/notifs/useIDEStatusIndicator.ts b/src/screens/src/hooks/notifs/useIDEStatusIndicator.ts deleted file mode 100644 index c85b1a312..000000000 --- a/src/screens/src/hooks/notifs/useIDEStatusIndicator.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useIDEStatusIndicator = any; diff --git a/src/screens/src/hooks/notifs/useInstallMessages.ts b/src/screens/src/hooks/notifs/useInstallMessages.ts deleted file mode 100644 index 033331f33..000000000 --- a/src/screens/src/hooks/notifs/useInstallMessages.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useInstallMessages = any; diff --git a/src/screens/src/hooks/notifs/useLspInitializationNotification.ts b/src/screens/src/hooks/notifs/useLspInitializationNotification.ts deleted file mode 100644 index 67239f66d..000000000 --- a/src/screens/src/hooks/notifs/useLspInitializationNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useLspInitializationNotification = any; diff --git a/src/screens/src/hooks/notifs/useMcpConnectivityStatus.ts b/src/screens/src/hooks/notifs/useMcpConnectivityStatus.ts deleted file mode 100644 index 7abc0f54f..000000000 --- a/src/screens/src/hooks/notifs/useMcpConnectivityStatus.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useMcpConnectivityStatus = any; diff --git a/src/screens/src/hooks/notifs/useModelMigrationNotifications.ts b/src/screens/src/hooks/notifs/useModelMigrationNotifications.ts deleted file mode 100644 index 2dbde4b2f..000000000 --- a/src/screens/src/hooks/notifs/useModelMigrationNotifications.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useModelMigrationNotifications = any; diff --git a/src/screens/src/hooks/notifs/useNpmDeprecationNotification.ts b/src/screens/src/hooks/notifs/useNpmDeprecationNotification.ts deleted file mode 100644 index ee5cd8011..000000000 --- a/src/screens/src/hooks/notifs/useNpmDeprecationNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useNpmDeprecationNotification = any; diff --git a/src/screens/src/hooks/notifs/usePluginAutoupdateNotification.ts b/src/screens/src/hooks/notifs/usePluginAutoupdateNotification.ts deleted file mode 100644 index 020e8df25..000000000 --- a/src/screens/src/hooks/notifs/usePluginAutoupdateNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type usePluginAutoupdateNotification = any; diff --git a/src/screens/src/hooks/notifs/usePluginInstallationStatus.ts b/src/screens/src/hooks/notifs/usePluginInstallationStatus.ts deleted file mode 100644 index c20954050..000000000 --- a/src/screens/src/hooks/notifs/usePluginInstallationStatus.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type usePluginInstallationStatus = any; diff --git a/src/screens/src/hooks/notifs/useRateLimitWarningNotification.ts b/src/screens/src/hooks/notifs/useRateLimitWarningNotification.ts deleted file mode 100644 index 81d3a769c..000000000 --- a/src/screens/src/hooks/notifs/useRateLimitWarningNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useRateLimitWarningNotification = any; diff --git a/src/screens/src/hooks/notifs/useSettingsErrors.ts b/src/screens/src/hooks/notifs/useSettingsErrors.ts deleted file mode 100644 index 0724b24d6..000000000 --- a/src/screens/src/hooks/notifs/useSettingsErrors.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useSettingsErrors = any; diff --git a/src/screens/src/hooks/notifs/useTeammateShutdownNotification.ts b/src/screens/src/hooks/notifs/useTeammateShutdownNotification.ts deleted file mode 100644 index 9fd3f8a7f..000000000 --- a/src/screens/src/hooks/notifs/useTeammateShutdownNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useTeammateLifecycleNotification = any; diff --git a/src/screens/src/hooks/useAwaySummary.ts b/src/screens/src/hooks/useAwaySummary.ts deleted file mode 100644 index 4455dec96..000000000 --- a/src/screens/src/hooks/useAwaySummary.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useAwaySummary = any; diff --git a/src/screens/src/hooks/useChromeExtensionNotification.ts b/src/screens/src/hooks/useChromeExtensionNotification.ts deleted file mode 100644 index c97ee1f82..000000000 --- a/src/screens/src/hooks/useChromeExtensionNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useChromeExtensionNotification = any; diff --git a/src/screens/src/hooks/useClaudeCodeHintRecommendation.ts b/src/screens/src/hooks/useClaudeCodeHintRecommendation.ts deleted file mode 100644 index 83701c8a8..000000000 --- a/src/screens/src/hooks/useClaudeCodeHintRecommendation.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useClaudeCodeHintRecommendation = any; diff --git a/src/screens/src/hooks/useFileHistorySnapshotInit.ts b/src/screens/src/hooks/useFileHistorySnapshotInit.ts deleted file mode 100644 index 8d14981c0..000000000 --- a/src/screens/src/hooks/useFileHistorySnapshotInit.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useFileHistorySnapshotInit = any; diff --git a/src/screens/src/hooks/useLspPluginRecommendation.ts b/src/screens/src/hooks/useLspPluginRecommendation.ts deleted file mode 100644 index c6d24fab8..000000000 --- a/src/screens/src/hooks/useLspPluginRecommendation.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useLspPluginRecommendation = any; diff --git a/src/screens/src/hooks/useOfficialMarketplaceNotification.ts b/src/screens/src/hooks/useOfficialMarketplaceNotification.ts deleted file mode 100644 index 95d10a32d..000000000 --- a/src/screens/src/hooks/useOfficialMarketplaceNotification.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useOfficialMarketplaceNotification = any; diff --git a/src/screens/src/hooks/usePromptsFromClaudeInChrome.ts b/src/screens/src/hooks/usePromptsFromClaudeInChrome.ts deleted file mode 100644 index ca8e71f05..000000000 --- a/src/screens/src/hooks/usePromptsFromClaudeInChrome.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type usePromptsFromClaudeInChrome = any; diff --git a/src/screens/src/hooks/useTerminalSize.ts b/src/screens/src/hooks/useTerminalSize.ts deleted file mode 100644 index 4a0ef3ea3..000000000 --- a/src/screens/src/hooks/useTerminalSize.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type useTerminalSize = any; diff --git a/src/screens/src/services/analytics/index.ts b/src/screens/src/services/analytics/index.ts deleted file mode 100644 index ce0a9a827..000000000 --- a/src/screens/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; diff --git a/src/screens/src/services/mcp/MCPConnectionManager.ts b/src/screens/src/services/mcp/MCPConnectionManager.ts deleted file mode 100644 index 2a0ec4e7f..000000000 --- a/src/screens/src/services/mcp/MCPConnectionManager.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type MCPConnectionManager = any; diff --git a/src/screens/src/services/tips/tipScheduler.ts b/src/screens/src/services/tips/tipScheduler.ts deleted file mode 100644 index 813f4de4e..000000000 --- a/src/screens/src/services/tips/tipScheduler.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getTipToShowOnSpinner = any; -export type recordShownTip = any; diff --git a/src/screens/src/utils/context.ts b/src/screens/src/utils/context.ts deleted file mode 100644 index 03d405458..000000000 --- a/src/screens/src/utils/context.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getModelMaxOutputTokens = any; diff --git a/src/screens/src/utils/permissions/bypassPermissionsKillswitch.ts b/src/screens/src/utils/permissions/bypassPermissionsKillswitch.ts deleted file mode 100644 index cd1c15aa3..000000000 --- a/src/screens/src/utils/permissions/bypassPermissionsKillswitch.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type checkAndDisableBypassPermissionsIfNeeded = any; -export type checkAndDisableAutoModeIfNeeded = any; -export type useKickOffCheckAndDisableBypassPermissionsIfNeeded = any; -export type useKickOffCheckAndDisableAutoModeIfNeeded = any; diff --git a/src/screens/src/utils/plugins/performStartupChecks.ts b/src/screens/src/utils/plugins/performStartupChecks.ts deleted file mode 100644 index e555a9f1f..000000000 --- a/src/screens/src/utils/plugins/performStartupChecks.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type performStartupChecks = any; diff --git a/src/screens/src/utils/sandbox/sandbox-adapter.ts b/src/screens/src/utils/sandbox/sandbox-adapter.ts deleted file mode 100644 index edebe2640..000000000 --- a/src/screens/src/utils/sandbox/sandbox-adapter.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SandboxManager = any; diff --git a/src/screens/src/utils/theme.ts b/src/screens/src/utils/theme.ts deleted file mode 100644 index c6999a678..000000000 --- a/src/screens/src/utils/theme.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type Theme = any; diff --git a/src/self-hosted-runner/main.ts b/src/self-hosted-runner/main.ts deleted file mode 100644 index 09139d298..000000000 --- a/src/self-hosted-runner/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const selfHostedRunnerMain: (args: string[]) => Promise = () => Promise.resolve(); diff --git a/src/server/backends/dangerousBackend.ts b/src/server/backends/dangerousBackend.ts deleted file mode 100644 index 8bb43e5eb..000000000 --- a/src/server/backends/dangerousBackend.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const DangerousBackend: new (...args: unknown[]) => Record = class {} as never; diff --git a/src/server/connectHeadless.ts b/src/server/connectHeadless.ts deleted file mode 100644 index 110ea4747..000000000 --- a/src/server/connectHeadless.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const runConnectHeadless: (...args: unknown[]) => Promise = () => Promise.resolve(); diff --git a/src/server/lockfile.ts b/src/server/lockfile.ts deleted file mode 100644 index 7efc3e804..000000000 --- a/src/server/lockfile.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Auto-generated stub — replace with real implementation - -export interface ServerLockInfo { - pid: number - port: number - host: string - httpUrl: string - startedAt: number -} - -export const writeServerLock: (info: ServerLockInfo) => Promise = (async () => {}); -export const removeServerLock: () => Promise = (async () => {}); -export const probeRunningServer: () => Promise = (async () => null); diff --git a/src/server/parseConnectUrl.ts b/src/server/parseConnectUrl.ts deleted file mode 100644 index f60ad4ecf..000000000 --- a/src/server/parseConnectUrl.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const parseConnectUrl: (url: string) => { serverUrl: string; authToken: string; [key: string]: unknown } = () => ({ serverUrl: '', authToken: '' }); diff --git a/src/server/server.ts b/src/server/server.ts deleted file mode 100644 index 94a377148..000000000 --- a/src/server/server.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const startServer: (...args: unknown[]) => { port?: number; stop: (closeActiveConnections: boolean) => void } = () => ({ stop() {} }); diff --git a/src/server/serverBanner.ts b/src/server/serverBanner.ts deleted file mode 100644 index b91b6b484..000000000 --- a/src/server/serverBanner.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const printBanner: (...args: unknown[]) => void = () => {}; diff --git a/src/server/serverLog.ts b/src/server/serverLog.ts deleted file mode 100644 index e89c00070..000000000 --- a/src/server/serverLog.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const createServerLogger: () => Record = () => ({}); diff --git a/src/server/sessionManager.ts b/src/server/sessionManager.ts deleted file mode 100644 index 5684d78f8..000000000 --- a/src/server/sessionManager.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const SessionManager: new (...args: unknown[]) => { destroyAll(): Promise; [key: string]: unknown } = class { async destroyAll() {} } as never; diff --git a/src/services/analytics/src/utils/user.ts b/src/services/analytics/src/utils/user.ts deleted file mode 100644 index be2aa4592..000000000 --- a/src/services/analytics/src/utils/user.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type CoreUserData = any; diff --git a/src/services/api/src/constants/betas.ts b/src/services/api/src/constants/betas.ts deleted file mode 100644 index fd08b7176..000000000 --- a/src/services/api/src/constants/betas.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AFK_MODE_BETA_HEADER = any; -export type CONTEXT_1M_BETA_HEADER = any; -export type CONTEXT_MANAGEMENT_BETA_HEADER = any; -export type EFFORT_BETA_HEADER = any; -export type FAST_MODE_BETA_HEADER = any; -export type PROMPT_CACHING_SCOPE_BETA_HEADER = any; -export type REDACT_THINKING_BETA_HEADER = any; -export type STRUCTURED_OUTPUTS_BETA_HEADER = any; -export type TASK_BUDGETS_BETA_HEADER = any; diff --git a/src/services/api/src/constants/querySource.ts b/src/services/api/src/constants/querySource.ts deleted file mode 100644 index 61a17200d..000000000 --- a/src/services/api/src/constants/querySource.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type QuerySource = any; diff --git a/src/services/api/src/context/notifications.ts b/src/services/api/src/context/notifications.ts deleted file mode 100644 index c212e68b7..000000000 --- a/src/services/api/src/context/notifications.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type Notification = any; diff --git a/src/services/api/src/cost-tracker.ts b/src/services/api/src/cost-tracker.ts deleted file mode 100644 index 3f76a9113..000000000 --- a/src/services/api/src/cost-tracker.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type addToTotalSessionCost = any; diff --git a/src/services/api/src/entrypoints/agentSdkTypes.ts b/src/services/api/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 0a85ba1ac..000000000 --- a/src/services/api/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SDKAssistantMessageError = any; diff --git a/src/services/api/src/services/analytics/index.ts b/src/services/api/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/services/api/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/services/api/src/types/connectorText.ts b/src/services/api/src/types/connectorText.ts deleted file mode 100644 index 6af50eb27..000000000 --- a/src/services/api/src/types/connectorText.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isConnectorTextBlock = (block: unknown) => boolean; diff --git a/src/services/api/src/types/ids.ts b/src/services/api/src/types/ids.ts deleted file mode 100644 index c8c60ebe5..000000000 --- a/src/services/api/src/types/ids.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AgentId = any; diff --git a/src/services/api/src/utils/advisor.ts b/src/services/api/src/utils/advisor.ts deleted file mode 100644 index 57cbac38c..000000000 --- a/src/services/api/src/utils/advisor.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ADVISOR_TOOL_INSTRUCTIONS = any; -export type getExperimentAdvisorModels = any; -export type isAdvisorEnabled = any; -export type isValidAdvisorModel = any; -export type modelSupportsAdvisor = any; diff --git a/src/services/api/src/utils/agentContext.ts b/src/services/api/src/utils/agentContext.ts deleted file mode 100644 index 92f1d4946..000000000 --- a/src/services/api/src/utils/agentContext.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getAgentContext = any; diff --git a/src/services/api/src/utils/auth.ts b/src/services/api/src/utils/auth.ts deleted file mode 100644 index ee66093d8..000000000 --- a/src/services/api/src/utils/auth.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getAnthropicApiKeyWithSource = any; -export type getClaudeAIOAuthTokens = any; -export type getOauthAccountInfo = any; -export type isClaudeAISubscriber = any; -export type checkAndRefreshOAuthTokenIfNeeded = any; -export type getAnthropicApiKey = any; -export type getApiKeyFromApiKeyHelper = any; -export type refreshAndGetAwsCredentials = any; -export type refreshGcpCredentialsIfNeeded = any; -export type isConsumerSubscriber = any; -export type hasProfileScope = any; diff --git a/src/services/api/src/utils/aws.ts b/src/services/api/src/utils/aws.ts deleted file mode 100644 index 1929aaf98..000000000 --- a/src/services/api/src/utils/aws.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isAwsCredentialsProviderError = any; diff --git a/src/services/api/src/utils/betas.ts b/src/services/api/src/utils/betas.ts deleted file mode 100644 index 20d09935e..000000000 --- a/src/services/api/src/utils/betas.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getToolSearchBetaHeader = any; -export type modelSupportsStructuredOutputs = any; -export type shouldIncludeFirstPartyOnlyBetas = any; -export type shouldUseGlobalCacheScope = any; diff --git a/src/services/api/src/utils/claudeInChrome/common.ts b/src/services/api/src/utils/claudeInChrome/common.ts deleted file mode 100644 index 26f787dab..000000000 --- a/src/services/api/src/utils/claudeInChrome/common.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type CLAUDE_IN_CHROME_MCP_SERVER_NAME = any; diff --git a/src/services/api/src/utils/claudeInChrome/prompt.ts b/src/services/api/src/utils/claudeInChrome/prompt.ts deleted file mode 100644 index 5029b1cc6..000000000 --- a/src/services/api/src/utils/claudeInChrome/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type CHROME_TOOL_SEARCH_INSTRUCTIONS = any; diff --git a/src/services/api/src/utils/context.ts b/src/services/api/src/utils/context.ts deleted file mode 100644 index 3840f431a..000000000 --- a/src/services/api/src/utils/context.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getMaxThinkingTokensForModel = any; diff --git a/src/services/api/src/utils/diagLogs.ts b/src/services/api/src/utils/diagLogs.ts deleted file mode 100644 index b016581ff..000000000 --- a/src/services/api/src/utils/diagLogs.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logForDiagnosticsNoPII = any; diff --git a/src/services/api/src/utils/effort.ts b/src/services/api/src/utils/effort.ts deleted file mode 100644 index c3acecb56..000000000 --- a/src/services/api/src/utils/effort.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type EffortValue = 'low' | 'medium' | 'high' | 'max' | number; -export type modelSupportsEffort = (model: string) => boolean; -export type EffortLevel = 'low' | 'medium' | 'high' | 'max'; diff --git a/src/services/api/src/utils/fastMode.ts b/src/services/api/src/utils/fastMode.ts deleted file mode 100644 index 1228a5815..000000000 --- a/src/services/api/src/utils/fastMode.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isFastModeAvailable = any; -export type isFastModeCooldown = any; -export type isFastModeEnabled = any; -export type isFastModeSupportedByModel = any; diff --git a/src/services/api/src/utils/gracefulShutdown.ts b/src/services/api/src/utils/gracefulShutdown.ts deleted file mode 100644 index 28329ba76..000000000 --- a/src/services/api/src/utils/gracefulShutdown.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type gracefulShutdown = any; diff --git a/src/services/api/src/utils/headlessProfiler.ts b/src/services/api/src/utils/headlessProfiler.ts deleted file mode 100644 index 123f78a48..000000000 --- a/src/services/api/src/utils/headlessProfiler.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type headlessProfilerCheckpoint = any; diff --git a/src/services/api/src/utils/http.ts b/src/services/api/src/utils/http.ts deleted file mode 100644 index 22100b2eb..000000000 --- a/src/services/api/src/utils/http.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getUserAgent = any; diff --git a/src/services/api/src/utils/log.ts b/src/services/api/src/utils/log.ts deleted file mode 100644 index cf30e90da..000000000 --- a/src/services/api/src/utils/log.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logError = any; diff --git a/src/services/api/src/utils/mcpInstructionsDelta.ts b/src/services/api/src/utils/mcpInstructionsDelta.ts deleted file mode 100644 index 5da03fccc..000000000 --- a/src/services/api/src/utils/mcpInstructionsDelta.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isMcpInstructionsDeltaEnabled = any; diff --git a/src/services/api/src/utils/model/modelStrings.ts b/src/services/api/src/utils/model/modelStrings.ts deleted file mode 100644 index 1265ece0e..000000000 --- a/src/services/api/src/utils/model/modelStrings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getModelStrings = any; diff --git a/src/services/api/src/utils/model/providers.ts b/src/services/api/src/utils/model/providers.ts deleted file mode 100644 index f8e248dfa..000000000 --- a/src/services/api/src/utils/model/providers.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getAPIProvider = any; -export type getAPIProviderForStatsig = any; -export type isFirstPartyAnthropicBaseUrl = any; diff --git a/src/services/api/src/utils/modelCost.ts b/src/services/api/src/utils/modelCost.ts deleted file mode 100644 index a37f5df38..000000000 --- a/src/services/api/src/utils/modelCost.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type calculateUSDCost = any; diff --git a/src/services/api/src/utils/permissions/PermissionMode.ts b/src/services/api/src/utils/permissions/PermissionMode.ts deleted file mode 100644 index 1bc6199f9..000000000 --- a/src/services/api/src/utils/permissions/PermissionMode.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PermissionMode = any; diff --git a/src/services/api/src/utils/permissions/filesystem.ts b/src/services/api/src/utils/permissions/filesystem.ts deleted file mode 100644 index ef39cc7f8..000000000 --- a/src/services/api/src/utils/permissions/filesystem.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getClaudeTempDir = any; diff --git a/src/services/api/src/utils/process.ts b/src/services/api/src/utils/process.ts deleted file mode 100644 index 1085e5d63..000000000 --- a/src/services/api/src/utils/process.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type writeToStderr = any; diff --git a/src/services/api/src/utils/proxy.ts b/src/services/api/src/utils/proxy.ts deleted file mode 100644 index e93b33d2d..000000000 --- a/src/services/api/src/utils/proxy.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getProxyFetchOptions = any; diff --git a/src/services/api/src/utils/queryProfiler.ts b/src/services/api/src/utils/queryProfiler.ts deleted file mode 100644 index 1283fcc9e..000000000 --- a/src/services/api/src/utils/queryProfiler.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type endQueryProfile = any; -export type queryCheckpoint = any; diff --git a/src/services/api/src/utils/slowOperations.ts b/src/services/api/src/utils/slowOperations.ts deleted file mode 100644 index b888efc24..000000000 --- a/src/services/api/src/utils/slowOperations.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type jsonStringify = any; diff --git a/src/services/api/src/utils/telemetry/events.ts b/src/services/api/src/utils/telemetry/events.ts deleted file mode 100644 index 4ae001883..000000000 --- a/src/services/api/src/utils/telemetry/events.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logOTelEvent = any; diff --git a/src/services/api/src/utils/telemetry/sessionTracing.ts b/src/services/api/src/utils/telemetry/sessionTracing.ts deleted file mode 100644 index 094d0f999..000000000 --- a/src/services/api/src/utils/telemetry/sessionTracing.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type endLLMRequestSpan = any; -export type isBetaTracingEnabled = any; -export type Span = any; diff --git a/src/services/api/src/utils/thinking.ts b/src/services/api/src/utils/thinking.ts deleted file mode 100644 index ea79bd179..000000000 --- a/src/services/api/src/utils/thinking.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type modelSupportsAdaptiveThinking = any; -export type modelSupportsThinking = any; -export type ThinkingConfig = any; diff --git a/src/services/api/src/utils/toolSearch.ts b/src/services/api/src/utils/toolSearch.ts deleted file mode 100644 index 3df7e9955..000000000 --- a/src/services/api/src/utils/toolSearch.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type extractDiscoveredToolNames = any; -export type isDeferredToolsDeltaEnabled = any; -export type isToolSearchEnabled = any; diff --git a/src/services/compact/cachedMCConfig.ts b/src/services/compact/cachedMCConfig.ts deleted file mode 100644 index 67d72648c..000000000 --- a/src/services/compact/cachedMCConfig.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const getCachedMCConfig: () => { enabled?: boolean; systemPromptSuggestSummaries?: boolean; supportedModels?: string[]; [key: string]: unknown } = () => ({}); diff --git a/src/services/compact/snipProjection.ts b/src/services/compact/snipProjection.ts deleted file mode 100644 index 80efe381a..000000000 --- a/src/services/compact/snipProjection.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; - -import type { Message } from 'src/types/message'; - -export const isSnipBoundaryMessage: (message: Message) => boolean = () => false; -export const projectSnippedView: (messages: Message[]) => Message[] = (messages) => messages; diff --git a/src/services/compact/src/tools/FileReadTool/prompt.ts b/src/services/compact/src/tools/FileReadTool/prompt.ts deleted file mode 100644 index fac6439fc..000000000 --- a/src/services/compact/src/tools/FileReadTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FILE_READ_TOOL_NAME = any; diff --git a/src/services/compact/src/tools/FileWriteTool/prompt.ts b/src/services/compact/src/tools/FileWriteTool/prompt.ts deleted file mode 100644 index e69299d74..000000000 --- a/src/services/compact/src/tools/FileWriteTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FILE_WRITE_TOOL_NAME = any; diff --git a/src/services/compact/src/tools/GlobTool/prompt.ts b/src/services/compact/src/tools/GlobTool/prompt.ts deleted file mode 100644 index 060caf29c..000000000 --- a/src/services/compact/src/tools/GlobTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type GLOB_TOOL_NAME = any; diff --git a/src/services/compact/src/tools/GrepTool/prompt.ts b/src/services/compact/src/tools/GrepTool/prompt.ts deleted file mode 100644 index 08b8a8d29..000000000 --- a/src/services/compact/src/tools/GrepTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type GREP_TOOL_NAME = any; diff --git a/src/services/compact/src/tools/WebFetchTool/prompt.ts b/src/services/compact/src/tools/WebFetchTool/prompt.ts deleted file mode 100644 index 63b342a25..000000000 --- a/src/services/compact/src/tools/WebFetchTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type WEB_FETCH_TOOL_NAME = any; diff --git a/src/services/compact/src/tools/WebSearchTool/prompt.ts b/src/services/compact/src/tools/WebSearchTool/prompt.ts deleted file mode 100644 index 38871a0ba..000000000 --- a/src/services/compact/src/tools/WebSearchTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type WEB_SEARCH_TOOL_NAME = any; diff --git a/src/services/compact/src/utils/shell/shellToolUtils.ts b/src/services/compact/src/utils/shell/shellToolUtils.ts deleted file mode 100644 index c89fe2ada..000000000 --- a/src/services/compact/src/utils/shell/shellToolUtils.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SHELL_TOOL_NAMES = any; diff --git a/src/services/contextCollapse/index.ts b/src/services/contextCollapse/index.ts deleted file mode 100644 index d3a1c3d6e..000000000 --- a/src/services/contextCollapse/index.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type { Message } from '../../types/message.js' -import type { ToolUseContext } from '../../Tool.js' -import type { QuerySource } from '../../constants/querySource.js' - -export interface ContextCollapseHealth { - totalSpawns: number - totalErrors: number - lastError: string | null - emptySpawnWarningEmitted: boolean - totalEmptySpawns: number -} - -export interface ContextCollapseStats { - collapsedSpans: number - collapsedMessages: number - stagedSpans: number - health: ContextCollapseHealth -} - -export interface CollapseResult { - messages: Message[] -} - -export interface DrainResult { - committed: number - messages: Message[] -} - -export const getStats: () => ContextCollapseStats = () => ({ - collapsedSpans: 0, - collapsedMessages: 0, - stagedSpans: 0, - health: { - totalSpawns: 0, - totalErrors: 0, - lastError: null, - emptySpawnWarningEmitted: false, - totalEmptySpawns: 0, - }, -}) - -let _contextCollapseEnabled = false - -export function isContextCollapseEnabled(): boolean { - return _contextCollapseEnabled -} - -export const subscribe: (callback: () => void) => () => void = - (_callback: () => void) => () => {} - -export const applyCollapsesIfNeeded: ( - messages: Message[], - toolUseContext: ToolUseContext, - querySource: QuerySource, -) => Promise = async (messages: Message[]) => ({ messages }) - -export const isWithheldPromptTooLong: ( - message: Message, - isPromptTooLongMessage: (msg: Message) => boolean, - querySource: QuerySource, -) => boolean = () => false - -export const recoverFromOverflow: ( - messages: Message[], - querySource: QuerySource, -) => DrainResult = (messages: Message[]) => ({ committed: 0, messages }) - -export function resetContextCollapse(): void { - _contextCollapseEnabled = false -} - -export function initContextCollapse(): void { - _contextCollapseEnabled = true -} diff --git a/src/services/contextCollapse/operations.ts b/src/services/contextCollapse/operations.ts deleted file mode 100644 index 731e30c40..000000000 --- a/src/services/contextCollapse/operations.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -import type { Message } from 'src/types/message.js'; -export const projectView: (messages: Message[]) => Message[] = (messages) => messages; diff --git a/src/services/contextCollapse/persist.ts b/src/services/contextCollapse/persist.ts deleted file mode 100644 index b89c2b8e9..000000000 --- a/src/services/contextCollapse/persist.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const restoreFromEntries: (...args: unknown[]) => void = () => {}; diff --git a/src/services/mcp/src/constants/oauth.ts b/src/services/mcp/src/constants/oauth.ts deleted file mode 100644 index a1b08933a..000000000 --- a/src/services/mcp/src/constants/oauth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOauthConfig = any; diff --git a/src/services/mcp/src/services/analytics/index.ts b/src/services/mcp/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/services/mcp/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/services/mcp/src/services/mcp/config.ts b/src/services/mcp/src/services/mcp/config.ts deleted file mode 100644 index 109c9d3cc..000000000 --- a/src/services/mcp/src/services/mcp/config.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type dedupClaudeAiMcpServers = any; -export type doesEnterpriseMcpConfigExist = any; -export type filterMcpServersByPolicy = any; -export type getClaudeCodeMcpConfigs = any; -export type isMcpServerDisabled = any; -export type setMcpServerEnabled = any; diff --git a/src/services/mcp/src/state/AppState.ts b/src/services/mcp/src/state/AppState.ts deleted file mode 100644 index caf2928ae..000000000 --- a/src/services/mcp/src/state/AppState.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AppState = any; diff --git a/src/services/mcp/src/types/plugin.ts b/src/services/mcp/src/types/plugin.ts deleted file mode 100644 index 5129b6880..000000000 --- a/src/services/mcp/src/types/plugin.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PluginError = any; diff --git a/src/services/mcp/src/utils/auth.ts b/src/services/mcp/src/utils/auth.ts deleted file mode 100644 index 118c05735..000000000 --- a/src/services/mcp/src/utils/auth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getClaudeAIOAuthTokens = any; diff --git a/src/services/mcp/src/utils/config.ts b/src/services/mcp/src/utils/config.ts deleted file mode 100644 index 7cf15deca..000000000 --- a/src/services/mcp/src/utils/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getGlobalConfig = any; -export type saveGlobalConfig = any; diff --git a/src/services/mcp/src/utils/platform.ts b/src/services/mcp/src/utils/platform.ts deleted file mode 100644 index b6686f812..000000000 --- a/src/services/mcp/src/utils/platform.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getPlatform = any; diff --git a/src/services/oauth/src/constants/oauth.ts b/src/services/oauth/src/constants/oauth.ts deleted file mode 100644 index 870b6dd12..000000000 --- a/src/services/oauth/src/constants/oauth.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOauthConfig = any; -export type OAUTH_BETA_HEADER = any; diff --git a/src/services/oauth/src/services/analytics/index.ts b/src/services/oauth/src/services/analytics/index.ts deleted file mode 100644 index ce0a9a827..000000000 --- a/src/services/oauth/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; diff --git a/src/services/oauth/src/utils/auth.ts b/src/services/oauth/src/utils/auth.ts deleted file mode 100644 index 2a02cad70..000000000 --- a/src/services/oauth/src/utils/auth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getAnthropicApiKey = any; diff --git a/src/services/oauth/src/utils/config.ts b/src/services/oauth/src/utils/config.ts deleted file mode 100644 index 00cdd1299..000000000 --- a/src/services/oauth/src/utils/config.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getGlobalConfig = any; diff --git a/src/services/oauth/src/utils/log.ts b/src/services/oauth/src/utils/log.ts deleted file mode 100644 index cf30e90da..000000000 --- a/src/services/oauth/src/utils/log.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logError = any; diff --git a/src/services/sessionTranscript/sessionTranscript.ts b/src/services/sessionTranscript/sessionTranscript.ts deleted file mode 100644 index 3b3b4e7b0..000000000 --- a/src/services/sessionTranscript/sessionTranscript.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type { Message } from '../../types/message.js'; - -export {}; -export const writeSessionTranscriptSegment: (messages: Message[]) => void = (() => {}); -export const flushOnDateChange: (messages: Message[], currentDate: string) => void = (() => {}); diff --git a/src/services/skillSearch/featureCheck.ts b/src/services/skillSearch/featureCheck.ts deleted file mode 100644 index ff8950f4b..000000000 --- a/src/services/skillSearch/featureCheck.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const isSkillSearchEnabled: () => boolean = () => false; diff --git a/src/services/skillSearch/prefetch.ts b/src/services/skillSearch/prefetch.ts deleted file mode 100644 index 50c8729ec..000000000 --- a/src/services/skillSearch/prefetch.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type { Attachment } from '../../utils/attachments.js' -import type { Message } from '../../types/message.js' -import type { ToolUseContext } from '../../Tool.js' - -export const startSkillDiscoveryPrefetch: ( - input: string | null, - messages: Message[], - toolUseContext: ToolUseContext, -) => Promise = (async () => []); -export const collectSkillDiscoveryPrefetch: ( - pending: Promise, -) => Promise = (async (pending) => pending); -export const getTurnZeroSkillDiscovery: ( - input: string, - messages: Message[], - context: ToolUseContext, -) => Promise = (async () => null); diff --git a/src/services/skillSearch/remoteSkillLoader.ts b/src/services/skillSearch/remoteSkillLoader.ts deleted file mode 100644 index db251d4ff..000000000 --- a/src/services/skillSearch/remoteSkillLoader.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Auto-generated stub — replace with real implementation -export function loadRemoteSkill(_slug: string, _url: string): Promise<{ - cacheHit: boolean; - latencyMs: number; - skillPath: string; - content: string; - fileCount?: number; - totalBytes?: number; - fetchMethod?: string; -}> { - return Promise.resolve({ - cacheHit: false, - latencyMs: 0, - skillPath: '', - content: '', - }); -} diff --git a/src/services/skillSearch/remoteSkillState.ts b/src/services/skillSearch/remoteSkillState.ts deleted file mode 100644 index af2f1999d..000000000 --- a/src/services/skillSearch/remoteSkillState.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export function stripCanonicalPrefix(_name: string): string | null { return null; } -export function getDiscoveredRemoteSkill(_slug: string): { url: string } | undefined { return undefined; } diff --git a/src/services/skillSearch/signals.ts b/src/services/skillSearch/signals.ts deleted file mode 100644 index 0b89faefe..000000000 --- a/src/services/skillSearch/signals.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated stub — replace with real implementation -export type DiscoverySignal = any; diff --git a/src/services/skillSearch/telemetry.ts b/src/services/skillSearch/telemetry.ts deleted file mode 100644 index ce2f85b22..000000000 --- a/src/services/skillSearch/telemetry.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Auto-generated stub — replace with real implementation -export function logRemoteSkillLoaded(_data: { - slug: string; - cacheHit: boolean; - latencyMs: number; - urlScheme: string; - error?: string; - fileCount?: number; - totalBytes?: number; - fetchMethod?: string; -}): void {} diff --git a/src/services/src/cost-tracker.ts b/src/services/src/cost-tracker.ts deleted file mode 100644 index 3f76a9113..000000000 --- a/src/services/src/cost-tracker.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type addToTotalSessionCost = any; diff --git a/src/services/src/utils/log.ts b/src/services/src/utils/log.ts deleted file mode 100644 index cf30e90da..000000000 --- a/src/services/src/utils/log.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logError = any; diff --git a/src/services/src/utils/model/providers.ts b/src/services/src/utils/model/providers.ts deleted file mode 100644 index df87a41b4..000000000 --- a/src/services/src/utils/model/providers.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getAPIProvider = any; diff --git a/src/services/src/utils/modelCost.ts b/src/services/src/utils/modelCost.ts deleted file mode 100644 index a37f5df38..000000000 --- a/src/services/src/utils/modelCost.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type calculateUSDCost = any; diff --git a/src/services/tips/src/utils/fileHistory.ts b/src/services/tips/src/utils/fileHistory.ts deleted file mode 100644 index 5c33161bd..000000000 --- a/src/services/tips/src/utils/fileHistory.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type fileHistoryEnabled = any; diff --git a/src/services/tips/src/utils/settings/settings.ts b/src/services/tips/src/utils/settings/settings.ts deleted file mode 100644 index bdf4efb89..000000000 --- a/src/services/tips/src/utils/settings/settings.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getInitialSettings = any; -export type getSettings_DEPRECATED = any; -export type getSettingsForSource = any; diff --git a/src/services/tools/src/services/analytics/index.ts b/src/services/tools/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/services/tools/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/services/tools/src/services/analytics/metadata.ts b/src/services/tools/src/services/analytics/metadata.ts deleted file mode 100644 index e702ce446..000000000 --- a/src/services/tools/src/services/analytics/metadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type sanitizeToolNameForAnalytics = any; -export type extractMcpToolDetails = any; -export type extractSkillName = any; -export type extractToolInputForTelemetry = any; -export type getFileExtensionForAnalytics = any; -export type getFileExtensionsFromBashCommand = any; -export type isToolDetailsLoggingEnabled = any; -export type mcpToolDetailsForAnalytics = any; diff --git a/src/skills/bundled/src/tools/AgentTool/built-in/claudeCodeGuideAgent.ts b/src/skills/bundled/src/tools/AgentTool/built-in/claudeCodeGuideAgent.ts deleted file mode 100644 index d9e0c872d..000000000 --- a/src/skills/bundled/src/tools/AgentTool/built-in/claudeCodeGuideAgent.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type CLAUDE_CODE_GUIDE_AGENT_TYPE = any; diff --git a/src/skills/bundled/src/utils/claudeInChrome/setup.ts b/src/skills/bundled/src/utils/claudeInChrome/setup.ts deleted file mode 100644 index 0f25ac9b8..000000000 --- a/src/skills/bundled/src/utils/claudeInChrome/setup.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type shouldAutoEnableClaudeInChrome = any; diff --git a/src/skills/bundled/src/utils/settings/settings.ts b/src/skills/bundled/src/utils/settings/settings.ts deleted file mode 100644 index c9d1262e3..000000000 --- a/src/skills/bundled/src/utils/settings/settings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getSettingsFilePathForSource = any; diff --git a/src/skills/mcpSkills.ts b/src/skills/mcpSkills.ts deleted file mode 100644 index 122e62fcb..000000000 --- a/src/skills/mcpSkills.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -import type { Command } from 'src/types/command.js'; -export const fetchMcpSkillsForClient: ((...args: unknown[]) => Promise) & { cache: Map } = Object.assign( - (..._args: unknown[]) => Promise.resolve([] as Command[]), - { cache: new Map() } -); diff --git a/src/state/src/context/notifications.ts b/src/state/src/context/notifications.ts deleted file mode 100644 index c212e68b7..000000000 --- a/src/state/src/context/notifications.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type Notification = any; diff --git a/src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts b/src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts deleted file mode 100644 index f2f91315a..000000000 --- a/src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type { TaskStateBase, SetAppState } from '../../Task.js' - -export type LocalWorkflowTaskState = TaskStateBase & { - type: 'local_workflow' - summary?: string - description: string -} -export const killWorkflowTask: (id: string, setAppState: SetAppState) => void = (() => {}); -export const skipWorkflowAgent: (id: string, agentId: string, setAppState: SetAppState) => void = (() => {}); -export const retryWorkflowAgent: (id: string, agentId: string, setAppState: SetAppState) => void = (() => {}); diff --git a/src/tasks/MonitorMcpTask/MonitorMcpTask.ts b/src/tasks/MonitorMcpTask/MonitorMcpTask.ts deleted file mode 100644 index 59edd098d..000000000 --- a/src/tasks/MonitorMcpTask/MonitorMcpTask.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type { TaskStateBase, SetAppState } from '../../Task.js'; -import type { AppState } from '../../state/AppState.js'; -import type { AgentId } from '../../types/ids.js'; - -export type MonitorMcpTaskState = TaskStateBase & { - type: 'monitor_mcp'; -}; -export const killMonitorMcp: (taskId: string, setAppState: SetAppState) => void = (() => {}); -export const killMonitorMcpTasksForAgent: (agentId: AgentId, getAppState: () => AppState, setAppState: SetAppState) => void = (() => {}); diff --git a/src/types/connectorText.ts b/src/types/connectorText.ts deleted file mode 100644 index a9aa0853d..000000000 --- a/src/types/connectorText.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated stub — replace with real implementation -export type ConnectorTextBlock = { type: string; connector_text: string; signature?: string; [key: string]: unknown }; -export type ConnectorTextDelta = { type: string; connector_text: string; text?: string; thinking?: string; signature?: string; [key: string]: unknown }; -export const isConnectorTextBlock: (block: unknown) => block is ConnectorTextBlock = (_block): _block is ConnectorTextBlock => false; diff --git a/src/types/messageQueueTypes.ts b/src/types/messageQueueTypes.ts deleted file mode 100644 index 6543963b2..000000000 --- a/src/types/messageQueueTypes.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Auto-generated stub — replace with real implementation -export type QueueOperationMessage = { - type: 'queue-operation' - operation: QueueOperation - timestamp: string - sessionId: string - content?: string - [key: string]: unknown -} -export type QueueOperation = 'enqueue' | 'dequeue' | 'remove' | string; diff --git a/src/types/src/entrypoints/agentSdkTypes.ts b/src/types/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index d06fee6e9..000000000 --- a/src/types/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HookEvent = any; -export type HOOK_EVENTS = any; -export type HookInput = any; -export type PermissionUpdate = any; -export type HookJSONOutput = any; -export type AsyncHookJSONOutput = any; -export type SyncHookJSONOutput = any; diff --git a/src/types/src/utils/fileHistory.ts b/src/types/src/utils/fileHistory.ts deleted file mode 100644 index f1dbe566a..000000000 --- a/src/types/src/utils/fileHistory.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FileHistorySnapshot = any; diff --git a/src/types/src/utils/permissions/PermissionResult.ts b/src/types/src/utils/permissions/PermissionResult.ts deleted file mode 100644 index 4ffc39c69..000000000 --- a/src/types/src/utils/permissions/PermissionResult.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PermissionResult = any; diff --git a/src/types/src/utils/permissions/PermissionRule.ts b/src/types/src/utils/permissions/PermissionRule.ts deleted file mode 100644 index 2b6b7b27a..000000000 --- a/src/types/src/utils/permissions/PermissionRule.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type permissionBehaviorSchema = any; diff --git a/src/types/src/utils/permissions/PermissionUpdateSchema.ts b/src/types/src/utils/permissions/PermissionUpdateSchema.ts deleted file mode 100644 index a56a548e6..000000000 --- a/src/types/src/utils/permissions/PermissionUpdateSchema.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type permissionUpdateSchema = any; diff --git a/src/types/src/utils/toolResultStorage.ts b/src/types/src/utils/toolResultStorage.ts deleted file mode 100644 index 2229baa6d..000000000 --- a/src/types/src/utils/toolResultStorage.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ContentReplacementRecord = any; diff --git a/src/types/tools.ts b/src/types/tools.ts deleted file mode 100644 index 218d782f6..000000000 --- a/src/types/tools.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Auto-generated stub — replace with real implementation -export type AgentToolProgress = any; -export type BashProgress = any; -export type MCPProgress = any; -export type REPLToolProgress = any; -export type SkillToolProgress = any; -export type TaskOutputProgress = any; -export type ToolProgressData = any; -export type WebSearchProgress = any; -export type ShellProgress = any; -export type PowerShellProgress = any; -export type SdkWorkflowProgress = any; diff --git a/src/types/utils.ts b/src/types/utils.ts deleted file mode 100644 index 208e5dd8a..000000000 --- a/src/types/utils.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export type DeepImmutable = T; -export type Permutations = T[]; diff --git a/src/utils/asciicast.ts b/src/utils/asciicast.ts deleted file mode 100644 index d3d89dfa9..000000000 --- a/src/utils/asciicast.ts +++ /dev/null @@ -1,239 +0,0 @@ -import { appendFile, rename } from 'fs/promises' -import { basename, dirname, join } from 'path' -import { getOriginalCwd, getSessionId } from '../bootstrap/state.js' -import { createBufferedWriter } from './bufferedWriter.js' -import { registerCleanup } from './cleanupRegistry.js' -import { logForDebugging } from './debug.js' -import { getClaudeConfigHomeDir, isEnvTruthy } from './envUtils.js' -import { getFsImplementation } from './fsOperations.js' -import { sanitizePath } from './path.js' -import { jsonStringify } from './slowOperations.js' - -// Mutable recording state — filePath is updated when session ID changes (e.g., --resume) -const recordingState: { filePath: string | null; timestamp: number } = { - filePath: null, - timestamp: 0, -} - -/** - * Get the asciicast recording file path. - * For ants with CLAUDE_CODE_TERMINAL_RECORDING=1: returns a path. - * Otherwise: returns null. - * The path is computed once and cached in recordingState. - */ -export function getRecordFilePath(): string | null { - if (recordingState.filePath !== null) { - return recordingState.filePath - } - if (process.env.USER_TYPE !== 'ant') { - return null - } - if (!isEnvTruthy(process.env.CLAUDE_CODE_TERMINAL_RECORDING)) { - return null - } - // Record alongside the transcript. - // Each launch gets its own file so --continue produces multiple recordings. - const projectsDir = join(getClaudeConfigHomeDir(), 'projects') - const projectDir = join(projectsDir, sanitizePath(getOriginalCwd())) - recordingState.timestamp = Date.now() - recordingState.filePath = join( - projectDir, - `${getSessionId()}-${recordingState.timestamp}.cast`, - ) - return recordingState.filePath -} - -export function _resetRecordingStateForTesting(): void { - recordingState.filePath = null - recordingState.timestamp = 0 -} - -/** - * Find all .cast files for the current session. - * Returns paths sorted by filename (chronological by timestamp suffix). - */ -export function getSessionRecordingPaths(): string[] { - const sessionId = getSessionId() - const projectsDir = join(getClaudeConfigHomeDir(), 'projects') - const projectDir = join(projectsDir, sanitizePath(getOriginalCwd())) - try { - // eslint-disable-next-line custom-rules/no-sync-fs -- called during /share before upload, not in hot path - const entries = getFsImplementation().readdirSync(projectDir) - const names = ( - typeof entries[0] === 'string' - ? entries - : (entries as { name: string }[]).map(e => e.name) - ) as string[] - const files = names - .filter(f => f.startsWith(sessionId) && f.endsWith('.cast')) - .sort() - return files.map(f => join(projectDir, f)) - } catch { - return [] - } -} - -/** - * Rename the recording file to match the current session ID. - * Called after --resume/--continue changes the session ID via switchSession(). - * The recorder was installed with the initial (random) session ID; this renames - * the file so getSessionRecordingPaths() can find it by the resumed session ID. - */ -export async function renameRecordingForSession(): Promise { - const oldPath = recordingState.filePath - if (!oldPath || recordingState.timestamp === 0) { - return - } - const projectsDir = join(getClaudeConfigHomeDir(), 'projects') - const projectDir = join(projectsDir, sanitizePath(getOriginalCwd())) - const newPath = join( - projectDir, - `${getSessionId()}-${recordingState.timestamp}.cast`, - ) - if (oldPath === newPath) { - return - } - // Flush pending writes before renaming - await recorder?.flush() - const oldName = basename(oldPath) - const newName = basename(newPath) - try { - await rename(oldPath, newPath) - recordingState.filePath = newPath - logForDebugging(`[asciicast] Renamed recording: ${oldName} → ${newName}`) - } catch { - logForDebugging( - `[asciicast] Failed to rename recording from ${oldName} to ${newName}`, - ) - } -} - -type AsciicastRecorder = { - flush(): Promise - dispose(): Promise -} - -let recorder: AsciicastRecorder | null = null - -function getTerminalSize(): { cols: number; rows: number } { - // Direct access to stdout dimensions — not in a React component - // eslint-disable-next-line custom-rules/prefer-use-terminal-size - const cols = process.stdout.columns || 80 - // eslint-disable-next-line custom-rules/prefer-use-terminal-size - const rows = process.stdout.rows || 24 - return { cols, rows } -} - -/** - * Flush pending recording data to disk. - * Call before reading the .cast file (e.g., during /share). - */ -export async function flushAsciicastRecorder(): Promise { - await recorder?.flush() -} - -/** - * Install the asciicast recorder. - * Wraps process.stdout.write to capture all terminal output with timestamps. - * Must be called before Ink mounts. - */ -export function installAsciicastRecorder(): void { - const filePath = getRecordFilePath() - if (!filePath) { - return - } - - const { cols, rows } = getTerminalSize() - const startTime = performance.now() - - // Write the asciicast v2 header - const header = jsonStringify({ - version: 2, - width: cols, - height: rows, - timestamp: Math.floor(Date.now() / 1000), - env: { - SHELL: process.env.SHELL || '', - TERM: process.env.TERM || '', - }, - }) - - try { - // eslint-disable-next-line custom-rules/no-sync-fs -- one-time init before Ink mounts - getFsImplementation().mkdirSync(dirname(filePath)) - } catch { - // Directory may already exist - } - // eslint-disable-next-line custom-rules/no-sync-fs -- one-time init before Ink mounts - getFsImplementation().appendFileSync(filePath, header + '\n', { mode: 0o600 }) - - let pendingWrite: Promise = Promise.resolve() - - const writer = createBufferedWriter({ - writeFn(content: string) { - // Use recordingState.filePath (mutable) so writes follow renames from --resume - const currentPath = recordingState.filePath - if (!currentPath) { - return - } - pendingWrite = pendingWrite - .then(() => appendFile(currentPath, content)) - .catch(() => { - // Silently ignore write errors — don't break the session - }) - }, - flushIntervalMs: 500, - maxBufferSize: 50, - maxBufferBytes: 10 * 1024 * 1024, // 10MB - }) - - // Wrap process.stdout.write to capture output - const originalWrite = process.stdout.write.bind( - process.stdout, - ) as typeof process.stdout.write - process.stdout.write = function ( - chunk: string | Uint8Array, - encodingOrCb?: BufferEncoding | ((err?: Error | null) => void), - cb?: (err?: Error | null) => void, - ): boolean { - // Record the output event - const elapsed = (performance.now() - startTime) / 1000 - const text = - typeof chunk === 'string' ? chunk : Buffer.from(chunk).toString('utf-8') - writer.write(jsonStringify([elapsed, 'o', text]) + '\n') - - // Pass through to the real stdout - if (typeof encodingOrCb === 'function') { - return originalWrite(chunk, encodingOrCb) - } - return originalWrite(chunk, encodingOrCb, cb) - } as typeof process.stdout.write - - // Handle terminal resize events - function onResize(): void { - const elapsed = (performance.now() - startTime) / 1000 - const { cols: newCols, rows: newRows } = getTerminalSize() - writer.write(jsonStringify([elapsed, 'r', `${newCols}x${newRows}`]) + '\n') - } - process.stdout.on('resize', onResize) - - recorder = { - async flush(): Promise { - writer.flush() - await pendingWrite - }, - async dispose(): Promise { - writer.dispose() - await pendingWrite - process.stdout.removeListener('resize', onResize) - process.stdout.write = originalWrite - }, - } - - registerCleanup(async () => { - await recorder?.dispose() - recorder = null - }) - - logForDebugging(`[asciicast] Recording to ${filePath}`) -} diff --git a/src/utils/attributionHooks.ts b/src/utils/attributionHooks.ts deleted file mode 100644 index 3ce54f977..000000000 --- a/src/utils/attributionHooks.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated stub — replace with real implementation -export const clearAttributionCaches: () => void = () => {}; -export const sweepFileContentCache: () => void = () => {}; -export const registerAttributionHooks: () => void = () => {}; diff --git a/src/utils/attributionTrailer.ts b/src/utils/attributionTrailer.ts deleted file mode 100644 index 6761691e3..000000000 --- a/src/utils/attributionTrailer.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const buildPRTrailers: (attributionData: unknown, attribution: unknown) => string[] = () => []; diff --git a/src/utils/background/remote/src/constants/oauth.ts b/src/utils/background/remote/src/constants/oauth.ts deleted file mode 100644 index a1b08933a..000000000 --- a/src/utils/background/remote/src/constants/oauth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOauthConfig = any; diff --git a/src/utils/background/remote/src/entrypoints/agentSdkTypes.ts b/src/utils/background/remote/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index d4bdb4fb4..000000000 --- a/src/utils/background/remote/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SDKMessage = any; diff --git a/src/utils/background/remote/src/services/oauth/client.ts b/src/utils/background/remote/src/services/oauth/client.ts deleted file mode 100644 index 5a7055fbe..000000000 --- a/src/utils/background/remote/src/services/oauth/client.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOrganizationUUID = any; diff --git a/src/utils/bash/src/components/PromptInput/PromptInputFooterSuggestions.ts b/src/utils/bash/src/components/PromptInput/PromptInputFooterSuggestions.ts deleted file mode 100644 index d0fd674c7..000000000 --- a/src/utils/bash/src/components/PromptInput/PromptInputFooterSuggestions.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SuggestionItem = any; diff --git a/src/utils/bash/src/services/analytics/index.ts b/src/utils/bash/src/services/analytics/index.ts deleted file mode 100644 index 60402f927..000000000 --- a/src/utils/bash/src/services/analytics/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; diff --git a/src/utils/ccshareResume.ts b/src/utils/ccshareResume.ts deleted file mode 100644 index 297f08b36..000000000 --- a/src/utils/ccshareResume.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated stub — replace with real implementation -import type { LogOption } from 'src/types/logs.js'; -export const parseCcshareId: (resume: string) => string | null = () => null; -export const loadCcshare: (ccshareId: string) => Promise = async () => { throw new Error('ccshare not implemented'); }; diff --git a/src/utils/computerUse/win32/ocr.ts b/src/utils/computerUse/win32/ocr.ts deleted file mode 100644 index 02536d919..000000000 --- a/src/utils/computerUse/win32/ocr.ts +++ /dev/null @@ -1,250 +0,0 @@ -/** - * OCR module using Windows.Media.Ocr.OcrEngine via PowerShell. - * Captures a screen region or window, then runs WinRT OCR to extract text. - */ - -import { ps as runPs } from './shared.js' - -export interface OcrLine { - text: string - bounds: { x: number; y: number; w: number; h: number } -} - -export interface OcrResult { - text: string - lines: OcrLine[] - language: string -} - -function emptyResult(language: string): OcrResult { - return { text: '', lines: [], language } -} - -/** - * PowerShell script that: - * 1. Screenshots a screen region using CopyFromScreen - * 2. Saves to temp PNG - * 3. Loads via WinRT BitmapDecoder -> SoftwareBitmap - * 4. Runs OcrEngine.RecognizeAsync - * 5. Outputs JSON with text, lines, and bounding rects - */ -function buildOcrRegionScript( - x: number, - y: number, - w: number, - h: number, - lang: string, -): string { - return ` -Add-Type -AssemblyName System.Drawing -Add-Type -AssemblyName System.Runtime.WindowsRuntime - -# Load WinRT types -$null = [Windows.Media.Ocr.OcrEngine, Windows.Foundation, ContentType = WindowsRuntime] -$null = [Windows.Graphics.Imaging.SoftwareBitmap, Windows.Foundation, ContentType = WindowsRuntime] -$null = [Windows.Graphics.Imaging.BitmapDecoder, Windows.Foundation, ContentType = WindowsRuntime] -$null = [Windows.Storage.StorageFile, Windows.Foundation, ContentType = WindowsRuntime] -$null = [Windows.Storage.Streams.RandomAccessStream, Windows.Foundation, ContentType = WindowsRuntime] -$null = [Windows.Globalization.Language, Windows.Foundation, ContentType = WindowsRuntime] - -# Await helper for WinRT async operations -$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | Where-Object { - $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and - $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation\`1' -})[0] -Function Await($WinRtTask, $ResultType) { - $asTask = $asTaskGeneric.MakeGenericMethod($ResultType) - $netTask = $asTask.Invoke($null, @($WinRtTask)) - $netTask.Wait(-1) | Out-Null - $netTask.Result -} - -try { - # Step 1: Screenshot region - $bmp = New-Object System.Drawing.Bitmap(${w}, ${h}) - $g = [System.Drawing.Graphics]::FromImage($bmp) - $g.CopyFromScreen(${x}, ${y}, 0, 0, (New-Object System.Drawing.Size(${w}, ${h}))) - $g.Dispose() - - # Step 2: Save to temp file - $tmpFile = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), "ocrtemp_$([guid]::NewGuid().ToString('N')).png") - $bmp.Save($tmpFile, [System.Drawing.Imaging.ImageFormat]::Png) - $bmp.Dispose() - - # Step 3: Open as StorageFile -> BitmapDecoder -> SoftwareBitmap - $storageFile = Await ([Windows.Storage.StorageFile]::GetFileFromPathAsync($tmpFile)) ([Windows.Storage.StorageFile]) - $stream = Await ($storageFile.OpenAsync([Windows.Storage.FileAccessMode]::Read)) ([Windows.Storage.Streams.IRandomAccessStream]) - $decoder = Await ([Windows.Graphics.Imaging.BitmapDecoder]::CreateAsync($stream)) ([Windows.Graphics.Imaging.BitmapDecoder]) - $softwareBmp = Await ($decoder.GetSoftwareBitmapAsync()) ([Windows.Graphics.Imaging.SoftwareBitmap]) - - # Step 4: Create OCR engine - $ocrLang = New-Object Windows.Globalization.Language('${lang}') - $engine = [Windows.Media.Ocr.OcrEngine]::TryCreateFromLanguage($ocrLang) - if ($engine -eq $null) { - # Fallback to en-US - $ocrLang = New-Object Windows.Globalization.Language('en-US') - $engine = [Windows.Media.Ocr.OcrEngine]::TryCreateFromLanguage($ocrLang) - } - if ($engine -eq $null) { - Write-Output '{"text":"","lines":[],"language":"${lang}"}' - return - } - - # Step 5: Run OCR - $ocrResult = Await ($engine.RecognizeAsync($softwareBmp)) ([Windows.Media.Ocr.OcrResult]) - - # Step 6: Extract lines with bounding rects - $lines = @() - foreach ($line in $ocrResult.Lines) { - $minX = [double]::MaxValue; $minY = [double]::MaxValue - $maxX = 0.0; $maxY = 0.0 - foreach ($word in $line.Words) { - $r = $word.BoundingRect - if ($r.X -lt $minX) { $minX = $r.X } - if ($r.Y -lt $minY) { $minY = $r.Y } - if (($r.X + $r.Width) -gt $maxX) { $maxX = $r.X + $r.Width } - if (($r.Y + $r.Height) -gt $maxY) { $maxY = $r.Y + $r.Height } - } - $lines += @{ - text = $line.Text - bounds = @{ - x = [int]$minX - y = [int]$minY - w = [int]($maxX - $minX) - h = [int]($maxY - $minY) - } - } - } - - $output = @{ - text = $ocrResult.Text - lines = $lines - language = $ocrLang.LanguageTag - } - Write-Output (ConvertTo-Json $output -Depth 4 -Compress) - - # Cleanup - $stream.Dispose() - Remove-Item $tmpFile -ErrorAction SilentlyContinue -} catch { - Write-Output '{"text":"","lines":[],"language":"${lang}"}' -} -` -} - -/** - * PowerShell script to get a window's bounding rect by title. - */ -function buildGetWindowRectScript(windowTitle: string): string { - const escaped = windowTitle.replace(/'/g, "''") - return ` -Add-Type @' -using System; -using System.Runtime.InteropServices; -public class WinRect { - [DllImport("user32.dll", CharSet=CharSet.Unicode)] - public static extern IntPtr FindWindow(string c, string t); - [DllImport("user32.dll")] - public static extern bool GetWindowRect(IntPtr h, out RECT r); - [StructLayout(LayoutKind.Sequential)] - public struct RECT { public int L, T, R, B; } - public static string Get(string title) { - IntPtr hwnd = FindWindow(null, title); - if (hwnd == IntPtr.Zero) return "NOT_FOUND"; - RECT r; GetWindowRect(hwnd, out r); - int w = r.R - r.L; int h = r.B - r.T; - if (w <= 0 || h <= 0) return "INVALID_SIZE"; - return r.L + "," + r.T + "," + w + "," + h; - } -} -'@ -[WinRect]::Get('${escaped}') -` -} - -function parseOcrOutput(raw: string, lang: string): OcrResult { - if (!raw) return emptyResult(lang) - try { - const parsed = JSON.parse(raw) - return { - text: parsed.text ?? '', - lines: Array.isArray(parsed.lines) - ? parsed.lines.map((l: any) => ({ - text: l.text ?? '', - bounds: { - x: l.bounds?.x ?? 0, - y: l.bounds?.y ?? 0, - w: l.bounds?.w ?? 0, - h: l.bounds?.h ?? 0, - }, - })) - : [], - language: parsed.language ?? lang, - } - } catch { - return emptyResult(lang) - } -} - -/** - * Perform OCR on a screen region. - * Screenshots the specified rectangle, then runs WinRT OcrEngine. - * - * @param x - Left coordinate - * @param y - Top coordinate - * @param w - Width in pixels - * @param h - Height in pixels - * @param lang - BCP-47 language tag (default 'en-US'). Confirmed: 'en-US', 'zh-Hans-CN' - */ -export async function ocrRegion( - x: number, - y: number, - w: number, - h: number, - lang?: string, -): Promise { - const language = lang ?? 'en-US' - if (w <= 0 || h <= 0) return emptyResult(language) - - try { - const script = buildOcrRegionScript(x, y, w, h, language) - const raw = runPs(script) - return parseOcrOutput(raw, language) - } catch { - return emptyResult(language) - } -} - -/** - * Perform OCR on a specific window by its title. - * Gets the window rect, then delegates to ocrRegion. - * - * @param windowTitle - Exact window title to find via FindWindow - * @param lang - BCP-47 language tag (default 'en-US') - */ -export async function ocrWindow( - windowTitle: string, - lang?: string, -): Promise { - const language = lang ?? 'en-US' - - try { - const rectScript = buildGetWindowRectScript(windowTitle) - const raw = runPs(rectScript) - const trimmed = raw.trim() - - if (!trimmed || trimmed === 'NOT_FOUND' || trimmed === 'INVALID_SIZE') { - return emptyResult(language) - } - - const parts = trimmed.split(',') - if (parts.length !== 4) return emptyResult(language) - - const [x, y, w, h] = parts.map(Number) - if (!w || !h) return emptyResult(language) - - return ocrRegion(x, y, w, h, lang) - } catch { - return emptyResult(language) - } -} diff --git a/src/utils/deepLink/src/services/analytics/index.ts b/src/utils/deepLink/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/utils/deepLink/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/utils/dxt/helpers.ts b/src/utils/dxt/helpers.ts index 85414ed3c..cdc89e0ac 100644 --- a/src/utils/dxt/helpers.ts +++ b/src/utils/dxt/helpers.ts @@ -20,7 +20,8 @@ export async function validateManifest( const errors = parseResult.error.flatten() const errorMessages = [ ...Object.entries(errors.fieldErrors).map( - ([field, errs]) => `${field}: ${(errs as any)?.join(', ')}`, + ([field, errs]) => + `${field}: ${(errs as string[] | undefined)?.join(', ')}`, ), ...(errors.formErrors || []), ] diff --git a/src/utils/eventLoopStallDetector.ts b/src/utils/eventLoopStallDetector.ts deleted file mode 100644 index 998b5477f..000000000 --- a/src/utils/eventLoopStallDetector.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const startEventLoopStallDetector: () => void = () => {}; diff --git a/src/utils/hooks/src/entrypoints/agentSdkTypes.ts b/src/utils/hooks/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 8dbc64c4c..000000000 --- a/src/utils/hooks/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HookEvent = any; -export type AsyncHookJSONOutput = any; -export type SyncHookJSONOutput = any; -export type HOOK_EVENTS = any; diff --git a/src/utils/hooks/src/entrypoints/sdk/coreTypes.ts b/src/utils/hooks/src/entrypoints/sdk/coreTypes.ts deleted file mode 100644 index 263795d50..000000000 --- a/src/utils/hooks/src/entrypoints/sdk/coreTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HOOK_EVENTS = any; diff --git a/src/utils/hooks/src/state/AppState.ts b/src/utils/hooks/src/state/AppState.ts deleted file mode 100644 index caf2928ae..000000000 --- a/src/utils/hooks/src/state/AppState.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AppState = any; diff --git a/src/utils/mcpInstructionsDelta.ts b/src/utils/mcpInstructionsDelta.ts index e3c83cf3d..54d209b11 100644 --- a/src/utils/mcpInstructionsDelta.ts +++ b/src/utils/mcpInstructionsDelta.ts @@ -65,8 +65,9 @@ export function getMcpInstructionsDelta( attachmentCount++ if (msg.attachment!.type !== 'mcp_instructions_delta') continue midCount++ - for (const n of (msg.attachment! as any).addedNames) announced.add(n) - for (const n of (msg.attachment! as any).removedNames) announced.delete(n) + const delta = msg.attachment! as unknown as McpInstructionsDelta + for (const n of delta.addedNames) announced.add(n) + for (const n of delta.removedNames) announced.delete(n) } const connected = mcpClients.filter( diff --git a/src/utils/messages/src/constants/outputStyles.ts b/src/utils/messages/src/constants/outputStyles.ts deleted file mode 100644 index 42c1edbfa..000000000 --- a/src/utils/messages/src/constants/outputStyles.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type DEFAULT_OUTPUT_STYLE_NAME = any; diff --git a/src/utils/messages/src/entrypoints/agentSdkTypes.ts b/src/utils/messages/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 59874aee6..000000000 --- a/src/utils/messages/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SDKAssistantMessage = any; -export type SDKCompactBoundaryMessage = any; -export type SDKMessage = any; -export type SDKRateLimitInfo = any; -export type ApiKeySource = any; -export type PermissionMode = any; diff --git a/src/utils/messages/src/services/claudeAiLimits.ts b/src/utils/messages/src/services/claudeAiLimits.ts deleted file mode 100644 index 42797958c..000000000 --- a/src/utils/messages/src/services/claudeAiLimits.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ClaudeAILimits = any; diff --git a/src/utils/messages/src/types/utils.ts b/src/utils/messages/src/types/utils.ts deleted file mode 100644 index b620f7a26..000000000 --- a/src/utils/messages/src/types/utils.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type DeepImmutable = any; diff --git a/src/utils/model/src/services/claudeAiLimits.ts b/src/utils/model/src/services/claudeAiLimits.ts deleted file mode 100644 index 85b6bcc6a..000000000 --- a/src/utils/model/src/services/claudeAiLimits.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type OverageDisabledReason = any; diff --git a/src/utils/nativeInstaller/src/services/analytics/index.ts b/src/utils/nativeInstaller/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/utils/nativeInstaller/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/utils/permissions/src/memdir/paths.ts b/src/utils/permissions/src/memdir/paths.ts deleted file mode 100644 index 2411afd7f..000000000 --- a/src/utils/permissions/src/memdir/paths.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type hasAutoMemPathOverride = any; -export type isAutoMemPath = any; diff --git a/src/utils/permissions/src/state/AppState.ts b/src/utils/permissions/src/state/AppState.ts deleted file mode 100644 index 994ed9cc4..000000000 --- a/src/utils/permissions/src/state/AppState.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AppState = any; -export type useAppState = any; -export type useAppStateStore = any; -export type useSetAppState = any; diff --git a/src/utils/permissions/src/tools/AgentTool/agentMemory.ts b/src/utils/permissions/src/tools/AgentTool/agentMemory.ts deleted file mode 100644 index 0cd1375dd..000000000 --- a/src/utils/permissions/src/tools/AgentTool/agentMemory.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isAgentMemoryPath = any; diff --git a/src/utils/plugins/src/entrypoints/agentSdkTypes.ts b/src/utils/plugins/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 2ad98a3ad..000000000 --- a/src/utils/plugins/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type HookEvent = any; diff --git a/src/utils/postCommitAttribution.ts b/src/utils/postCommitAttribution.ts deleted file mode 100644 index b078505ab..000000000 --- a/src/utils/postCommitAttribution.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const installPrepareCommitMsgHook: (worktreePath: string, worktreeHooksDir?: string) => Promise = async () => {}; diff --git a/src/utils/processUserInput/src/commands.ts b/src/utils/processUserInput/src/commands.ts deleted file mode 100644 index f8826ed74..000000000 --- a/src/utils/processUserInput/src/commands.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type builtInCommandNames = any; -export type Command = any; -export type CommandBase = any; -export type findCommand = any; -export type getCommand = any; -export type getCommandName = any; -export type hasCommand = any; -export type PromptCommand = any; diff --git a/src/utils/processUserInput/src/components/BashModeProgress.ts b/src/utils/processUserInput/src/components/BashModeProgress.ts deleted file mode 100644 index c1db5a924..000000000 --- a/src/utils/processUserInput/src/components/BashModeProgress.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type BashModeProgress = any; diff --git a/src/utils/processUserInput/src/constants/querySource.ts b/src/utils/processUserInput/src/constants/querySource.ts deleted file mode 100644 index 61a17200d..000000000 --- a/src/utils/processUserInput/src/constants/querySource.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type QuerySource = any; diff --git a/src/utils/processUserInput/src/services/analytics/index.ts b/src/utils/processUserInput/src/services/analytics/index.ts deleted file mode 100644 index 60402f927..000000000 --- a/src/utils/processUserInput/src/services/analytics/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logEvent = any; diff --git a/src/utils/processUserInput/src/tools/BashTool/BashTool.ts b/src/utils/processUserInput/src/tools/BashTool/BashTool.ts deleted file mode 100644 index 7a3ea3cc5..000000000 --- a/src/utils/processUserInput/src/tools/BashTool/BashTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type BashTool = any; diff --git a/src/utils/processUserInput/src/types/tools.ts b/src/utils/processUserInput/src/types/tools.ts deleted file mode 100644 index df558fc7f..000000000 --- a/src/utils/processUserInput/src/types/tools.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ShellProgress = any; diff --git a/src/utils/protectedNamespace.ts b/src/utils/protectedNamespace.ts deleted file mode 100644 index 3cb94bec1..000000000 --- a/src/utils/protectedNamespace.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const checkProtectedNamespace: () => boolean = () => false; diff --git a/src/utils/sandbox/src/tools/BashTool/toolName.ts b/src/utils/sandbox/src/tools/BashTool/toolName.ts deleted file mode 100644 index 2da8eb7a9..000000000 --- a/src/utils/sandbox/src/tools/BashTool/toolName.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type BASH_TOOL_NAME = any; diff --git a/src/utils/sandbox/src/tools/WebFetchTool/prompt.ts b/src/utils/sandbox/src/tools/WebFetchTool/prompt.ts deleted file mode 100644 index 63b342a25..000000000 --- a/src/utils/sandbox/src/tools/WebFetchTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type WEB_FETCH_TOOL_NAME = any; diff --git a/src/utils/sdkHeapDumpMonitor.ts b/src/utils/sdkHeapDumpMonitor.ts deleted file mode 100644 index 949cf8d16..000000000 --- a/src/utils/sdkHeapDumpMonitor.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const startSdkMemoryMonitor: () => void = () => {}; diff --git a/src/utils/secureStorage/src/constants/oauth.ts b/src/utils/secureStorage/src/constants/oauth.ts deleted file mode 100644 index a1b08933a..000000000 --- a/src/utils/secureStorage/src/constants/oauth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOauthConfig = any; diff --git a/src/utils/sessionDataUploader.ts b/src/utils/sessionDataUploader.ts deleted file mode 100644 index 5de795518..000000000 --- a/src/utils/sessionDataUploader.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const createSessionTurnUploader: () => void = () => {}; diff --git a/src/utils/sessionTitle.ts b/src/utils/sessionTitle.ts index ba413e8d0..6e156b9eb 100644 --- a/src/utils/sessionTitle.ts +++ b/src/utils/sessionTitle.ts @@ -35,7 +35,12 @@ export function extractConversationText(messages: Message[]): string { for (const msg of messages) { if (msg.type !== 'user' && msg.type !== 'assistant') continue if ('isMeta' in msg && msg.isMeta) continue - if ('origin' in msg && (msg as any).origin && (msg as any).origin.kind !== 'human') continue + if ( + 'origin' in msg && + (msg as unknown as { origin?: { kind?: string } }).origin && + (msg as unknown as { origin: { kind?: string } }).origin.kind !== 'human' + ) + continue const content = msg.message!.content if (typeof content === 'string') { parts.push(content) @@ -111,7 +116,9 @@ export async function generateSessionTitle( }, }) - const text = extractTextContent(result.message.content as any) + const text = extractTextContent( + result.message.content as readonly { readonly type: string }[], + ) const parsed = titleSchema().safeParse(safeParseJSON(text)) const title = parsed.success ? parsed.data.title.trim() || null : null diff --git a/src/utils/src/constants/oauth.ts b/src/utils/src/constants/oauth.ts deleted file mode 100644 index 4a2c8878d..000000000 --- a/src/utils/src/constants/oauth.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOauthConfig = any; -export type OAUTH_BETA_HEADER = any; -export type CLAUDE_AI_PROFILE_SCOPE = any; diff --git a/src/utils/src/constants/prompts.ts b/src/utils/src/constants/prompts.ts deleted file mode 100644 index 5f6f23012..000000000 --- a/src/utils/src/constants/prompts.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getSystemPrompt = any; -export type SYSTEM_PROMPT_DYNAMIC_BOUNDARY = any; diff --git a/src/utils/src/constants/querySource.ts b/src/utils/src/constants/querySource.ts deleted file mode 100644 index 61a17200d..000000000 --- a/src/utils/src/constants/querySource.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type QuerySource = any; diff --git a/src/utils/src/context.ts b/src/utils/src/context.ts deleted file mode 100644 index f303aa8c4..000000000 --- a/src/utils/src/context.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getSystemContext = any; -export type getUserContext = any; diff --git a/src/utils/src/entrypoints/agentSdkTypes.ts b/src/utils/src/entrypoints/agentSdkTypes.ts deleted file mode 100644 index 982295636..000000000 --- a/src/utils/src/entrypoints/agentSdkTypes.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ExitReason = any; -export type HookEvent = any; -export type SDKAssistantMessageError = any; -export type ModelUsage = any; -export type SDKMessage = any; -export type SyncHookJSONOutput = any; -export type HookInput = any; -export type HookJSONOutput = any; -export type NotificationHookInput = any; -export type PostToolUseHookInput = any; -export type PostToolUseFailureHookInput = any; -export type PermissionDeniedHookInput = any; -export type PreCompactHookInput = any; -export type PostCompactHookInput = any; -export type PreToolUseHookInput = any; -export type SessionStartHookInput = any; -export type SessionEndHookInput = any; -export type SetupHookInput = any; -export type StopHookInput = any; -export type StopFailureHookInput = any; -export type SubagentStartHookInput = any; -export type SubagentStopHookInput = any; -export type TeammateIdleHookInput = any; -export type TaskCreatedHookInput = any; -export type TaskCompletedHookInput = any; -export type ConfigChangeHookInput = any; -export type CwdChangedHookInput = any; -export type FileChangedHookInput = any; -export type InstructionsLoadedHookInput = any; -export type UserPromptSubmitHookInput = any; -export type PermissionRequestHookInput = any; -export type ElicitationHookInput = any; -export type ElicitationResultHookInput = any; -export type PermissionUpdate = any; -export type AsyncHookJSONOutput = any; -export type SDKAssistantMessage = any; diff --git a/src/utils/src/entrypoints/sdk/controlTypes.ts b/src/utils/src/entrypoints/sdk/controlTypes.ts deleted file mode 100644 index bd1b0590d..000000000 --- a/src/utils/src/entrypoints/sdk/controlTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type StdoutMessage = any; diff --git a/src/utils/src/entrypoints/sdk/runtimeTypes.ts b/src/utils/src/entrypoints/sdk/runtimeTypes.ts deleted file mode 100644 index 9ce95c99b..000000000 --- a/src/utils/src/entrypoints/sdk/runtimeTypes.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type EffortLevel = 'low' | 'medium' | 'high' | 'max'; diff --git a/src/utils/src/services/analytics/config.ts b/src/utils/src/services/analytics/config.ts deleted file mode 100644 index a74c40666..000000000 --- a/src/utils/src/services/analytics/config.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isAnalyticsDisabled = any; diff --git a/src/utils/src/services/analytics/index.ts b/src/utils/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/utils/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/utils/src/services/analytics/metadata.ts b/src/utils/src/services/analytics/metadata.ts deleted file mode 100644 index b00cab5f1..000000000 --- a/src/utils/src/services/analytics/metadata.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type sanitizeToolNameForAnalytics = any; diff --git a/src/utils/src/services/compact/microCompact.ts b/src/utils/src/services/compact/microCompact.ts deleted file mode 100644 index 26c0c27cf..000000000 --- a/src/utils/src/services/compact/microCompact.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type microcompactMessages = any; diff --git a/src/utils/src/services/mcp/client.ts b/src/utils/src/services/mcp/client.ts deleted file mode 100644 index 65f6d1153..000000000 --- a/src/utils/src/services/mcp/client.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type prefetchAllMcpResources = any; diff --git a/src/utils/src/services/mcp/vscodeSdkMcp.ts b/src/utils/src/services/mcp/vscodeSdkMcp.ts deleted file mode 100644 index ac040b3c9..000000000 --- a/src/utils/src/services/mcp/vscodeSdkMcp.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type notifyVscodeFileUpdated = any; diff --git a/src/utils/src/services/policyLimits/index.ts b/src/utils/src/services/policyLimits/index.ts deleted file mode 100644 index 887817d1a..000000000 --- a/src/utils/src/services/policyLimits/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type isPolicyAllowed = any; diff --git a/src/utils/src/tools.ts b/src/utils/src/tools.ts deleted file mode 100644 index f9dcbf2e5..000000000 --- a/src/utils/src/tools.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getTools = any; diff --git a/src/utils/src/tools/AgentTool/built-in/exploreAgent.ts b/src/utils/src/tools/AgentTool/built-in/exploreAgent.ts deleted file mode 100644 index 22214f18c..000000000 --- a/src/utils/src/tools/AgentTool/built-in/exploreAgent.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type EXPLORE_AGENT = any; diff --git a/src/utils/src/tools/AgentTool/built-in/planAgent.ts b/src/utils/src/tools/AgentTool/built-in/planAgent.ts deleted file mode 100644 index 6ff4323b2..000000000 --- a/src/utils/src/tools/AgentTool/built-in/planAgent.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type PLAN_AGENT = any; diff --git a/src/utils/src/tools/AgentTool/builtInAgents.ts b/src/utils/src/tools/AgentTool/builtInAgents.ts deleted file mode 100644 index 8358c0b6b..000000000 --- a/src/utils/src/tools/AgentTool/builtInAgents.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type areExplorePlanAgentsEnabled = any; diff --git a/src/utils/src/tools/AskUserQuestionTool/prompt.ts b/src/utils/src/tools/AskUserQuestionTool/prompt.ts deleted file mode 100644 index 93098f1a8..000000000 --- a/src/utils/src/tools/AskUserQuestionTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ASK_USER_QUESTION_TOOL_NAME = any; diff --git a/src/utils/src/tools/BashTool/BashTool.ts b/src/utils/src/tools/BashTool/BashTool.ts deleted file mode 100644 index 7a3ea3cc5..000000000 --- a/src/utils/src/tools/BashTool/BashTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type BashTool = any; diff --git a/src/utils/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts b/src/utils/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts deleted file mode 100644 index f9708d2b3..000000000 --- a/src/utils/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type ExitPlanModeV2Tool = any; diff --git a/src/utils/src/tools/FileEditTool/FileEditTool.ts b/src/utils/src/tools/FileEditTool/FileEditTool.ts deleted file mode 100644 index 0d3bc60eb..000000000 --- a/src/utils/src/tools/FileEditTool/FileEditTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FileEditTool = any; diff --git a/src/utils/src/tools/FileEditTool/utils.ts b/src/utils/src/tools/FileEditTool/utils.ts deleted file mode 100644 index 5a2f3c0af..000000000 --- a/src/utils/src/tools/FileEditTool/utils.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type normalizeFileEditInput = any; -export type stripTrailingWhitespace = any; -export type getSnippetForTwoFileDiff = any; diff --git a/src/utils/src/tools/FileReadTool/limits.ts b/src/utils/src/tools/FileReadTool/limits.ts deleted file mode 100644 index a094e85b8..000000000 --- a/src/utils/src/tools/FileReadTool/limits.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getDefaultFileReadingLimits = any; diff --git a/src/utils/src/tools/FileReadTool/prompt.ts b/src/utils/src/tools/FileReadTool/prompt.ts deleted file mode 100644 index a8a0962eb..000000000 --- a/src/utils/src/tools/FileReadTool/prompt.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FILE_READ_TOOL_NAME = any; -export type MAX_LINES_TO_READ = any; diff --git a/src/utils/src/tools/FileWriteTool/FileWriteTool.ts b/src/utils/src/tools/FileWriteTool/FileWriteTool.ts deleted file mode 100644 index 9417a7a94..000000000 --- a/src/utils/src/tools/FileWriteTool/FileWriteTool.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FileWriteTool = any; diff --git a/src/utils/src/tools/FileWriteTool/prompt.ts b/src/utils/src/tools/FileWriteTool/prompt.ts deleted file mode 100644 index e69299d74..000000000 --- a/src/utils/src/tools/FileWriteTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type FILE_WRITE_TOOL_NAME = any; diff --git a/src/utils/src/tools/GlobTool/prompt.ts b/src/utils/src/tools/GlobTool/prompt.ts deleted file mode 100644 index 060caf29c..000000000 --- a/src/utils/src/tools/GlobTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type GLOB_TOOL_NAME = any; diff --git a/src/utils/src/tools/GrepTool/prompt.ts b/src/utils/src/tools/GrepTool/prompt.ts deleted file mode 100644 index 08b8a8d29..000000000 --- a/src/utils/src/tools/GrepTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type GREP_TOOL_NAME = any; diff --git a/src/utils/src/tools/ListMcpResourcesTool/prompt.ts b/src/utils/src/tools/ListMcpResourcesTool/prompt.ts deleted file mode 100644 index 987c4a383..000000000 --- a/src/utils/src/tools/ListMcpResourcesTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type LIST_MCP_RESOURCES_TOOL_NAME = any; diff --git a/src/utils/src/tools/TaskStopTool/prompt.ts b/src/utils/src/tools/TaskStopTool/prompt.ts deleted file mode 100644 index 28c2e71db..000000000 --- a/src/utils/src/tools/TaskStopTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type TASK_STOP_TOOL_NAME = any; diff --git a/src/utils/src/tools/WebSearchTool/prompt.ts b/src/utils/src/tools/WebSearchTool/prompt.ts deleted file mode 100644 index 38871a0ba..000000000 --- a/src/utils/src/tools/WebSearchTool/prompt.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type WEB_SEARCH_TOOL_NAME = any; diff --git a/src/utils/src/types/ids.ts b/src/utils/src/types/ids.ts deleted file mode 100644 index ba0dcc8a1..000000000 --- a/src/utils/src/types/ids.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AgentId = any; -export type SessionId = any; diff --git a/src/utils/src/types/logs.ts b/src/utils/src/types/logs.ts deleted file mode 100644 index 729b9b474..000000000 --- a/src/utils/src/types/logs.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type LogOption = any; diff --git a/src/utils/src/types/utils.ts b/src/utils/src/types/utils.ts deleted file mode 100644 index 96cc5d26d..000000000 --- a/src/utils/src/types/utils.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type Permutations = any; -export type DeepImmutable = any; diff --git a/src/utils/src/utils/cwd.ts b/src/utils/src/utils/cwd.ts deleted file mode 100644 index 76c192ed8..000000000 --- a/src/utils/src/utils/cwd.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getCwd = any; diff --git a/src/utils/src/utils/model/modelStrings.ts b/src/utils/src/utils/model/modelStrings.ts deleted file mode 100644 index 1265ece0e..000000000 --- a/src/utils/src/utils/model/modelStrings.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getModelStrings = any; diff --git a/src/utils/src/utils/model/providers.ts b/src/utils/src/utils/model/providers.ts deleted file mode 100644 index df87a41b4..000000000 --- a/src/utils/src/utils/model/providers.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getAPIProvider = any; diff --git a/src/utils/src/utils/secureStorage/macOsKeychainHelpers.ts b/src/utils/src/utils/secureStorage/macOsKeychainHelpers.ts deleted file mode 100644 index 9a57f4079..000000000 --- a/src/utils/src/utils/secureStorage/macOsKeychainHelpers.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getMacOsKeychainStorageServiceName = any; diff --git a/src/utils/src/utils/shell/shellToolUtils.ts b/src/utils/src/utils/shell/shellToolUtils.ts deleted file mode 100644 index c89fe2ada..000000000 --- a/src/utils/src/utils/shell/shellToolUtils.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SHELL_TOOL_NAMES = any; diff --git a/src/utils/suggestions/src/components/PromptInput/PromptInputFooterSuggestions.ts b/src/utils/suggestions/src/components/PromptInput/PromptInputFooterSuggestions.ts deleted file mode 100644 index d0fd674c7..000000000 --- a/src/utils/suggestions/src/components/PromptInput/PromptInputFooterSuggestions.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type SuggestionItem = any; diff --git a/src/utils/suggestions/src/utils/cwd.ts b/src/utils/suggestions/src/utils/cwd.ts deleted file mode 100644 index 76c192ed8..000000000 --- a/src/utils/suggestions/src/utils/cwd.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getCwd = any; diff --git a/src/utils/suggestions/src/utils/fsOperations.ts b/src/utils/suggestions/src/utils/fsOperations.ts deleted file mode 100644 index d30ccea0a..000000000 --- a/src/utils/suggestions/src/utils/fsOperations.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getFsImplementation = any; diff --git a/src/utils/suggestions/src/utils/log.ts b/src/utils/suggestions/src/utils/log.ts deleted file mode 100644 index cf30e90da..000000000 --- a/src/utils/suggestions/src/utils/log.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type logError = any; diff --git a/src/utils/systemThemeWatcher.ts b/src/utils/systemThemeWatcher.ts deleted file mode 100644 index 3c61f952c..000000000 --- a/src/utils/systemThemeWatcher.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export {}; -export const watchSystemTheme: (querier: unknown, setTheme: React.Dispatch>) => (() => void) = () => () => {}; diff --git a/src/utils/taskSummary.ts b/src/utils/taskSummary.ts deleted file mode 100644 index 514e894c2..000000000 --- a/src/utils/taskSummary.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated stub — replace with real implementation -export const shouldGenerateTaskSummary: () => boolean = () => false; -export const maybeGenerateTaskSummary: (options: Record) => void = () => {}; diff --git a/src/utils/telemetry/src/services/api/metricsOptOut.ts b/src/utils/telemetry/src/services/api/metricsOptOut.ts deleted file mode 100644 index abe38aa99..000000000 --- a/src/utils/telemetry/src/services/api/metricsOptOut.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type checkMetricsEnabled = any; diff --git a/src/utils/telemetry/src/utils/auth.ts b/src/utils/telemetry/src/utils/auth.ts deleted file mode 100644 index 250437a55..000000000 --- a/src/utils/telemetry/src/utils/auth.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOtelHeadersFromHelper = any; -export type getSubscriptionType = any; -export type is1PApiCustomer = any; -export type isClaudeAISubscriber = any; diff --git a/src/utils/telemetry/src/utils/platform.ts b/src/utils/telemetry/src/utils/platform.ts deleted file mode 100644 index da6332eed..000000000 --- a/src/utils/telemetry/src/utils/platform.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getPlatform = any; -export type getWslVersion = any; diff --git a/src/utils/teleport/src/constants/oauth.ts b/src/utils/teleport/src/constants/oauth.ts deleted file mode 100644 index a1b08933a..000000000 --- a/src/utils/teleport/src/constants/oauth.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOauthConfig = any; diff --git a/src/utils/teleport/src/services/analytics/index.ts b/src/utils/teleport/src/services/analytics/index.ts deleted file mode 100644 index 142e7b6f5..000000000 --- a/src/utils/teleport/src/services/analytics/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS = any; -export type logEvent = any; diff --git a/src/utils/teleport/src/services/oauth/client.ts b/src/utils/teleport/src/services/oauth/client.ts deleted file mode 100644 index 5a7055fbe..000000000 --- a/src/utils/teleport/src/services/oauth/client.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Auto-generated type stub — replace with real implementation -export type getOrganizationUUID = any; diff --git a/src/utils/warningHandler.ts b/src/utils/warningHandler.ts index 3c9572e6c..d91322208 100644 --- a/src/utils/warningHandler.ts +++ b/src/utils/warningHandler.ts @@ -48,15 +48,6 @@ function isInternalWarning(warning: Error): boolean { // Store reference to our warning handler so we can detect if it's already installed let warningHandler: ((warning: Error) => void) | null = null -// For testing only - allows resetting the warning handler state -export function resetWarningHandler(): void { - if (warningHandler) { - process.removeListener('warning', warningHandler) - } - warningHandler = null - warningCounts.clear() -} - export function initializeWarningHandler(): void { // Only set up handler once - check if our handler is already installed const currentListeners = process.listeners('warning')