Skip to content

Commit ff43707

Browse files
fix: resolve all CI build errors (types, console, fields SSR)
- Fix TS2430: Rename ChatbotSchema.body to requestBody to avoid conflict with BaseSchema.body - Fix TS2322: Add type assertion for DesignerFieldType in ObjectManagerPage.tsx - Fix SSR: Add react/jsx-runtime to fields package vite externals for Next.js compatibility - Update CHANGELOG.md Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/f91e232a-9e03-48ed-9599-fcc920e1e008 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent 885db2f commit ff43707

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- **AI SDUI Chatbot integration** (`@object-ui/plugin-chatbot`): Refactored chatbot plugin to support full AI streaming via `service-ai` backend and `vercel/ai` SDK (`@ai-sdk/react`). New `useObjectChat` composable hook wraps `@ai-sdk/react`'s `useChat` for SSE streaming, tool-calling, and production-grade chat. Auto-detects API mode (when `api` schema field is set) vs legacy local auto-response mode. ChatbotEnhanced component now supports stop, reload, error display, and streaming state indicators. 44 unit tests (19 new hook tests, 10 new streaming tests).
1313

14-
- **New ChatbotSchema fields** (`@object-ui/types`): Extended `ChatbotSchema` with `api`, `conversationId`, `systemPrompt`, `model`, `streamingEnabled`, `headers`, `body`, `maxToolRoundtrips`, and `onError` fields for service-ai integration. Extended `ChatMessage` with `streaming`, `toolInvocations` fields and added `ChatToolInvocation` interface for tool-calling flows.
14+
- **New ChatbotSchema fields** (`@object-ui/types`): Extended `ChatbotSchema` with `api`, `conversationId`, `systemPrompt`, `model`, `streamingEnabled`, `headers`, `requestBody`, `maxToolRoundtrips`, and `onError` fields for service-ai integration. Extended `ChatMessage` with `streaming`, `toolInvocations` fields and added `ChatToolInvocation` interface for tool-calling flows.
1515

1616
- **New Storybook stories for AI chatbot** (`@object-ui/components`): Added `AIStreamingMode`, `AIWithSystemPrompt`, and `AIWithToolCalls` stories demonstrating the new AI SDUI chat modes alongside existing local/demo stories.
1717

@@ -33,6 +33,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3333

3434
### Fixed
3535

36+
- **TypeScript build error in ObjectManagerPage** (`apps/console`): Fixed `TS2322: Type 'string' is not assignable to type 'DesignerFieldType'` by adding proper type assertion and missing import for `DesignerFieldType`.
37+
38+
- **ChatbotSchema `body` property conflict with BaseSchema** (`@object-ui/types`): Renamed `ChatbotSchema.body` to `requestBody` to resolve `TS2430: Interface 'ChatbotSchema' incorrectly extends interface 'BaseSchema'` — the chatbot's HTTP request body parameter conflicted with `BaseSchema.body` (child schema nodes). Updated all references in `@object-ui/plugin-chatbot` renderer accordingly.
39+
40+
- **Fields package SSR compatibility for Next.js docs site** (`@object-ui/fields`): Added `react/jsx-runtime` to the Vite build externals configuration to prevent it from being bundled. This fixes the `Error: dynamic usage of require is not supported` failure during Next.js static page prerendering of the `/docs/components/overlay/tooltip` page.
41+
3642
- **Dashboard widgets now surface API errors instead of showing hardcoded data** (`@object-ui/plugin-dashboard`, `@object-ui/plugin-charts`):
3743
- **ObjectChart**: Added error state tracking. When `dataSource.aggregate()` or `dataSource.find()` fails, the chart now shows a prominent error message with a red alert icon instead of silently swallowing errors and rendering an empty chart.
3844
- **MetricWidget / MetricCard**: Added `loading` and `error` props. When provided, the widget shows a loading spinner or a destructive-colored error message instead of the metric value, making API failures immediately visible.

apps/console/src/pages/system/ObjectManagerPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { useNavigate, useParams } from 'react-router-dom';
1515
import { Button, Badge } from '@object-ui/components';
1616
import { ArrowLeft, Database, Settings2, Link2 } from 'lucide-react';
1717
import { ObjectManager, FieldDesigner } from '@object-ui/plugin-designer';
18-
import type { ObjectDefinition, DesignerFieldDefinition } from '@object-ui/types';
18+
import type { ObjectDefinition, DesignerFieldDefinition, DesignerFieldType } from '@object-ui/types';
1919
import { toast } from 'sonner';
2020
import { useMetadata } from '../../context/MetadataProvider';
2121

@@ -103,7 +103,7 @@ function toFieldDefinition(field: MetadataField, index: number): DesignerFieldDe
103103
id: field.name || `fld_${index}`,
104104
name: field.name || '',
105105
label: typeof field.label === 'object' ? field.label.defaultValue || field.label.key || '' : (field.label || field.name || ''),
106-
type: field.type || 'text',
106+
type: (field.type || 'text') as DesignerFieldType,
107107
group: field.group || undefined,
108108
sortOrder: index,
109109
description: field.description || field.help || undefined,

packages/fields/vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default defineConfig({
3333
external: [
3434
'react',
3535
'react-dom',
36+
'react/jsx-runtime',
3637
'@object-ui/components',
3738
'@object-ui/core',
3839
'@object-ui/react',
@@ -43,6 +44,7 @@ export default defineConfig({
4344
globals: {
4445
react: 'React',
4546
'react-dom': 'ReactDOM',
47+
'react/jsx-runtime': 'jsxRuntime',
4648
'@object-ui/components': 'ObjectUIComponents',
4749
},
4850
},

packages/plugin-chatbot/src/renderer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { useObjectChat } from './useObjectChat';
2222
* - Uses @ai-sdk/react for SSE streaming, tool-calling, and production-grade chat
2323
* - Connects to service-ai backend (e.g., /api/v1/ai/chat)
2424
* - Supports streaming, stop, reload, clear actions
25-
* - Schema fields: api, conversationId, systemPrompt, model, streamingEnabled, headers, body, maxToolRoundtrips
25+
* - Schema fields: api, conversationId, systemPrompt, model, streamingEnabled, headers, requestBody, maxToolRoundtrips
2626
*
2727
* **Legacy Mode** (when `api` is not set):
2828
* - Local auto-response for demo/playground use
@@ -57,7 +57,7 @@ ComponentRegistry.register('chatbot',
5757
model: schema.model,
5858
streamingEnabled: schema.streamingEnabled,
5959
headers: schema.headers,
60-
body: schema.body,
60+
body: schema.requestBody,
6161
maxToolRoundtrips: schema.maxToolRoundtrips,
6262
onError: schema.onError,
6363
showTimestamp: schema.showTimestamp,
@@ -260,7 +260,7 @@ ComponentRegistry.register('chatbot-enhanced',
260260
model: schema.model,
261261
streamingEnabled: schema.streamingEnabled,
262262
headers: schema.headers,
263-
body: schema.body,
263+
body: schema.requestBody,
264264
maxToolRoundtrips: schema.maxToolRoundtrips,
265265
onError: schema.onError,
266266
showTimestamp: schema.showTimestamp,

packages/types/src/complex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ export interface ChatbotSchema extends BaseSchema {
528528
/**
529529
* Additional body parameters to include with each API request.
530530
*/
531-
body?: Record<string, unknown>;
531+
requestBody?: Record<string, unknown>;
532532
/**
533533
* Maximum number of tool-calling round-trips per user message.
534534
* @default 5

0 commit comments

Comments
 (0)