Skip to content

feat: add evlog/eve integration#399

Merged
HugoRCD merged 11 commits into
mainfrom
feat/eve-integration
Jul 4, 2026
Merged

feat: add evlog/eve integration#399
HugoRCD merged 11 commits into
mainfrom
feat/eve-integration

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add evlog/eve with defineEvlogHook() (one wide event per turn) and useTurnLogger(ctx) for tool context
  • Share turn state on globalThis when Eve bundles hooks/tools separately; harden finalizeAudit() against partial audit objects
  • Add examples/eve — Clearbill support-refund copilot on Eve + Next.js (withEve, useEveAgent)
  • Document the use case and register the eve semantic-PR scope

Test plan

  • pnpm run typecheck
  • pnpm --filter evlog exec vitest run test/eve.test.ts test/core/audit.test.ts
  • pnpm run example:evehttp://localhost:3000 → Acme Corp / order #4821 refund flow
  • Wide events land in examples/eve/.evlog/logs/ via batched FS drain

Summary by CodeRabbit

  • New Features
    • Introduced evlog × eve integration to emit one wide event per completed agent turn, including token/tool/drain details and turn-scoped useLogger().
    • Added an EVE refund demo with a live wide-events UI panel.
  • Bug Fixes
    • Prevented failures when audit data is missing required actor fields.
    • Improved stream behavior so non-SSE paths return 404, and tool turn logging is correctly re-bound.
    • Reduced unintended Next.js/Nitro runtime probing.
  • Documentation
    • Published EVE integration and use-case pages; updated docs redirects.
  • Chores / Tests
    • Updated examples, workspace/release plumbing, and expanded integration test coverage.

HugoRCD added 4 commits July 1, 2026 17:47
Export defineEvlogHook and useTurnLogger for one wide event per Eve turn,
share turn state across authored-module bundles, and harden finalizeAudit.
Ship a support-refund copilot with useEveAgent, tool latency, and evlog
wide events; wire example:eve and eve>ai workspace override.
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evlog-docs Ready Ready Preview, Comment, Open in v0 Jul 4, 2026 2:56pm
just-use-evlog Ready Ready Preview, Comment Jul 4, 2026 2:56pm

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds eve-scoped turn logging and audit handling in evlog, then introduces a Clearbill demo app with agent tools, UI components, and docs. It also updates docs routing, package metadata, and workspace configuration for the new eve integration.

Changes

evlog/eve core integration

Layer / File(s) Summary
Audit and eve contracts
packages/evlog/src/audit.ts, packages/evlog/src/eve/index.ts, packages/evlog/src/logger.ts, packages/evlog/package.json
Adds the audit completeness guard, eve options and session types, logger initialization tracking, and package export/peer metadata for ./eve.
Turn logger state and lifecycle
packages/evlog/src/eve/index.ts, packages/evlog/src/shared/nitroConfigBridge.ts, packages/evlog/src/stream.ts
Implements ALS-backed logger lookup, shared turn/session state, turn lifecycle handling, cleanup helpers, Nitro host guarding, and non-root stream-server 404 routing.
Eve runtime tests
packages/evlog/test/core/audit.test.ts, packages/evlog/test/eve.test.ts, packages/evlog/test/core/logger.test.ts, packages/evlog/test/shared/nitroConfigBridge.test.ts, packages/evlog/test/http/stream-server.test.ts
Adds coverage for audit finalization, eve turn flows, keep/redaction/session behavior, Nitro host probing, and stream-server path handling.
Docs, changesets, and release wiring
.changeset/eve-integration.md, .changeset/stream-eve-proxy-fix.md, packages/evlog/README.md, apps/docs/content/4.use-cases/5.eve.md, apps/docs/content/4.use-cases/0.overview.md, apps/docs/config/redirects.ts, .github/pull_request_template.md, .github/workflows/semantic-pull-request.yml, .gitignore, apps/docs/nuxt.config.ts, pnpm-workspace.yaml, package.json, packages/evlog/tsdown.config.ts
Adds eve docs, use-case routing, README integration notes, changesets, scope entries, ignore rules, font config, workspace overrides, the example run script, and build wiring for the new entrypoint.

examples/eve support demo

