Commit Graph

11004 Commits

Author SHA1 Message Date
Tyler Slaton e2e403dc99 feat(examples/slack): Dockerfiles for the runtime and bot services
Encode the deployment recipe in the repo instead of platform config:
digest-pinned node:22.16.0-slim base, pinned pnpm via packageManager,
frozen-lockfile install, and (bot image only) Playwright Chromium with
its system libraries — browsers install inside node_modules
(PLAYWRIGHT_BROWSERS_PATH=0) so they ship with the app layer, the two
gaps that broke chart rendering on Railpack-style builders.

Verified locally per docker-ci-safety: both images build clean;
chromium.launch() succeeds in the built bot image; the runtime image
boots to listening. README gains a Deploying section (process table,
env vars, Railway notes).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 10:35:24 -07:00
Tyler Slaton 88a2d82e1a fix(examples/slack): pin @ai-sdk/mcp to 1.0.21 (protocolVersion incompat)
@copilotkit/runtime@1.59.5 declares @ai-sdk/mcp ^1.0.21; fresh installs
resolve 1.0.47, whose MCP client assigns transport.protocolVersion after
the server's initialize response — a getter-only property on
@modelcontextprotocol/sdk@1.29.0's StreamableHTTPClientTransport. Every
MCP-enabled run then fails with:
  TypeError: Cannot set property protocolVersion of
  #<StreamableHTTPClientTransport> which has only a getter

