mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
7bec77a13a
Rework the Controlled Generative UI demo to be minimal, self-contained, and render charts via `useComponent`. Frontend (`src/app/demos/gen-ui-tool-based/`): - `page.tsx` -- `CopilotKit` + full-screen `CopilotChat` (no sidebar), two `useComponent` registrations (`render_bar_chart`, `render_pie_chart`), three chart-oriented suggestions. - `bar-chart.tsx`, `pie-chart.tsx` -- ported from `examples/integrations/langgraph-python`. Each file reads top-to- bottom as imports -> schema -> props type -> component; colors and animation helpers are inlined inside the component. No shared chart-config module. - Haiku card + schema removed. Agent (`src/agents/main.py`): - Rewritten using `create_agent` + `CopilotKitMiddleware()` so the LangGraph middleware injects the frontend `render_*_chart` tools into the model request at runtime. - Deleted all backend-tool modules (`tools.py`, `todos.py`, `a2ui_dynamic_schema.py`, `a2ui_fixed_schema.py`). System prompt trimmed to a data-viz assistant. Peripheral cleanups: - `demos/agentic-chat/page.tsx` -- `change_background` tool + its suggestion removed; it had nothing to do with chat. - New `demos/frontend-tools/` (In-App Actions) hosts `change_background` as its own demo with a `frontend_tools` agent name registered in `api/copilotkit/route.ts`. - Stub `gen-ui-tool-based/agent.py` removed. - `generate-starters.test.ts` no longer requires every python package to have backend tool imports -- a package with only frontend tools (like this controlled-gen-ui demo) is now valid. - Whitelist generated shell data (`demo-content.json`, `search-index.json`, `starter-content.json`) in check-binaries hook -- they're generated artifacts like `package-lock.json`. - Regenerated `demo-content.json` + `registry.json`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
37 lines
716 B
YAML
37 lines
716 B
YAML
output:
|
|
- meta
|
|
- summary
|
|
- success
|
|
- failure
|
|
- execution
|
|
- execution_out
|
|
- execution_info
|
|
- skips
|
|
|
|
pre-commit:
|
|
parallel: true
|
|
commands:
|
|
check-binaries:
|
|
tags: binaries
|
|
run: bash scripts/hooks/check-binaries.sh
|
|
sync-lockfile:
|
|
tags: lockfile
|
|
glob: "**/package.json"
|
|
run: pnpm i --lockfile-only
|
|
stage_fixed: true
|
|
lint-fix:
|
|
tags: lint
|
|
run: pnpm run lint && pnpm run format
|
|
stage_fixed: true
|
|
test-and-check-packages:
|
|
tags: test-packages
|
|
env:
|
|
NX_TUI: "false"
|
|
run: pnpm run test && pnpm run check:packages
|
|
|
|
commit-msg:
|
|
commands:
|
|
commitlint:
|
|
tags: commitlint
|
|
run: pnpm commitlint --edit {1}
|