Files
adnify/tsconfig.json
adnaan 3ffea3860b fix: repair typecheck, corrupted prompt text, and phantom tool references
Restores a green typecheck and removes three classes of defect that were
silently degrading agent behaviour.

Typecheck (CI runs `npx tsc --noEmit`; note `pnpm build` = `vite build` does
NOT typecheck, so these could ship):

- PlanHistoryDrawer rendered <History /> without importing it. The empty-state
  branch is only reachable via a search with no matches, so it crashed there
  and nowhere else. Tests never render this component, so both gates missed it.
- PlanWorkbench/planWorkbenchProjection accessed `.progress` on union members
  that lacked it; annotate the focus literals and toolActivities so the
  declared PlanWorkbenchFocus/PlanActivityItem types apply.
- useGlobalShortcuts subscribed to showChangelog but omitted it from
  stateRef.current, so the shortcut could never read it.
- ChangelogDialog: drop genuinely unused imports.
- tsconfig: scope out src/main (compiled by tsconfig.main.json with
  module: CommonJS, where `import x = require()` is valid and intentional) and
  the tests/treeSitterTest.ts scratch script that imports it. Rewriting those
  imports would have broken the main build to satisfy the wrong config.

Prompt text sent on every request:

- promptTemplates.ts:263-265 contained mojibake (bytes E9 88 AB 3F) where a
  UTF-8 arrow was decoded as GBK, so the model read "change 鈫?use ..." — the
  arrow lost and a stray "?" turning each line into a question.

Phantom tools — advertised to the model but with no TOOL_CONFIGS entry, so
BuiltinToolProvider silently drops them while the prompt still taught them:

- Remove read_multiple_files / get_dir_tree / get_file_info from the
  CORE_TOOLS and PLAN_EXPLORATION_TOOLS allow-lists.
- Point the prompt and SEARCH_DECISION_GUIDE at the real capability instead:
  read_file accepts an array (path=["a.ts","b.ts"]), and list_directory takes
  recursive=true.
- ContextBuilder called a non-existent 'get_terminal_output' (real name is
  read_terminal_output), so @Terminal context injection always returned
  "[No terminal output available]".

Adds tests/agent/plan/planWorkbenchComponents.test.ts: a static guard that
every PascalCase JSX tag in the workbench resolves to an import or local
declaration. Verified to fail when the History import is removed and to pass
once restored.
2026-08-15 22:57:19 +08:00

35 lines
1.3 KiB
JSON

{
"extends": "./tsconfig.shared.json",
"compilerOptions": {
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"jsx": "react-jsx",
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@main/*": ["src/main/*"],
"@renderer/*": ["src/renderer/*"],
"@shared/*": ["src/shared/*"],
"@components/*": ["src/renderer/components/*"],
"@features/*": ["src/renderer/features/*"],
"@services/*": ["src/renderer/services/*"],
"@store": ["src/renderer/store"],
"@store/*": ["src/renderer/store/*"],
"@hooks/*": ["src/renderer/hooks/*"],
"@utils/*": ["src/renderer/utils/*"],
"@app-types/*": ["src/renderer/types/*"]
}
},
"include": ["src/**/*", "src/renderer/vite-env.d.ts","tests/**/*"],
// src/main is compiled by tsconfig.main.json (module: CommonJS). It is excluded
// here because main-process files legitimately use `import x = require(...)`,
// which is invalid under this config's module: ESNext and would report TS1202.
// tests/treeSitterTest.ts is a manual scratch script (not matched by vitest's
// *.{test,spec,property}.ts globs) that imports src/main directly.
"exclude": ["src/main/**/*", "tests/treeSitterTest.ts"],
}