Skip to content

Commit 50bdd5d

Browse files
committed
Merge remote-tracking branch 'origin/main' into worktree-silly-nibbling-bumblebee
# Conflicts: # packages/typescript/ai/src/activities/chat/index.ts
2 parents ec7027a + ec1393d commit 50bdd5d

29 files changed

Lines changed: 299 additions & 169 deletions

File tree

.changeset/eslint-config-0-4-0.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@tanstack/ai': patch
3+
'@tanstack/ai-code-mode': patch
4+
'@tanstack/ai-code-mode-skills': patch
5+
'@tanstack/ai-elevenlabs': patch
6+
'@tanstack/ai-fal': patch
7+
'@tanstack/ai-gemini': patch
8+
'@tanstack/ai-grok': patch
9+
'@tanstack/ai-openai': patch
10+
'@tanstack/ai-openrouter': patch
11+
'@tanstack/ai-react-ui': patch
12+
---
13+
14+
Adopt `@tanstack/eslint-config@0.4.0` and clean up the local override layer.
15+
16+
- Bump `@tanstack/eslint-config` from `0.3.3` to `0.4.0`.
17+
- Drop dead `pnpm/enforce-catalog` and `pnpm/json-enforce-catalog` disables (upstream removed `eslint-plugin-pnpm` in `0.3.1`).
18+
- Drop the `no-case-declarations: off` override — no current source actually violates it.
19+
- Drop the `no-shadow: off` override — upstream sets it to `warn`, so it surfaces in editors without blocking CI.
20+
- Remove ~25 unnecessary type assertions across the publishable packages that the upgraded `typescript-eslint` now catches via `no-unnecessary-type-assertion`. One deliberately defensive cast in `ag-ui-wire.ts` is preserved with an inline opt-out and a reason comment.
21+
22+
No public-API or runtime-behavior changes.

eslint.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ const config = [
1212
'unused-imports': unusedImports,
1313
},
1414
rules: {
15-
'no-case-declarations': 'off',
16-
'no-shadow': 'off',
1715
'unused-imports/no-unused-imports': 'warn',
18-
'pnpm/enforce-catalog': 'off',
19-
'pnpm/json-enforce-catalog': 'off',
2016
},
2117
},
2218
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@changesets/cli": "^2.30.0",
5656
"@faker-js/faker": "^10.1.0",
5757
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
58-
"@tanstack/eslint-config": "0.3.3",
58+
"@tanstack/eslint-config": "0.4.0",
5959
"@tanstack/typedoc-config": "0.3.1",
6060
"@tanstack/vite-config": "0.4.1",
6161
"@types/node": "^24.10.1",

packages/typescript/ai-code-mode-skills/src/generate-skill-types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export function generateSkillTypes(skills: Array<Skill>): string {
116116
if (
117117
skill.inputSchema.type === 'object' &&
118118
skill.inputSchema.properties &&
119-
Object.keys(skill.inputSchema.properties as object).length > 0
119+
Object.keys(skill.inputSchema.properties).length > 0
120120
) {
121121
declarations.push(`interface ${inputTypeName} ${inputType}`)
122122
}
@@ -126,7 +126,7 @@ export function generateSkillTypes(skills: Array<Skill>): string {
126126
if (
127127
skill.outputSchema.type === 'object' &&
128128
skill.outputSchema.properties &&
129-
Object.keys(skill.outputSchema.properties as object).length > 0
129+
Object.keys(skill.outputSchema.properties).length > 0
130130
) {
131131
declarations.push(`interface ${outputTypeName} ${outputType}`)
132132
}
@@ -135,14 +135,14 @@ export function generateSkillTypes(skills: Array<Skill>): string {
135135
const inputRef =
136136
skill.inputSchema.type === 'object' &&
137137
skill.inputSchema.properties &&
138-
Object.keys(skill.inputSchema.properties as object).length > 0
138+
Object.keys(skill.inputSchema.properties).length > 0
139139
? inputTypeName
140140
: inputType
141141

142142
const outputRef =
143143
skill.outputSchema.type === 'object' &&
144144
skill.outputSchema.properties &&
145-
Object.keys(skill.outputSchema.properties as object).length > 0
145+
Object.keys(skill.outputSchema.properties).length > 0
146146
? outputTypeName
147147
: outputType
148148

packages/typescript/ai-code-mode/src/type-generator/json-schema-to-ts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function jsonSchemaToTypeScript(
8484
if (
8585
schema.type === 'object' &&
8686
schema.properties &&
87-
Object.keys(schema.properties as object).length > 0
87+
Object.keys(schema.properties).length > 0
8888
) {
8989
return {
9090
name: typeName,

packages/typescript/ai-elevenlabs/src/realtime/adapter.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
RealtimeMessage,
99
RealtimeMode,
1010
RealtimeSessionConfig,
11-
RealtimeStatus,
1211
RealtimeToken,
1312
} from '@tanstack/ai'
1413
import type { InternalLogger } from '@tanstack/ai/adapter-internals'
@@ -119,15 +118,15 @@ async function createElevenLabsConnection(
119118
logger.provider(`provider=elevenlabs direction=in type=connect`, {
120119
frame: { type: 'connect' },
121120
})
122-
emit('status_change', { status: 'connected' as RealtimeStatus })
121+
emit('status_change', { status: 'connected' })
123122
emit('mode_change', { mode: 'listening' })
124123
},
125124

126125
onDisconnect: () => {
127126
logger.provider(`provider=elevenlabs direction=in type=disconnect`, {
128127
frame: { type: 'disconnect' },
129128
})
130-
emit('status_change', { status: 'idle' as RealtimeStatus })
129+
emit('status_change', { status: 'idle' })
131130
emit('mode_change', { mode: 'idle' })
132131
},
133132

@@ -205,7 +204,7 @@ async function createElevenLabsConnection(
205204
await conversation.endSession()
206205
conversation = null
207206
}
208-
emit('status_change', { status: 'idle' as RealtimeStatus })
207+
emit('status_change', { status: 'idle' })
209208
},
210209

211210
async startAudioCapture() {

packages/typescript/ai-fal/src/adapters/image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class FalImageAdapter<TModel extends FalModel> extends BaseImageAdapter<
135135
img &&
136136
typeof img === 'object' &&
137137
'url' in img &&
138-
typeof (img as { url: unknown }).url === 'string'
138+
typeof img.url === 'string'
139139
) {
140140
url = (img as { url: string }).url
141141
} else {

packages/typescript/ai-gemini/src/adapters/text.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ export class GeminiTextAdapter<
750750
response: {
751751
content: msg.content || '',
752752
},
753-
} as any,
753+
},
754754
})
755755
}
756756