Layer / File(s) Summary
Agent, tools, and demo data
examples/eve/agent/...
Defines the agent, auth channel, support data, latency helper, evlog hook, instructions, and refund/customer/order tools.
Chat and wide-event panels
examples/eve/app/_components/*, examples/eve/app/api/demo/logs/route.ts, examples/eve/app/page.tsx, examples/eve/app/layout.tsx
Implements the agent chat shell, message rendering, wide-event log panel, API route, and app entry/layout.
AI element components
examples/eve/components/ai-elements/*
Adds the conversation, message, reasoning, tool, code block, prompt input, chain-of-thought, and shimmer UI primitives used by the demo.
Shared UI primitives
examples/eve/components/ui/*, examples/eve/lib/utils.ts
Adds the base shadcn-style Radix wrappers and local cn helper used by the demo UI.
App shell and project setup
examples/eve/app/*, examples/eve/components.json, examples/eve/css.d.ts, examples/eve/next-env.d.ts, examples/eve/next.config.ts, examples/eve/package.json, examples/eve/postcss.config.mjs, examples/eve/tsconfig*.json, package.json
Sets up the Next.js app shell, styles, type declarations, package manifest, build config, and example run script.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

  • HugoRCD/evlog#356: Also changes packages/evlog/src/audit.ts and audit finalization behavior, which is directly adjacent to this PR’s audit guard update.
  • HugoRCD/evlog#340: Also touches packages/evlog/src/shared/nitroConfigBridge.ts to control when Nitro runtime probing runs.
  • HugoRCD/evlog#335: Related to the docs redirects table in apps/docs/config/redirects.ts.

Suggested labels: documentation, dependencies

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is on-topic but omits the template’s Linked issue, Description, and Checklist sections. Add the missing template sections: link an issue/discussion, expand the Description, and complete the checklist items.
Docstring Coverage ⚠️ Warning Docstring coverage is 2.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, conventional, and clearly matches the main change: adding evlog/eve integration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/eve-integration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@HugoRCD HugoRCD changed the title feat(eve): add evlog/eve integration and Clearbill example feat(eve): add evlog/eve integration Jul 1, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 1, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/evlog@399
npm i https://pkg.pr.new/@evlog/nuxthub@399

commit: b0dcea5

@HugoRCD HugoRCD marked this pull request as ready for review July 1, 2026 17:07
@HugoRCD HugoRCD changed the title feat(eve): add evlog/eve integration feat: add evlog/eve integration Jul 1, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 20

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/pull_request_template.md:
- Line 47: The scopes list in the pull request template is out of alphabetical
order because the `eve` entry is placed between `orpc` and `otlp`; move the `eve
(eve agent integration)` bullet so it sits between `elysia` and `express` in the
list, keeping the ordering consistent with the surrounding scope entries.

In `@apps/docs/content/4.use-cases/5.eve.md`:
- Around line 163-174: The keep example in defineEvlogHook is using the wrong
token field name, so update the snippet to read from the documented ai
inputTokens/outputTokens fields instead of totalTokens. In the keep callback,
derive the high-usage threshold from the available token counts on
ctx.context.ai, and keep the failed-tools check unchanged so the example remains
copy-pastable and consistent with the rest of the page.

In `@examples/eve/agent/channels/eve.ts`:
- Around line 1-2: Remove the stray semicolons to satisfy the ESLint semi rule
in this module; update the import statements in eve.ts and any other affected
statement in the same file so the syntax matches the project’s no-semicolon
style.
- Around line 5-13: Replace the placeholder auth in the eve channel config
before shipping this example. In `auth` within `eve.ts`, swap
`placeholderAuth()` for a real provider such as Auth.js or Clerk, or `none()` if
this is meant to be a public demo. Keep `localDev()` and `vercelOidc()` as-is,
and remove the placeholder so browser requests can authenticate in production.

In `@examples/eve/agent/tools/issue_refund.ts`:
- Around line 16-19: The approval-threshold check is duplicated between
needsApproval and the requiresApproval logic used in execute, which can drift
over time. Extract a shared helper in issue_refund.ts that computes whether an
order amount exceeds REFUND_APPROVAL_THRESHOLD_USD, and use that helper in both
the needsApproval callback and the execute audit logging so gating and logging
always stay consistent.

In `@examples/eve/app/layout.tsx`:
- Around line 28-36: The app root in RootLayout already provides
TooltipProvider, so the extra nested provider in MessageAction is redundant.
Update MessageAction in the message component to stop wrapping the button with
its own TooltipProvider when a tooltip exists, and rely on the provider
established by RootLayout instead; keep the tooltip content/trigger behavior
intact while removing the unnecessary inner provider.

In `@examples/eve/components/ai-elements/chain-of-thought.tsx`:
- Around line 50-55: The ChainOfThought header and content are currently
rendered under separate Collapsible roots, so their accessibility wiring is
disconnected even though they share isOpen. Update ChainOfThought to use a
single Collapsible root around both the header trigger and the content, and keep
the existing ChainOfThoughtContext/ChainOfThought components wired together so
the shared state drives one Radix instance.

In `@examples/eve/components/ai-elements/code-block.tsx`:
- Around line 137-141: The cache key in getTokensCacheKey is too weak because it
only uses language, length, prefix, and suffix, which can collide for different
code snippets. Update getTokensCacheKey in code-block.tsx to derive the key from
the full source text or a real hash of the entire code string so TokenizedCode
entries cannot be reused across different blocks with the same partial shape.

In `@examples/eve/components/ai-elements/message.tsx`:
- Around line 276-286: The custom comparator in MessageResponse is too narrow
and skips re-renders when className or other Streamdown props change. Update the
memo comparison logic for MessageResponse so it either compares all relevant
props passed through to Streamdown or remove the bespoke comparator and rely on
the default behavior. Keep the fix scoped to MessageResponse and ensure prop
changes besides children and isAnimating are not ignored.

In `@examples/eve/components/ai-elements/prompt-input.tsx`:
- Around line 802-806: The uncontrolled textarea is being cleared too early in
PromptInput, before the submit flow has actually succeeded. Update PromptInput
so the non-provider path does not call form.reset() immediately after capturing
the text; instead, mirror the provider branch by keeping the local text until
onSubmit/agent.send completes successfully, and only clear it after success.
Make sure the retry behavior in agent-chat preserves the typed prompt when a
send fails.

In `@examples/eve/components/ai-elements/reasoning.tsx`:
- Around line 146-154: The default thinking message used by
defaultGetThinkingMessage is rendering block-level elements inside
CollapsibleTrigger’s button, which creates invalid markup. Update the streaming
and non-streaming branches to return inline content only, and make sure Shimmer
in examples/eve/components/ai-elements/shimmer.tsx also renders inline when used
there so the trigger content stays button-safe.

In `@examples/eve/components/ai-elements/shimmer.tsx`:
- Around line 12-15: The shimmer component type annotation is referencing
React.ComponentType without importing React, so the file fails type-check.
Update the type usage in shimmer.tsx by importing ComponentType as a type from
react and replacing the React.ComponentType reference in motionComponentCache
with the imported ComponentType symbol.

In `@examples/eve/components/ai-elements/tool.tsx`:
- Around line 127-130: The ToolOutput component is treating valid falsy outputs
like 0, false, and empty string as missing because it relies on truthiness in
the early return. Update ToolOutput to check output and errorText for null or
undefined instead of using !(output || errorText), so legitimate falsy values
still render. Keep the fix localized to ToolOutput and preserve the existing
behavior for truly absent values.
- Around line 98-104: The CollapsibleContent styling in tool.tsx references
animation utilities that are not available in this example, so the open/close
transitions will not work. Either add the missing animation support used by the
className passed to CollapsibleContent (including animate-in, animate-out,
fade-out-0, and slide-* utilities), or remove those transition classes from the
cn() call so the component uses only supported Tailwind styles.

In `@examples/eve/components/ui/collapsible.tsx`:
- Around line 5-18: The Collapsible component types are referencing
React.ComponentProps without importing React, so update the type usage in
Collapsible, CollapsibleTrigger, and CollapsibleContent to use ComponentProps
imported from react. Add the type-only import at the top of the file and replace
the React.ComponentProps references so the file type-checks without relying on
an undeclared React identifier.

In `@examples/eve/components/ui/input-group.tsx`:
- Around line 69-74: The click handler in InputGroup currently focuses only an
input element, which misses other shared controls like InputGroupTextarea used
by the prompt composer. Update the onClick logic in InputGroup to target the
shared control slot instead of querySelector("input"), so clicking the addon
chrome focuses whichever control is rendered there. Keep the existing button
guard and use the InputGroup control container or equivalent shared selector
from the InputGroup component.

In `@examples/eve/lib/utils.ts`:
- Around line 1-6: The imports and function in cn currently use semicolons,
which conflicts with the repo’s no-semicolon style and triggers ESLint. Update
the statements in cn and its import lines to match the surrounding codebase
style by removing the extra semicolons, while keeping the exported cn helper and
its twMerge(clsx(inputs)) behavior unchanged.

In `@package.json`:
- Line 27: Update the example:eve script to run through Turbo like the other
example scripts instead of invoking pnpm directly. In package.json, change the
example:eve entry so it uses turbo run dev with the evlog-eve-example filter,
ensuring dev:prepare runs before startup. This keeps the script aligned with the
existing example script pattern and avoids the missing packages/evlog/dist issue
when importing evlog/* subpaths.

In `@packages/evlog/src/eve/index.ts`:
- Around line 247-261: Always clear per-turn state even when state.finish()
fails in finishTurn. Update finishTurn in eve/index.ts so the cleanup of
turnStates() and activeTurnBySession() happens in a finally path after
flushAi(state) and await state.finish(opts), ensuring turn.completed/turn.failed
callers do not leave stale entries on drain/enrich outages. Use the finishTurn
helper and the turnStates()/activeTurnBySession() maps as the main touchpoints.
- Around line 98-103: ensureInit() currently calls initLogger() unconditionally
on the first Eve setup, which can overwrite an app’s existing logger
configuration. Update ensureInit() in eve/index.ts to avoid reinitializing the
global logger: either skip initLogger() when logging is already configured, or
merge only the missing env.service value into the existing options before
calling initLogger(). Keep the existing isEveInitialized(), setEveInitialized(),
and initialized flow intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5c6219d3-2f2b-43c3-84e1-db54ef9dd039

📥 Commits

Reviewing files that changed from the base of the PR and between 32ea435 and ca5ac59.

⛔ Files ignored due to path filters (5)
  • apps/docs/app/assets/icons/eve.svg is excluded by !**/*.svg
  • apps/docs/public/eve-logo.svg is excluded by !**/*.svg
  • examples/eve/public/eve-logo.svg is excluded by !**/*.svg
  • packages/evlog/test/toolkit/__snapshots__/api-surface.test.ts.snap is excluded by !**/*.snap
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (66)
  • .changeset/eve-integration.md
  • .github/pull_request_template.md
  • .github/workflows/semantic-pull-request.yml
  • .gitignore
  • apps/docs/config/redirects.ts
  • apps/docs/content/4.use-cases/0.overview.md
  • apps/docs/content/4.use-cases/5.eve.md
  • apps/docs/nuxt.config.ts
  • examples/eve/.gitignore
  • examples/eve/README.md
  • examples/eve/agent/agent.ts
  • examples/eve/agent/channels/eve.ts
  • examples/eve/agent/hooks/evlog.ts
  • examples/eve/agent/instructions.md
  • examples/eve/agent/lib/fake-latency.ts
  • examples/eve/agent/lib/support-data.ts
  • examples/eve/agent/tools/issue_refund.ts
  • examples/eve/agent/tools/lookup_customer.ts
  • examples/eve/agent/tools/lookup_order.ts
  • examples/eve/app/_components/agent-chat.tsx
  • examples/eve/app/_components/agent-message.tsx
  • examples/eve/app/_components/eve-logo.tsx
  • examples/eve/app/globals.css
  • examples/eve/app/layout.tsx
  • examples/eve/app/page.tsx
  • examples/eve/components.json
  • examples/eve/components/ai-elements/chain-of-thought.tsx
  • examples/eve/components/ai-elements/code-block.tsx
  • examples/eve/components/ai-elements/conversation.tsx
  • examples/eve/components/ai-elements/message.tsx
  • examples/eve/components/ai-elements/prompt-input.tsx
  • examples/eve/components/ai-elements/reasoning.tsx
  • examples/eve/components/ai-elements/shimmer.tsx
  • examples/eve/components/ai-elements/tool.tsx
  • examples/eve/components/ui/badge.tsx
  • examples/eve/components/ui/button-group.tsx
  • examples/eve/components/ui/button.tsx
  • examples/eve/components/ui/collapsible.tsx
  • examples/eve/components/ui/command.tsx
  • examples/eve/components/ui/dialog.tsx
  • examples/eve/components/ui/dropdown-menu.tsx
  • examples/eve/components/ui/hover-card.tsx
  • examples/eve/components/ui/input-group.tsx
  • examples/eve/components/ui/input.tsx
  • examples/eve/components/ui/select.tsx
  • examples/eve/components/ui/separator.tsx
  • examples/eve/components/ui/spinner.tsx
  • examples/eve/components/ui/textarea.tsx
  • examples/eve/components/ui/tooltip.tsx
  • examples/eve/css.d.ts
  • examples/eve/lib/utils.ts
  • examples/eve/next-env.d.ts
  • examples/eve/next.config.ts
  • examples/eve/package.json
  • examples/eve/postcss.config.mjs
  • examples/eve/tsconfig.agent.json
  • examples/eve/tsconfig.json
  • package.json
  • packages/evlog/README.md
  • packages/evlog/package.json
  • packages/evlog/src/audit.ts
  • packages/evlog/src/eve/index.ts
  • packages/evlog/test/core/audit.test.ts
  • packages/evlog/test/eve.test.ts
  • packages/evlog/tsdown.config.ts
  • pnpm-workspace.yaml

Comment thread .github/pull_request_template.md Outdated
Comment thread apps/docs/content/4.use-cases/5.eve.md
Comment thread examples/eve/agent/channels/eve.ts Outdated
Comment on lines +5 to +13
auth: [
// Open on localhost for `eve dev` and the REPL; ignored in production.
localDev(),
// Lets the eve TUI and your Vercel deployments reach the deployed agent.
vercelOidc(),
// This placeholder will not allow browser requests in production.
// Replace it with your app's auth provider, like Auth.js or Clerk,
// or use none() for a public demo.
placeholderAuth(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== File outline ==\n'
ast-grep outline examples/eve/agent/channels/eve.ts --view expanded || true

printf '\n== File contents ==\n'
cat -n examples/eve/agent/channels/eve.ts

printf '\n== Search for placeholderAuth references ==\n'
rg -n "placeholderAuth\(|vercelOidc\(|localDev\(" examples/eve -S || true

printf '\n== Search for related docs/comments ==\n'
rg -n "placeholderAuth|public demo|browser requests in production|vercelOidc|localDev|eve dev|Next.js copilot" -S . || true

Repository: HugoRCD/evlog

Length of output: 1815


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Auth helper definitions ==\n'
rg -n "placeholderAuth|localDev|vercelOidc|none\(" . -S --glob '!**/node_modules/**' || true

printf '\n== Lint / formatting config ==\n'
rg -n '"semi"|semi:|`@typescript-eslint/semi`|prettier|biome|eslint' . -S --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' || true

printf '\n== Example docs mentioning deploy/public demo ==\n'
rg -n "public demo|deploy|production|browser requests|auth provider|none\(\)" examples README.md . -S --glob '!**/node_modules/**' || true

Repository: HugoRCD/evlog

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Auth helper definition file(s) ==\n'
fd -a "auth.*" examples/eve packages . | sed -n '1,40p'

printf '\n== Relevant source slices ==\n'
for f in \
  examples/eve/agent/channels/eve.ts \
  eslint.config.mjs \
  examples/eve/package.json
do
  if [ -f "$f" ]; then
    printf '\n--- %s ---\n' "$f"
    cat -n "$f" | sed -n '1,220p'
  fi
done

printf '\n== Semicolon-related lint config ==\n'
rg -n "semi|no-extra-semi|semi-style|`@typescript-eslint/semi`" eslint.config.mjs package.json examples/eve/package.json packages/evlog/package.json . -S --glob '!**/node_modules/**' || true

Repository: HugoRCD/evlog

Length of output: 21559


🌐 Web query:

Eve auth placeholderAuth localDev vercelOidc none public demo documentation

💡 Result:

In the Eve Agent Framework, authentication for channels is managed via the auth configuration in the eveChannel definition [1][2][3]. The framework is designed to be "fail-closed," meaning unconfigured channels default to a restrictive policy that rejects production browser traffic [1][4][3]. The components mentioned serve specific roles in this authentication lifecycle: 1. placeholderAuth: This is a guardrail provided by the eve init scaffolding [1]. It returns a structured 401 error, allowing the application to indicate that authentication is not yet configured rather than throwing an internal error [1]. It must be replaced with a real authentication policy before moving to production [1][4]. 2. localDev: This helper authenticates a synthetic local-dev principal [1]. It is designed for development and only functions when the request is addressed to a loopback hostname (such as localhost, 127.0.0.1, or::1) [1][3]. There is an exception for vercel dev environments when VERCEL=1 and VERCEL_ENV=development are both set [1]. 3. vercelOidc: This is a built-in helper used to verify Vercel OIDC tokens [1]. It is intended for production environments deployed on Vercel [4][3]. 4. none: For public-facing demos, the none() helper can be used to skip authentication entirely [3]. When setting up your agent/channels/eve.ts file, you typically define an array of these authenticators [1][3]. The default configuration for an unauthored file is [localDev(), vercelOidc()] [3]. To secure a production application, you should replace placeholderAuth() with a production-ready policy, such as httpBasic(), jwtHmac(), jwtEcdsa(), oidc(), or a custom AuthFn that validates your specific session or identity provider requirements [4]. Note that the Python Eve framework is a separate project (a REST API framework) and has its own distinct authentication system (e.g., BasicAuth, TokenAuth, HMAC) [5][6], which should not be confused with the Eve Agent Framework described here.

Citations:


Replace placeholderAuth() before shipping this example.
It returns 401 for browser requests in production, so the deployed app won’t be able to talk to the agent unless you swap in a real auth provider or none() for a public demo.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/eve/agent/channels/eve.ts` around lines 5 - 13, Replace the
placeholder auth in the eve channel config before shipping this example. In
`auth` within `eve.ts`, swap `placeholderAuth()` for a real provider such as
Auth.js or Clerk, or `none()` if this is meant to be a public demo. Keep
`localDev()` and `vercelOidc()` as-is, and remove the placeholder so browser
requests can authenticate in production.

Comment thread examples/eve/agent/tools/issue_refund.ts
Comment thread examples/eve/components/ui/input-group.tsx
Comment thread examples/eve/lib/utils.ts Outdated
Comment thread package.json Outdated
Comment thread packages/evlog/src/eve/index.ts
Comment thread packages/evlog/src/eve/index.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
examples/eve/components/ai-elements/tool.tsx (1)

124-135: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Explicit null output still renders literal "null" alongside an error.

typeof null === "object" is true in JS, so when output is explicitly null and errorText is set, the early-return is skipped and the object branch runs JSON.stringify(null, null, 2), rendering the text "null" under the error message.

🐛 Proposed fix
   let Output = <div>{output as ReactNode}</div>;

-  if (typeof output === "object" && !isValidElement(output)) {
+  if (output !== null && typeof output === "object" && !isValidElement(output)) {
     Output = <CodeBlock code={JSON.stringify(output, null, 2)} language="json" />;
   } else if (typeof output === "string") {
     Output = <CodeBlock code={output} language="json" />;
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/eve/components/ai-elements/tool.tsx` around lines 124 - 135,
ToolOutput currently treats explicit null as an object, so when errorText is
present it still renders JSON.stringify(null) and shows literal "null" in the
UI. Update ToolOutput in tool.tsx to explicitly guard against null before the
typeof output === "object" branch, and keep the existing early return behavior
for null output when appropriate so the error display does not include a stray
null.
examples/eve/components/ai-elements/prompt-input.tsx (2)

682-737: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate drag/drop handler bodies across form-local and document-global effects.

onDragOver/onDrop are defined identically in both useEffects, differing only by the target (form vs document). Extract a shared factory (e.g., createDropHandlers(add)) to avoid keeping two copies in sync.

♻️ Proposed refactor sketch
+  const createDropHandlers = useCallback(
+    () => ({
+      onDragOver: (e: DragEvent) => {
+        if (e.dataTransfer?.types?.includes("Files")) {
+          e.preventDefault();
+        }
+      },
+      onDrop: (e: DragEvent) => {
+        if (e.dataTransfer?.types?.includes("Files")) {
+          e.preventDefault();
+        }
+        if (e.dataTransfer?.files && e.dataTransfer.files.length > 0) {
+          add(e.dataTransfer.files);
+        }
+      },
+    }),
+    [add],
+  );

Both effects would then call const { onDragOver, onDrop } = createDropHandlers(); and only differ in the addEventListener target.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/eve/components/ai-elements/prompt-input.tsx` around lines 682 - 737,
There are duplicated drag-and-drop handler bodies in the two useEffect blocks in
prompt-input.tsx; extract the shared onDragOver/onDrop logic into a helper or
factory such as createDropHandlers(add) so both the form-local and
document-global effects reuse the same handlers. Keep the effects themselves
focused on choosing the event target (formRef.current vs document) and
wiring/unwiring listeners, while the shared helper owns the Files check,
preventDefault behavior, and add(e.dataTransfer.files) call.

538-583: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate file-validation logic in addLocal and addWithProviderValidation.

Both functions repeat the same accept-type filtering, "No files match the accepted types" error, size filtering, and "All files exceed the maximum size" error. Extract a shared validateFiles(fileList) helper returning the accepted/sized files (or emitting the appropriate onError) to avoid divergence.

♻️ Proposed refactor sketch
+  const validateFiles = useCallback(
+    (fileList: File[] | FileList) => {
+      const incoming = [...fileList];
+      const accepted = incoming.filter((f) => matchesAccept(f));
+      if (incoming.length && accepted.length === 0) {
+        onError?.({ code: "accept", message: "No files match the accepted types." });
+        return null;
+      }
+      const withinSize = (f: File) => (maxFileSize ? f.size <= maxFileSize : true);
+      const sized = accepted.filter(withinSize);
+      if (accepted.length > 0 && sized.length === 0) {
+        onError?.({ code: "max_file_size", message: "All files exceed the maximum size." });
+        return null;
+      }
+      return sized;
+    },
+    [matchesAccept, maxFileSize, onError],
+  );

Then both addLocal and addWithProviderValidation call validateFiles(fileList) and only implement the capacity-capping + storage logic that differs between them.

Also applies to: 598-635

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/eve/components/ai-elements/prompt-input.tsx` around lines 538 - 583,
`addLocal` duplicates the same file-validation flow used by
`addWithProviderValidation` (accept filtering, empty-accept error, size
filtering, and max-size error). Extract that shared logic into a helper like
`validateFiles(fileList)` in `prompt-input.tsx` that returns the accepted/sized
files or triggers `onError`, then have both `addLocal` and
`addWithProviderValidation` call it and keep only their differing
capacity/storage behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/evlog/src/eve/index.ts`:
- Line 4: `ensureInit()` in `eve/index.ts` still allows `initLogger()` to run
again on the first Eve turn because it only checks `isLoggerLocked()`, which is
not set in the Eve path. Add a real Eve-side initialization guard in
`ensureInit()` (or lock the logger during adapter setup) so `initLogger()` is
only called once and cannot overwrite existing env/drain/sampling configuration.
Use the existing `ensureInit`, `initLogger`, and `isLoggerLocked` symbols to
locate and update the guard logic.

---

Outside diff comments:
In `@examples/eve/components/ai-elements/prompt-input.tsx`:
- Around line 682-737: There are duplicated drag-and-drop handler bodies in the
two useEffect blocks in prompt-input.tsx; extract the shared onDragOver/onDrop
logic into a helper or factory such as createDropHandlers(add) so both the
form-local and document-global effects reuse the same handlers. Keep the effects
themselves focused on choosing the event target (formRef.current vs document)
and wiring/unwiring listeners, while the shared helper owns the Files check,
preventDefault behavior, and add(e.dataTransfer.files) call.
- Around line 538-583: `addLocal` duplicates the same file-validation flow used
by `addWithProviderValidation` (accept filtering, empty-accept error, size
filtering, and max-size error). Extract that shared logic into a helper like
`validateFiles(fileList)` in `prompt-input.tsx` that returns the accepted/sized
files or triggers `onError`, then have both `addLocal` and
`addWithProviderValidation` call it and keep only their differing
capacity/storage behavior.

In `@examples/eve/components/ai-elements/tool.tsx`:
- Around line 124-135: ToolOutput currently treats explicit null as an object,
so when errorText is present it still renders JSON.stringify(null) and shows
literal "null" in the UI. Update ToolOutput in tool.tsx to explicitly guard
against null before the typeof output === "object" branch, and keep the existing
early return behavior for null output when appropriate so the error display does
not include a stray null.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6827f669-a0bd-4ae3-81d6-d2b027dd0f05

📥 Commits

Reviewing files that changed from the base of the PR and between ca5ac59 and 10a174f.

📒 Files selected for processing (18)
  • .github/pull_request_template.md
  • apps/docs/content/4.use-cases/5.eve.md
  • examples/eve/README.md
  • examples/eve/agent/channels/eve.ts
  • examples/eve/agent/tools/issue_refund.ts
  • examples/eve/components/ai-elements/chain-of-thought.tsx
  • examples/eve/components/ai-elements/code-block.tsx
  • examples/eve/components/ai-elements/message.tsx
  • examples/eve/components/ai-elements/prompt-input.tsx
  • examples/eve/components/ai-elements/reasoning.tsx
  • examples/eve/components/ai-elements/shimmer.tsx
  • examples/eve/components/ai-elements/tool.tsx
  • examples/eve/components/ui/collapsible.tsx
  • examples/eve/components/ui/input-group.tsx
  • examples/eve/lib/utils.ts
  • package.json
  • packages/evlog/src/eve/index.ts
  • packages/evlog/test/eve.test.ts

Comment thread packages/evlog/src/eve/index.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/eve/components/ai-elements/prompt-input.tsx`:
- Line 593: The file validation flow in validateIncomingFiles and matchesAccept
only handles MIME-style accept rules, so extension-based patterns like ".pdf"
are rejected even though the input allows them. Update matchesAccept to also
recognize extension tokens (and any combined accept lists like ".pdf,image/*")
before the rejection path, and make sure the same logic is used for both
dropped/pasted files and the other validation call site referenced in this
change.

In `@examples/eve/components/ai-elements/tool.tsx`:
- Around line 131-133: Guard the object-to-JSON rendering path in tool.tsx so a
bad tool result cannot crash the component. In the output handling branch inside
the component that builds Output, wrap the JSON.stringify call in a safe
serialization path and fall back to a placeholder or string when serialization
fails for circular references or BigInt values. Keep the existing object check
and isValidElement logic, but ensure the CodeBlock only receives a serialized
string when it can be produced safely.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3ce54784-d8f0-4bcc-aae0-5df605489ff6

📥 Commits

Reviewing files that changed from the base of the PR and between 10a174f and ca0208b.

📒 Files selected for processing (5)
  • examples/eve/components/ai-elements/prompt-input.tsx
  • examples/eve/components/ai-elements/tool.tsx
  • packages/evlog/src/eve/index.ts
  • packages/evlog/src/logger.ts
  • packages/evlog/test/eve.test.ts

Comment thread examples/eve/components/ai-elements/prompt-input.tsx
Comment thread examples/eve/components/ai-elements/tool.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
examples/eve/agent/hooks/evlog.ts (1)

17-29: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Refund amount sampling is unreachable. Successful refunds always record status: 'refunded' in examples/eve/agent/tools/issue_refund.ts, so this || keeps every refunded order and the > 100 check never matters. Remove the status branch if amount-based sampling is still intended.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/eve/agent/hooks/evlog.ts` around lines 17 - 29, The refund sampling
logic in keep() is effectively always enabled for refunded orders because
issue_refund.ts always sets context.refund.status to refunded, making the
amount-based condition unreachable. Update the refund check in evlog.ts to rely
on amount-based sampling only, removing the status branch so ctx.shouldKeep is
set based on refund.amount when intended, while keeping the existing tools and
audit checks unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/evlog/src/eve/index.ts`:
- Around line 839-849: The exported resetEvlogEveForTests API is missing the
required JSDoc documentation. Add a JSDoc block for resetEvlogEveForTests,
matching the style used by nearby public exports like useLogger, and briefly
describe that it clears Eve/evlog test state and resets global initialization so
it is documented as a public API.
- Around line 441-455: The session approval lookup in consumeSessionApproval is
matching by toolName even when a callId is provided, which can consume the wrong
pending approval. Update the findIndex logic so that when callId is present it
only matches approvals with the same callId, and only fall back to toolName
matching when callId is absent. Keep the rest of the consumeSessionApproval flow
unchanged, including the splice and sessionApprovals cleanup.
- Around line 413-422: `trackPendingAction` in eve/index.ts violates the
max-params rule by taking five arguments. Refactor it to accept a single options
object for the call-specific fields (for example the turn, call, tool, and
timestamp data) while keeping the session identifier separate if needed, and
update the `actions.requested` handler call site to pass that object. Make sure
the `trackPendingAction` function and its caller use the new shape consistently
so the pending-action storage logic still writes the same values to
`getSessionPendingActions`.

In `@packages/evlog/test/eve.test.ts`:
- Around line 401-495: Add test coverage for concurrent approvals using the same
toolName but different callId values in the same session, since the current
approval tests in eve.test.ts only cover one pending/approved flow. Extend the
existing turn/step/event setup around defineEvlogHook and the approval
assertions to create two overlapping issue_refund tool-calls, then verify
consumeSessionApproval keeps each approval matched to the correct callId without
mismatch, and that both approval states and durations are recorded correctly.

---

Outside diff comments:
In `@examples/eve/agent/hooks/evlog.ts`:
- Around line 17-29: The refund sampling logic in keep() is effectively always
enabled for refunded orders because issue_refund.ts always sets
context.refund.status to refunded, making the amount-based condition
unreachable. Update the refund check in evlog.ts to rely on amount-based
sampling only, removing the status branch so ctx.shouldKeep is set based on
refund.amount when intended, while keeping the existing tools and audit checks
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f4d43372-c89a-46c8-ad77-b4d46c85d966

📥 Commits

Reviewing files that changed from the base of the PR and between ca0208b and 57273b3.

⛔ Files ignored due to path filters (1)
  • packages/evlog/test/toolkit/__snapshots__/api-surface.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (14)
  • .changeset/eve-integration.md
  • apps/docs/content/4.use-cases/5.eve.md
  • examples/eve/README.md
  • examples/eve/agent/hooks/evlog.ts
  • examples/eve/agent/tools/issue_refund.ts
  • examples/eve/agent/tools/lookup_customer.ts
  • examples/eve/agent/tools/lookup_order.ts
  • packages/evlog/README.md
  • packages/evlog/src/eve/index.ts
  • packages/evlog/src/logger.ts
  • packages/evlog/src/shared/nitroConfigBridge.ts
  • packages/evlog/test/core/logger.test.ts
  • packages/evlog/test/eve.test.ts
  • packages/evlog/test/shared/nitroConfigBridge.test.ts

Comment thread packages/evlog/src/eve/index.ts
Comment thread packages/evlog/src/eve/index.ts
Comment thread packages/evlog/src/eve/index.ts
Comment thread packages/evlog/test/eve.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
examples/eve/app/_components/agent-chat.tsx (1)

95-111: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Simplify the header-visibility ternary.

{!embedded && isEmpty ? null : !embedded ? (...) : null} is equivalent to !embedded && !isEmpty ? (...) : null — the current form re-checks !embedded twice and reads awkwardly.

♻️ Suggested simplification
-      {!embedded && isEmpty ? null : !embedded ? (
+      {!embedded && !isEmpty ? (
         <header className="flex h-14 shrink-0 items-center justify-center gap-3 pr-2 pl-4">
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/eve/app/_components/agent-chat.tsx` around lines 95 - 111, Simplify
the conditional rendering in agent-chat.tsx around the header block so it only
checks the non-embedded, non-empty case once. In the JSX near the header markup,
replace the duplicated ternary logic using the existing embedded and isEmpty
flags with the simpler equivalent form, keeping the same rendered header content
and behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/eve/app/api/demo/logs/route.ts`:
- Around line 7-22: The GET handler in the logs route buffers every entry from
readFsLogs() into events before trimming, which can waste memory on large logs.
Update GET to keep only the last MAX_EVENTS items while iterating, using a
bounded ring buffer or fixed-size queue instead of events.push plus slice at the
end. Keep the existing Response.json behavior and Cache-Control header, and
preserve readFsLogs() as the source of events.

---

Outside diff comments:
In `@examples/eve/app/_components/agent-chat.tsx`:
- Around line 95-111: Simplify the conditional rendering in agent-chat.tsx
around the header block so it only checks the non-embedded, non-empty case once.
In the JSX near the header markup, replace the duplicated ternary logic using
the existing embedded and isEmpty flags with the simpler equivalent form,
keeping the same rendered header content and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 767a3e72-5448-4248-97ea-1b5d9bff012a

📥 Commits

Reviewing files that changed from the base of the PR and between 57273b3 and b0dcea5.

⛔ Files ignored due to path filters (1)
  • packages/evlog/test/toolkit/__snapshots__/api-surface.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (17)
  • .changeset/stream-eve-proxy-fix.md
  • .gitignore
  • examples/eve/.gitignore
  • examples/eve/agent/hooks/evlog.ts
  • examples/eve/app/_components/agent-chat.tsx
  • examples/eve/app/_components/demo-app.tsx
  • examples/eve/app/_components/evlog-events-panel.tsx
  • examples/eve/app/api/demo/logs/route.ts
  • examples/eve/app/layout.tsx
  • examples/eve/app/page.tsx
  • examples/eve/components/ai-elements/prompt-input.tsx
  • examples/eve/components/ai-elements/reasoning.tsx
  • examples/eve/components/ai-elements/tool.tsx
  • packages/evlog/src/eve/index.ts
  • packages/evlog/src/stream.ts
  • packages/evlog/test/eve.test.ts
  • packages/evlog/test/http/stream-server.test.ts

Comment thread examples/eve/app/api/demo/logs/route.ts
@HugoRCD HugoRCD merged commit b1d04d0 into main Jul 4, 2026
18 checks passed
@HugoRCD HugoRCD self-assigned this Jul 4, 2026
@HugoRCD HugoRCD deleted the feat/eve-integration branch July 4, 2026 15:01
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