Skip to content

Commit a747f67

Browse files
committed
Fix compatibility with upstream main after rebase
- Update theater page import from @copilotkit/a2ui-renderer to @/lib/a2ui - Align useA2UISurface types with shared A2UIComponent type - Add specVersion to Widget mocks in test files - Regenerate pnpm-lock.yaml for npm @a2ui/react and @a2ui/web_core
1 parent e9ab1cd commit a747f67

File tree

7 files changed

+5227
-1980
lines changed

7 files changed

+5227
-1980
lines changed

tools/composer/pnpm-lock.yaml

Lines changed: 5216 additions & 1970 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/composer/src/app/theater/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
} from 'lucide-react';
2525
import { useStreamingPlayer } from '@/components/theater/useStreamingPlayer';
2626
import { useA2UISurface } from '@/components/theater/useA2UISurface';
27-
import { A2UIViewer } from '@copilotkit/a2ui-renderer';
27+
import { A2UIViewer } from '@/lib/a2ui';
2828
import { Button } from '@/components/ui/button';
2929
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable';
3030
import { scenarios, ScenarioId } from '@/data/theater';

tools/composer/src/components/editor/editor-header.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe('EditorHeader', () => {
2424
const mockWidget: Widget = {
2525
id: 'test-id',
2626
name: 'Test Widget',
27+
specVersion: '0.8',
2728
createdAt: new Date(),
2829
updatedAt: new Date(),
2930
root: 'root',

tools/composer/src/components/editor/widget-editor.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
1818
import { render, screen, act } from '@testing-library/react';
1919
import { WidgetEditor } from './widget-editor';
2020
import { useWidgets } from '@/contexts/widgets-context';
21+
import type { Widget } from '@/types/widget';
2122
import { useFrontendTool } from '@copilotkit/react-core/v2';
2223
import React from 'react';
2324

@@ -57,9 +58,10 @@ vi.mock('@/contexts/widgets-context', () => ({
5758
}));
5859

5960
describe('WidgetEditor', () => {
60-
const mockWidget = {
61+
const mockWidget: Widget = {
6162
id: '1',
6263
name: 'Test Widget',
64+
specVersion: '0.8',
6365
root: 'root',
6466
components: [],
6567
dataStates: [{ name: 'default', data: {} }],

tools/composer/src/components/theater/useA2UISurface.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@
1616

1717
import { useMemo } from 'react';
1818
import { transpileToV0_8 } from '@/lib/transcoder';
19-
20-
export interface ComponentInstance {
21-
id: string;
22-
component: Record<string, any>;
23-
}
19+
import type { A2UIComponent } from '@/types/widget';
2420

2521
export interface A2UISurfaceState {
2622
root: string;
27-
components: ComponentInstance[];
23+
components: A2UIComponent[];
2824
data: Record<string, any>;
2925
}
3026

@@ -35,7 +31,7 @@ export interface A2UISurfaceState {
3531
export function useA2UISurface(messages: any[]): A2UISurfaceState {
3632
return useMemo(() => {
3733
let root = "root";
38-
const componentsMap = new Map<string, ComponentInstance>();
34+
const componentsMap = new Map<string, A2UIComponent>();
3935
let data: Record<string, any> = {};
4036

4137
for (const msg of messages) {

tools/composer/src/contexts/widgets-context.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('WidgetsContext', () => {
3030
const mockWidget: Widget = {
3131
id: '1',
3232
name: 'Test Widget',
33+
specVersion: '0.8',
3334
createdAt: new Date(),
3435
updatedAt: new Date(),
3536
root: 'root',
@@ -55,7 +56,7 @@ describe('WidgetsContext', () => {
5556
{widgets.map(w => (
5657
<div key={w.id} data-testid={`widget-${w.id}`}>{w.name}</div>
5758
))}
58-
<button onClick={() => addWidget({ id: '2', name: 'New', createdAt: new Date(), updatedAt: new Date(), root: 'root', components: [], dataStates: [] })}>Add</button>
59+
<button onClick={() => addWidget({ id: '2', name: 'New', specVersion: '0.8', createdAt: new Date(), updatedAt: new Date(), root: 'root', components: [], dataStates: [] })}>Add</button>
5960
<button onClick={() => updateWidget('1', { name: 'Updated' })}>Update</button>
6061
<button onClick={() => removeWidget('1')}>Remove</button>
6162
</div>

tools/composer/src/lib/storage.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('storage', () => {
3131
const mockWidget: Widget = {
3232
id: '1',
3333
name: 'Test Widget',
34+
specVersion: '0.8',
3435
createdAt: new Date(),
3536
updatedAt: new Date(),
3637
root: 'root',

0 commit comments

Comments
 (0)