@@ -829,8 +829,7 @@ export class GeminiTextAdapter<
829829
// local `thinkingLevel?: keyof typeof ThinkingLevel` type doesn't leak
830830
// into the SDK config object via the `...modelOpts` spread — we re-add a
831831
// properly-typed `ThinkingConfig` below.
832-
const { thinkingConfig, ...modelOpts } =
833-
options.modelOptions ?? ({} as GeminiTextProviderOptions)
832+
const { thinkingConfig, ...modelOpts } = options.modelOptions ?? {}
834833
// Build the thinkingConfig payload only when the caller actually supplied
835834
// one. Our local `thinkingLevel` is typed as `keyof typeof ThinkingLevel`
836835
// (string union) so users can pass plain strings; the SDK target is the

packages/typescript/ai-grok/src/adapters/tts.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { GrokTTSModel } from '../model-meta'
55
import type {
66
GrokTTSCodec,
77
GrokTTSProviderOptions,
8-
GrokTTSVoice,
98
} from '../audio/tts-provider-options'
109

1110
const DEFAULT_GROK_BASE_URL = 'https://api.x.ai/v1'
@@ -155,7 +154,7 @@ export function buildTTSRequestBody(options: {
155154

156155
const body: Record<string, unknown> = {
157156
text,
158-
voice_id: (voice as GrokTTSVoice | undefined) ?? 'eve',
157+
voice_id: voice ?? 'eve',
159158
language: modelOptions?.language ?? 'en',
160159
output_format: outputFormat,
161160
}

packages/typescript/ai-grok/src/realtime/adapter.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type {
77
RealtimeMessage,
88
RealtimeMode,
99
RealtimeSessionConfig,
10-
RealtimeStatus,
1110
RealtimeToken,
1211
} from '@tanstack/ai'
1312
import type { InternalLogger } from '@tanstack/ai/adapter-internals'
@@ -210,7 +209,7 @@ async function createWebRTCConnection(
210209
// don't attempt a redundant reject on an already-settled promise.
211210
rejectDataChannelReady = null
212211
flushPendingEvents()
213-
emit('status_change', { status: 'connected' as RealtimeStatus })
212+
emit('status_change', { status: 'connected' })
214213
resolve()
215214
}
216215
})
@@ -297,10 +296,7 @@ async function createWebRTCConnection(
297296
// guard listeners would see two `idle` events per disconnect.
298297
if (!isTornDown) {
299298
emit('status_change', {
300-
status:
301-
state === 'failed'
302-
? ('error' as RealtimeStatus)
303-
: ('idle' as RealtimeStatus),
299+
status: state === 'failed' ? 'error' : 'idle',
304300
})
305301
}
306302
if (!dataChannelOpened) {
@@ -961,7 +957,7 @@ async function createWebRTCConnection(
961957
// every cleanup site stays in sync (input analyser, output analyser,
962958
// output source, audio element, etc.).
963959
await teardownConnection()
964-
emit('status_change', { status: 'idle' as RealtimeStatus })
960+
emit('status_change', { status: 'idle' })
965961
},
966962

967963
async startAudioCapture() {

0 commit comments

Comments
 (0)