Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🔧 chore(type-check): replace tsgo with tsrs (#22102)

Innei459a8d5a7dd1
diff --git a/.agents/acceptance/PROJECT.md b/.agents/acceptance/PROJECT.md
index 932ce121230..26cfcca7008 100644
--- a/.agents/acceptance/PROJECT.md
+++ b/.agents/acceptance/PROJECT.md
@@ -374,7 +374,7 @@ bash "$GUARD" stop # teardown, always
| `ACCEPTANCE_GUARD_RED` | `swap=80,free=8` | Linux host stop thresholds |
Thresholds are host-level on purpose. The groups (`Google Chrome for Testing`,
-`next-server|vite`, `tsgo`) also match other worktrees' servers and other runs'
+`next-server|vite`, `tsrs`) also match other worktrees' servers and other runs'
browsers — five such processes held \~20 GB here — so a group or total RSS cap turns a
merely busy machine red and stops a healthy run. The groups select what
`stop-owned` may stop; they do not determine this adapter's tier.
diff --git a/.agents/acceptance/common-mistakes.md b/.agents/acceptance/common-mistakes.md
index 432dac95e66..d5f9acd0d0c 100644
--- a/.agents/acceptance/common-mistakes.md
+++ b/.agents/acceptance/common-mistakes.md
@@ -567,7 +567,7 @@ account has been checked; do not debug it as product behaviour.
`since 2026-09-18` · `holds-while: pnpm-workspace.yaml sets lockfile: false, and Turbopack resolves next/package.json from the workspace root it detects`
**Trap:** a new worktree has no `node_modules`, and a farm of symlinks into a
-working checkout is quick and makes `vitest` and `tsgo` pass — so the tree looks
+working checkout is quick and makes `vitest` and `tsrs` pass — so the tree looks
ready. The dev server then dies on `Could not find the Next.js package
(next/package.json)`, every route 500s, and the visible errors point elsewhere
(`Failed to resolve import "anser"` from a package-level dependency the farm
diff --git a/.agents/acceptance/scripts/acceptance-guard.sh b/.agents/acceptance/scripts/acceptance-guard.sh
index 891895e1e43..db59286e3ae 100755
--- a/.agents/acceptance/scripts/acceptance-guard.sh
+++ b/.agents/acceptance/scripts/acceptance-guard.sh
@@ -48,7 +48,7 @@ RED="${ACCEPTANCE_GUARD_RED:-swap=80,free=8}"
GUARD_GROUPS=(
'browser=Google Chrome for Testing'
'devserver=next-server|vite'
- 'typecheck=tsgo'
+ 'typecheck=tsrs'
)
RUN_TAG="${ACCEPTANCE_RUN_TAG:-}"
diff --git a/.agents/acceptance/scripts/acceptance-guard.test.sh b/.agents/acceptance/scripts/acceptance-guard.test.sh
index dc2913559ee..a47ee063350 100755
--- a/.agents/acceptance/scripts/acceptance-guard.test.sh
+++ b/.agents/acceptance/scripts/acceptance-guard.test.sh
@@ -88,7 +88,7 @@ assert_contains "$(stub_args)" "start --state-dir $TEST_TMP/state"
assert_contains "$(stub_args)" "--run-tag lobehub-acceptance-test"
assert_contains "$(stub_args)" "--group browser=Google Chrome for Testing"
assert_contains "$(stub_args)" "--group devserver=next-server|vite"
-assert_contains "$(stub_args)" "--group typecheck=tsgo"
+assert_contains "$(stub_args)" "--group typecheck=tsrs"
assert_contains "$(stub_args)" "--yellow swap=60,free=20"
assert_contains "$(stub_args)" "--red swap=80,free=8"
assert_contains "$(stub_args)" "--on-red stop-owned"
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 2bdabbbbb3b..9a13c02f2da 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -293,7 +293,7 @@ jobs:
# pnpm 12 writes broken relative symlinks for workspace members outside the desktop
# workspace root (../../packages/*). Installing the root workspace relinks them so
- # tsgo can resolve sibling packages from source.
+ # tsrs can resolve sibling packages from source.
- name: Relink root workspace members
run: pnpm install --ignore-scripts
env:
diff --git a/AGENTS.md b/AGENTS.md
index b6416fbfc93..a4e5924a160 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -80,7 +80,7 @@ Use `bun run check [changed-files...]`.
- Every bug fix needs a regression test that fails before the fix and passes after it. Skip pure style/CSS fixes when the only practical assertion would match stylesheet source strings.
- Run once with the selectors needed: no selector means lint + related tests; `--lint`, `--test`, and `--type` compose. Default scope is all staged, unstaged and untracked changes; explicit paths override it.
- Lint autofixes files: review the emitted diff. Tests use the nearest owning Vitest config. `--type` checks the full repo (`bun run type-check`). Never run `bun run test`, which runs the full suite.
-- `bun run type-check` runs Bun's builtin checker (`bun --check --tsconfig-override tsconfig.type-check.json`). That needs Bun ≥ 1.4.3. The package.json `check` script is the agent CLI (`bun run check`).
+- `bun run type-check` runs `tsrs` (the Rust port of the TypeScript 7 compiler) over `tsconfig.type-check.json`. The package.json `check` script is the agent CLI (`bun run check`).
- `--alint` is opt-in: model-backed rules in `packages/alint/` for judgement calls a linter cannot express. It needs a provider (`bun run alint:setup`); findings are warnings to fix or justify in the PR.
- For a manual package test, run from the owning package: `cd packages/database && bunx vitest run --silent='passed-only' '[file-path]'`.
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index 3960dab1372..ea5afdd2f2e 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -46,8 +46,8 @@
"stylelint": "stylelint \"src/**/*.{css,less}\" --fix --allow-empty-input",
"test": "vitest --run",
"test:core-ota": "vitest run --config scripts/core-ota-test/vitest.config.mjs",
- "type-check": "tsgo --noEmit -p tsconfig.json",
- "typecheck": "tsgo --noEmit -p tsconfig.json",
+ "type-check": "tsrs --noEmit -p tsconfig.json",
+ "typecheck": "tsrs --noEmit -p tsconfig.json",
"update-server": "sh scripts/update-test/run-test.sh"
},
"dependencies": {
@@ -94,7 +94,6 @@
"@types/resolve": "^1.20.6",
"@types/semver": "^7.8.0",
"@types/set-cookie-parser": "^2.4.10",
- "@typescript/native-preview": "7.0.0-dev.20260707.2",
"@vanilla-extract/css": "^1.21.2",
"@vanilla-extract/vite-plugin": "^5.2.6",
"consola": "^3.4.2",
@@ -129,6 +128,7 @@
"strip-ansi": "7.2.0",
"stylelint": "^17.16.0",
"superjson": "^2.2.6",
+ "tsrs": "0.20.1-ts7.1.0-beta",
"tsx": "^4.23.15",
"typescript": "^6.0.3",
"undici": "^8.11.2",
diff --git a/apps/desktop/pnpm-lock.yaml b/apps/desktop/pnpm-lock.yaml
index 2b97a19be3e..b8ccb5a28a9 100644
--- a/apps/desktop/pnpm-lock.yaml
+++ b/apps/desktop/pnpm-lock.yaml
@@ -139,9 +139,6 @@ importers:
'@types/set-cookie-parser':
specifier: ^2.4.10
version: 2.4.10
- '@typescript/native-preview':
- specifier: 7.0.0-dev.20260707.2
- version: 7.0.0-dev.20260707.2
'@vanilla-extract/css':
specifier: ^1.21.2
version: 1.21.2([email protected])
@@ -244,6 +241,9 @@ importers:
superjson:
specifier: ^2.2.6
version: 2.2.6
+ tsrs:
+ specifier: 0.20.1-ts7.1.0-beta
+ version: 0.20.1-ts7.1.0-beta
tsx:
specifier: ^4.23.15
version: 4.23.15
@@ -3423,6 +3423,52 @@ packages:
peerDependencies:
typescript: '>=5.7.2'
+ resolution: {integrity: sha512-35FzlwW1basYFfHM4aEXD9ix/BJ7xfBM4/k0CLnooHVYKELg279gK5peLGQzI7IuTMWlwxt8IB9MRKT7GfKWXA==}
+ engines: {node: '>=16.20.0'}
+ cpu: [arm64]
+ os: [darwin]
+
+ resolution: {integrity: sha512-WvAYTRLKEMin3yJOxnER6DHOv9Bkgy6Cua+aZPoI8S/D8gR3x2ZR/NdF9mozwPxaK2PdsZPVZTJpTaJmiGf1AA==}
+ engines: {node: '>=16.20.0'}
+ cpu: [x64]
+ os: [darwin]
+
+ resolution: {integrity: sha512-VznDJaK3ddbR13fjSYmOPXINGsyKSQkQDsGpSvt33hjumsiHY9N7awR4de+Pk+gtmUv9ylkJnruiLQdt1LDEiw==}
+ engines: {node: '>=16.20.0'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
+ resolution: {integrity: sha512-AEj++EKJ+ZlRLWdFtYopctph5klOpUtZ+ehiezsrgMr/GP118E0H+5ux1vg1FM20jbAipNxecPg/311MOzN/fw==}
+ engines: {node: '>=16.20.0'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [musl]
+
+ resolution: {integrity: sha512-DhRKQrdKmY20gdl/I2aNAAwTH1+CKs1SpUoE/Xsxd/AoNpGqU+KKOGZaX1aWDgff3GTdAnK1fhQItSdz5jqp0A==}
+ engines: {node: '>=16.20.0'}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
+ resolution: {integrity: sha512-DoqErlQkQioKYunFyl6nUXWR1kjerqoRV56dggx7qMKvauSZMGkjBQ2Za4tmnISIn4BiJBOyZa/SYc0wfnxDpA==}
+ engines: {node: '>=16.20.0'}
+ cpu: [x64]
+ os: [linux]
+ libc: [musl]
+
+ resolution: {integrity: sha512-hQ98/ViclULVELy4bsFHlWM1PsR2K/ohuPVxx2H9wg1iJ/Rhfezdo3lXB3rq7x+NyYMXIBHX7c51ztA74VytPQ==}
+ engines: {node: '>=16.20.0'}
+ cpu: [x64]
+ os: [win32]
+
resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==}
@@ -7753,6 +7799,11 @@ packages:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
+ resolution: {integrity: sha512-9BiTYTorhgJTEjlJmU0yy14wx2kJBbPIE5aSQjZ3G1cDKZFWRRThAASNlwt870EN1oiuiibxdjxxoIW3jBRDBg==}
+ engines: {node: '>=16.20.0'}
+ hasBin: true
+
resolution: {integrity: sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==}
engines: {node: '>=18'}
@@ -10660,6 +10711,27 @@ snapshots:
dependencies:
typescript: 6.0.3
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
dependencies:
tslib: 2.8.1
@@ -10901,6 +10973,7 @@ snapshots:
'@typescript/native-preview-linux-x64': 7.0.0-dev.20260707.2
'@typescript/native-preview-win32-arm64': 7.0.0-dev.20260707.2
'@typescript/native-preview-win32-x64': 7.0.0-dev.20260707.2
+ optional: true
'@ungap/[email protected]': {}
@@ -15690,6 +15763,16 @@ snapshots:
+ optionalDependencies:
+ '@tsrs/darwin-arm64': 0.20.1-ts7.1.0-beta
+ '@tsrs/darwin-x64': 0.20.1-ts7.1.0-beta
+ '@tsrs/linux-arm64-gnu': 0.20.1-ts7.1.0-beta
+ '@tsrs/linux-arm64-musl': 0.20.1-ts7.1.0-beta
+ '@tsrs/linux-x64-gnu': 0.20.1-ts7.1.0-beta
+ '@tsrs/linux-x64-musl': 0.20.1-ts7.1.0-beta
+ '@tsrs/win32-x64': 0.20.1-ts7.1.0-beta
+
dependencies:
bundle-require: 5.1.0([email protected])
diff --git a/apps/desktop/src/main/controllers/McpCtr.ts b/apps/desktop/src/main/controllers/McpCtr.ts
index 12158c12609..92b0f28d3c9 100644
--- a/apps/desktop/src/main/controllers/McpCtr.ts
+++ b/apps/desktop/src/main/controllers/McpCtr.ts
@@ -35,7 +35,7 @@ const loadMcpClient = () => import('../libs/mcp/client');
* Desktop-only copy of `@lobechat/types`'s `CheckMcpInstallResult`.
*
* We intentionally keep it local to avoid pulling the web app's path-alias
- * expectations (e.g. `@/config/*`) into the desktop `tsgo` typecheck.
+ * expectations (e.g. `@/config/*`) into the desktop `tsrs` typecheck.
*/ interface CheckMcpInstallResult {
allDependenciesMet?: boolean;
allOptions?: Array<{
diff --git a/apps/server/src/services/bot/platforms/chatSdkContract.test.ts b/apps/server/src/services/bot/platforms/chatSdkContract.test.ts
index 65c44dd6fdb..12e50a0ce75 100644
--- a/apps/server/src/services/bot/platforms/chatSdkContract.test.ts
+++ b/apps/server/src/services/bot/platforms/chatSdkContract.test.ts
@@ -13,7 +13,7 @@ import { patchDiscordForwardedInteractions } from './discord/patch';
* change reaches production without passing through any commit of ours.
*
* Two safety nets already exist and are NOT duplicated here:
- * - `tsgo` covers every typed surface, including the five in-house adapters
+ * - `tsrs` covers every typed surface, including the five in-house adapters
* that `implements Adapter<…>`;
* - each patch has unit tests for its own branching logic.
*
@@ -155,7 +155,7 @@ afterEach(() => {
describe('chat-sdk contract · adapter registry', () => {
it('exposes adapters through an `adapters` Map keyed by platform id', () => {
// `DiscordClient` / `QQClient` / both Discord patches all reach the adapter
- // this way, through an `any` cast that hides a rename from tsgo:
+ // this way, through an `any` cast that hides a rename from tsrs:
// (bot as any).adapters.get('discord')
const chatBot = createRealBot({ patch: false });
const registry = (chatBot as any).adapters;
@@ -336,7 +336,7 @@ describe('chat-sdk contract · overlapping-message strategies', () => {
// sentence about it, a few hundred ms apart. `burst` is what folds them into
// a single agent turn, and it is the WeChat channel default in
// `wechat/schema.ts`. `debounce` looks similar but is documented to keep only
- // the final message of the window. The difference is invisible to tsgo and
+ // the final message of the window. The difference is invisible to tsrs and
// decides whether a user's picture reaches the model, so pin it here.
beforeEach(() => {
vi.stubGlobal('fetch', vi.fn().mockResolvedValue(new Response('{}', { status: 200 })));
diff --git a/package.json b/package.json
index 9c98a8556ba..070c409ce1f 100644
--- a/package.json
+++ b/package.json
@@ -135,7 +135,7 @@
"test-app:coverage": "vitest --coverage --silent='passed-only'",
"tunnel:cloudflare": "cloudflared tunnel --url http://localhost:3010 --protocol http2",
"tunnel:ngrok": "ngrok http http://localhost:3010",
- "type-check": "bun --check --tsconfig-override tsconfig.type-check.json",
+ "type-check": "tsrs --noEmit -p tsconfig.type-check.json --checkers 4",
"type-check:tsc": "tsc --noEmit",
"widget:tick": "tsx ./scripts/widgetTick/index.mts",
"workflow:cdn": "tsx ./scripts/cdnWorkflow/index.ts",
@@ -553,7 +553,6 @@
"@types/unist": "^3.0.3",
"@types/ws": "^8.18.1",
"@types/xast": "^2.0.4",
- "@typescript/native-preview": "7.0.0-dev.20260630.1",
"@vitejs/devtools": "0.2.0",
"@vitejs/plugin-react": "^6.0.5",
"@vitest/coverage-v8": "5.0.0",
@@ -602,6 +601,7 @@
"s3rver": "3.7.1",
"semantic-release": "^21.1.2",
"stylelint": "^16.26.1",
+ "tsrs": "0.20.1-ts7.1.0-beta",
"tsx": "^4.23.12",
"type-fest": "^5.8.0",
"typescript": "6.0.3",
diff --git a/packages/connector-data/src/jira/client.ts b/packages/connector-data/src/jira/client.ts
index 3d6f7c8f835..89f0de5037f 100644
--- a/packages/connector-data/src/jira/client.ts
+++ b/packages/connector-data/src/jira/client.ts
@@ -54,7 +54,7 @@ export const createJiraConnectorClient = (
const run = createComposioToolRunner('jira', options);
return {
- listProjects: async ({ maxResults } = {}) => {
+ listProjects: async ({ maxResults }: { maxResults?: number } = {}) => {
const data = await run(LIST_PROJECTS_TOOL_SLUG, 'listProjects', {
expand: 'description,lead',
maxResults: pageSize(maxResults, DEFAULT_PROJECTS),
diff --git a/packages/connector-data/src/linear/marketClient.ts b/packages/connector-data/src/linear/marketClient.ts
index b2ed8c75cd6..3a91db093c7 100644
--- a/packages/connector-data/src/linear/marketClient.ts
+++ b/packages/connector-data/src/linear/marketClient.ts
@@ -7,6 +7,7 @@ import type {
LinearConnectorClient,
LinearCycle,
LinearIssue,
+ LinearListInput,
LinearOrganization,
LinearProject,
LinearTeam,
@@ -183,7 +184,7 @@ export const createLinearMarketConnectorClient = ({
);
return { name: str(organization?.name) ?? '', urlKey: str(organization?.urlKey) };
},
- listRecentIssues: async ({ first, publicTeamsOnly } = {}) => {
+ listRecentIssues: async ({ first, publicTeamsOnly }: LinearListInput = {}) => {
const data = await query('listRecentIssues', LINEAR_QUERIES.issues, {
filter: publicTeamsOnly ? PUBLIC_FILTERS.issues : null,
first: pageSize(first, DEFAULT_ISSUES),
@@ -209,7 +210,7 @@ export const createLinearMarketConnectorClient = ({
];
});
},
- listRecentProjects: async ({ first, publicTeamsOnly } = {}) => {
+ listRecentProjects: async ({ first, publicTeamsOnly }: LinearListInput = {}) => {
const data = await query('listRecentProjects', LINEAR_QUERIES.projects, {
filter: publicTeamsOnly ? PUBLIC_FILTERS.projects : null,
first: pageSize(first, DEFAULT_PROJECTS),
@@ -232,7 +233,7 @@ export const createLinearMarketConnectorClient = ({
];
});
},
- listTeams: async ({ first, publicTeamsOnly } = {}) => {
+ listTeams: async ({ first, publicTeamsOnly }: LinearListInput = {}) => {
const data = await query('listTeams', LINEAR_QUERIES.teams, {
filter: publicTeamsOnly ? PUBLIC_FILTERS.teams : null,
first: pageSize(first, DEFAULT_TEAMS),
diff --git a/packages/connector-data/src/notion/client.ts b/packages/connector-data/src/notion/client.ts
index 0bcf12e0eb2..c2383ec4b13 100644
--- a/packages/connector-data/src/notion/client.ts
+++ b/packages/connector-data/src/notion/client.ts
@@ -6,7 +6,7 @@ import {
} from '../composio';
import { ConnectorDataError, getConnectorErrorMessage } from '../errors';
import { parseNotionItems, parseNotionPageMarkdown } from './parser';
-import type { NotionConnectorClient } from './types';
+import type { NotionConnectorClient, NotionListItemsInput } from './types';
const DEFAULT_MAX_RESULTS = 50;
const MAX_QUERY_LENGTH = 500;
@@ -56,7 +56,7 @@ export const createNotionConnectorClient = (
});
return parseNotionPageMarkdown(response);
},
- listItems: async ({ maxResults = DEFAULT_MAX_RESULTS, query } = {}) => {
+ listItems: async ({ maxResults = DEFAULT_MAX_RESULTS, query }: NotionListItemsInput = {}) => {
const finiteMaxResults = Number.isFinite(maxResults) ? maxResults : DEFAULT_MAX_RESULTS;
const boundedMaxResults = Math.min(
Math.max(1, Math.floor(finiteMaxResults)),
diff --git a/packages/const/src/verify.ts b/packages/const/src/verify.ts
index 33f35fa9ce8..486cb8563f5 100644
--- a/packages/const/src/verify.ts
+++ b/packages/const/src/verify.ts
@@ -175,7 +175,7 @@ const PROGRAMMATIC_TEST_PATTERNS: RegExp[] = [
/\b(?:npm|pnpm|yarn|bun|bunx)\s+run\s+check\b/i,
// static analysis / build / CI gates
/\btype[\s-]?check(?:s|ing)?\b/i,
- /\b(?:tsc|tsgo|eslint|stylelint|prettier|biome|ruff|mypy|clippy)\b/i,
+ /\b(?:tsc|tsrs|eslint|stylelint|prettier|biome|ruff|mypy|clippy)\b/i,
/\blint(?:s|ing)?\b/i,
/\bcompiles?\s+(?:cleanly|without errors)\b/i,
/\bbuild\s+(?:pass(?:es|ed)?|succeed(?:s|ed)?|(?:is\s+)?(?:green|clean))\b/i,
diff --git a/packages/database/src/core/pgSearchMigrations.test.ts b/packages/database/src/core/pgSearchMigrations.test.ts
index 97b8ff15e55..1759f7ea709 100644
--- a/packages/database/src/core/pgSearchMigrations.test.ts
+++ b/packages/database/src/core/pgSearchMigrations.test.ts
@@ -8,7 +8,7 @@ import { drizzle } from 'drizzle-orm/pglite';
import { migrate } from 'drizzle-orm/pglite/migrator';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
-// @ts-ignore tsgo handle esm import cjs and compatibility issues
+// @ts-ignore tsrs handle esm import cjs and compatibility issues
import {
assertPgSearchReady,
PgSearchNotReadyError,
diff --git a/packages/memory-user-memory/package.json b/packages/memory-user-memory/package.json
index 3f6e632964b..b60ca64b7b3 100644
--- a/packages/memory-user-memory/package.json
+++ b/packages/memory-user-memory/package.json
@@ -13,8 +13,7 @@
"main": "src/index.ts",
"scripts": {
"test": "vitest --run",
- "test:coverage": "vitest --coverage --silent='passed-only'",
- "type-check": "tsgo --noEmit -p tsconfig.json"
+ "test:coverage": "vitest --coverage --silent='passed-only'"
},
"dependencies": {
"@lobechat/context-engine": "workspace:*",
diff --git a/scripts/migrateServerDB/index.ts b/scripts/migrateServerDB/index.ts
index 52a98327548..6e5ee7180d5 100644
--- a/scripts/migrateServerDB/index.ts
+++ b/scripts/migrateServerDB/index.ts
@@ -6,9 +6,9 @@ import { sql } from 'drizzle-orm';
import { migrate as neonMigrate } from 'drizzle-orm/neon-serverless/migrator';
import { migrate as nodeMigrate } from 'drizzle-orm/node-postgres/migrator';
-// @ts-ignore tsgo handle esm import cjs and compatibility issues
+// @ts-ignore tsrs handle esm import cjs and compatibility issues
import { DB_FAIL_INIT_HINT, DUPLICATE_EMAIL_HINT, PGVECTOR_HINT } from './errorHint';
-// @ts-ignore tsgo handle esm import cjs and compatibility issues
+// @ts-ignore tsrs handle esm import cjs and compatibility issues
import { assertPgSearchReady, PgSearchNotReadyError } from './pgSearchGuard';
import { runWithLockRetry } from './retry';
diff --git a/src/store/chat/slices/agentRun/actions/transports/gateway/execRequest.ts b/src/store/chat/slices/agentRun/actions/transports/gateway/execRequest.ts
index f0145838d21..cdd54735422 100644
--- a/src/store/chat/slices/agentRun/actions/transports/gateway/execRequest.ts
+++ b/src/store/chat/slices/agentRun/actions/transports/gateway/execRequest.ts
@@ -140,6 +140,11 @@ export const resolveUserInterventionConfig = () => ({
allowList: toolInterventionSelectors.allowList(useUserStore.getState()),
});
+type NewTopicProjectInput = {
+ projectId?: string;
+ projectWorkingDirectoryId?: string;
+};
+
/**
* The `appContext` of a Gateway run request: what the server acts on, read
* from the conversation the send came from.
@@ -150,16 +155,17 @@ export const buildExecAppContext = (
executionContext,
initialTopicMetadata,
messageContext = executionContext,
- newTopicProject: { projectId, projectWorkingDirectoryId } = {},
+ newTopicProject,
}: {
executionContext: ConversationContext;
/** Seed metadata for the topic this run creates. */
initialTopicMetadata?: Partial<ChatTopicMetadata>;
messageContext?: ConversationContext;
/** The project directory — or, without one, the project — the topic this run creates is bound to. */
- newTopicProject?: { projectId?: string; projectWorkingDirectoryId?: string };
+ newTopicProject?: NewTopicProjectInput;
},
): ExecAgentAppContext => {
+ const { projectId, projectWorkingDirectoryId }: NewTopicProjectInput = newTopicProject ?? {};
const newThread = resolveNewThreadIntent(executionContext);
return {