Commit Graph

6618 Commits

Author SHA1 Message Date
Jordan Ritter 4fc3933432 test: add Playwright regression test for dark mode CSS scoping (#2920)
Verifies that .dark CSS selectors in console.css and input.css are
properly scoped to CopilotKit elements and do not leak into the host
application. Tests detect the specific rgb(69, 69, 69) color leak that
occurred when .dark was used as a standalone selector.
2026-04-15 13:10:28 +02:00
github-actions[bot] 13c2ccae78 style: auto-fix formatting 2026-04-15 13:10:27 +02:00
Jordan Ritter db2ed5e19a fix: scope .dark CSS selectors to CopilotKit elements (#2920) 2026-04-15 13:10:27 +02:00
Jordan Ritter 141b189a0b fix: regenerate shell registry and starter content data 2026-04-15 13:10:26 +02:00
Jordan Ritter 0d4b9c6370 fix: resolve langgraph-python starter crash from wrong graph path and fragile imports
The langgraph.json in the starter was copied verbatim from the demo package
with path ./src/agents/main.py:graph, but the starter flattens agents into
the agent/ dir so the correct path is ./main.py:graph.

Also wraps A2UI agent imports in try/except so the starter starts cleanly
even if copilotkit's ToolRuntime patch isn't available — these are optional
features that shouldn't prevent the core agent from running.

Fixes the generate-starters.ts script to rewrite langgraph.json graph paths
when copying from packages to starters, preventing this drift in the future.
2026-04-15 13:10:25 +02:00
Jordan Ritter 8d84907642 fix: add AG-UI SDK build-from-source step to spring-ai Dockerfile
The com.ag-ui.community artifacts aren't published to Maven Central,
so the Docker build fails when resolving dependencies. The demo package
Dockerfile already handles this by cloning the ag-ui repo and running
mvn install before building the agent — mirror that in the template
and regenerate the starter.
2026-04-15 13:10:25 +02:00
Jordan Ritter 362a04e1cc fix: resolve agent factory functions in V1 CopilotRuntime constructor
The V1 CopilotRuntime constructor did `{...endpointAgents, ...agents}`
which silently spread a factory function to `{}`, losing all agents.
Anyone using the V1 API with a factory function got zero agents and no
error. This wraps factory functions so endpoint agents are merged at
resolution time instead of construction time.
2026-04-15 13:10:24 +02:00
Jordan Ritter f336c0aece fix: preserve graph-owned state keys during frontend state merge (#2893) 2026-04-15 13:10:23 +02:00
Jordan Ritter cf55228f95 test: add comprehensive tests for _sanitize_for_json
27 tests covering:
- Passthrough of valid types (floats, ints, strings, booleans, None)
- NaN and +/-Infinity replacement with None
- Recursive sanitization through dicts, lists, and tuples
- Real-world event structures (on_chain_end, streaming chunks, state sync)
2026-04-15 13:10:23 +02:00
Jordan Ritter ef9a50e1b2 fix: sanitize raw event stream to prevent NaN/Infinity in JSON output
The _sanitize_for_json function was applied to state sync events and
get_state responses but not to the raw event stream yielded at line 507.
Events with NaN/Infinity float values in their data payloads would
produce invalid JSON (literal NaN) that downstream parsers cannot handle.
2026-04-15 13:10:22 +02:00
Jordan Ritter ae57609b11 fix: sanitize NaN/Infinity values in LangGraph state before JSON serialization (#1955) 2026-04-15 13:10:21 +02:00
Jordan Ritter d2486c33d6 test: add tests for multi-part AIMessage content extraction
Verifies langchain_messages_to_copilotkit correctly concatenates all text
parts from list-style content blocks (Anthropic models). Includes
regression tests for the exact scenario from #1748 (text + image blocks)
and tests for string lists, mixed content, empty lists, and edge cases.
2026-04-15 13:10:20 +02:00
Jordan Ritter 3bcff877ae fix: extract all text parts when AIMessage content is a list (#1748)
When Anthropic models return multi-part content lists, only the first
element was used and the rest discarded. Now iterates all parts and
concatenates text blocks, preserving the full message content.
2026-04-15 13:10:20 +02:00
Jordan Ritter 5c71d28676 fix: also serialize Pydantic state in get_state() and fix implicit None return
The original fix only covered _emit_state_sync_event but missed the
get_state() code path, which also returns state containing Pydantic
BaseModel instances to callers that will JSON-serialize downstream.

Also fixes filter_state_on_schema_keys returning None implicitly when
schema keys are not set (the except branch returned state but the
non-matching if branch did not).

Adds 17 tests covering _serialize_state, _emit_state_sync_event, and
get_state with Pydantic models (nested, lists, plain dicts, empty).
2026-04-15 13:10:19 +02:00
Jordan Ritter f9333dec88 fix: convert Pydantic BaseModel instances to dicts before langchain_dumps serialization (#2158) 2026-04-15 13:10:18 +02:00
Jordan Ritter 900d326369 test(sdk-python): replace mock test with integration tests for emit_state merge
The original test only tested the _merge_emit_state helper in isolation
using mocks. Replace with integration tests that simulate the actual
state-tracking loop from _stream_events, including:

- Sequential emits with different keys preserve all keys (core bug)
- Proof that the bug manifests without current_graph_state.update
- Three sequential emits accumulate correctly
- Same key emitted twice uses latest value
- Non-dict emit does not corrupt current_graph_state
- Initial state reference is not mutated
2026-04-15 13:10:18 +02:00
Jordan Ritter f6ec3d3c27 fix(sdk-python): update current_graph_state after manual emit to persist across iterations
The _merge_emit_state call merges emitted state with current_graph_state
into manually_emitted_state, but the `continue` statement skips the
later current_graph_state.update(updated_state). Without this update,
the next manual emit merges against stale current_graph_state and loses
keys from the previous emit.

Also guards the update call against non-dict values from _merge_emit_state
to prevent TypeError on edge-case non-dict emits.
2026-04-15 13:10:17 +02:00
Jordan Ritter 08fbb79ac8 fix(sdk-python): copilotkit_emit_state merges state instead of replacing (#3138)
Sequential emit_state calls with different keys now preserve all keys
in the snapshot. Previously, each call would replace the entire
manually_emitted_state, losing keys from earlier calls.
2026-04-15 13:10:17 +02:00
Jordan Ritter f4ccc21de6 fix: correct starter Dockerfiles for spring-ai (mvnw), ms-agent-dotnet (adduser), mastra (agent dir)
spring-ai: Use maven:3-eclipse-temurin-21 image with mvn instead of
missing ./mvnw wrapper.

ms-agent-dotnet: Replace addgroup/adduser (not available on aspnet:9.0)
with groupadd/useradd. Applied same fix to all four Dockerfile templates
for consistency.

mastra: Make Dockerfile.typescript template use {{AGENT_DIR}} variable
so mastra correctly gets src/mastra/ instead of hardcoded agent/.
Updated generate-starters.ts to substitute variables in Dockerfiles.
2026-04-15 13:10:16 +02:00
Jordan Ritter 5e027f68dd fix: remove shared_frontend from Dockerfiles and test-integration-tmp from CI 2026-04-15 13:10:15 +02:00
Jordan Ritter 42943f88e8 fix: update QA sync parent page to new Showcase QA Instructions under QA Root 2026-04-15 13:10:15 +02:00
Jordan Ritter 5d20d47ef2 fix: remove shared_frontend COPY from demo package Dockerfiles (deleted in #3896) 2026-04-15 13:10:14 +02:00
Jordan Ritter a528fd71ac feat: add on-demand aimock e2e test workflow with PR comment trigger 2026-04-15 13:10:13 +02:00
Jordan Ritter 9007f0d2a1 chore: remove dead demo-wrapper/error-boundary files, regenerate shell data
Remove orphaned demo-wrapper.tsx (1 file) and error-boundary.tsx (17 files)
that still imported from the deleted @copilotkit/showcase-shared.
Regenerate registry.json, demo-content.json, and starter-content.json.
2026-04-15 13:10:12 +02:00
Jordan Ritter 0885507fb7 feat: CI, shell, and aimock integration for showcase starters
CI:
- Add 17 starter services to showcase deploy workflow with Railway IDs
- Add drift detection workflow (triggers on starters, packages, scripts, shared)
- Remove shared_frontend copy step for starter builds

Shell:
- Update clone command to npx degit with clipboard fallback
- Update starter content bundler for full component tree + .java support
- Add clone_command to manifest schema and registry types

Aimock:
- Expand feature-parity.json from 18 to 37 fixture rules
- Add docker-compose.packages.yml for CI aimock sidecar (strict mode)
- Add run-e2e-with-aimock.sh convenience script
2026-04-15 13:10:12 +02:00
Jordan Ritter d317c806e8 feat: generate all 17 standalone starter packages
Generated from template via showcase/scripts/generate-starters.ts.
Each starter is fully self-contained with Sales Dashboard + 5 renderers,
self-contained agent backend, per-language Dockerfile (non-root user),
and deterministic entrypoint with agent health checks.

Marked linguist-generated=true in .gitattributes.
2026-04-15 13:10:11 +02:00
Jordan Ritter 86dda44640 feat: add starter template, generation script, and comprehensive test suite
Canonical template at showcase/starters/template/ with Sales Dashboard
hero page, 5 GenUI rendering strategies, per-language Dockerfiles
(non-root user, agent health checks), and self-contained agent backends.

Generation script at showcase/scripts/generate-starters.ts:
- Python sys.path.insert removal + relative import rewriting
- TypeScript shared-tools import rewriting
- Deterministic output (sorted devDependencies, stable file ordering)
- --check mode for CI drift detection
- Strict error handling (throws on missing required inputs)

537 tests: generation unit tests (transform functions, entrypoint blocks),
cross-starter consistency checks (270), Playwright e2e interaction tests
(renderer switching, deal creation, suggestion verification).
2026-04-15 13:10:09 +02:00
Jordan Ritter 3321d71495 feat: delete shared frontend — all consumers now self-contained
Remove showcase/shared/frontend/ directory and its pnpm-workspace.yaml
entry. All 17 demo packages and 17 starters are fully self-contained
with no shared frontend dependency.
2026-04-15 13:10:09 +02:00
Jordan Ritter 6870bbf44b feat: decouple 17 demo packages from shared frontend, update manifests and playwright configs
- Remove @copilotkit/showcase-shared webpack alias from all 17 next.config.ts
- Remove @copilotkit/showcase-shared tsconfig paths from all 17 tsconfig.json
- Update all 17 manifest.yaml starter sections to point to showcase/starters/<slug>
  with Sales Dashboard name, npx degit clone command, and Railway demo URLs
- Add OPENAI_BASE_URL/OPENAI_API_KEY env passthrough to all 17 playwright configs
  for aimock-backed e2e testing
2026-04-15 13:10:08 +02:00
Jordan Ritter 2bf5b69f99 feat: revert all 153 demo pages to self-contained originals
Replace shared-import demo pages across all 17 showcase packages with
the original self-contained implementations from git history. Each demo
is now fully readable in the Code tab with zero @copilotkit/showcase-shared
imports, no demonstrationCatalog, and no shared error boundaries.

9 demos x 17 packages = 153 page.tsx files reverted.
2026-04-15 13:10:07 +02:00
Alem Tuzlak b875258b22 docs(vscode-extension): add README with setup, usage, and CI/CD instructions 2026-04-15 13:10:07 +02:00
Alem Tuzlak 966a1127c1 ci: add GitHub Actions workflow for VS Code extension build and marketplace publishing 2026-04-15 13:08:19 +02:00
Alem Tuzlak 18b88a5112 feat(vscode-extension): wire up full extension with sidebar, preview panel, and file watcher 2026-04-15 13:07:19 +02:00
Alem Tuzlak 3c5333fee1 feat(vscode-extension): add debounced file watcher for component and fixture files 2026-04-15 13:06:19 +02:00
Alem Tuzlak ae823c9272 feat(vscode-extension): add WebviewPanel with message bridge and CSP 2026-04-15 13:05:06 +02:00
Alem Tuzlak 6adf209bdc feat(vscode-extension): add webview React app with bridge, fixture picker, and error overlay 2026-04-15 13:03:05 +02:00
Alem Tuzlak 5d02b8bad8 feat(vscode-extension): add sidebar TreeDataProvider for component tree 2026-04-15 13:00:39 +02:00
Alem Tuzlak 262f87c57a feat(vscode-extension): add component scanner for catalog discovery 2026-04-15 12:59:29 +02:00
Alem Tuzlak 954e0251a9 feat(vscode-extension): add fixture validator with oxc-parser 2026-04-15 12:56:51 +02:00
Alem Tuzlak ddce45b370 feat(vscode-extension): add Rolldown-based catalog bundler 2026-04-15 12:54:21 +02:00
Alem Tuzlak bdb44e5016 feat(vscode-extension): scaffold package with manifest and build config 2026-04-15 12:51:35 +02:00
Markus Ecker 0f02aae198 fix: align A2UI schema format with v0.9 spec and improve path binding prompts
- Replace custom { name, props } schema format with spec-aligned inline
  catalog format (allOf + properties) so the LLM sees the same flat
  structure it must produce — eliminates "props" nesting confusion.
- Restructure generation prompts: inline literal values are the default,
  path binding is a narrow schema-driven exception for form inputs.
- Export InlineCatalogSchema type from a2ui-renderer.
2026-04-15 12:28:13 +02:00
Markus Ecker abd0d5c11c fix: add path binding schema rule to A2UI generation prompts
LLMs sometimes use path bindings (e.g. {"path": "/chartData"}) on
component properties that only accept literal values, causing silent
render failures. The new guideline tells the LLM to check the schema's
anyOf type before using path bindings.
2026-04-15 11:51:05 +02:00
Jordan Ritter eb23cc96b6 fix: restructure spring-ai starter to use Maven standard directory layout (#3925)
## Summary
- The `generate-starters.ts` script was flattening
`src/main/{java,resources}` into `agent/{java,resources}`, breaking
Maven builds which expect the standard `src/main/` layout
- Added a post-copy restructure step that moves `agent/java/` to
`agent/src/main/java/` and `agent/resources/` to
`agent/src/main/resources/`
- Removed the now-redundant explicit resources copy that was duplicating
work
- Updated tests to verify the correct Maven layout and assert the
flattened directories no longer exist

## Test plan
- [x] `npx vitest run
showcase/scripts/__tests__/generate-starters.test.ts` — all 251 tests
pass
- [x] Verified regenerated `showcase/starters/spring-ai/agent/` has
`src/main/java/` and `src/main/resources/` (not flattened `java/` and
`resources/`)
- [x] Verified Dockerfile `COPY agent/ ./` is compatible with the new
layout (no changes needed)
2026-04-14 22:39:41 -07:00
Jordan Ritter 9fbf7f3b54 feat: fill QA checklists with real test steps, add coverage matrix (#3917)
## Summary

- Replace TODO placeholders in all 73 QA checklist files across 17
showcase packages with specific, actionable test steps derived from
reading actual demo page source code
- Each checklist now references real data-testid selectors, hook names
(useFrontendTool, useRenderTool, useLangGraphInterrupt,
useHumanInTheLoop, useAgent, useConfigureSuggestions), expected UI
states, and interaction flows
- Stub demos (shared-state-write, shared-state-streaming, subagents) are
marked as stubs with basic chat verification steps
- Add `showcase/QA-COVERAGE.md` with a comprehensive test coverage
matrix covering manual QA, Vitest unit tests, Playwright E2E (smoke +
interaction), per-package E2E, aimock fixtures, and CI automation for
all 9 demos plus the Sales Dashboard starter hero

## Test plan

- [ ] Verify QA checklist files no longer contain generic "TODO: Add
checks specific to X" placeholders
- [ ] Verify each checklist references the correct demo-specific
features (e.g., agentic-chat mentions background change + weather card,
hitl mentions step selector + accept/reject)
- [ ] Verify QA-COVERAGE.md matrix entries are accurate by
cross-referencing with actual test files
- [ ] Verify framework names in titles are preserved correctly across
all 17 packages
2026-04-14 22:34:56 -07:00
Jordan Ritter 34be9fead9 fix: restructure spring-ai starter to use Maven standard directory layout
The generate-starters script was flattening src/main/{java,resources} into
agent/{java,resources}, breaking Maven builds. Add a post-copy step that
moves them to agent/src/main/{java,resources} as Maven expects.
2026-04-14 22:33:53 -07:00
Jordan Ritter 63a38ecdb5 fix: prevent langgraph-python agent from looping on query_data (#3923)
## Summary

- The langgraph-python starter's agent loops endlessly on `query_data`
instead of calling `pieChart`/`barChart` frontend tools to render charts
- Root cause: system prompt doesn't mention the frontend chart tools,
and the `query_data` tool description encourages calling it ("Always
call before showing a chart") without saying what to do after
- Updated system prompt to explicitly instruct the agent to call
`query_data` once then use `pieChart` or `barChart`
- Updated `query_data` tool description to reinforce single-call
semantics
- Fixed in both the source package (`showcase/packages/`) and the
generated starter (`showcase/starters/`)

## Test plan

- [ ] Deploy langgraph-python starter and click "Pie Chart" suggestion
pill
- [ ] Verify agent calls `query_data` once, then calls `pieChart`
frontend tool
- [ ] Verify no infinite loop on `query_data`
- [ ] Repeat for "Bar Chart" suggestion pill
2026-04-14 22:30:13 -07:00
Jordan Ritter 17ae431082 fix: prevent langgraph-python agent from looping on query_data
The agent's system prompt didn't mention pieChart/barChart frontend
tools, so gpt-4o-mini would call query_data repeatedly instead of
rendering charts. Updated the system prompt to explicitly instruct
the agent to call query_data once then use pieChart/barChart, and
updated the query_data tool description to reinforce single-call
semantics.
2026-04-14 22:19:33 -07:00
Jordan Ritter e64acdc091 fix: langgraph-python starter agent — 3 root causes fixed, verified locally (#3921)
## Root causes (all verified locally with docker build + run)

1. **PermissionError**: non-root `USER app` can't create
`.langgraph_api` directory — fix: `chown -R app:app /app` before `USER
app`
2. **ImportError**: relative imports (`from .tools`) fail when
`langgraph_cli` loads modules — fix: absolute imports (`from
src.agents.tools`)
3. **ValueError**: `tools.py` file collides with `tools/` directory —
fix: rename to `tool_wrappers.py`

## Verified
```
docker build -t test-lgp-starter .
docker run --rm -e OPENAI_API_KEY=test -e PORT=10003 -p 10003:10003 test-lgp-starter
# {"status":"ok","integration":"langgraph-python","agent":"ok"}
```
2026-04-14 17:20:19 -07:00
github-actions[bot] fa8190d6b8 style: auto-fix formatting 2026-04-15 00:07:54 +00:00