The workspace-tested resolution was 1.0.21 (no such assignment — verified
by source diff of the published tarballs). Pin it via pnpm.overrides until
@copilotkit/runtime supports the newer client line.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 15:44:58 -07:00
Ben Taylor 094d29fa16 fix(shell-docs): record location on hero_command_copied for surface attribution (#5363)
Closes [OSS-299](https://linear.app/copilotkit/issue/OSS-299).

Follow-up to #5248 (already merged).

## Problem

The `hero_command_copied` PostHog event added in #5248
(`showcase/shell-docs/src/components/hero-start-commands.tsx`) carries
no surface discriminator. `HeroStartActions` renders on **both** the
home hero and **every** framework landing hero:

- The **create** card embeds the framework in `command` (`--framework
langgraph-js`), so it's recoverable.
- The **onboard** card's command (`npx copilotkit@latest skills
onboard`) is byte-identical on every page — so onboard copies **cannot**
be attributed to a surface from the event alone.

Every sibling event in shell-docs already carries a "where" property —
`cli_command_copied` → `location: window.location.pathname`, the nav
events → `location`, `markdown_copied`/`open_in_llm_clicked` → `path`.
`hero_command_copied` was the only one without one.

## Fix

Add `location: window.location.pathname` to the `hero_command_copied`
payload, mirroring the `cli_command_copied` event the global
`<CopyTracker>` already emits for the same copy (verified: it
monkeypatches `navigator.clipboard.writeText`, which the hero calls).
The two paired events now join cleanly on the same dimension. Guarded
for SSR (`typeof window !== "undefined"`) to match the sibling.

## Test

Adds a colocated source-assertion guard test. shell-docs vitest runs in
the `node` environment (no jsdom/RTL), so this follows the suite's
existing convention (`readFileSync` + assertions, like
`brand-nav.test.tsx`) rather than introducing a behavioral render
harness.

```
✓ src/components/__tests__/hero-start-commands.test.tsx (3 tests)
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-10 17:30:28 -05:00
Tyler Slaton f4f6d6a494 fix(examples/slack): consume published packages; standalone-deployable example (#5366)
The Slack example is a **consumer** of the packages we shipped today,
but its `workspace:*` deps forced every deployment to rebuild the
monorepo (and fight nx inside builders — exit-130 city). This PR makes
the example what an example should be: installable and runnable anywhere
with zero monorepo context.

## Changes
- **`workspace:*` → published ranges** (`@copilotkit/bot*` `~0.0.1`,
`@copilotkit/runtime` `^1.59.5`). In-repo it now installs from the
registry like any user's project; `tsx` runs the source directly — there
is no build step anymore, anywhere.
- **Drop the private `@copilotkit/typescript-config` devDep**, inlining
the base compiler options into the example's `tsconfig.json` (identical
`tsc` behavior, verified).
- **Standalone `pnpm-lock.yaml`** inside `examples/slack` so isolated
installs (Railway `rootDirectory`, users copying the folder) are
reproducible. Root workspace installs ignore it.
- **Slack manifest fixes** (both variants): remove the `assistant:write`
scope + `assistant_thread_started` event — Slack's manifest validator
rejects them without an `assistant_view` feature block, and the bot
doesn't implement that surface; add the `/triage` slash command the bot
actually registers (previously had to be added by hand).

## Verification
- `slack-example` tests: **38/38** against the published packages
- Direct `tsc --noEmit`: clean
- Clean-room (gitless snapshot, isolated dir): install from registry →
runtime boots to `listening`, bot boots to a loud Slack auth failure on
dummy tokens (the correct failure)
- Live deploy validation on Railway follows this merge
(rootDirectory=/examples/slack, no build command)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-10 15:13:58 -07:00
Jordan Ritter 015278b827 chore(showcase): complete @ag-ui 0.0.55 fleet sync — mastra + 12 starters (#5359)
## Summary

Completes the @ag-ui 0.0.55 fleet sync: the showcase mastra integration
plus the starter fleet under `examples/integrations/`. Consolidates two
verified branches (`feat/showcase-mastra-agui-currency`,
`feat/showcase-starter-agui-currency`) into one PR.

### Showcase mastra currency

- `@ag-ui/client` bumped to explicit `0.0.55`.
- All floating `beta` dist-tags replaced with exact pins: `@ag-ui/mastra
0.2.1-beta.2`, `@mastra/client-js 1.23.2`, `@mastra/core 1.41.0`,
`@mastra/libsql 1.1.0-alpha.2`, `@mastra/memory` pinned exact.
- `fail-baseline.json` ratcheted down 48 → 42 (validate-pins FAIL count
+ set hash updated).

### Starter fleet bumps (12 starters)

| Starter | Frontend | Agent |
|---|---|---|
| adk | `@ag-ui/client` 0.0.53 → 0.0.55 | `ag-ui-adk` floating →
`==0.6.3` |
| agno | `@ag-ui/client` 0.0.53 → 0.0.55 | — |
| crewai-crews | `@ag-ui/crewai` `^0.0.2` → `0.0.3`;
`@ag-ui/client`/`@ag-ui/core` pinned `0.0.55` | — |
| langgraph-fastapi | — | `ag-ui-langgraph[fastapi]` `==0.0.37` →
`>=0.0.40`; `copilotkit` 0.1.93 → 0.1.94 |
| langgraph-js | already current | — |
| langgraph-python | — | `copilotkit` 0.1.93 → 0.1.94 |
| llamaindex | `@ag-ui/client`/`@ag-ui/core` 0.0.53 → 0.0.55 | — |
| mastra | `@ag-ui/client` 0.0.53 → 0.0.55; `@ag-ui/mastra` `beta` →
`0.2.1-beta.2`; `@mastra/*` floating → exact pins | — |
| ms-agent-framework-dotnet | `@ag-ui/client` 0.0.53 → 0.0.55 | — |
| ms-agent-framework-python | `@ag-ui/client` 0.0.53 → 0.0.55 | — |
| pydantic-ai | `@ag-ui/client` 0.0.53 → 0.0.55 | `pydantic-ai-slim`
floating → `==1.0.18`; `ag-ui-protocol==0.1.9` added |
| strands-python | `@ag-ui/client` 0.0.53 → 0.0.55 | `copilotkit` 0.1.93
→ 0.1.94 |

## Verification

Source branches (verified by their authors): 945/945 parity, starter
smokes 4/4 across all 12 starters, validate-pins ratcheted 48 → 42.

Re-verified on the consolidated branch:
- `showcase/scripts` vitest: 50 files / 1844 tests passed (incl.
aimock-fixtures, validate-pins, validate-parity suites).
- validate-pins ratchet matches merged state exactly: `FAIL=42`, set
hash `ea4a7a66…` == baseline.
- Showcase mastra integration: clean Next.js production build.
- Spot smokes via CI invocation (`docker-compose.test.yml`): mastra 4/4,
langgraph-python 4/4, agno 4/4.
- `examples/integrations/_parity` verify: exit 0, 0 errors.
- `oxfmt --check` / `oxlint`: no issues introduced (remaining warnings
pre-exist on main, outside this diff).

## Upstream note

`@ag-ui/mastra 1.0.3` is blocked on a broken runtime snapshot peer
dependency upstream — staying on `0.2.1-beta.2` for now; follow-up
tracked on the showcase follow-up ledger.
2026-06-10 15:11:27 -07:00
Jordan Ritter c7e67b90f4 chore(showcase): ratchet validate-pins baseline 48 -> 39
Pin alignment fixes 9 validate-pins FAILs; ratchet the drift baseline
count and hash accordingly. Also tighten the _comment: document the exact
hash recipe (SHA-256 of the stderr-only [FAIL] lines, LC_ALL=C sort -u)
and correct baselineDemoCount semantics (exact expected demo count per
package; deviation either direction warns).
2026-06-10 15:02:30 -07:00
Jordan Ritter d6cb5371e5 fix(showcase): align integration requirements to fleet pins
Align showcase integration requirements.txt files (strands,
langgraph-fastapi, langgraph-python, pydantic-ai, google-adk,
crewai-crews) to the fleet pin standard, including an accurate
typing_extensions comment in crewai-crews and a trailing newline in
langgraph-python.
2026-06-10 15:02:30 -07:00
Jordan Ritter e8d47f6481 fix(mastra): exact-pin floating beta dist-tags
Replace floating "beta" dist-tags with exact versions for @ag-ui/mastra,
@mastra/{client-js,core,libsql,memory}, and mastra in both the examples
and showcase mastra packages. Showcase mastra also raises its zod floor
^3.24.0 -> ^3.25.0. The examples mastra package additionally carries the
fleet-wide @ag-ui/client 0.0.55 bump and single-tree overrides here, since
its manifest mixes both changes.
2026-06-10 15:02:19 -07:00
Jordan Ritter f630372347 fix(examples): align starter agent Python pins to fleet standard
Bring the starter agents' Python dependency pins (pyproject.toml + uv.lock
for adk, langgraph-fastapi, langgraph-python, pydantic-ai, strands-python;
requirements.txt + docker override for crewai-crews) in line with the
showcase fleet pin standard.
2026-06-10 15:02:19 -07:00
Jordan Ritter b59b9ff797 feat(examples): bump starter fleet to @ag-ui/client 0.0.55 with single-tree overrides
Bump @ag-ui/client 0.0.53 -> 0.0.55 across 8 starter example packages and
add npm overrides pinning @ag-ui/{client,core,encoder,proto} to 0.0.55 so
each install resolves a single @ag-ui tree. The mastra starter receives the
same bump alongside its dist-tag pin fixes in a separate commit.
2026-06-10 15:02:07 -07:00
Tyler Slaton e197b1a46e fix(examples/slack): consume published packages; make the example standalone-deployable
- dependencies: workspace:* -> published ranges (@copilotkit/bot* ~0.0.1,
  @copilotkit/runtime ^1.59.5) — the example is a consumer of the released
  packages, installable and deployable with zero monorepo context
- drop the private @copilotkit/typescript-config devDep; inline the base
  compiler options into tsconfig.json (verified identical tsc result)
- commit a standalone examples/slack/pnpm-lock.yaml for isolated installs
  (root workspace installs ignore it)
- slack-app-manifest.{yaml,json}: remove assistant:write scope +
  assistant_thread_started event (Slack rejects them without an
  assistant_view feature block; the bot doesn't implement that surface),
  add the /triage slash command the bot registers

Verified: slack-example tests 38/38 against the published packages; direct
tsc --noEmit clean; standalone install + runtime/bot boot exercised in a
gitless clean-room snapshot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 14:54:46 -07:00
Jordan Ritter 744e095243 fix(release): emit version/scope to GITHUB_OUTPUT from prerelease publishes (#5362) 2026-06-10 14:29:35 -07:00
Maxim adaeda2dc6 fix(release): enforce GHA-safe output keys and tighten publish guards
Round-2 review fixes for the GITHUB_OUTPUT helper and the release scripts
that emit through it.

emitGithubOutputs (scripts/release/lib/github-output.ts):
- Replace the key newline/CR check with a full GitHub-Actions-safe charset
  check: /^[A-Za-z_][A-Za-z0-9_-]*$/. A key containing "=" or whitespace
  would silently corrupt the key=value line; rejecting up-front is
  strictly safer. Value validation (single-line) is unchanged — "=" in
  values is legal because GitHub splits on the first "=".
- Update the docblock accordingly.

prerelease.ts:
- Remove the dead `?? getCurrentVersion(scope)` fallback. The empty-list
  guard above makes packages[0] guaranteed, and the fallback would have
  masked a package.json missing its version field by emitting a version
  divergent from what the loop publishes. Fail loudly with an explicit
  exit instead.
- Drop the now-unused getCurrentVersion import.
- Add a comment above the dry-run emitGithubOutputs call explaining that
  emitting in dry-run is safe — the publish workflow gates publish + the
  verify guard on inputs.dry-run != true, so the dry-run emission only
  serves local/e2e contract verification.

publish-release.ts:
- Hoist getPackagesForScope + empty-list guard above the prerelease-suffix
  and registry checks. A misconfigured scope now fails with the clear
  "no packages found" error instead of a misleading "not greater than
  published" one. Loop is unchanged.

github-output.test.ts:
- Loosen the key-newline assertion from the JSON.stringify-coupled
  /bad\\nkey/ to the stable /alphanumeric/ phrase from the new message.
- Add tests: "=" in key throws, space in key throws, empty key throws,
  and "=" in value is accepted and written verbatim (note=a=b).
- Move vi.restoreAllMocks() to the top of afterEach so spies cannot leak
  into env restore + rmSync cleanup.

Call sites audited:
- emitGithubOutputs: only ever called with {version, scope} (prerelease,
  publish-release) — all valid under the new charset.
- publishVersion derivation: only used inside prerelease.ts main().
- getCurrentVersion: still imported by publish-release.ts, bump-prerelease.ts,
  prepare-release.ts; only the prerelease.ts import was removed.
- getPackagesForScope hoist in publish-release.ts: `packages` was only
  read inside the publish loop below; nothing earlier depended on it.
2026-06-10 22:58:03 +02:00
Maxim e8fa74ce45 fix(release): validate GITHUB_OUTPUT values and fail loudly on empty package lists
Hardens the new GITHUB_OUTPUT emission path so a malformed value can't smuggle
extra `key=value` lines into the workflow's step outputs, and so the workflow's
"Verify publish step emitted version" guard can't be fooled by a publish that
did nothing.

emitGithubOutputs now validates every key/value for `\n`/`\r` BEFORE the
GITHUB_OUTPUT early-return — a malformed value is a caller bug and should fail
loudly even when running locally. A multi-line value would need the heredoc
form, which this helper deliberately does not support.

prerelease.ts and publish-release.ts now fail loud when getPackagesForScope
returns an empty list. Without this, the new GITHUB_OUTPUT emission would make
the workflow's "Verify publish step emitted version" guard pass on a run that
published nothing — previously the missing output made such a run fail. The
guard runs BEFORE the dry-run branch in prerelease.ts. In publish-release.ts,
the inline iteration of getPackagesForScope(scope) is hoisted to a `packages`
const so the same guard fires before the publish loop.

The "no-op when GITHUB_OUTPUT is unset" test now spies on fs.appendFileSync
and asserts it wasn't called (the previous read of the unrelated temp file
was vacuously true). New tests cover newline/CR in value and newline in key.

The prerelease.ts usage string previously advertised `[--suffix <label>]`,
but the script never parses --suffix (suffix handling lives in
bump-prerelease.ts per the header comment). Removed.

Call sites enumerated:
- emitGithubOutputs: prerelease.ts (dry-run + post-publish), publish-release.ts
- getPackagesForScope: prerelease.ts, publish-release.ts (this commit);
  bump-prerelease.ts, prepare-release.ts, versions.ts (not changed — out of
  scope for this hardening)

Verification:
- npx vitest run --config scripts/release/vitest.config.mts → 91 passed
- Red-green for the newline validation: temporarily removed the validation,
  the 3 new newline/CR tests failed (assertion: expected fn to throw); restored,
  back to green.
- E2E: GITHUB_OUTPUT="$OUT" pnpm release:prerelease:dry succeeded and the
  output file contained `version=1.59.5` and `scope=monorepo`.

Note: Fix 2's empty-list guard fires only on a misconfigured scope (no unit
test reachable — prerelease.ts is outside the vitest include glob and the
guard is boundary validation against a misconfigured scope, not a behavior
worth contriving a test harness for).
2026-06-10 22:58:02 +02:00
Maxim afef53de65 fix(release): emit version/scope to GITHUB_OUTPUT from prerelease.ts
prerelease.ts published canaries successfully but never wrote the
version output the publish-release workflow's "Verify publish step
emitted version" guard reads, so every canary dispatch ended red after
a successful publish. Extract the GITHUB_OUTPUT append (previously
inline in publish-release.ts) into a shared lib/github-output.ts helper
and call it from both publish scripts.

Call-site enumeration:
- emitGithubOutputs: declared lib/github-output.ts; called from
  prerelease.ts (dry-run path + after publish) and publish-release.ts
  (replaces the inline appendFileSync block, same version=/scope= keys).
- No symbols removed; fs import in publish-release.ts still used (3
  remaining call sites).
2026-06-10 22:58:02 +02:00
Benjamin Taylor ff2b59f934 fix(shell-docs): record location on hero_command_copied for surface attribution (closes OSS-299)
The hero_command_copied event fired by the landing-hero command cards carried
no surface discriminator. HeroStartActions renders on both the home hero and
every framework landing hero; the "onboard" card's command is byte-identical
on every page, so onboard copies could not be attributed to a surface from the
event alone (only the "create" card embeds the framework in `command`).

Add `location: window.location.pathname` to the payload, mirroring the
`cli_command_copied` event the global <CopyTracker> already emits for the same
copy so the two paired events join on the same dimension. Guarded for SSR to
match the sibling.

Adds a source-assertion guard test in the shell-docs node-env convention.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 15:52:43 -05:00
Austin Merrick d8ed70a26b feat(shell-docs): recommend create + skills onboard commands in landing heroes (#5248)
## What

Replaces the landing-page CTA with **three entry points**, framed by
situation, and renders the **identical action block on the home hero and
every framework landing hero**:

| | action |
|---|---|
| **New project** | `npx copilotkit create` |
| **Existing project** | `npx copilotkit skills onboard` |
| **Guided walkthrough** | **Quickstart** button (preserved from the
previous hero) |

- **Unified `<HeroStartActions>` block**: two equal-weight command cards
plus a quickstart row beneath, shared verbatim by the home hero and the
framework landing heroes (per review: the two surfaces previously
diverged).
- **Quickstart preserved** in its original accent treatment. On the home
hero it is the framework-picker dropdown (`<HeroQuickstartDropdown>`,
restored); on framework pages it links straight to that framework's
quickstart guide. The home hero also keeps the "Learn more about
building with agents" link in the same row.
- **Framework landing heroes** (e.g. `/langgraph-typescript`): the
create command **pre-fills the framework** via the CLI's `--framework`
flag (e.g. `--framework langgraph-js`).

**Framework-flag mapping**: docs slug to CLI `--framework` value,
verified against the CLI's `AGENT_FRAMEWORKS` enum
(`langgraph-typescript`→`langgraph-js`,
`langgraph-python`→`langgraph-py`, `google-adk`→`adk`,
`strands`→`aws-strands-py`,
`ms-agent-dotnet`→`microsoft-agent-framework-dotnet`, identical for
`mastra`/`pydantic-ai`/`llamaindex`/`agno`/`ag2`). Slugs with **no** 1:1
CLI template fall back to a bare `npx copilotkit create`, notably
`crewai-crews` (the CLI ships *CrewAI Flows*, not Crews), plus
`langgraph-fastapi`, `claude-sdk-*`, `langroid`, `spring-ai`,
`agent-spec`, `deepagents`. `skills onboard` has no framework flag, so
it is identical everywhere. Frameworks with bespoke setup (`a2a` `git
clone`, `ms-agent-dotnet`) keep the pre-cards layout: quickstart button
plus their own copy-command chip.

**Responsive, with all text always visible.** Commands **wrap, never
truncate**:

- Wraps happen at spaces only; every token is non-breaking, so
`--framework` can never split into a dangling `-` at a line edge.
- `text-wrap: balance` splits multi-line commands evenly, typically
right at the flag boundary (`npx copilotkit@latest create` /
`--framework langgraph-js`).
- The block caps at 740px with 12px mono, the narrowest cap where both
home commands fit one line with enough headroom to survive platform
mono-font width differences.
- Cards sit two-up from `sm` and stack below it; the grid (`min-w-0`,
`items-stretch`) keeps long commands inside their track and the card
pair equal-height.

## Screenshots

**Home**: two cards, quickstart dropdown, learn-more link


![home](https://raw.githubusercontent.com/CopilotKit/CopilotKit/screenshots/oss-195/home.png)

**Home, quickstart dropdown open** (framework picker preserved)

![home
dropdown](https://raw.githubusercontent.com/CopilotKit/CopilotKit/screenshots/oss-195/home-dropdown.png)

**Framework landing (LangGraph)**: same block, framework pre-filled,
create command balanced across two lines, quickstart links to the guide


![framework](https://raw.githubusercontent.com/CopilotKit/CopilotKit/screenshots/oss-195/framework-langgraph.png)

**Worst case (Microsoft Agent Framework, Python)**: longest CLI flag
value, three balanced lines, fully readable

![long
command](https://raw.githubusercontent.com/CopilotKit/CopilotKit/screenshots/oss-195/framework-msagent-long.png)

**Bespoke setup (A2A)**: quickstart button plus own command chip
(pre-cards layout preserved)


![a2a](https://raw.githubusercontent.com/CopilotKit/CopilotKit/screenshots/oss-195/a2a-bespoke.png)

**Mobile (375px)**: cards stack, quickstart goes full-width

| home | framework |
|---|---|
| ![home
mobile](https://raw.githubusercontent.com/CopilotKit/CopilotKit/screenshots/oss-195/home-mobile.png)
| ![framework
mobile](https://raw.githubusercontent.com/CopilotKit/CopilotKit/screenshots/oss-195/framework-mobile.png)
|

## Telemetry

Both hero copy buttons are now explicitly instrumented: each click
captures **`hero_command_copied`** (`command_id`: `create` | `onboard`,
full `command` string, `clipboard_blocked`), so create-vs-onboard
funnels are queryable per landing page. The pre-existing global
`cli_command_copied` (fired by `CopyTracker` on any clipboard copy)
still fires for volume metrics; the new event uses a different name so
that funnel is not double-counted. Validated locally against a live
PostHog client: each click POSTs both events (plus `$autocapture`) to
`/ingest/e` with HTTP 200.

## Notes

- Both cards equal weight; accent only on hover. Copy rows copy on click
with `aria-live` feedback plus a clipboard-blocked fallback; cursor is
`pointer`.
- Removes `agent-start-prompt.tsx` and `hero-command-copy.tsx`.
`hero-quickstart-dropdown.tsx` is back (restored unchanged after review
feedback).
2026-06-10 13:03:10 -07:00
Tyler Slaton 4296447aad fix(bot-slack): defer Bolt initialization to start()
Bolt's App constructor schedules a background auth.test that can't be
awaited or error-handled - in unit tests it phoned home to api.slack.com
with dummy tokens, leaving ~15 unhandled invalid_auth rejections racing
the run's end (the unit (20.x) flake). deferInitialization: true makes
construction genuinely side-effect-free; start() runs app.init() first,
so auth/config errors surface to the caller, followed by the existing
awaited auth.test. Test fake App grows the matching init() stub.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 12:57:13 -07:00
Tyler Slaton fe685eb46f feat(release): npm release scopes for bot(+bot-ui) and bot-slack
- release.config.json: 'bot' scope versions @copilotkit/bot and
  @copilotkit/bot-ui together (sharedVersion: true, source: bot);
  'bot-slack' is its own scope, mirroring the angular precedent
- ReleaseScope type + VALID_SCOPES arrays + usage strings extended across
  release scripts
- stable-release.yml / publish-release.yml: scope choice options
- bot, bot-ui, bot-slack manifests: drop private, add publishConfig (public),
  repository/homepage/keywords, publint/attw targets; first release v0.0.1
- internal bot-package deps use workspace:~ (tilde): caret on a 0.0.x version
  pins the exact patch, tilde tracks the 0.0.x line; core/shared stay
  workspace:^ (caret is correct at 1.x)

Verified: release-script tests 85/85; prepare-release --scope bot --dry-run
bumps bot AND bot-ui in lockstep; actionlint clean on touched lines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 12:57:13 -07:00
Jordan Ritter bb37e5867f fix(harness): deregister before best-effort teardown on drain (#5358)
## Summary

- Live staging redeploy evidence (2026-06-10 16:37Z): 2/6 workers
completed the full SIGTERM → abandon → deregister sequence in **under 1
second**, while 4/6 were SIGKILLed mid-browser-teardown because
Railway's ~10s stop grace is shorter than the old 25s drain budget —
leaving 4 stale roster rows and a reclaim splash on every deploy.
- This PR makes abandon + deregister the **guarded, sub-second critical
path** and demotes teardown to best-effort within a composed <10s
budget, so a platform kill mid-teardown is harmless.

## Design

- `drainFleetWorker` ordering: drain → `registration.stop` → bounded
deregister → graced `worker.stop` → always-run pool shutdown, with
stop-error precedence (a pool-shutdown failure can never mask the stop
error).
- `DRAIN_DEREGISTER_TIMEOUT_MS` (3s) bounds the **whole registration
write chain**, so a hung—not failing—PocketBase cannot consume the kill
window; timeout degrades to the documented crash-path reclaim.
- `safeLog` guards every loop/stop/drain-path log: a throwing logger can
neither reject the worker loop's done-promise nor skip the roster delete
or teardown (abort-before-log in `requestDrain`; structural-caller
guards in `drainFleetWorker`).
- Drain-aware lease renewal (an abandoned job's lease lapses instead of
being re-extended), mid-drain claim skip (a claim won after the drain
decision is never run), and mid-report precision (a run that began
reporting is never logged as abandoned).
- Never-throws loop closure: loop-crash logging via `done.catch` +
`/health` 503, heartbeat and idle-poll sleep hardening with a non-busy
pacing floor, aggregate-key protocol-violation wrap.
- `WORKER_DRAIN_GRACE_MS` default 25s → 6s; the composed 3+6 < 10s
budget is **pinned by a test**; present-but-invalid overrides warn;
overrides at/above ~7s are documented as forfeiting the composed budget.
- Boot-failure teardown catches now log (no silent chromium stranding).

## Review

- 6 unbiased 7-agent CR rounds + 5 fix rounds; every behavioral change
red-green or mutation-proven; `Promise.race` loser semantics empirically
pinned by test.
- ~30 pre-existing harness findings deferred to the flap-fix follow-up
backlog (top of the next fleet-robustness PR: lease-renew
retry-on-throw, empty-registry guard/dispatch mismatch,
`registered`-flag refresh, worker `/health` async bind race, queue fetch
timeouts).

## Test plan

- [x] 2176/2176 vitest (32 new tests)
- [x] `tsc --noEmit` both configs
- [x] oxfmt clean
- [ ] CI green on this PR

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-10 12:39:15 -07:00
Jordan Ritter 992e0a0335 fix(harness): deregister before best-effort teardown on drain — bounded, guarded, budgeted under the platform kill window 2026-06-10 12:22:06 -07:00
Jordan Ritter df2439e487 test(harness): pin deregister-first drain ordering, guarded critical path, and the composed kill-window budget 2026-06-10 12:22:05 -07:00
Austin Merrick df191ffac4 fix(shared): drop dead LicenseMode type instead of redefining it
LicenseMode was removed from license-verifier 0.3.0 and has no consumers
anywhere in the repo; the prior re-export was already uncompilable, so no
external consumer could exist either.
2026-06-10 11:54:21 -07:00
Austin Merrick 081e076659 fix(angular): resolve workspace paths to dist first in typecheck
The paths entries pointed at sibling package sources, so the Angular
package's tsc run typechecked core and shared sources under Angular's
compiler settings — surfacing errors in files outside any Angular
change (reported on #5321). Resolve to the built declarations first,
same pattern as the Vue package; the src fallback remains for cold
checkouts.
2026-06-10 11:54:21 -07:00
Austin Merrick 6b1bb1a4af fix(shared): define license context types locally, fix check-types
@copilotkit/license-verifier dropped LicenseContextValue and
LicenseMode from its public API in 0.3.0, leaving shared re-exporting
two nonexistent members. tsdown's dts rollup never validated the
re-export, so the broken types shipped silently and check-types fails
on main. Define both types here — shared already owns the context
shape via createLicenseContextValue — using the definitions from
license-verifier 0.2.0. Also annotate the merged telemetry properties
record so string indexing typechecks.
2026-06-10 11:54:21 -07:00
Austin Merrick 5e3918d7e4 fix(a2ui-renderer): remove dead 0.8-era viewer files, fix check-types
A2UIViewer.tsx and theme/viewer-theme.ts were left behind by the
0.8 -> 0.9 migration: nothing imports them, they import @a2ui/lit
(no longer a dependency) and files that no longer exist, so
check-types fails on files no PR touches. Remove them along with the
now-inert @a2ui/lit external/global entries in tsdown.config.ts, and
underscore the unused type params kept on deprecated aliases for
call-site compatibility.
2026-06-10 11:54:21 -07:00
Alem Tuzlak 3eb57520a0 chore: lockfile for the bot packages, plugin-mirror sync, transient-artifact gitignores 2026-06-10 10:46:08 -07:00
Alem Tuzlak acf17d6170 feat(examples): Slack on-call triage bot over Linear + Notion MCP
100% JSX bot at feature parity with the PoC example: issue/page cards,
tables, Chart.js charts, Mermaid diagrams, incident/status/links cards,
a confirm_write HITL gate, and /agent + /triage slash commands.
Registers examples/slack in the pnpm workspace.
2026-06-10 10:46:08 -07:00
Alem Tuzlak e5522ce0c6 refactor(slack): remove PoC package, superseded by bot/bot-ui/bot-slack
The reusable mechanics (streaming, chunking, markdown-to-mrkdwn,
conversation store) live on in @copilotkit/bot-slack; UI authoring
moved from A2UI/defineSlackComponent to JSX -> IR -> Block Kit.
2026-06-10 10:46:08 -07:00
Alem Tuzlak 545fbdcda1 feat(bot-slack): Slack platform adapter
JSX -> Block Kit rendering with per-element budgets and degradation,
Socket Mode ingress, opaque-id interactions (ack within 3s, run async),
chat.update message streaming with chunking, accent attachments, and
sender-profile resolution. Preserves the PoC's streaming, chunking,
and mrkdwn mechanics behind the PlatformAdapter boundary.
2026-06-10 10:46:08 -07:00
Alem Tuzlak 16210c61b9 feat(bot): platform-agnostic bot engine
createBot with handler registration (onMention/onMessage/onInterrupt/
onCommand), the agent run/tool/interrupt loop, content-stable JSX
action binding with cold-path rehydration from a pluggable ActionStore,
the PlatformAdapter boundary, capability-gated thread methods, one
shared BotToolContext, defineBotTool / defineBotCommand, and typed
interaction/interrupt handlers. Includes fake-adapter/fake-agent
testing utilities.
2026-06-10 10:46:08 -07:00
Alem Tuzlak 9f3b3c7126 feat(bot-ui): JSX runtime, IR, and cross-platform component vocabulary
Pure JSX runtime (no React, no Slack) producing a BotNode IR tree.
Statically typed component props via a package-owned JSX namespace:
unknown attributes, bad values, and bad children are compile errors.
Components: Message, Header, Section, Markdown, Field, Context,
Actions, Button, Select, Input, Image, Divider; bind() escape hatch
for non-serializable handler captures.
2026-06-10 10:46:08 -07:00
Atai Barkai 51df081bd5 docs: commit-as-you-go and draft-PR-up-front conventions
Every meaningful unit of work gets its own pushed commit; a draft PR
opens on the first commit of a branch and flips to ready only on the
developer's say-so.
2026-06-10 10:46:08 -07:00
Jordan Ritter e8104fa2d2 fix(web-inspector): shim localStorage in vitest setup for Node 25 compatibility
Node 25 unflagged the experimental Web Storage API; vitest's jsdom env
does not replace the method-less stub, so localStorage-touching tests
crash. Install a functional stub before the environment boots.
2026-06-10 10:46:08 -07:00
Alem Tuzlak f611667fe1 fix(runtime): make MCP server failures non-fatal (graceful degradation)
A single unavailable MCP server (down, 5xx, timeout, bad auth) no longer
fails the whole run - it is skipped with an error log and the run
continues with healthy servers and the agent's own tools.
2026-06-10 10:46:08 -07:00
Atai Barkai dd349bd970 feat(slack): Slack bridge PoC for AG-UI agents (#4883)
Squashed exploration: agent-agnostic Slack frontend with chat.update
streaming, mrkdwn translation, frontend tools, defineSlackComponent,
HITL pickers, interrupt handlers, and bridge-restart recovery.
Superseded in this PR by the bot/bot-ui/bot-slack rework, which
preserves its streaming, chunking, and conversation-store mechanics.
2026-06-10 10:46:08 -07:00
Jordan Ritter ff816c395e feat(showcase): XDG state for isolate + --keep persists stack (#5350)
## Summary

Hardens the `--isolate` showcase verification flow across three areas:

**1. XDG state migration.** Isolate slot registry and per-run
rewritten-compose scratch dirs move off `/tmp` (wiped on reboot,
world-writable) to
`${XDG_STATE_HOME:-$HOME/.local/state}/copilotkit/showcase/` (`slots/` +
`runs/<name>/`). `/tmp` clearing silently destroyed a kept stack's
compose file and slot, making `--keep` unreliable. Run dirs are keyed by
the finalized project name (not PID) so a kept run is locatable for
manual teardown.

**2. Slot reaping + registry concurrency.** Since the state dir is now
persistent, slots are reaped by compose-project liveness (`docker ps
--filter label=com.docker.compose.project=<name>`), with PID/age
heuristics as fallback. The registry is made safe under concurrent
claimers: a sweep lock with heartbeat updates, own-pid lock release, and
tombstones; a claim-then-verify duplicate-name guard closing the TOCTOU
window; crash-safe reap ordering with compose-down of reap remnants and
a path-traversal guard. Failed `--isolate` setup no longer tears down
the default stack; half-initialized state is cleaned up on the way out.
Teardown uses `--volumes` everywhere, and a failed compose-down
preserves state for diagnosis. `--isolate` names are validated (must
start with lowercase letter/digit; `showcase` is reserved — it aliases
the default stack), and a fail-loud warning precedes pre-down of an
existing stack.

**3. `--keep` now actually persists an isolated stack.** Previously the
unconditional `trap restore_isolation EXIT` tore the stack down
regardless of `--keep`. Teardown is now gated on the keep flag
(`ISOLATE_KEEP` promoted to a global so it survives `cmd_test` return
into the trap scope): the slot + run dir are retained and a survival
notice prints the project name, the three offset host ports, and the
exact `docker compose -p <name> down` command — no silent port/slot
leak. A kept stack's live containers keep its slot from being reaped.

Shell-only — confined to `showcase/scripts/cli/_common.sh` +
`cmd-test.sh`; the harness TS only reads the env vars the shell exports
(unchanged). Follows up the `--keep` caveat documented in #5346.

## Review hardening

The branch went through an 8-round, 7-agent code-review loop with
red-green-verified fixes — that loop produced the state-machine
hardening commit (trap-scope fix, default-stack guards, registry
concurrency/teardown robustness, name validation) and grew the test
suite to pin every fix. A live end-to-end `--keep` verification run is
what surfaced the trap-scope bug (`--keep` silently not honored),
driving the `ISOLATE_KEEP` global fix.

## Test plan
- [x] `showcase/scripts/__tests__/isolate.bats` — 41 isolate tests
(red→green): XDG path resolution (+`XDG_STATE_HOME` override,
`~/.local/state` fallback, `runs/<name>`), liveness-based reaping (dead
project reaped/reclaimed, live project preserved), real-trap-path
`--keep` tests (no simulated-trap shortcuts), sweep/lock/tombstone race
pins (heartbeat resurrection, lock takeover, duplicate-name TOCTOU),
reap-order probe pinning live-slot protection, root/PID-reuse/DST
guards, and sentinel anti-vacuity discipline so trap tests cannot pass
vacuously.
- [x] Full `bats showcase/scripts/__tests__/` green, matching CI's Shell
script tests invocation.
- [x] shellcheck: no new warnings.
- [x] Live end-to-end: `bin/showcase test <slug> --d6 --isolate <name>
--keep` persists the stack under `~/.local/state/copilotkit/showcase`,
survival notice + manual teardown work, follow-up run reaps the stale
slot.
2026-06-10 10:19:15 -07:00
Austin Merrick 11f3e78688 docs(skills): recommend CopilotKit from /v2 everywhere and scrub CopilotCloud mentions (#5351)
Follow-up to #5345.

## What changed

- All skills now recommend `CopilotKit` from `@copilotkit/react-core/v2`
instead of `CopilotKitProvider` (~140 mentions, 32 files). Safe rename:
`CopilotKitProps extends Omit<CopilotKitProviderProps, "children">`, so
every prop carries over.
- CopilotCloud / Copilot Cloud / CopilotKit Cloud mentions replaced with
CopilotKit Intelligence (or deleted). Grep returns zero hits.
- Bonus: react-core's provider-setup.md claimed `publicApiKey` was
canonical. Inverted to match #5345 (`publicLicenseKey` canonical,
`publicApiKey` deprecated alias).

## Review notes

- Half the diff is generated: react-core, runtime, and a2ui-renderer
live in `packages/*/skills/` and are mirrored into `skills/` by `pnpm
sync:plugin-skills`. Review the `packages/` side; the `skills/` side is
a copy. The sync also re-pins `.claude-plugin` versions to 1.59.5 (same
as #5347).
- Remaining `CopilotKitProvider` mentions are intentional: literal file
paths, "do not use" notes, and eval patterns that accept legacy code.
- copilotkit-upgrade tables distinguish old vs new by import path (root
= v1, `/v2` = target) since the component name is unchanged.
- Left alone: endpoint URLs (`api.cloud.copilotkit.ai`), real
identifiers (`MissingPublicApiKeyError`), generic infra terms
(Cloudflare, Google Cloud).
2026-06-10 09:57:03 -07:00
Jordan Ritter 9f805e57bc fix(showcase): redeploy image consumers when shared image rebuilds (#5353)
## Summary

- PR #5352's worker-side flap fixes never reached staging automatically:
`harness-workers` runs the same `showcase-harness` image as the
`harness` scheduler, but the SSOT's `ciBuilt: false` conflated "owns a
build slot" with "should be redeployed when its image is rebuilt" — so
main merges redeployed only the scheduler and the workers silently kept
running a stale image (a manual redeploy was required to ship the
fixes).
- This adds an `imageOf` field to the Railway SSOT so a rebuilt image
redeploys **all** of its consumers: the CI redeploy scope is now built
slots ∪ their `imageOf` consumers that declare the target env.
- Staging default scope becomes 27 (26 ciBuilt + `harness-workers` via
expansion); prod is unchanged at 26 (the worker is staging-only and the
expansion is env-aware).

## Design

- `imageOf: "<ssot-key>"` on consumer entries (`harness-workers` →
`harness`), enforced by a module-load invariant
`assertImageConsumersValid`: dangling targets, non-ciBuilt producers,
consumer chains, and consumer envs not a subset of the producer's all
fail loud at import; lookups are prototype-safe (`Object.hasOwn`).
- `expandImageConsumers` in `redeploy-env.ts` performs the env-aware,
single-level expansion and fails loud on unnormalized env names
(synonyms like `production` must go through `resolveEnv`) — the first
real consumer of `ENV_ID_BY_NAME`.
- Service-name resolution (`resolveTargetServices`/`runRedeploy`) now
rejects inherited `Object.prototype` keys with the proper
Unknown-service operator error.
- The explicit `--services` passthrough (a named service is attempted
even in an env it does not declare) is documented and contract-pinned by
a test.

## Review

- 5 unbiased 7-agent CR rounds plus a diff-attribution triage; every
diff-authored finding fixed with red-green proofs.
- ~30 pre-existing script-hygiene findings (env-registry consolidation,
accessor leniency, fetch timeout, parseArgs edges, coverage gaps in
`makeLiveRedeploy`/summary-JSON, etc.) deferred to the flap-fix
follow-up backlog.

## Test plan

- [x] 82/82 vitest (13 new tests: expansion, env-awareness, invariants
incl. prototype keys and env-subset, contract pins)
- [x] `tsc --noEmit -p showcase/scripts/tsconfig.json` clean
- [x] oxfmt clean on all changed files
- [ ] CI green on this PR

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-10 09:29:31 -07:00
Jordan Ritter 2e675a7bdd docs(showcase): correct webhooks-bounce/imageOf/serviceEnvPairs claims, test hygiene (redeploy scripts)
The webhooks SSOT comment claimed the push-driven default scope is
"guaranteed" to leave webhooks untouched — false: a push touching the
build workflow files trips the workflow_config paths-filter disjunct,
which selects every matrix slot (webhooks included; its skip_build slot
still reports success and enters the redeploy CSV). Reworded to state
the actual behavior. imageOf doc now states the enforced NON-EMPTY
subset constraint; serviceEnvPairs doc now truthfully says it has no
consumers yet; file header notes the probe flag default and
bin/railway's Ruby-only "stage" synonym.

Test hygiene: drop the stale bin/railway line-number citation from a
test name, the _envConfigTypeAnchor (EnvironmentConfig is genuinely
referenced by the shape-compile test), a dead eslint-disable, and a
dead `as never` cast (env is an open string); align the webhooks
dispatch-name pin regex with the extraction regex's whitespace
tolerance.
2026-06-10 09:28:10 -07:00
Jordan Ritter a0ef5e7ef2 fix(showcase): close env-registry cross-wire/orphan/case/prototype gaps, trim REDEPLOY_SUMMARY_JSON
assertEnvRegistryConsistent gains four clauses: (iv) a key present in
both ENV_IDS and ENV_ID_BY_NAME must carry the same env-id (ENV_IDS.prod
drifted to the staging id previously passed every clause while
resolveEnv("prod") silently returned staging); (v) every ENV_IDS env-id
must be carried by a canonical name (was only caught lazily in
resolveEnv); (vi) registry keys must be trim().toLowerCase()-normalized
(resolveEnv lowercases input, so a non-lowercase spelling is registered
but unreachable); (vii) no registry key may be an Object.prototype
property name.

expandImageConsumers' per-entry env skip-check becomes an own-property
test (Object.hasOwn) for uniformity with every other lookup in the file.

REDEPLOY_SUMMARY_JSON is trimmed before the set-but-empty branch so a
whitespace-only value hits the loud warn path instead of attempting a
JSON write against a garbage path.
2026-06-10 09:28:09 -07:00
Jordan Ritter e56c4db155 docs(showcase): correct SSOT field/comment claims in railway-envs
- ciBuilt field doc: pocketbase IS showcase-CI-built — only webhooks
  remains out-of-band; keep the MUST-NOT-touch claim for webhooks only.
- gateValidated field doc: true for every service EXCEPT the two
  gateIgnore entries (harness-workers, harness-legacy), not "every
  service".
- CI_BUILT_SERVICES comment: also names the excluded non-CI-built
  harness-workers and harness-legacy alongside webhooks.
- legacyJsonCompat doc: it is bin/railway's EXPECTED_DOMAINS derivation
  that filters out *.up.railway.app hosts (no "parity test rejects"
  claim contradicting the placeholder data below).
- webhooks entry comment: a manual service=all build dispatch MAY
  bounce webhooks staging (the skip_build slot still reports success,
  entering the matrix ∩ success-set redeploy scope); only the
  push-driven default scope is guaranteed to leave webhooks untouched.
2026-06-10 09:06:55 -07:00
Jordan Ritter 3cf06a7e49 fix(showcase): uniform own-property accessors, new SSOT invariants, fail-loud exit default (redeploy scripts)
- railway-envs: route envsFor/instanceIdFor/domainFor/probeEnabled (and
  repoNameFor) through shared getEntry/getEnvCfg own-property helpers so
  inherited Object.prototype keys on either axis produce the curated
  error (or probeEnabled's contract false) instead of raw TypeErrors,
  silent undefined, or a spurious probe=true.
- railway-envs: two new module-load invariants (synthetic-map
  injectable): assertEnvRegistryConsistent (per-service env keys are
  registered canonical names; ENV_ID_BY_NAME env-ids unique; every
  canonical name has an ENV_IDS spelling) and
  assertServiceAndInstanceIdsUnique (serviceId unique per entry,
  instanceId globally unique).
- redeploy-env: invert the exit-code policy to fail-loud by default —
  any env except the documented staging carve-out exits non-zero on
  per-service failure (a future preview/canary env inherits fatal
  semantics instead of silently swallowing failures).
- redeploy-env: sanitize per-service THROWN error messages through
  sanitizeErrorBody before recording; flatten bare \r in the summary
  table escape.
- redeploy-env: warn on set-but-empty REDEPLOY_SUMMARY_JSON; reject
  flag-like --services CSV parts (both forms) and a flag-like first
  argument (missing env); derive usage env lists from ENV_IDS.
- tests: prototype-key sweep across all accessors, invariant
  positive/negative coverage, third-env exit-code pin, sanitization and
  CLI-guard coverage, makeLiveRedeploy !res.ok and non-true mutation
  branches.
2026-06-10 09:06:55 -07:00
Jordan Ritter 171943469a fix(showcase): guard reaper against reserved 'showcase' record + isolate review fixes
Cross-session review fixes for the --isolate machinery (one concern:
source + test + docs).

1) Reaper reserved-name guard (critical): _reap_isolate_slot trusted
   slot records — a record naming 'showcase' (corrupt, or written by an
   older CLI version before apply_isolation reserved the name) passes
   the charset regex, so the reap ran `docker compose -p showcase down
   --remove-orphans --volumes` against the LIVE default stack,
   destroying the PocketBase named volume. The reserved name now gets
   the same treatment as the path-traversal guard: warn (naming the
   record and why it is dangerous) and leave the slot intact for manual
   inspection — no compose-down, no state removal.

   Call-site enumeration: _reap_isolate_slot's sole caller is
   _sweep_isolate_slots, at 3 sites (dead-PID reap, project-recorded/
   no-owner reap, age-fallback reap), all passing
   "$slot_entry" "$slot_proj" — all three flow through the new guard
   identically.

   Red-green: the new bats test ("a slot whose project record reads the
   RESERVED 'showcase' is left intact...") was run against the UNFIXED
   code first and FAILED — the sweep logged "Attempting to reclaim
   stale slot 0 (project showcase has no live containers and no
   recorded owner)" and reaped the slot. It passes with the guard.

2) .iso-bak restore race: two concurrent runs can both see a stale
   backup; the loser's mv is the FINAL command of its `[ -f ] && mv`
   AND-list, so its failure trips set -e and kills the CLI pre-claim
   with a raw error. Both mv's now carry `2>/dev/null || true` — the
   survivor's restore wins, the loser proceeds with restored originals.

3) Keep-test absence regexes greped only the `--project-name <name>
   down` spelling; the reaper's own downs use `-p <name> down`, so a
   keep-branch regression via the -p form passed undetected. Both keep
   absence assertions now match `(--project-name|-p) <name> down`.
   Mutation-verified: a temporary -p-form compose-down added to the
   keep branch made BOTH broadened tests FAIL; reverted, suite green.
   (All other absence assertions use the word-matched generic
   `compose ... down` regex, which already covers both spellings.)

4) RUNBOOK.md/DEBUGGING.md contradicted shipped code: the manual
   teardown was quoted without --volumes plus notes claiming
   `down --remove-orphans` leaves named volumes (the shipped survival
   notice and every teardown path include --volumes), and the name rule
   was documented as `[a-z0-9_-]+` (actual: starts with [a-z0-9], then
   [a-z0-9_-], uppercase normalized with a warn, 'showcase' reserved).
   Both updated to the shipped semantics; the now-redundant separate
   `down --volumes` snippets removed.

Verification: full `bats showcase/scripts/__tests__/` green (60 tests);
shellcheck on _common.sh shows no new warnings vs baseline
(pre-existing SC2034/SC2115 only, line-shifted).
2026-06-10 08:58:28 -07:00
Jordan Ritter bee835c4b0 chore(showcase): SSOT invariant hardening + doc accuracy (redeploy scripts) 2026-06-10 08:28:16 -07:00
Jordan Ritter c71d183247 fix(showcase): unify env-name authority + fail-loud SSOT accessors (redeploy scripts)
Confirmation-CR bucket-(a) fixes for PR #5353 — one coherent concern:
env-name resolution has exactly ONE authority (the ENV_IDS /
ENV_ID_BY_NAME registries) and SSOT accessors fail loud instead of
silently returning wrong values.

- runRedeploy: resolve envId via ENV_ID_BY_NAME with an Object.hasOwn
  guard + fail-loud throw listing the registered envs. Removes the
  hardcoded `prod`/`staging` pair check and PRODUCTION/STAGING ternary
  that contradicted the SSOT's documented open-env contract ("a new env
  needs only a registry entry"); the registry lookup subsumes it.
- resolveEnv: derive resolution entirely from the registries (ENV_IDS
  spellings -> env-id -> canonical ENV_ID_BY_NAME name) instead of its
  own hardcoded synonym chain. Behavior identical for
  prod/production/staging; still throws on unknowns, and now also
  throws on a mis-wired registry (a spelling whose env-id has no
  canonical name).
- serviceForDispatchName: fix the docstring's false "CI-built service"
  claim — it does no ciBuilt filtering and tests pin the unfiltered
  behavior (the non-CI-built webhooks resolves).
- repoNameFor: fail loud (consistent with instanceIdFor/domainFor)
  instead of silently echoing the service name — the exact
  silently-wrong-GHCR-name class this PR's hardening targets. Throws on
  unknown service, on an env not registered in ENV_ID_BY_NAME
  (unnormalized synonyms like "production"), and on a registered env
  the service does not declare. Keeps the documented default (the
  service name) for declared envs without an override.
  Call-site enumeration confirming nothing relies on the old fallback:
    - verify-railway-image-refs.ts:523 — iterates the entry's DECLARED
      environments keys, registry-filtered, SSOT-matched service names
    - __tests__/railway-envs.golden.test.ts:81 — iterates envsFor(name)
      (declared envs only) over real SSOT keys
    - railway-envs.test.ts repoNameFor cases — dual-env services,
      prod/staging only
    - __tests__/verify-railway-image-refs.test.ts:264 — FIVE_NEW keys,
      all dual-env
- resolveTargetServices: throw when an explicitly-provided services
  list resolves to zero entries (whitespace-only programmatic input)
  instead of letting runRedeploy exit 0 having redeployed nothing; the
  default undefined -> full CI-built scope is unchanged.
- makeLiveRedeploy: add signal: AbortSignal.timeout(30s) so a hung
  Railway API records a per-service FAIL instead of stalling CI, and
  pass GraphQL errors[].message through sanitizeErrorBody for
  consistency with the HTTP-error path. Exported for direct unit tests.

Red-green: 11 new tests (open-env registry resolution incl. a
runtime-registered hypothetical env, repoNameFor negatives,
empty-resolution throw, abort-signal presence, GraphQL error
sanitization) all failed against the old code; full showcase/scripts
suite green (50 files, 1807 tests) + tsc --noEmit clean.
2026-06-10 08:28:16 -07:00
Jordan Ritter c4a5f9d57c fix(showcase): @ag-ui 0.0.55 currency, reasoning ports, google-adk demos (#5348)
## Summary

Combined landing of three browser-verified showcase work waves (37
commits, per-integration grouping preserved), plus a full multi-round
code review with all mandatory fixes folded in.

**Wave 1 — @ag-ui currency (9/9 integrations).** Bump `@ag-ui/*`
frontend deps to exact `0.0.55` for: llamaindex, agno,
claude-sdk-python, pydantic-ai, strands, claude-sdk-typescript,
ms-agent-python, ms-agent-dotnet, google-adk. Exact pins land across 13
`package.json` files.

**Wave 2 — reasoning emission ports (4/4, ref #76).** Port
reasoning-message emission to ag2, crewai-crews, langroid, and spring-ai
(each also bumped to `@ag-ui` 0.0.55). Adds per-integration
`reasoning_agent` (Python) / `ReasoningController` (spring-ai Java) and
wires the copilotkit route.

**Wave 3 — google-adk demo parity (3/4).** Port `hitl`,
`threadid-frontend-tool-roundtrip`, and `gen-ui-interrupt` demos to
google-adk for parity with the gold reference, plus d6/aimock fixtures.
The `interrupt-headless` demo is intentionally kept `not_supported`
(needs aimock `customEvents` support + an ADK interrupt route — tracked
as a known upstream gap).

## Code review

A 5-round unbiased multi-agent CR loop ran against the combined diff and
converged at zero mandatory findings; the bucket-(c) promotion audit
came back clean. Key fixes folded into the branch:

- **Client error-leak hardening** in the crewai, langroid, and spring-ai
reasoning routes — internal exception details no longer leak to the
client, with `errorId` correlation between client response and server
logs (also applied to google-adk).
- **Protocol-correct reasoning error paths** — on failure the emitters
now close any open frames, emit a generic `RUN_ERROR`, and never emit
`RUN_FINISHED` after `RUN_ERROR`; verified against `@ag-ui/client`
`verifyEvents` semantics, with red-green tests.
- **`x-aimock-context` propagation** across spring-ai's async hop, so
fixture replay stays correct through the thread boundary.
- **Bounded reasoning executor** (no unbounded thread growth) and
**parse-failure observability** (failures surface in logs instead of
being swallowed).
- **Full multi-turn history threading** in the reasoning agents — prior
turns are now forwarded to the LLM, with single-turn byte-equality
preserved so existing aimock fixtures stay valid; covered by tests.
- **Phantom deps declared** — `@copilotkit/shared`/`@ag-ui` deps that
were imported but undeclared in claude-sdk-python and
ms-agent-dotnet/python are now in their `package.json`.
- **`@copilotkit/core` `"latest"` overrides pinned** to `1.59.4`.
- **Reasoning parity token-identity test** across the 3 ported Python
integrations (ag2/crewai-crews/langroid) so their reasoning streams
can't silently drift.
- **Ratchets tightened/updated**: shadow-collision ceiling ratcheted
down 151 → 123 (actual count), duplicate-fixture ceiling 288 → 290 (new
google-adk fixtures reuse standard prebuilt-probe pills,
runtime-disambiguated by demo route), and the `validate-pins` baseline
drops 57 → 48 (currency bumps retire 9 exact-pin FAIL lines).

The final commit is the `style: auto-fix formatting` bot commit
(formatting on the new Python test files).

## Test plan

- [x] Per-integration browser verification (each touched integration's
demos exercised end-to-end) with aimock fixtures added/updated.
- [x] crewai pytest — 113/113 pass.
- [x] `showcase/scripts` vitest — 1780/1780 pass.
- [x] `validate-parity` MUST checks — 19/19 pass, 0 fail.
- [x] `validate-pins` ratchet — exits 0 against the updated baseline
(FAIL-set hash matched).
- [x] D6 `gen-ui-custom` cells verified live (google-adk + agno).
- [x] CI fully green — per-integration Depot Docker `build-check`,
Python unit tests (3.10 + 3.12), commitlint, format, oxlint, Validate
Showcase, production-pinning lint.

## Follow-ups

Consolidated follow-up ledger (bucket c/d items):
https://www.notion.so/copilotkit/37b3aa38185281e5b871d0b907aaef71
2026-06-10 07:28:35 -07:00
Jordan Ritter 3c84d93fbd test(showcase): fixture-collision ceiling ratchets (duplicates 288->290, shadows 151->123) + honest overflow diagnostics 2026-06-10 07:11:26 -07:00
Jordan Ritter 2dbecf5f93 test(showcase): reasoning error-path, history, and parity coverage + forwarded-props agent stub 2026-06-10 07:11:25 -07:00
Jordan Ritter 8c31efcfa7 docs(showcase): accurate reasoning/demo comments and docstrings 2026-06-10 07:11:25 -07:00