Skip to content

docs: add new video for flows and integrate CLI into crews docs - #1580

Merged
tylerslaton merged 1 commit into
mainfrom
tyler/crew-cli-docs
Mar 27, 2025
Merged

tylerslaton merged 1 commit into
mainfrom
tyler/crew-cli-docs

Conversation

@tylerslaton

Copy link
Copy Markdown
Contributor

No description provided.

@changesets-bot-copilotkit

Copy link
Copy Markdown

⏭️ Changeset Not Required

Latest commit: 768247a

No changes in this PR affected the @copilitkit/* packages. Merging this PR will not cause a version bump for any packages.

Changeset is not required for this PR.

@vercel

vercel Bot commented Mar 27, 2025

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
copilot-kit 🔄 Building (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 3:31pm
copilot-kit-qd8p 🔄 Building (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 3:31pm
demo-viewer 🔄 Building (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 3:31pm
docs 🔄 Building (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 3:31pm
examples-coagents-ai-researcher-ui 🔄 Building (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 3:31pm
examples-coagents-ai-travel-app 🔄 Building (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 3:31pm
examples-coagents-research-canvas-ui 🔄 Building (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 3:31pm

@github-actions

Copy link
Copy Markdown
Contributor

Previews

Commit SHA: 9ca9474

Name Preview
coagents-research-canvas Preview • Preview with LGC Python • Preview with LGC JS
coagents-qa-text Preview • Preview with LGC Python • Preview with LGC JS
coagents-qa-native Preview • Preview with LGC Python • Preview with LGC JS
coagents-routing Preview • Preview with LGC Python • Preview with LGC JS
next-openai Preview

tylerslaton added a commit that referenced this pull request Oct 2, 2026
Try it: `pnpm --filter demo exec next dev --turbopack -p 3471`, then
open `http://localhost:3471/learning` and click through a deal.

This PR adds Trajectory capture to CopilotKit. `@copilotkit/learning`
records browser activity (clicks, form edits, page changes, and network
requests) as AG-UI `CUSTOM` events. With CopilotKit, Core authenticates
through Runtime and sends the events to the Intelligence Realtime
Gateway. Apps that do not pass `learning` behave exactly as before. This
PR now also contains #7566 (Runtime authentication and Gateway
delivery), which was stacked on it.

## What does this PR do?

- **`@copilotkit/learning`** (new, about 5.8 KB gzip): the collector.
Capture follows the approved October 9 self-hosted scope: maximum
resolution, with no filtering or categorization. Two kinds of values
never leave the browser: password values and credential headers become
`[redacted]`.
- **Runtime:** a `trajectory/connect` route (REST and single endpoint).
It resolves the user with `identifyUser` and requests a single-use join
token from Intelligence. The project key stays on the server.
- **Core:**
- A `learning` config, plus `startTrajectory()`, `stopTrajectory()`,
`emitTrajectoryEvent()`, and `registerOpenThread()`.
- Batches go over Phoenix with sequence numbers, receipts, the Gateway
limits, and `dropped` counts. A failed batch is never resent.
- A custom `sink` keeps the standalone mode, which also adds Thread,
message, and tool context.
- **React:** a `learning` prop on `CopilotKitProvider`, with automatic
or manual start and cleanup on unmount. The `data-tool-call-id` wrapper
renders only while capture is active.
- **Demo and docs:** the `/learning` pages in `examples/v2/react/demo`,
and three Intelligence docs pages.

## Related PRs and Issues

- Linear: [PE-471](https://linear.app/copilotkit/issue/PE-471),
[PE-506](https://linear.app/copilotkit/issue/PE-506)
- Includes #7566. Backend: CopilotKit/Intelligence#1569 (ingestion) and
#1580 (read APIs).

## Checklist

- [ ] I have read the [Contribution
Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md)
- [x] If the PR changes or adds functionality, I have updated the
relevant documentation
- [ ] "Allow edits by maintainers" is checked (lets us help iterate on
your PR directly — faster turnaround for everyone)

## Changes in the latest push

- Merged #7566 and `main`.
- **Fix:** with `"auto"` transport (the default), capture started before
`/info` finished and sent a single-endpoint request to REST runtimes,
which failed. Core now waits for transport detection.
- **CodeRabbit:**
  - Password values and credential headers are redacted.
  - `data-copilotkit-ignore` now works through shadow roots.
- Click text is capped at 1,000 characters, so a large container cannot
exceed the 16 KiB event limit.
  - Reopening an in-flight XHR no longer reports the old request.

## Existing users (PE-506)

With no `learning` prop or config:

- No listeners, patches, timers, sockets, or Core or agent subscriptions
are installed. The tests `installs nothing without the learning prop`
and `warns and captures nothing without the learning option` cover this.
- The tool-call DOM is unchanged, because the wrapper renders only
during capture.
- Runtime routes are unchanged. `trajectory/connect` is new and returns
clear errors outside Intelligence.
- `fetch`, XHR, and streaming responses are untouched.

## Testing

Commands run (Windows, local):

- `pnpm nx run-many --targets=test,check-types
--projects=@copilotkit/learning,@copilotkit/core,@copilotkit/react-core,@copilotkit/runtime`:
all pass. learning 77 tests, core 1,140, react-core 1,786 (plus 54 node
checks), runtime 2,803. Types pass in all four.
- `node packages/learning/scripts/check-size.mjs`: 5,783 bytes gzip
(budget 6,144).
- `oxfmt` and `oxlint` on the changed files: 0 errors.
- Skipped: the local lefthook hooks (heavy, and flaky on this machine).
CI runs the full checks.

Manual test:

1. Run the demo, then open `/learning`.
2. Click **Open** on a deal, send a chat message, and click **Approve**
in the approval prompt.
3. Open **Captured events**. Check the click, page, network, and agent
events.

How this PR makes testing easy: unit tests in all four packages, a
real-Phoenix boundary test in Core, and the demo pages.

## Risk / rollback

Low for existing users, because nothing runs without `learning`. Core
now bundles the collector, so `@copilotkit/core` grows. Rollback: revert
this PR.

Open items, not in this PR:

- In the authenticated mode, events carry no Thread context yet. The
backend already supports Thread links. This was deferred on purpose, and
the decision is tracked in PE-504.
- No real round trip against Intelligence Dev yet. That is PE-507.

## Public API change

**Before**

```tsx
<CopilotKitProvider runtimeUrl="/api/copilotkit">{children}</CopilotKitProvider>
```

**After**

```tsx
<CopilotKitProvider runtimeUrl="/api/copilotkit" learning={{ trajectoryId }}>
  {children}
</CopilotKitProvider>;

// Or start capture yourself:
const result = await copilotkit.startTrajectory(); // { status: "started", trajectoryId }
copilotkit.emitTrajectoryEvent("deal.approved", { dealId: "deal-1" });
copilotkit.stopTrajectory();
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added learning and interaction capture for page navigation, clicks,
form input, network activity, agent messages, and tool interactions,
with credential redaction.
* Added controls to start and stop trajectories, send custom events,
filter captured data, and deliver event batches to custom endpoints.
* Added authenticated trajectory capture through the CopilotKit
provider.
* Added a demo for reviewing captured events and trying deal approval
flows.
* **Documentation**
* Added guides for interaction capture, standalone collection, captured
data, and setup.
* **Bug Fixes**
* Preserved message and tool-call identifiers in custom chat layouts for
interaction attribution.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

This branch was successfully deployed

6 active deployments
Preview – docs — 768247a2 Deployed Mar 27, 2025 by vercel[bot]
Preview – examples-coagents-ai-travel-app — 768247a2 Deployed Mar 27, 2025 by vercel[bot]
Preview – examples-coagents-research-canvas-ui — 768247a2 Deployed Mar 27, 2025 by vercel[bot]
Preview – demo-viewer — 768247a2 Deployed Mar 27, 2025 by vercel[bot]
Preview – copilot-kit — 768247a2 Deployed Mar 27, 2025 by vercel[bot]
Preview – copilot-kit-qd8p — 768247a2 Deployed Mar 27, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant