Skip to content

feat(tool-cards): render the element page/extension tools acted on - #348

Merged
omridevk merged 49 commits into
mainfrom
feat/tool-cards
Aug 10, 2026
Merged

omridevk merged 49 commits into
mainfrom
feat/tool-cards

Conversation

@omridevk

@omridevk omridevk commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Works toward #344. Draft on purpose — not mergeable yet. The element-capture half is still to come and lands on this same branch.

Every page.* call rendered as raw JSON, because pageActionTool matched conciv_page — a tool name #284 replaced with 37 page.<verb> tools. ToolCallCard matches on part.name, nothing matched, so everything fell through to ToolFallback.

Landed so far

Dispatch. ToolCallCard resolves extension card → builtin card → MetaToolCard → ToolFallback. The extension layer already existed end to end (ToolBuilder.render → collectToolRenderers → chat pane) and had no callers; layer 3 is new. ToolFallback now only serves tools that declare no meta at all — i.e. foreign harness tools.

The wire. ToolViewMeta gained category, hint, positional, approval, inputSchema, outputSchema, errors, so a card can be built from a declaration alone. input/output were renamed to inputSchema/outputSchema so the widget's structural assignment needs no adapter.

MetaToolCard in @conciv/ui-kit-chat, rendering from meta alone and naming no tool: label → title by state, positional → headline argument, summary/hint, icon, category → accent, remaining input fields → chips, mutating → writes badge, mirrors → "shown on your page", errors → the declared message, outputSchema → result view. schemaParams and tool-icon moved into ui-kit-chat (the card needs them; the other direction is a cycle).

Declared errors are read from the structured payload. errorReply (core/src/api/mcp.ts) already emits {error: {message, name?, code?}}; the card now reads error.code and matches it against the tool's declared errors instead of splitting the "CODE: message" string. That string packing exists only to cross the code-mode sandbox boundary and stays.

PageActionCard / pageActionTool deleted. Result views survive as page-result-views.tsx primitives (A11yNodeList, PageHtmlBlock, PageValueChip) for the per-verb cards.

PermissionCard renders again for tools reaching the first three layers. The Show stays — ToolFallback draws its own approval buttons and would otherwise double the prompt.

nowTitle reads label.running from the live registry catalog before its hardcoded table. The table remains for foreign harness tools (Bash, Edit, Read, Grep, TodoWrite), which no extension of ours declares.

ToolAccent deleted — dead, and its members never matched the category values tools actually declare.

Two UI landmines found on the way

Silently dead UnoCSS classes. A quoted attribute selector inside an arbitrary variant, combined with an arbitrary property, generates nothing:

OK    [&_[data-part="item"]]:flex                       quoted + standard utility
FAIL  [&_[data-kind="key"]]:[color:var(--chat-text-3)]   quoted + arbitrary property
OK    [&_[data-kind=key]]:[color:var(--chat-text-3)]     unquoted + arbitrary property

Half the JsonTreeView styling was dead on arrival — no syntax colours, no hover. Nothing in typecheck, lint or tests catches this; it only shows up as something looking wrong on screen. A lint rule for the pattern is worth considering separately.

Ark anatomy styling. JsonTreeView.Tree renders its own parts, so you cannot put a class on each one and descendant selectors are the only hook — which had produced a 2000-character class string. It is now a rule in presetConciv emitting plain nested CSS. transformerVariantGroup was the alternative, but transformers are top-level config only and cannot ship from a preset, so any consumer that forgot to enable it would get silently empty CSS — the same failure class as above. Rules ship with the preset.

Also dropped the row border-radius: 8px on a 20.5px row rendered every hovered row as a lozenge and read as scalloped notches between rows.

Still to come on this branch

  • Verify tool call ids survive a transcript reload — every capture is keyed by that id
  • Element capture in @conciv/page (rrweb node + ancestor skeleton + shared CSS bundle, password masking at serialize time)
  • toolCaptures storage, so captures reach the transcript UI and never the model
  • ElementCapture in protocol and <ElementPreview> in ui-kit-chat
  • Page extension packaging and its own cards via .render()
  • Move conciv_ui / conciv_open / conciv_extensions cards to packages/tools, execute_typescript to core

Gates

19/19 test tasks (99 ui-kit-chat, 199 storybook), typecheck 92/92, lint 0 errors, format clean, fallow audit verdict pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added specialized cards for page actions, reads, edits, console output, React inspection, effects, code execution, and UI prompts.
    • Added interactive choices, confirmations, diffs, and forms with answer submission.
    • Added persistent capture history with before-and-after previews, accessibility details, HTML formatting, result chips, and refresh support.
    • Added metadata-driven fallback cards for tools without specialized renderers.
    • Added safe capture previews with reusable styling and CSS support.
  • Bug Fixes

    • Sensitive fields are masked and captured content is sanitized before display.
    • Improved rendering for unknown, malformed, and structured tool results.
    • Ensured specialized cards take precedence over built-in and fallback renderers.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

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

The change moves tool cards into owning packages and adds metadata-driven fallback rendering. It adds sanitized page captures, CSS-bundle persistence, session retrieval, unified UI answers, expanded tool metadata, and Solid/Vite packaging.

Changes

Tool cards and frozen captures

Layer / File(s) Summary
Tool contracts and execution
packages/protocol/*, packages/contract/*, packages/extension/*, packages/core/src/page-bus.ts, packages/page/*
Tool signatures now expose schemas, errors, approval data, and capture modes. Page execution returns optional capture bundles and forwards tool-call identifiers.
Capture storage and session retrieval
packages/db/*, packages/core/src/api/rpc/*, apps/conciv/src/pane/*
The database stores before/after captures and deduplicated CSS bundles. RPC and app hooks load and refresh captures.
Package-owned card rendering
packages/ui-kit-chat/*, packages/tools/src/cards/*, packages/extensions/page/src/client/*, packages/core/src/cards/*
Extension cards take precedence over built-in cards. Metadata-driven cards render schemas, errors, approvals, mirrors, and captures.
Host integration and validation
apps/conciv/*, packages/*/test/*, packages/*/vite.config.ts, packages/*/uno.config.ts
The app wires registries, capture lookup, and UI replies. Browser, integration, Storybook, and build updates cover the new paths.

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

Sequence Diagram(s)

sequenceDiagram
  participant PageToolDispatcher
  participant PageBus
  participant CaptureDatabase
  participant ToolCallCard

  PageToolDispatcher->>PageBus: Return result and optional capture bundle
  PageBus->>CaptureDatabase: Persist capture and CSS bundle
  CaptureDatabase-->>PageBus: Store completion
  ToolCallCard->>PageBus: Request session captures
  PageBus-->>ToolCallCard: Return capture views for rendering
Loading

Possibly related issues

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: rendering tool cards for acted-on page and extension tools.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tool-cards

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

Copilot AI 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.

Pull request overview

Adds metadata-driven tool cards so declared page and extension tools no longer fall back to raw tool rendering.

Changes:

  • Adds MetaToolCard and layered card dispatch with approval support.
  • Expands registry metadata with schemas, errors, and approval details.
  • Removes obsolete conciv_page cards and preserves reusable page result views.

Reviewed changes

Copilot reviewed 30 out of 31 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/ui-kit-chat/test/tool-call-card-dispatch.browser.test.tsx Tests dispatch precedence and approvals.
packages/ui-kit-chat/test/schema-params.test.ts Tests schema field projection.
packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx Adds metadata-driven dispatch.
packages/ui-kit-chat/src/styled/tools/meta-tool-card.tsx Implements generic metadata cards.
packages/ui-kit-chat/src/styled/tools/meta-tool-card.stories.tsx Adds card examples.
packages/ui-kit-chat/src/styled/tool-icon.tsx Moves shared tool icons.
packages/ui-kit-chat/src/primitives/tools/schema-params.ts Exposes structured schema fields.
packages/ui-kit-chat/src/index.tsx Exports new card primitives.
packages/ui-kit-chat-tools/test/schema-params.test.ts Removes relocated tests.
packages/ui-kit-chat-tools/test/registry-card-declarations.browser.test.tsx Updates declaration-card tests.
packages/ui-kit-chat-tools/test/page-tool-cards.browser.test.tsx Tests page metadata cards.
packages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsx Removes obsolete card tests.
packages/ui-kit-chat-tools/test/new-tool-projection.browser.test.tsx Updates projection coverage.
packages/ui-kit-chat-tools/test/catalog-cards.browser.test.tsx Tests metadata rendering behavior.
packages/ui-kit-chat-tools/src/styled/tools/tool-chip.stories.tsx Uses relocated schema helper.
packages/ui-kit-chat-tools/src/styled/tools/page-result-views.tsx Preserves page result primitives.
packages/ui-kit-chat-tools/src/styled/tools/page-result-views.stories.tsx Adds result-view examples.
packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.tsx Uses shared schema helper.
packages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.ts Removes stale page registration.
packages/ui-kit-chat-tools/src/styled/page-action-card.tsx Deletes obsolete page card.
packages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsx Deletes obsolete stories.
packages/ui-kit-chat-tools/src/primitives/tools/now-title.ts Reads live catalog labels.
packages/ui-kit-chat-tools/src/index.tsx Updates public exports.
packages/protocol/src/tool-view-types.ts Expands tool view metadata.
packages/extension/test/tool-registry.test.ts Updates renamed schema fields.
packages/extension/src/tool-registry.ts Renames catalog schema properties.
packages/core/src/chat/capabilities.ts Adapts capability signatures.
packages/core/src/api/rpc/router.ts Projects expanded metadata over RPC.
packages/contract/src/contract.ts Expands wire signature schema.
packages/cli/src/tool-command.ts Consumes renamed input schema.
docs/superpowers/specs/2026-08-08-page-tool-cards-design.md Documents the broader card design.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI 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.

Pull request overview

Copilot reviewed 36 out of 37 changed files in this pull request and generated no new comments.

Suppressed comments (5)

packages/ui-kit-chat-tools/test/catalog-cards.browser.test.tsx:69

  • This assertion reaches through the diffs-container implementation and its shadow root. Widget UI tests in this repository are required to use user-facing role/text locators instead of CSS or implementation-detail selectors; assert the rendered result through a text locator and remove this helper.
  return Array.from(document.querySelectorAll('diffs-container'))
    .map((host) => host.shadowRoot?.textContent ?? '')
    .join('\n')

packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx:24

  • While the registry query is still loading, declared() is necessarily undefined, so an existing page.* call temporarily renders through ToolFallback (and can switch approval ownership when the query resolves). This contradicts the intended invariant that the raw fallback is used only after the loaded catalog confirms no metadata; the removed pending-catalog test covered this case. Treat an unloaded catalog as meta-card-owned until it resolves.
    if (declared()) return MetaToolCard
    return props.fallback ?? ToolFallback

packages/uno-preset/src/json-tree.ts:6

  • s is an abbreviated identifier, which this repository’s TypeScript conventions prohibit. Rename it to a self-explanatory name such as selector and update the template references.
    packages/ui-kit-chat-tools/src/styled/tools/page-result-views.stories.tsx:41
  • This story assertion depends on the diffs-container tag and its shadow-root implementation. UI assertions are required to use user-facing role/text queries so the test remains stable if the code-block implementation changes.
        Array.from(canvasElement.querySelectorAll('diffs-container'))
          .map((host) => host.shadowRoot?.textContent ?? '')
          .join('\n'),
      ).toContain('hero'),

packages/ui-kit-chat/src/styled/tool-card.tsx:40

  • The tooltip trigger is rendered as a non-focusable <span> inside Collapsible.Trigger (the actual button). Keyboard focus lands on the outer button, so Ark’s tooltip trigger never receives focus and the title tooltip is hover-only. Compose the tooltip trigger onto the collapsible button itself (or forward its trigger props to that button) so the same element supports hover and keyboard focus.
        <Tooltip.Trigger
          asChild={(triggerProps) => (
            <span {...triggerProps()} class={TITLE}>
              {props.title}
            </span>
          )}

@omridevk
omridevk marked this pull request as ready for review August 9, 2026 21:31
@omridevk
omridevk requested a balanced review from Copilot August 9, 2026 21:33

Copilot AI 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.

Pull request overview

Copilot reviewed 182 out of 186 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (6)

packages/page/src/element-capture.ts:108

  • The serialized target subtree has no size bound. Because mutating tools accept arbitrary selectors, targeting a large container such as body can persist an unbounded rrweb tree; every session load then returns all such trees through captures.list, causing database growth and large RPC/UI allocations. Enforce a serialized capture byte/node cap and fall back to the descriptor when exceeded.
    packages/page/src/page-tool-dispatcher.ts:147
  • For capture: 'after' tools, the only snapshot is attempted after execution. Common actions such as clicking a dismiss/submit control can detach or replace the target; takeElementCapture then rejects it because it is no longer connected, leaving the card with no capture. Retain a pre-action snapshot as a fallback and prefer the post-action snapshot when it succeeds.
    packages/db/src/capture-queries.ts:66
  • Deleting an unreferenced CSS row invalidates the page-side deduper. makeCssBundleDeduper remembers that hash for the lifetime of the connected page and will send only {hash} on later captures; after deleting the last referencing session, a new session on the same page can therefore store captures whose CSS can never be resolved. Either make deduplication acknowledgement/storage-aware or retain/re-request bundles when garbage collecting them.
    packages/page/src/page-tool-dispatcher.ts:113
  • PageCaptureBundle has only one cssBundle, but this loop can capture different stylesheets before and after an edit. The second new hash overwrites the first bundle while the before capture still references its old hash, and ToolCaptureView then applies one CSS string to both previews. Preserve every referenced CSS bundle and resolve CSS per capture side.
    packages/ui-kit-chat/src/index.tsx:196
  • These exports expose test/story fixtures from the production @conciv/ui-kit-chat entry point; repository guidance prohibits test code in product source. Move the fixture data to a testkit or Storybook-only module instead of publishing it as runtime API.
    packages/extensions/page/src/client/cards/shared.tsx:105
  • Every page verb now uses these custom cards, but this helper bypasses the declared-error resolver. It renders both the structured {error:{message,code}} form and the code-mode synthetic {error:"CODE: message"} form as raw JSON, so page cards never show the declaration's user-facing message. Normalize synthetic error chunks to the structured shape and share the metadata-aware resolver with these cards.

Comment thread packages/db/src/schema.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 15

🧹 Nitpick comments (8)
packages/ui-kit-chat/test/element-preview.browser.test.tsx (1)

180-203: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Exercise each hostile execution path.

This test does not click either link. It does not assert that onerror and onclick attributes are removed. It only checks the malformed java\tscript: URL.

A sanitizer regression that preserves a normal javascript: URL or an event handler can pass. Assert that these attributes are absent. Click the ordinary link and verify that XSS_FLAG remains unset.

🤖 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 `@packages/ui-kit-chat/test/element-preview.browser.test.tsx` around lines 180
- 203, Extend the test around the hostile payload in the existing element
preview case to assert that onerror and onclick attributes are absent from the
sanitized shadow content. Also locate the ordinary hostile link, click it, and
verify XSS_FLAG remains unset, while preserving the existing malformed
java\tscript: href assertion and safe-content checks.
packages/db/src/schema.ts (1)

43-53: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Add a non-unique session_id index and generate the migration.

sessionCaptures and deleteSessionCaptures filter by tool_captures.session_id. The composite primary key (tool_call_id, kind) cannot support these lookups, so SQLite scans the table. Declare index('tool_captures_session_id_idx').on(table.sessionId) and include the generated migration.

🤖 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 `@packages/db/src/schema.ts` around lines 43 - 53, Add the non-unique sessionId
index to the toolCaptures table definition using the name
tool_captures_session_id_idx, then generate and include the corresponding
database migration. Preserve the existing composite primary key and all other
columns unchanged.
packages/db/drizzle/20260808214400_tool_captures/snapshot.json (1)

367-426: 🧹 Nitpick | 🔵 Trivial

Consider indexing tool_captures.session_id.

The snapshot declares only the composite primary key (tool_call_id, kind). Capture reload and session cleanup filter by session_id, which requires a full table scan without an index. Add an index in packages/db/src/schema.ts and regenerate the migration if those access paths exist. The same applies to css_bundles.session_id.

🤖 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 `@packages/db/drizzle/20260808214400_tool_captures/snapshot.json` around lines
367 - 426, Update the schema definition for tool_captures and css_bundles in
schema.ts to add indexes on session_id, supporting capture reload and session
cleanup queries; then regenerate the corresponding Drizzle migration/snapshot so
the indexes are represented in the database schema.
packages/page/test/element-capture.browser.test.ts (1)

202-227: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Also assert that no hostile handler executed.

The test proves the handlers are absent from the serialized capture. It does not prove the fixture payload stayed inert. img onerror and the iframe srcdoc script run when the fixture mounts in the host page, and a later regression in the fixture would go unnoticed. Add a direct assertion on the sentinel.

💚 Proposed extra assertion
     const serialized = JSON.stringify(node)
     expect(serialized).not.toContain('onerror')
     expect(serialized).not.toContain('onmouseover')
     expect(serialized).not.toContain('javascript:')
     expect(serialized.toLowerCase()).not.toContain('iframe')
+    expect(Reflect.get(window, '__xssCapture')).toBeUndefined()
   })
🤖 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 `@packages/page/test/element-capture.browser.test.ts` around lines 202 - 227,
Update the test case around captureOf and the hostile fixture to assert the
handler-execution sentinel remains unset, in addition to the existing
serialized-node checks. Verify the sentinel after the fixture mounts and capture
completes, covering both the img onerror and iframe srcdoc payloads.
packages/core/test/chat/approving-call-post-result-traffic.it.test.ts (1)

42-54: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the tool output and the latency the test name claims.

JSON.stringify(outcome) contains 'target' even if the outcome only echoes the input elementId. The test also states "resolves quickly", but only the 8 s timeout bounds the duration, and the noise stream lasts about 900 ms. Assert the removed field and a duration below the stream length.

♻️ Proposed stronger assertions
       const approvingCall = makeApprovingCallTool(kit.base, session)
+      const started = Date.now()
       const outcome = await approvingCall('canvas.delete', {elementId: 'target'})
-      expect(JSON.stringify(outcome)).toContain('target')
+      expect(Date.now() - started).toBeLessThan(NOISE_CHUNK_COUNT * NOISE_INTERVAL_MS)
+      expect(JSON.stringify(outcome)).toContain('"removed":"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 `@packages/core/test/chat/approving-call-post-result-traffic.it.test.ts` around
lines 42 - 54, Strengthen the test around makeApprovingCallTool by recording the
call start time, asserting the outcome’s removed field confirms the target was
deleted, and asserting the call duration is below the long-running stream
duration (about 900 ms). Keep the existing cleanup and timeout behavior
unchanged.
packages/embed/vite.config.ts (1)

7-7: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Inline only @conciv/core/cards.

@conciv/core resolves to the server entry, while the widget uses the browser-safe @conciv/core/cards entry. The current prefix also inlines @conciv/core/app and unrelated names such as @conciv/core-server. Use an exact cards-entry allowlist, and retain the @conciv/extension/*, Ark, and Solid externalization assertions.

🤖 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 `@packages/embed/vite.config.ts` at line 7, Update INLINED_PREFIXES to remove
the broad `@conciv/core` prefix and allow only the exact `@conciv/core/cards` entry
for inlining. Preserve the existing `@conciv/page`, `@conciv/app`, and `@conciv/tools`
entries, along with the `@conciv/extension/`*, Ark, and Solid externalization
behavior.

Source: Coding guidelines

packages/extensions/page/test/defs.test.ts (1)

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

Remove the as const assertion.

MIRROR_VERBS is only used in a spread within an equality assertion. Literal tuple inference is not required, so the assertion is unnecessary and violates the TypeScript guideline that prohibits as.

🤖 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 `@packages/extensions/page/test/defs.test.ts` at line 41, Remove the `as const`
assertion from the `MIRROR_VERBS` definition, leaving the array contents and
spread-based equality assertion unchanged.

Source: Coding guidelines

packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx (1)

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

The inherited capture prop is silently ignored.

ToolCallCardProps extends Omit<ToolCardProps, 'addResult'>, so it still declares an optional capture field. Line 35 always resolves the capture from props.ctx.captureFor. A caller that passes capture directly gets no effect and no type error.

Either prefer the explicit prop, or omit capture from the public props type.

♻️ Option 1: honour the explicit prop
-        capture={props.ctx.captureFor?.(props.part.id)}
+        capture={props.capture ?? props.ctx.captureFor?.(props.part.id)}
♻️ Option 2: remove it from the public surface
-export type ToolCallCardProps = Omit<ToolCardProps, 'addResult'> & {
+export type ToolCallCardProps = Omit<ToolCardProps, 'addResult' | 'capture'> & {
🤖 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 `@packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx` at line 35, Update
the capture handling in ToolCallCard so the declared optional capture prop is
not ignored: prefer an explicitly supplied props.capture value and fall back to
props.ctx.captureFor?.(props.part.id), or remove capture from ToolCallCardProps
if it is intentionally unsupported.
🤖 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 @.fallowrc.json:
- Line 23: Restrict the Fallow exclusions in the configuration to only the
specific affected vite.config.ts path and package containing
`@conciv/extension-page`, or remove them after resolving the findings; do not use
repository-wide glob or package-wide exemptions, and audit the changed code with
Fallow before finishing.

In `@docs/superpowers/specs/2026-08-08-page-tool-cards-design.md`:
- Line 113: Add a language identifier to both fenced code blocks in the
document, using text for language-neutral examples so each fence satisfies
markdownlint MD040.

In `@packages/core/src/tool-registry.ts`:
- Around line 35-40: Update the conciv_page invocation and storeCapture flow so
direct conciv_page calls preserve and pass their tool-call ID even when no
ToolRequest exists. Adjust storeCapture’s inputs or caller to supply the session
and ID explicitly, while retaining existing ToolRequest handling and capture
persistence for normal tool calls.

In `@packages/core/test/chat/code-mode-reload-fold.it.test.ts`:
- Around line 56-60: Update bootScripted to call bootKit without passing
tmpdir() as cwd, allowing the harness adapter to use its sandbox-virtual
/workspace default. Keep the existing harness creation, cleanup registration,
and returned kit/harness behavior unchanged.

In `@packages/db/src/capture-queries.ts`:
- Around line 12-34: Update writeToolCapture and deleteSessionCaptures in
packages/db/src/capture-queries.ts:12-34 and
packages/db/src/capture-queries.ts:57-66 to execute their CSS/capture writes,
reference scan, and orphan cleanup within database transactions. Ensure each
operation uses the transaction handle consistently so deletion cannot interleave
between CSS insertion and capture upserts.

In `@packages/embed/test/helpers/page-plane-host.ts`:
- Around line 4-12: The openPagePlaneHost setup flow must clean up when
page.goto, waitForFunction, or subscribed rejects. Wrap the setup and return
logic in try/finally so observer.dispose() always runs, and close the page in
the failure path before rethrowing the original error.

In `@packages/embed/uno.config.ts`:
- Around line 14-16: Update the core source glob in the UnoCSS configuration to
include the top-level src/cards.tsx entry in addition to files under src/cards/,
ensuring utility classes from both locations are scanned for the embed bundle.

In `@packages/extension/src/types.ts`:
- Line 24: Update the normal chat tool execution flow in runtime.ts to include
the current tool-call ID when constructing the ToolRequest passed to
registry.call. Ensure the value propagates into runClientTool so capture
persistence works for page-tool calls, while preserving existing behavior when
no ID is available.

In `@packages/extensions/page/src/client/cards/shared.tsx`:
- Around line 100-106: Update cardErrorMessage to accept the ToolViewMeta.errors
catalog, resolve declared error codes from result.content to their matching
catalog message before calling resultText, and retain the existing direct-error
and fallback behavior when no catalog match exists. Update all callers to pass
the available errors catalog.

In `@packages/harness-testkit/src/call-tool.ts`:
- Around line 83-105: Update the approval flow around pumpApprovals and
rpc.chat.permissionDecision to pass abort.signal into the RPC call, attach
pumpApprovals’s rejection handler immediately when starting it, and await
iterator.return() during cancellation. Preserve normal abort completion while
propagating non-abort iterator or approval-decision failures so they remain
observable.

In `@packages/page/src/element-capture.ts`:
- Around line 59-68: Update decodeEntities and isJavascriptUrl so malformed or
out-of-range numeric entities, including values above 0x10FFFF, are treated as
unsafe and make isJavascriptUrl return true instead of throwing. Ensure
neutralizeAttributes removes such URL attributes, and add a regression test
covering an invalid numeric entity.
- Around line 105-123: Update serializeWithAncestors to enforce a node or byte
budget for the serialized capture, including descendants produced by
serializeNodeWithId and ancestor wrappers rather than only limiting
ANCESTOR_CAP. When the budget would be exceeded, omit the serialized node
payload while retaining the descriptor-only capture, and preserve the existing
dangerous-node and ancestor handling behavior.

In `@packages/page/src/page-tool-dispatcher.ts`:
- Around line 100-115: Update PageCaptureBundle and buildCaptureBundle so every
unique shipped CSS bundle is retained by its hash instead of overwriting
bundle.cssBundle for each entry. Preserve each capture’s cssBundleId and ensure
both before and after payloads remain resolvable by the host. Add an integration
test covering a before-after capture where the stylesheet changes between
captures.

In `@packages/ui-kit-chat/src/styled/collapsible-card.tsx`:
- Around line 87-90: Update the fallback branch in the collapsible-card
component so static cards preserve local.tooltip/titleTooltip behavior. Apply
the same tooltip wrapper used for regular card content around StaticRow, or pass
the tooltip value into StaticRow, while keeping the existing CardFrame and
local.class behavior unchanged.

In `@packages/ui-kit-chat/src/styled/element-preview.tsx`:
- Around line 29-33: Harden the element-preview rebuild flow by rejecting
executable and resource-loading elements before rebuild, including script and
link in addition to the existing DANGEROUS_TAGS handling. Prefer a render-only
element allowlist, or route rebuilding through rebuildIntoSandboxedIframe, so
UNSAFE_allowUnprotectedRebuild cannot connect unsafe content through
shadow.appendChild(built). Add browser coverage verifying script and link
payloads are rejected or safely isolated.

---

Nitpick comments:
In `@packages/core/test/chat/approving-call-post-result-traffic.it.test.ts`:
- Around line 42-54: Strengthen the test around makeApprovingCallTool by
recording the call start time, asserting the outcome’s removed field confirms
the target was deleted, and asserting the call duration is below the
long-running stream duration (about 900 ms). Keep the existing cleanup and
timeout behavior unchanged.

In `@packages/db/drizzle/20260808214400_tool_captures/snapshot.json`:
- Around line 367-426: Update the schema definition for tool_captures and
css_bundles in schema.ts to add indexes on session_id, supporting capture reload
and session cleanup queries; then regenerate the corresponding Drizzle
migration/snapshot so the indexes are represented in the database schema.

In `@packages/db/src/schema.ts`:
- Around line 43-53: Add the non-unique sessionId index to the toolCaptures
table definition using the name tool_captures_session_id_idx, then generate and
include the corresponding database migration. Preserve the existing composite
primary key and all other columns unchanged.

In `@packages/embed/vite.config.ts`:
- Line 7: Update INLINED_PREFIXES to remove the broad `@conciv/core` prefix and
allow only the exact `@conciv/core/cards` entry for inlining. Preserve the
existing `@conciv/page`, `@conciv/app`, and `@conciv/tools` entries, along with the
`@conciv/extension/`*, Ark, and Solid externalization behavior.

In `@packages/extensions/page/test/defs.test.ts`:
- Line 41: Remove the `as const` assertion from the `MIRROR_VERBS` definition,
leaving the array contents and spread-based equality assertion unchanged.

In `@packages/page/test/element-capture.browser.test.ts`:
- Around line 202-227: Update the test case around captureOf and the hostile
fixture to assert the handler-execution sentinel remains unset, in addition to
the existing serialized-node checks. Verify the sentinel after the fixture
mounts and capture completes, covering both the img onerror and iframe srcdoc
payloads.

In `@packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx`:
- Line 35: Update the capture handling in ToolCallCard so the declared optional
capture prop is not ignored: prefer an explicitly supplied props.capture value
and fall back to props.ctx.captureFor?.(props.part.id), or remove capture from
ToolCallCardProps if it is intentionally unsupported.

In `@packages/ui-kit-chat/test/element-preview.browser.test.tsx`:
- Around line 180-203: Extend the test around the hostile payload in the
existing element preview case to assert that onerror and onclick attributes are
absent from the sanitized shadow content. Also locate the ordinary hostile link,
click it, and verify XSS_FLAG remains unset, while preserving the existing
malformed java\tscript: href assertion and safe-content checks.
🪄 Autofix

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: CHILL

Plan: Pro Plus

Run ID: a6ab5c22-8e5a-4f00-9759-9cf88ee6734d

📥 Commits

Reviewing files that changed from the base of the PR and between 9af0758 and e3c3692.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (185)
  • .fallowrc.json
  • apps/conciv/package.json
  • apps/conciv/src/pane/chat-pane.tsx
  • apps/conciv/src/pane/conciv-ui-card.tsx
  • apps/conciv/src/pane/session-captures.ts
  • apps/conciv/src/pane/tool-view-ctx.ts
  • apps/conciv/test/helpers/fake-core-router.ts
  • apps/conciv/test/helpers/fake-core.ts
  • apps/conciv/test/kit-controls.browser.test.tsx
  • apps/conciv/test/tool-card-dispatch.browser.test.tsx
  • apps/conciv/uno.config.ts
  • apps/storybook/.storybook/main.ts
  • apps/storybook/package.json
  • apps/storybook/uno.config.ts
  • docs/superpowers/specs/2026-08-08-page-tool-cards-design.md
  • docs/superpowers/specs/2026-08-09-conciv-ui-card-unification-design.md
  • packages/cli/src/tool-command.ts
  • packages/contract/src/contract.ts
  • packages/core/package.json
  • packages/core/src/api/execute-schemas.ts
  • packages/core/src/api/mcp.ts
  • packages/core/src/api/rpc/router.ts
  • packages/core/src/api/rpc/sessions.ts
  • packages/core/src/app.ts
  • packages/core/src/cards.tsx
  • packages/core/src/cards/code-run-card.stories.tsx
  • packages/core/src/cards/code-run-card.tsx
  • packages/core/src/chat/capabilities.ts
  • packages/core/src/chat/code-mode-parts.ts
  • packages/core/src/chat/code-mode.ts
  • packages/core/src/page-bus.ts
  • packages/core/src/tool-registry.ts
  • packages/core/test/api/page/tool-capture.it.test.ts
  • packages/core/test/builtin-tool-calls.test.ts
  • packages/core/test/chat/approving-call-post-result-traffic.it.test.ts
  • packages/core/test/chat/code-mode-parts.test.ts
  • packages/core/test/chat/code-mode-reload-fold.it.test.ts
  • packages/core/test/client-tool-gate.test.ts
  • packages/core/tsconfig.cards.build.json
  • packages/core/tsconfig.cards.json
  • packages/core/uno.config.ts
  • packages/core/vite.config.ts
  • packages/db/drizzle/20260808214400_tool_captures/migration.sql
  • packages/db/drizzle/20260808214400_tool_captures/snapshot.json
  • packages/db/src/capture-queries.ts
  • packages/db/src/index.ts
  • packages/db/src/run-queries.ts
  • packages/db/src/schema.ts
  • packages/db/test/capture-queries.test.ts
  • packages/embed/test/element-capture.it.test.ts
  • packages/embed/test/embed.it.test.ts
  • packages/embed/test/helpers/page-plane-host.ts
  • packages/embed/test/mount-externals.test.ts
  • packages/embed/uno.config.ts
  • packages/embed/vite.config.ts
  • packages/extension-testkit/src/card-harness.tsx
  • packages/extension/src/collect-client.ts
  • packages/extension/src/define-tool.ts
  • packages/extension/src/tool-registry.ts
  • packages/extension/src/types.ts
  • packages/extension/test/tool-registry.test.ts
  • packages/extensions/page/.gitignore
  • packages/extensions/page/package.json
  • packages/extensions/page/src/client.tsx
  • packages/extensions/page/src/client/bodies.ts
  • packages/extensions/page/src/client/cards/act-card.stories.tsx
  • packages/extensions/page/src/client/cards/act-card.tsx
  • packages/extensions/page/src/client/cards/console-card.stories.tsx
  • packages/extensions/page/src/client/cards/console-card.tsx
  • packages/extensions/page/src/client/cards/edit-live-card.stories.tsx
  • packages/extensions/page/src/client/cards/edit-live-card.tsx
  • packages/extensions/page/src/client/cards/effect-card.stories.tsx
  • packages/extensions/page/src/client/cards/effect-card.tsx
  • packages/extensions/page/src/client/cards/react-card.stories.tsx
  • packages/extensions/page/src/client/cards/react-card.tsx
  • packages/extensions/page/src/client/cards/read-bulk-card.stories.tsx
  • packages/extensions/page/src/client/cards/read-bulk-card.tsx
  • packages/extensions/page/src/client/cards/read-value-card.stories.tsx
  • packages/extensions/page/src/client/cards/read-value-card.tsx
  • packages/extensions/page/src/client/cards/shared.tsx
  • packages/extensions/page/src/client/cards/story.fixtures.ts
  • packages/extensions/page/src/client/js-beautify-html.d.ts
  • packages/extensions/page/src/client/page-format.ts
  • packages/extensions/page/src/client/page-result-views.stories.tsx
  • packages/extensions/page/src/client/page-result-views.tsx
  • packages/extensions/page/src/shared/defs.ts
  • packages/extensions/page/test/defs.test.ts
  • packages/extensions/page/test/tsconfig.json
  • packages/extensions/page/tsconfig.build.json
  • packages/extensions/page/tsconfig.json
  • packages/extensions/page/tsconfig.refs.json
  • packages/extensions/page/tsdown.config.ts
  • packages/extensions/page/uno.config.ts
  • packages/extensions/page/vite.config.ts
  • packages/extensions/test-runner/test/test-card.browser.test.tsx
  • packages/extensions/whiteboard/src/client/model/comments.tsx
  • packages/harness-testkit/src/call-tool.ts
  • packages/page/package.json
  • packages/page/src/css-bundle.ts
  • packages/page/src/element-capture.ts
  • packages/page/src/element-descriptor.ts
  • packages/page/src/page-driver.ts
  • packages/page/src/page-snapshot.ts
  • packages/page/src/page-tool-dispatcher.ts
  • packages/page/test/css-bundle.test.ts
  • packages/page/test/element-capture.browser.test.ts
  • packages/page/test/page-dispatcher.browser.test.ts
  • packages/protocol/package.json
  • packages/protocol/src/chat-types.ts
  • packages/protocol/src/done-types.ts
  • packages/protocol/src/element-capture-types.ts
  • packages/protocol/src/page-types.ts
  • packages/protocol/src/tool-view-types.ts
  • packages/protocol/tsdown.config.ts
  • packages/tools/package.json
  • packages/tools/src/cards.tsx
  • packages/tools/src/cards/extensions-card.tsx
  • packages/tools/src/cards/inline-cards.stories.tsx
  • packages/tools/src/cards/open-card.tsx
  • packages/tools/src/cards/ui-card.stories.tsx
  • packages/tools/src/cards/ui-card.tsx
  • packages/tools/tsconfig.cards.build.json
  • packages/tools/tsconfig.cards.json
  • packages/tools/uno.config.ts
  • packages/tools/vite.config.ts
  • packages/ui-kit-chat-tools/package.json
  • packages/ui-kit-chat-tools/src/index.tsx
  • packages/ui-kit-chat-tools/src/primitives/tools/inline-tool.tsx
  • packages/ui-kit-chat-tools/src/primitives/tools/now-title.ts
  • packages/ui-kit-chat-tools/src/styled/done-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/done-card.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/apply-patch-diff.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/bash-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.ts
  • packages/ui-kit-chat-tools/src/styled/tools/discovered-apis-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/file-read-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/todo-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/tool-chip.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/tool-lookup-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.tsx
  • packages/ui-kit-chat-tools/test/catalog-cards.browser.test.tsx
  • packages/ui-kit-chat-tools/test/new-tool-projection.browser.test.tsx
  • packages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsx
  • packages/ui-kit-chat-tools/test/page-tool-cards.browser.test.tsx
  • packages/ui-kit-chat-tools/test/registry-card-declarations.browser.test.tsx
  • packages/ui-kit-chat-tools/test/schema-params.test.ts
  • packages/ui-kit-chat/package.json
  • packages/ui-kit-chat/src/index.tsx
  • packages/ui-kit-chat/src/primitives/message/message.tsx
  • packages/ui-kit-chat/src/primitives/tools/schema-params.ts
  • packages/ui-kit-chat/src/primitives/tools/tool-presentation.ts
  • packages/ui-kit-chat/src/store/element-capture.fixtures.ts
  • packages/ui-kit-chat/src/store/tool-context.tsx
  • packages/ui-kit-chat/src/styled/chip.tsx
  • packages/ui-kit-chat/src/styled/collapsible-card.tsx
  • packages/ui-kit-chat/src/styled/element-preview.stories.tsx
  • packages/ui-kit-chat/src/styled/element-preview.tsx
  • packages/ui-kit-chat/src/styled/json-tree.tsx
  • packages/ui-kit-chat/src/styled/tool-card.tsx
  • packages/ui-kit-chat/src/styled/tool-fallback.stories.tsx
  • packages/ui-kit-chat/src/styled/tool-icon.tsx
  • packages/ui-kit-chat/src/styled/tools/inline-row.tsx
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.stories.tsx
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.tsx
  • packages/ui-kit-chat/src/styled/tools/note-row.tsx
  • packages/ui-kit-chat/src/styled/tools/permission-card.stories.tsx
  • packages/ui-kit-chat/src/styled/tools/permission-card.tsx
  • packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx
  • packages/ui-kit-chat/test/collapsible-card-shape.browser.test.tsx
  • packages/ui-kit-chat/test/element-preview.browser.test.tsx
  • packages/ui-kit-chat/test/meta-tool-card-error.browser.test.tsx
  • packages/ui-kit-chat/test/schema-params.test.ts
  • packages/ui-kit-chat/test/tool-call-card-dispatch.browser.test.tsx
  • packages/ui-kit-system/src/index.tsx
  • packages/ui-kit-system/src/json-tree-view.tsx
  • packages/ui-kit-system/src/select.tsx
  • packages/uno-preset/src/index.ts
  • packages/uno-preset/src/json-tree.ts
💤 Files with no reviewable changes (13)
  • packages/ui-kit-chat-tools/package.json
  • packages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.ts
  • packages/ui-kit-chat-tools/src/styled/done-card.tsx
  • apps/conciv/src/pane/conciv-ui-card.tsx
  • packages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsx
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsx
  • packages/ui-kit-chat-tools/src/primitives/tools/inline-tool.tsx
  • packages/ui-kit-chat-tools/src/styled/done-card.stories.tsx
  • packages/ui-kit-chat-tools/test/schema-params.test.ts
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.tsx
  • packages/protocol/src/done-types.ts
  • packages/ui-kit-chat-tools/src/styled/page-action-card.tsx

Comment thread .fallowrc.json Resolved
Comment thread packages/core/src/tool-registry.ts Resolved
Comment thread packages/db/src/capture-queries.ts Resolved
Comment thread packages/page/src/element-capture.ts Resolved
Comment thread packages/page/src/element-capture.ts Resolved

Copilot AI 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.

Pull request overview

Copilot reviewed 182 out of 186 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (6)

packages/ui-kit-chat/src/styled/element-preview.tsx:170

  • Replaying the captured CSS and DOM can issue network requests. The sanitizer preserves normal src/href URLs, and arbitrary page CSS can contain url() or @import; inserting them here causes the transcript viewer to fetch attacker-controlled resources even though the subtree is inert. Strip or safely rewrite all network-capable URLs in both serialized attributes and CSS before rebuilding, since inert only blocks interaction, not resource loading.
    packages/extensions/page/src/client/cards/shared.tsx:105
  • The specialized page cards bypass the structured declared-error handling added to MetaToolCard. For an MCP error payload such as {"error":{"message":"...","code":"NO_MATCH"}}, result.error is absent and this returns the entire JSON string, so every page card shows raw JSON instead of the declared message. Parse the structured payload here and resolve its code against the card metadata's errors, then pass that metadata from the page cards.
    packages/core/src/tool-registry.ts:38
  • Captures from ordinary direct chat tool calls are dropped here because buildChatTools creates the ToolRequest at packages/core/src/chat/runtime.ts:102 without a toolCallId. Only code-mode calls currently add one, so direct page.* calls can render without their stored capture. Thread the actual streamed tool-call ID into the execution request (and add a direct-chat integration test) before requiring it here.
    packages/page/src/element-capture.ts:108
  • The full target subtree is serialized without any size or node-count limit. A valid call targeting body or a large application root can therefore send and persist megabytes of DOM per side, despite CSS having a 512 KiB cap, causing transcript/database growth and UI stalls. Apply a capture budget and fall back to the descriptor-only representation when it is exceeded.
    packages/page/src/page-tool-dispatcher.ts:113
  • A before/after capture can reference two different stylesheet hashes when the tool changes page CSS, but this single field is overwritten by the last entry. The earlier capture then references a hash whose CSS was never sent or stored, so its frozen preview loses its original styling. Carry all newly encountered CSS bundles (or store CSS per capture side) instead of only the final one.
    packages/page/src/css-bundle.ts:42
  • This marks a stylesheet as shipped before the receiver acknowledges or persists it. If a page call has no tool-call ID (for example the current direct-chat/RPC paths) or storage transiently fails, the full bundle is discarded, and every later capture sends only the hash, leaving previews permanently without CSS. Either resend the small bundle with each capture and rely on DB conflict deduplication, or add an acknowledgement/reset mechanism before caching it client-side.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
packages/embed/test/element-capture.it.test.ts (1)

19-28: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Create a fresh session for each test.

sessionId is created once in beforeAll, so all four tests share one persisted capture list. Earlier tests can change the rows searched by later tests. Concurrent or retried tests can also make the count assertions flaky. Create and clean up a session in beforeEach/afterEach, or reset captures before each test.

🤖 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 `@packages/embed/test/element-capture.it.test.ts` around lines 19 - 28, Update
the test setup around sessionId so each test receives an isolated fresh session
instead of sharing the session created in beforeAll. Move session creation into
beforeEach and clean up or reset the session state in afterEach, while keeping
browser, kit, and host initialization shared.
🤖 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/embed/test/element-capture.it.test.ts`:
- Around line 84-90: Update the read-verb test around page.text and capturesFor
to compare the complete capture state before and after the call using stable row
identity and content, rather than querying the fabricated "never-minted" ID.
Preserve the assertion that page.text creates no capture and ensure the
comparison detects replacements as well as count changes.
- Around line 53-60: Extend the capture assertions after the existing
before-capture checks to locate the row with kind "after" and validate its
post-action state. Use the same selectorPath-filtered captures and assert the
after capture reflects the expected updated accessible name and DOM attributes,
ensuring a duplicated pre-action snapshot cannot pass.
- Around line 66-71: Strengthen the test “never lets a password value reach the
stored capture or the tool result” by locating captures for the page.fill call
using its actual tool-call ID or the `#secret` selector, asserting that both
before and after captures exist, and then checking every matching capture for
PASSWORD redaction alongside the existing result check.

In `@packages/ui-kit-chat/test/element-preview.browser.test.tsx`:
- Around line 44-46: Update the anchor fixture in the relevant browser test
cases to include a usable ID, trigger a click on that anchor before checking the
XSS flag, and then assert that window.${XSS_FLAG} remains unset. Apply the same
interaction and assertion sequence to both affected cases.

---

Nitpick comments:
In `@packages/embed/test/element-capture.it.test.ts`:
- Around line 19-28: Update the test setup around sessionId so each test
receives an isolated fresh session instead of sharing the session created in
beforeAll. Move session creation into beforeEach and clean up or reset the
session state in afterEach, while keeping browser, kit, and host initialization
shared.
🪄 Autofix

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: CHILL

Plan: Pro Plus

Run ID: 62ec716e-2f77-4b12-a54a-a03f89ce5ffb

📥 Commits

Reviewing files that changed from the base of the PR and between 9af0758 and e3c3692.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (185)
  • .fallowrc.json
  • apps/conciv/package.json
  • apps/conciv/src/pane/chat-pane.tsx
  • apps/conciv/src/pane/conciv-ui-card.tsx
  • apps/conciv/src/pane/session-captures.ts
  • apps/conciv/src/pane/tool-view-ctx.ts
  • apps/conciv/test/helpers/fake-core-router.ts
  • apps/conciv/test/helpers/fake-core.ts
  • apps/conciv/test/kit-controls.browser.test.tsx
  • apps/conciv/test/tool-card-dispatch.browser.test.tsx
  • apps/conciv/uno.config.ts
  • apps/storybook/.storybook/main.ts
  • apps/storybook/package.json
  • apps/storybook/uno.config.ts
  • docs/superpowers/specs/2026-08-08-page-tool-cards-design.md
  • docs/superpowers/specs/2026-08-09-conciv-ui-card-unification-design.md
  • packages/cli/src/tool-command.ts
  • packages/contract/src/contract.ts
  • packages/core/package.json
  • packages/core/src/api/execute-schemas.ts
  • packages/core/src/api/mcp.ts
  • packages/core/src/api/rpc/router.ts
  • packages/core/src/api/rpc/sessions.ts
  • packages/core/src/app.ts
  • packages/core/src/cards.tsx
  • packages/core/src/cards/code-run-card.stories.tsx
  • packages/core/src/cards/code-run-card.tsx
  • packages/core/src/chat/capabilities.ts
  • packages/core/src/chat/code-mode-parts.ts
  • packages/core/src/chat/code-mode.ts
  • packages/core/src/page-bus.ts
  • packages/core/src/tool-registry.ts
  • packages/core/test/api/page/tool-capture.it.test.ts
  • packages/core/test/builtin-tool-calls.test.ts
  • packages/core/test/chat/approving-call-post-result-traffic.it.test.ts
  • packages/core/test/chat/code-mode-parts.test.ts
  • packages/core/test/chat/code-mode-reload-fold.it.test.ts
  • packages/core/test/client-tool-gate.test.ts
  • packages/core/tsconfig.cards.build.json
  • packages/core/tsconfig.cards.json
  • packages/core/uno.config.ts
  • packages/core/vite.config.ts
  • packages/db/drizzle/20260808214400_tool_captures/migration.sql
  • packages/db/drizzle/20260808214400_tool_captures/snapshot.json
  • packages/db/src/capture-queries.ts
  • packages/db/src/index.ts
  • packages/db/src/run-queries.ts
  • packages/db/src/schema.ts
  • packages/db/test/capture-queries.test.ts
  • packages/embed/test/element-capture.it.test.ts
  • packages/embed/test/embed.it.test.ts
  • packages/embed/test/helpers/page-plane-host.ts
  • packages/embed/test/mount-externals.test.ts
  • packages/embed/uno.config.ts
  • packages/embed/vite.config.ts
  • packages/extension-testkit/src/card-harness.tsx
  • packages/extension/src/collect-client.ts
  • packages/extension/src/define-tool.ts
  • packages/extension/src/tool-registry.ts
  • packages/extension/src/types.ts
  • packages/extension/test/tool-registry.test.ts
  • packages/extensions/page/.gitignore
  • packages/extensions/page/package.json
  • packages/extensions/page/src/client.tsx
  • packages/extensions/page/src/client/bodies.ts
  • packages/extensions/page/src/client/cards/act-card.stories.tsx
  • packages/extensions/page/src/client/cards/act-card.tsx
  • packages/extensions/page/src/client/cards/console-card.stories.tsx
  • packages/extensions/page/src/client/cards/console-card.tsx
  • packages/extensions/page/src/client/cards/edit-live-card.stories.tsx
  • packages/extensions/page/src/client/cards/edit-live-card.tsx
  • packages/extensions/page/src/client/cards/effect-card.stories.tsx
  • packages/extensions/page/src/client/cards/effect-card.tsx
  • packages/extensions/page/src/client/cards/react-card.stories.tsx
  • packages/extensions/page/src/client/cards/react-card.tsx
  • packages/extensions/page/src/client/cards/read-bulk-card.stories.tsx
  • packages/extensions/page/src/client/cards/read-bulk-card.tsx
  • packages/extensions/page/src/client/cards/read-value-card.stories.tsx
  • packages/extensions/page/src/client/cards/read-value-card.tsx
  • packages/extensions/page/src/client/cards/shared.tsx
  • packages/extensions/page/src/client/cards/story.fixtures.ts
  • packages/extensions/page/src/client/js-beautify-html.d.ts
  • packages/extensions/page/src/client/page-format.ts
  • packages/extensions/page/src/client/page-result-views.stories.tsx
  • packages/extensions/page/src/client/page-result-views.tsx
  • packages/extensions/page/src/shared/defs.ts
  • packages/extensions/page/test/defs.test.ts
  • packages/extensions/page/test/tsconfig.json
  • packages/extensions/page/tsconfig.build.json
  • packages/extensions/page/tsconfig.json
  • packages/extensions/page/tsconfig.refs.json
  • packages/extensions/page/tsdown.config.ts
  • packages/extensions/page/uno.config.ts
  • packages/extensions/page/vite.config.ts
  • packages/extensions/test-runner/test/test-card.browser.test.tsx
  • packages/extensions/whiteboard/src/client/model/comments.tsx
  • packages/harness-testkit/src/call-tool.ts
  • packages/page/package.json
  • packages/page/src/css-bundle.ts
  • packages/page/src/element-capture.ts
  • packages/page/src/element-descriptor.ts
  • packages/page/src/page-driver.ts
  • packages/page/src/page-snapshot.ts
  • packages/page/src/page-tool-dispatcher.ts
  • packages/page/test/css-bundle.test.ts
  • packages/page/test/element-capture.browser.test.ts
  • packages/page/test/page-dispatcher.browser.test.ts
  • packages/protocol/package.json
  • packages/protocol/src/chat-types.ts
  • packages/protocol/src/done-types.ts
  • packages/protocol/src/element-capture-types.ts
  • packages/protocol/src/page-types.ts
  • packages/protocol/src/tool-view-types.ts
  • packages/protocol/tsdown.config.ts
  • packages/tools/package.json
  • packages/tools/src/cards.tsx
  • packages/tools/src/cards/extensions-card.tsx
  • packages/tools/src/cards/inline-cards.stories.tsx
  • packages/tools/src/cards/open-card.tsx
  • packages/tools/src/cards/ui-card.stories.tsx
  • packages/tools/src/cards/ui-card.tsx
  • packages/tools/tsconfig.cards.build.json
  • packages/tools/tsconfig.cards.json
  • packages/tools/uno.config.ts
  • packages/tools/vite.config.ts
  • packages/ui-kit-chat-tools/package.json
  • packages/ui-kit-chat-tools/src/index.tsx
  • packages/ui-kit-chat-tools/src/primitives/tools/inline-tool.tsx
  • packages/ui-kit-chat-tools/src/primitives/tools/now-title.ts
  • packages/ui-kit-chat-tools/src/styled/done-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/done-card.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/apply-patch-diff.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/bash-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.ts
  • packages/ui-kit-chat-tools/src/styled/tools/discovered-apis-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/file-read-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/todo-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/tool-chip.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/tool-lookup-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.tsx
  • packages/ui-kit-chat-tools/test/catalog-cards.browser.test.tsx
  • packages/ui-kit-chat-tools/test/new-tool-projection.browser.test.tsx
  • packages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsx
  • packages/ui-kit-chat-tools/test/page-tool-cards.browser.test.tsx
  • packages/ui-kit-chat-tools/test/registry-card-declarations.browser.test.tsx
  • packages/ui-kit-chat-tools/test/schema-params.test.ts
  • packages/ui-kit-chat/package.json
  • packages/ui-kit-chat/src/index.tsx
  • packages/ui-kit-chat/src/primitives/message/message.tsx
  • packages/ui-kit-chat/src/primitives/tools/schema-params.ts
  • packages/ui-kit-chat/src/primitives/tools/tool-presentation.ts
  • packages/ui-kit-chat/src/store/element-capture.fixtures.ts
  • packages/ui-kit-chat/src/store/tool-context.tsx
  • packages/ui-kit-chat/src/styled/chip.tsx
  • packages/ui-kit-chat/src/styled/collapsible-card.tsx
  • packages/ui-kit-chat/src/styled/element-preview.stories.tsx
  • packages/ui-kit-chat/src/styled/element-preview.tsx
  • packages/ui-kit-chat/src/styled/json-tree.tsx
  • packages/ui-kit-chat/src/styled/tool-card.tsx
  • packages/ui-kit-chat/src/styled/tool-fallback.stories.tsx
  • packages/ui-kit-chat/src/styled/tool-icon.tsx
  • packages/ui-kit-chat/src/styled/tools/inline-row.tsx
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.stories.tsx
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.tsx
  • packages/ui-kit-chat/src/styled/tools/note-row.tsx
  • packages/ui-kit-chat/src/styled/tools/permission-card.stories.tsx
  • packages/ui-kit-chat/src/styled/tools/permission-card.tsx
  • packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx
  • packages/ui-kit-chat/test/collapsible-card-shape.browser.test.tsx
  • packages/ui-kit-chat/test/element-preview.browser.test.tsx
  • packages/ui-kit-chat/test/meta-tool-card-error.browser.test.tsx
  • packages/ui-kit-chat/test/schema-params.test.ts
  • packages/ui-kit-chat/test/tool-call-card-dispatch.browser.test.tsx
  • packages/ui-kit-system/src/index.tsx
  • packages/ui-kit-system/src/json-tree-view.tsx
  • packages/ui-kit-system/src/select.tsx
  • packages/uno-preset/src/index.ts
  • packages/uno-preset/src/json-tree.ts
💤 Files with no reviewable changes (13)
  • packages/ui-kit-chat-tools/src/styled/done-card.tsx
  • packages/protocol/src/done-types.ts
  • packages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsx
  • packages/ui-kit-chat-tools/test/schema-params.test.ts
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.stories.tsx
  • apps/conciv/src/pane/conciv-ui-card.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.tsx
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.ts
  • packages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/done-card.stories.tsx
  • packages/ui-kit-chat-tools/package.json
  • packages/ui-kit-chat-tools/src/primitives/tools/inline-tool.tsx
🚧 Files skipped from review as they are similar to previous changes (159)
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.tsx
  • apps/storybook/.storybook/main.ts
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.stories.tsx
  • packages/embed/vite.config.ts
  • packages/page/package.json
  • packages/core/src/chat/code-mode.ts
  • packages/core/tsconfig.cards.build.json
  • packages/extensions/page/.gitignore
  • packages/tools/tsconfig.cards.build.json
  • packages/core/src/api/rpc/sessions.ts
  • packages/extensions/page/src/client/js-beautify-html.d.ts
  • packages/ui-kit-chat/src/styled/tools/permission-card.tsx
  • packages/ui-kit-chat/src/styled/tool-fallback.stories.tsx
  • packages/cli/src/tool-command.ts
  • packages/ui-kit-system/src/index.tsx
  • packages/extensions/page/test/tsconfig.json
  • packages/extension/src/define-tool.ts
  • packages/embed/test/mount-externals.test.ts
  • .fallowrc.json
  • packages/extensions/page/src/client/cards/console-card.tsx
  • packages/protocol/tsdown.config.ts
  • packages/tools/src/cards/inline-cards.stories.tsx
  • packages/ui-kit-chat/test/collapsible-card-shape.browser.test.tsx
  • packages/core/test/chat/approving-call-post-result-traffic.it.test.ts
  • apps/storybook/uno.config.ts
  • packages/extensions/whiteboard/src/client/model/comments.tsx
  • packages/page/test/page-dispatcher.browser.test.ts
  • packages/ui-kit-chat-tools/src/styled/tools/tool-chip.stories.tsx
  • packages/core/test/client-tool-gate.test.ts
  • packages/ui-kit-system/src/json-tree-view.tsx
  • packages/extensions/page/src/client/cards/effect-card.tsx
  • packages/core/test/chat/code-mode-reload-fold.it.test.ts
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.tsx
  • packages/extensions/page/src/client/page-format.ts
  • apps/conciv/uno.config.ts
  • packages/uno-preset/src/json-tree.ts
  • packages/core/src/chat/code-mode-parts.ts
  • apps/conciv/src/pane/session-captures.ts
  • packages/core/src/chat/capabilities.ts
  • packages/ui-kit-chat/src/styled/tool-card.tsx
  • packages/db/drizzle/20260808214400_tool_captures/snapshot.json
  • packages/core/vite.config.ts
  • packages/protocol/src/chat-types.ts
  • packages/extension/src/types.ts
  • packages/extensions/page/src/client/cards/read-value-card.tsx
  • packages/extensions/page/src/client/cards/read-value-card.stories.tsx
  • packages/ui-kit-chat/src/index.tsx
  • packages/extension-testkit/src/card-harness.tsx
  • packages/extensions/page/src/client/cards/edit-live-card.stories.tsx
  • packages/uno-preset/src/index.ts
  • apps/conciv/test/helpers/fake-core.ts
  • packages/db/src/run-queries.ts
  • packages/db/drizzle/20260808214400_tool_captures/migration.sql
  • packages/core/src/app.ts
  • packages/embed/test/helpers/page-plane-host.ts
  • packages/db/test/capture-queries.test.ts
  • packages/extensions/page/tsconfig.json
  • packages/core/uno.config.ts
  • packages/extensions/page/tsconfig.refs.json
  • packages/extensions/page/src/client/cards/act-card.tsx
  • packages/extensions/page/src/client/cards/act-card.stories.tsx
  • packages/protocol/package.json
  • packages/extensions/page/tsconfig.build.json
  • packages/ui-kit-chat/src/styled/tools/permission-card.stories.tsx
  • packages/tools/src/cards.tsx
  • apps/conciv/test/kit-controls.browser.test.tsx
  • apps/conciv/test/helpers/fake-core-router.ts
  • packages/page/test/css-bundle.test.ts
  • packages/ui-kit-chat/src/styled/tools/note-row.tsx
  • packages/tools/src/cards/ui-card.stories.tsx
  • docs/superpowers/specs/2026-08-09-conciv-ui-card-unification-design.md
  • packages/embed/test/embed.it.test.ts
  • packages/protocol/src/page-types.ts
  • packages/extensions/page/src/client/cards/read-bulk-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.stories.tsx
  • packages/tools/src/cards/open-card.tsx
  • packages/ui-kit-chat/test/meta-tool-card-error.browser.test.tsx
  • packages/extensions/test-runner/test/test-card.browser.test.tsx
  • packages/page/src/page-driver.ts
  • packages/core/src/tool-registry.ts
  • packages/core/tsconfig.cards.json
  • packages/extensions/page/tsdown.config.ts
  • packages/extension/test/tool-registry.test.ts
  • packages/tools/tsconfig.cards.json
  • packages/harness-testkit/src/call-tool.ts
  • packages/ui-kit-chat-tools/src/styled/tools/tool-lookup-card.stories.tsx
  • packages/ui-kit-chat/package.json
  • packages/ui-kit-chat/src/styled/chip.tsx
  • packages/ui-kit-chat/src/store/element-capture.fixtures.ts
  • packages/extensions/page/src/client/page-result-views.tsx
  • packages/ui-kit-chat-tools/test/page-tool-cards.browser.test.tsx
  • apps/conciv/package.json
  • packages/core/src/cards/code-run-card.tsx
  • packages/page/src/page-snapshot.ts
  • packages/core/src/cards/code-run-card.stories.tsx
  • packages/extensions/page/src/client/cards/react-card.tsx
  • packages/db/src/index.ts
  • packages/extensions/page/uno.config.ts
  • packages/ui-kit-chat/test/tool-call-card-dispatch.browser.test.tsx
  • packages/extensions/page/test/defs.test.ts
  • apps/conciv/src/pane/tool-view-ctx.ts
  • packages/extension/src/collect-client.ts
  • packages/core/src/api/mcp.ts
  • packages/ui-kit-chat/src/primitives/tools/schema-params.ts
  • packages/page/src/css-bundle.ts
  • packages/core/test/builtin-tool-calls.test.ts
  • packages/tools/vite.config.ts
  • packages/extensions/page/src/client/cards/react-card.stories.tsx
  • packages/core/src/api/execute-schemas.ts
  • packages/ui-kit-chat/src/primitives/tools/tool-presentation.ts
  • packages/protocol/src/tool-view-types.ts
  • packages/protocol/src/element-capture-types.ts
  • packages/ui-kit-chat/src/styled/collapsible-card.tsx
  • packages/ui-kit-chat-tools/src/primitives/tools/now-title.ts
  • packages/contract/src/contract.ts
  • packages/extensions/page/src/client/cards/read-bulk-card.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/file-read-card.stories.tsx
  • packages/extensions/page/src/client/cards/effect-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/discovered-apis-card.stories.tsx
  • packages/tools/package.json
  • packages/ui-kit-chat-tools/src/index.tsx
  • packages/extension/src/tool-registry.ts
  • packages/page/src/element-descriptor.ts
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.stories.tsx
  • packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.tsx
  • packages/ui-kit-chat-tools/test/registry-card-declarations.browser.test.tsx
  • packages/ui-kit-chat-tools/test/new-tool-projection.browser.test.tsx
  • packages/extensions/page/src/client/cards/story.fixtures.ts
  • packages/extensions/page/src/client/page-result-views.stories.tsx
  • packages/ui-kit-chat/src/styled/element-preview.tsx
  • packages/extensions/page/vite.config.ts
  • packages/db/src/schema.ts
  • packages/extensions/page/src/client/cards/shared.tsx
  • packages/page/src/page-tool-dispatcher.ts
  • packages/extensions/page/package.json
  • apps/conciv/test/tool-card-dispatch.browser.test.tsx
  • packages/ui-kit-chat/src/styled/element-preview.stories.tsx
  • packages/embed/uno.config.ts
  • packages/extensions/page/src/client/cards/edit-live-card.tsx
  • packages/extensions/page/src/shared/defs.ts
  • apps/conciv/src/pane/chat-pane.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/todo-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/apply-patch-diff.stories.tsx
  • packages/extensions/page/src/client/cards/console-card.stories.tsx
  • packages/ui-kit-chat/test/schema-params.test.ts
  • packages/core/src/cards.tsx
  • packages/ui-kit-chat/src/primitives/message/message.tsx
  • packages/core/src/api/rpc/router.ts
  • packages/core/package.json
  • packages/core/src/page-bus.ts
  • apps/storybook/package.json
  • packages/tools/src/cards/extensions-card.tsx
  • packages/extensions/page/src/client.tsx
  • packages/db/src/capture-queries.ts
  • packages/ui-kit-chat-tools/src/styled/tools/bash-card.stories.tsx
  • packages/core/test/api/page/tool-capture.it.test.ts
  • packages/ui-kit-chat/src/store/tool-context.tsx
  • packages/core/test/chat/code-mode-parts.test.ts

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
packages/page/test/element-capture.browser.test.ts (1)

24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the repeated as const assertions.

Return a contextually typed success literal, or define a typed success-result helper. Confirm that defineTool().client() retains the ok: true output type after this change.

  • packages/page/test/element-capture.browser.test.ts#L24-L27: remove true as const from actFill.
  • packages/page/test/element-capture.browser.test.ts#L36-L39: remove true as const from editText.
  • packages/page/test/element-capture.browser.test.ts#L47-L50: remove true as const from editRemove.
  • packages/page/test/element-capture.browser.test.ts#L58-L66: remove true as const from editStyled.
  • packages/page/test/element-capture.browser.test.ts#L74-L77: remove true as const from actMark.

As per coding guidelines, “avoid any, as, and @ts-ignore”.

🤖 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 `@packages/page/test/element-capture.browser.test.ts` around lines 24 - 27,
Remove the repeated “true as const” assertions from the success results returned
by actFill, editText, editRemove, editStyled, and actMark in
packages/page/test/element-capture.browser.test.ts at lines 24-27, 36-39, 47-50,
58-66, and 74-77. Use contextual typing or a shared typed success-result helper,
and confirm defineTool().client() still infers the output as {ok: true} without
using any or type assertions.

Source: Coding guidelines

🤖 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/page/src/css-bundle.ts`:
- Around line 20-23: Update collectPendingCss to measure the collected CSS using
its UTF-8 encoded byte length rather than the JavaScript string length, while
preserving the empty-string and 512 KiB CSS_BUNDLE_CAP checks before returning
{css}.

In `@packages/page/test/element-capture.browser.test.ts`:
- Around line 214-221: The test currently exercises only the password target, so
it does not verify payment-field masking. In the test case around probe.fill,
add a separate successful execute call targeting `#card` and assert that its
result descriptor and capture payload do not contain 4111111111111111, while
preserving the existing `#secret` assertions and the expected masked-value
behavior.

In `@packages/protocol/src/element-capture-sanitize.ts`:
- Line 9: Update the DANGEROUS_TAGS set to include meta so neutralizeSubtree
removes meta-refresh elements from captures. Add protocol-level and
browser-level coverage using a meta http-equiv="refresh" payload, verifying it
is blocked and cannot trigger navigation or an outbound request during replay.

---

Nitpick comments:
In `@packages/page/test/element-capture.browser.test.ts`:
- Around line 24-27: Remove the repeated “true as const” assertions from the
success results returned by actFill, editText, editRemove, editStyled, and
actMark in packages/page/test/element-capture.browser.test.ts at lines 24-27,
36-39, 47-50, 58-66, and 74-77. Use contextual typing or a shared typed
success-result helper, and confirm defineTool().client() still infers the output
as {ok: true} without using any or type assertions.
🪄 Autofix

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: CHILL

Plan: Pro Plus

Run ID: d149140c-a4df-4e1a-97d7-69f2df16a062

📥 Commits

Reviewing files that changed from the base of the PR and between 99bbfa8 and 7377aa4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (192)
  • .fallowrc.json
  • apps/conciv/package.json
  • apps/conciv/src/pane/chat-pane.tsx
  • apps/conciv/src/pane/conciv-ui-card.tsx
  • apps/conciv/src/pane/session-captures.ts
  • apps/conciv/src/pane/tool-view-ctx.ts
  • apps/conciv/test/helpers/fake-core-router.ts
  • apps/conciv/test/helpers/fake-core.ts
  • apps/conciv/test/kit-controls.browser.test.tsx
  • apps/conciv/test/tool-card-dispatch.browser.test.tsx
  • apps/conciv/uno.config.ts
  • apps/storybook/.storybook/main.ts
  • apps/storybook/package.json
  • apps/storybook/uno.config.ts
  • docs/superpowers/specs/2026-08-08-page-tool-cards-design.md
  • docs/superpowers/specs/2026-08-09-conciv-ui-card-unification-design.md
  • packages/cli/src/tool-command.ts
  • packages/contract/src/contract.ts
  • packages/core/package.json
  • packages/core/src/api/execute-schemas.ts
  • packages/core/src/api/mcp.ts
  • packages/core/src/api/rpc/router.ts
  • packages/core/src/api/rpc/sessions.ts
  • packages/core/src/app.ts
  • packages/core/src/cards.tsx
  • packages/core/src/cards/code-run-card.stories.tsx
  • packages/core/src/cards/code-run-card.tsx
  • packages/core/src/chat/capabilities.ts
  • packages/core/src/chat/code-mode-parts.ts
  • packages/core/src/chat/code-mode.ts
  • packages/core/src/chat/runtime.ts
  • packages/core/src/page-bus.ts
  • packages/core/src/tool-registry.ts
  • packages/core/test/api/page/tool-capture.it.test.ts
  • packages/core/test/builtin-tool-calls.test.ts
  • packages/core/test/chat/approving-call-post-result-traffic.it.test.ts
  • packages/core/test/chat/code-mode-parts.it.test.ts
  • packages/core/test/chat/code-mode-parts.test.ts
  • packages/core/test/chat/code-mode-reload-fold.it.test.ts
  • packages/core/test/client-tool-gate.test.ts
  • packages/core/test/extension-tool-call-id.it.test.ts
  • packages/core/tsconfig.cards.build.json
  • packages/core/tsconfig.cards.json
  • packages/core/uno.config.ts
  • packages/core/vite.config.ts
  • packages/db/drizzle/20260808214400_tool_captures/migration.sql
  • packages/db/drizzle/20260808214400_tool_captures/snapshot.json
  • packages/db/src/capture-queries.ts
  • packages/db/src/index.ts
  • packages/db/src/run-queries.ts
  • packages/db/src/schema.ts
  • packages/db/test/capture-queries.test.ts
  • packages/embed/test/element-capture.it.test.ts
  • packages/embed/test/embed.it.test.ts
  • packages/embed/test/helpers/page-plane-host.ts
  • packages/embed/test/mount-externals.test.ts
  • packages/embed/uno.config.ts
  • packages/embed/vite.config.ts
  • packages/extension-testkit/src/card-harness.tsx
  • packages/extension/src/collect-client.ts
  • packages/extension/src/define-tool.ts
  • packages/extension/src/tool-registry.ts
  • packages/extension/src/types.ts
  • packages/extension/test/tool-registry.test.ts
  • packages/extensions/page/.gitignore
  • packages/extensions/page/package.json
  • packages/extensions/page/src/client.tsx
  • packages/extensions/page/src/client/bodies.ts
  • packages/extensions/page/src/client/cards/act-card.stories.tsx
  • packages/extensions/page/src/client/cards/act-card.tsx
  • packages/extensions/page/src/client/cards/console-card.stories.tsx
  • packages/extensions/page/src/client/cards/console-card.tsx
  • packages/extensions/page/src/client/cards/edit-live-card.stories.tsx
  • packages/extensions/page/src/client/cards/edit-live-card.tsx
  • packages/extensions/page/src/client/cards/effect-card.stories.tsx
  • packages/extensions/page/src/client/cards/effect-card.tsx
  • packages/extensions/page/src/client/cards/react-card.stories.tsx
  • packages/extensions/page/src/client/cards/react-card.tsx
  • packages/extensions/page/src/client/cards/read-bulk-card.stories.tsx
  • packages/extensions/page/src/client/cards/read-bulk-card.tsx
  • packages/extensions/page/src/client/cards/read-value-card.stories.tsx
  • packages/extensions/page/src/client/cards/read-value-card.tsx
  • packages/extensions/page/src/client/cards/shared.tsx
  • packages/extensions/page/src/client/cards/story.fixtures.ts
  • packages/extensions/page/src/client/js-beautify-html.d.ts
  • packages/extensions/page/src/client/page-format.ts
  • packages/extensions/page/src/client/page-result-views.stories.tsx
  • packages/extensions/page/src/client/page-result-views.tsx
  • packages/extensions/page/src/shared/defs.ts
  • packages/extensions/page/test/defs.test.ts
  • packages/extensions/page/test/tsconfig.json
  • packages/extensions/page/tsconfig.build.json
  • packages/extensions/page/tsconfig.json
  • packages/extensions/page/tsconfig.refs.json
  • packages/extensions/page/tsdown.config.ts
  • packages/extensions/page/uno.config.ts
  • packages/extensions/page/vite.config.ts
  • packages/extensions/test-runner/test/test-card.browser.test.tsx
  • packages/extensions/whiteboard/src/client/model/comments.tsx
  • packages/harness-testkit/src/call-tool.ts
  • packages/harness-testkit/src/scripted-run.ts
  • packages/harness-testkit/test/scripted-run.test.ts
  • packages/page/package.json
  • packages/page/src/css-bundle.ts
  • packages/page/src/element-capture.ts
  • packages/page/src/element-descriptor.ts
  • packages/page/src/page-driver.ts
  • packages/page/src/page-snapshot.ts
  • packages/page/src/page-tool-dispatcher.ts
  • packages/page/test/css-bundle.test.ts
  • packages/page/test/element-capture.browser.test.ts
  • packages/page/test/page-dispatcher.browser.test.ts
  • packages/protocol/package.json
  • packages/protocol/src/chat-types.ts
  • packages/protocol/src/done-types.ts
  • packages/protocol/src/element-capture-sanitize.ts
  • packages/protocol/src/element-capture-types.ts
  • packages/protocol/src/page-types.ts
  • packages/protocol/src/tool-view-types.ts
  • packages/protocol/test/element-capture-sanitize.test.ts
  • packages/protocol/tsdown.config.ts
  • packages/tools/package.json
  • packages/tools/src/cards.tsx
  • packages/tools/src/cards/extensions-card.tsx
  • packages/tools/src/cards/inline-cards.stories.tsx
  • packages/tools/src/cards/open-card.tsx
  • packages/tools/src/cards/ui-card.stories.tsx
  • packages/tools/src/cards/ui-card.tsx
  • packages/tools/tsconfig.cards.build.json
  • packages/tools/tsconfig.cards.json
  • packages/tools/uno.config.ts
  • packages/tools/vite.config.ts
  • packages/ui-kit-chat-tools/package.json
  • packages/ui-kit-chat-tools/src/index.tsx
  • packages/ui-kit-chat-tools/src/primitives/tools/inline-tool.tsx
  • packages/ui-kit-chat-tools/src/primitives/tools/now-title.ts
  • packages/ui-kit-chat-tools/src/styled/done-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/done-card.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/apply-patch-diff.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/bash-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.ts
  • packages/ui-kit-chat-tools/src/styled/tools/discovered-apis-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/file-read-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/todo-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/tool-chip.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/tool-lookup-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.tsx
  • packages/ui-kit-chat-tools/test/catalog-cards.browser.test.tsx
  • packages/ui-kit-chat-tools/test/new-tool-projection.browser.test.tsx
  • packages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsx
  • packages/ui-kit-chat-tools/test/page-tool-cards.browser.test.tsx
  • packages/ui-kit-chat-tools/test/registry-card-declarations.browser.test.tsx
  • packages/ui-kit-chat-tools/test/schema-params.test.ts
  • packages/ui-kit-chat/package.json
  • packages/ui-kit-chat/src/index.tsx
  • packages/ui-kit-chat/src/primitives/message/message.tsx
  • packages/ui-kit-chat/src/primitives/tools/schema-params.ts
  • packages/ui-kit-chat/src/primitives/tools/tool-presentation.ts
  • packages/ui-kit-chat/src/store/element-capture.fixtures.ts
  • packages/ui-kit-chat/src/store/tool-context.tsx
  • packages/ui-kit-chat/src/styled/chip.tsx
  • packages/ui-kit-chat/src/styled/collapsible-card.tsx
  • packages/ui-kit-chat/src/styled/element-preview.stories.tsx
  • packages/ui-kit-chat/src/styled/element-preview.tsx
  • packages/ui-kit-chat/src/styled/json-tree.tsx
  • packages/ui-kit-chat/src/styled/tool-card.tsx
  • packages/ui-kit-chat/src/styled/tool-fallback.stories.tsx
  • packages/ui-kit-chat/src/styled/tool-icon.tsx
  • packages/ui-kit-chat/src/styled/tools/inline-row.tsx
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.stories.tsx
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.tsx
  • packages/ui-kit-chat/src/styled/tools/note-row.tsx
  • packages/ui-kit-chat/src/styled/tools/permission-card.stories.tsx
  • packages/ui-kit-chat/src/styled/tools/permission-card.tsx
  • packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx
  • packages/ui-kit-chat/test/collapsible-card-shape.browser.test.tsx
  • packages/ui-kit-chat/test/element-preview.browser.test.tsx
  • packages/ui-kit-chat/test/meta-tool-card-error.browser.test.tsx
  • packages/ui-kit-chat/test/schema-params.test.ts
  • packages/ui-kit-chat/test/tool-call-card-dispatch.browser.test.tsx
  • packages/ui-kit-system/src/index.tsx
  • packages/ui-kit-system/src/json-tree-view.tsx
  • packages/ui-kit-system/src/select.tsx
  • packages/uno-preset/src/index.ts
  • packages/uno-preset/src/json-tree.ts
💤 Files with no reviewable changes (13)
  • packages/ui-kit-chat-tools/test/schema-params.test.ts
  • packages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsx
  • packages/ui-kit-chat-tools/src/styled/done-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.tsx
  • packages/ui-kit-chat-tools/src/primitives/tools/inline-tool.tsx
  • packages/ui-kit-chat-tools/src/styled/done-card.tsx
  • packages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsx
  • packages/protocol/src/done-types.ts
  • packages/ui-kit-chat-tools/src/styled/ui-chip-card.tsx
  • apps/conciv/src/pane/conciv-ui-card.tsx
  • packages/ui-kit-chat-tools/package.json
  • packages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.ts
🚧 Files skipped from review as they are similar to previous changes (158)
  • packages/embed/vite.config.ts
  • apps/storybook/package.json
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.tsx
  • packages/extension/test/tool-registry.test.ts
  • packages/ui-kit-system/src/json-tree-view.tsx
  • packages/tools/tsconfig.cards.build.json
  • apps/storybook/uno.config.ts
  • .fallowrc.json
  • packages/protocol/tsdown.config.ts
  • packages/extensions/page/.gitignore
  • apps/conciv/uno.config.ts
  • packages/ui-kit-chat-tools/src/styled/tools/tool-chip.stories.tsx
  • packages/extensions/page/src/client/cards/read-value-card.tsx
  • packages/core/src/chat/code-mode.ts
  • packages/ui-kit-system/src/index.tsx
  • packages/tools/src/cards/extensions-card.tsx
  • packages/ui-kit-chat/test/meta-tool-card-error.browser.test.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/tool-lookup-card.stories.tsx
  • packages/protocol/package.json
  • apps/storybook/.storybook/main.ts
  • packages/embed/test/helpers/page-plane-host.ts
  • packages/ui-kit-system/src/select.tsx
  • packages/extension/src/types.ts
  • apps/conciv/src/pane/session-captures.ts
  • packages/extension/src/define-tool.ts
  • packages/cli/src/tool-command.ts
  • packages/ui-kit-chat/test/schema-params.test.ts
  • packages/embed/uno.config.ts
  • packages/extensions/page/src/client/js-beautify-html.d.ts
  • packages/ui-kit-chat/test/tool-call-card-dispatch.browser.test.tsx
  • packages/core/test/chat/code-mode-parts.test.ts
  • packages/tools/package.json
  • packages/extensions/page/src/client/cards/act-card.stories.tsx
  • packages/core/tsconfig.cards.json
  • packages/db/src/index.ts
  • packages/extensions/page/tsdown.config.ts
  • packages/uno-preset/src/json-tree.ts
  • apps/conciv/package.json
  • packages/ui-kit-chat/src/styled/tools/permission-card.stories.tsx
  • packages/core/src/api/mcp.ts
  • packages/ui-kit-chat-tools/test/page-tool-cards.browser.test.tsx
  • packages/extensions/page/src/client/page-format.ts
  • packages/extension-testkit/src/card-harness.tsx
  • packages/core/test/chat/code-mode-reload-fold.it.test.ts
  • packages/ui-kit-chat-tools/src/styled/tools/bash-card.stories.tsx
  • packages/core/src/api/rpc/sessions.ts
  • apps/conciv/test/helpers/fake-core.ts
  • packages/extensions/page/src/client/cards/effect-card.tsx
  • packages/protocol/src/page-types.ts
  • packages/ui-kit-chat/src/styled/tool-card.tsx
  • packages/tools/tsconfig.cards.json
  • packages/extensions/page/src/client/cards/edit-live-card.stories.tsx
  • packages/extensions/page/src/client/cards/react-card.tsx
  • packages/core/vite.config.ts
  • packages/db/test/capture-queries.test.ts
  • packages/embed/test/embed.it.test.ts
  • packages/tools/uno.config.ts
  • packages/embed/test/mount-externals.test.ts
  • packages/extensions/page/src/client.tsx
  • packages/extensions/page/src/client/cards/effect-card.stories.tsx
  • packages/ui-kit-chat/src/styled/json-tree.tsx
  • packages/core/test/api/page/tool-capture.it.test.ts
  • packages/core/tsconfig.cards.build.json
  • packages/uno-preset/src/index.ts
  • packages/extensions/page/tsconfig.json
  • packages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.stories.tsx
  • packages/core/src/cards.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/todo-card.stories.tsx
  • packages/extensions/page/src/client/cards/story.fixtures.ts
  • packages/tools/vite.config.ts
  • packages/ui-kit-chat-tools/src/styled/tools/apply-patch-diff.stories.tsx
  • packages/extensions/page/src/client/cards/react-card.stories.tsx
  • packages/tools/src/cards.tsx
  • packages/core/src/chat/capabilities.ts
  • packages/ui-kit-chat/src/store/element-capture.fixtures.ts
  • packages/ui-kit-chat/src/styled/tools/permission-card.tsx
  • packages/extensions/page/tsconfig.build.json
  • packages/extension/src/tool-registry.ts
  • packages/core/test/builtin-tool-calls.test.ts
  • packages/extensions/page/tsconfig.refs.json
  • packages/page/src/page-driver.ts
  • docs/superpowers/specs/2026-08-09-conciv-ui-card-unification-design.md
  • packages/ui-kit-chat/src/primitives/message/message.tsx
  • packages/protocol/src/chat-types.ts
  • packages/extensions/page/uno.config.ts
  • packages/ui-kit-chat/src/store/tool-context.tsx
  • packages/harness-testkit/src/call-tool.ts
  • packages/ui-kit-chat/src/styled/tool-fallback.stories.tsx
  • apps/conciv/test/helpers/fake-core-router.ts
  • packages/extensions/page/src/client/cards/read-bulk-card.tsx
  • packages/ui-kit-chat/src/styled/element-preview.tsx
  • packages/ui-kit-chat/src/styled/chip.tsx
  • packages/ui-kit-chat/src/styled/tools/tool-call-card.tsx
  • packages/tools/src/cards/ui-card.stories.tsx
  • packages/ui-kit-chat/src/styled/collapsible-card.tsx
  • apps/conciv/test/tool-card-dispatch.browser.test.tsx
  • packages/extensions/page/src/client/cards/act-card.tsx
  • packages/tools/src/cards/open-card.tsx
  • packages/extensions/page/test/defs.test.ts
  • packages/ui-kit-chat/src/styled/tool-icon.tsx
  • apps/conciv/test/kit-controls.browser.test.tsx
  • packages/extensions/page/vite.config.ts
  • packages/ui-kit-chat-tools/src/styled/tools/file-read-card.stories.tsx
  • packages/extensions/whiteboard/src/client/model/comments.tsx
  • packages/db/drizzle/20260808214400_tool_captures/snapshot.json
  • packages/core/src/api/rpc/router.ts
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.stories.tsx
  • packages/ui-kit-chat/test/collapsible-card-shape.browser.test.tsx
  • packages/extensions/page/test/tsconfig.json
  • packages/page/src/element-descriptor.ts
  • packages/page/package.json
  • packages/ui-kit-chat-tools/test/registry-card-declarations.browser.test.tsx
  • packages/tools/src/cards/inline-cards.stories.tsx
  • packages/core/uno.config.ts
  • packages/protocol/src/tool-view-types.ts
  • packages/core/src/chat/code-mode-parts.ts
  • packages/page/src/element-capture.ts
  • packages/ui-kit-chat-tools/src/styled/tools/discovered-apis-card.stories.tsx
  • packages/page/src/page-snapshot.ts
  • packages/ui-kit-chat-tools/src/primitives/tools/now-title.ts
  • packages/extensions/page/src/client/cards/shared.tsx
  • packages/core/src/page-bus.ts
  • packages/core/src/cards/code-run-card.stories.tsx
  • packages/contract/src/contract.ts
  • packages/core/package.json
  • packages/ui-kit-chat/src/primitives/tools/tool-presentation.ts
  • packages/extension/src/collect-client.ts
  • packages/core/src/api/execute-schemas.ts
  • packages/protocol/src/element-capture-types.ts
  • packages/extensions/page/src/client/page-result-views.stories.tsx
  • packages/core/src/tool-registry.ts
  • packages/ui-kit-chat/src/styled/tools/inline-row.tsx
  • packages/extensions/page/src/shared/defs.ts
  • packages/extensions/page/src/client/cards/read-bulk-card.stories.tsx
  • packages/db/src/capture-queries.ts
  • apps/conciv/src/pane/tool-view-ctx.ts
  • packages/db/src/run-queries.ts
  • packages/page/src/page-tool-dispatcher.ts
  • packages/ui-kit-chat/src/primitives/tools/schema-params.ts
  • packages/extensions/page/src/client/cards/read-value-card.stories.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.stories.tsx
  • packages/ui-kit-chat/src/index.tsx
  • packages/ui-kit-chat/src/styled/tools/meta-tool-card.tsx
  • packages/ui-kit-chat/src/styled/tools/note-row.tsx
  • packages/core/src/app.ts
  • packages/extensions/page/src/client/cards/edit-live-card.tsx
  • packages/extensions/test-runner/test/test-card.browser.test.tsx
  • packages/core/test/client-tool-gate.test.ts
  • packages/page/test/page-dispatcher.browser.test.ts
  • apps/conciv/src/pane/chat-pane.tsx
  • packages/ui-kit-chat-tools/test/new-tool-projection.browser.test.tsx
  • packages/ui-kit-chat-tools/src/index.tsx
  • packages/ui-kit-chat-tools/src/styled/tools/inline-tool.tsx
  • packages/core/src/cards/code-run-card.tsx
  • packages/extensions/page/package.json
  • packages/core/test/chat/approving-call-post-result-traffic.it.test.ts
  • packages/ui-kit-chat/src/styled/element-preview.stories.tsx
  • packages/ui-kit-chat/package.json

Comment thread packages/page/src/css-bundle.ts Resolved
omridevk and others added 5 commits August 10, 2026 19:18
…s.tsx entry, tighten capture assertions

openPagePlaneHost leaked its RPC observer and an unclosable page if setup
rejected; wrap it in try/finally and close the page on the failure path. The
UnoCSS content glob covered core/src/cards/** but missed the top-level
cards.tsx entry, so its own utility classes never made it into the embed
bundle. The element-capture IT assertions also only checked one side of a
before/after edit, searched the whole session for password redaction instead
of scoping to the touched element, and compared a read verb's captures by
count against a fabricated tool-call id instead of by row identity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mode IT

Harness workdirs are sandbox-virtual and default to /workspace; passing a
host tmpdir() as cwd nests a junk Users/... tree inside the sandbox.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… configs

The wildcard **/vite.config.ts pattern excluded every vite config from
fallow's audit, including build configs this PR didn't need excluded.
Scope it to the three new vite.config.ts files (core, extensions/page,
tools) that actually need it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
markdownlint MD040 flagged both fences as language-neutral without a tag.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The old-socket frame snapshot was read BEFORE rebindHandle instead of
after, so client frames legitimately in flight during the rebind
window (in-flight rpc, subscription traffic) inflated the "after"
count and flaked the assertion, near-100% on CI's slower runners.

Move the snapshot to after the rebind has settled (proxyF.base
visible), then drive one more real chat round-trip against the NEW
core and assert it completes there via the rpc observer before
re-checking the old socket's frame count is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Copilot reviewed 190 out of 195 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (2)

packages/protocol/src/element-capture-types.ts:70

  • Before/after captures can reference different stylesheet hashes (the dispatcher explicitly records one bundle per side), but this view collapses both to one css value and overwrites it in database row order. EditLiveCard then renders both previews with that same CSS, so a tool that injects or edits styles shows at least one frozen state with the wrong stylesheet. Preserve CSS per side when constructing the view and pass each preview its matching bundle.
    packages/harness-testkit/src/call-tool.ts:134
  • Awaiting the original pump promise rethrows subscription or abort errors and can replace a successful run() result with the approval-pump failure. The earlier pump.catch(() => {}) only registers a handler; it does not make subsequent await pump non-throwing. Keep cleanup failures best-effort as before.

Comment thread packages/page/src/element-descriptor.ts Resolved
omridevk and others added 3 commits August 10, 2026 19:53
… captures

page.value and page.fill returned el.value verbatim even for password/card
inputs, leaking what the descriptor masking already hid from captures. Reuse
the same isSensitiveField predicate (now exported from @conciv/page) to mask
the returned value too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…itizer

The url()/image-set() check on captured inline styles was bypassable with a
CSS escape (u\72l(...) decodes to url(...) in a real stylesheet). protocol
is DOM-free so there's no CSS parser to unescape it properly; conservatively
drop any inline style containing a backslash instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
vitest's shared-Chromium browser project (fileParallelism: false) has
had its websocket die around router-restore.browser.test.ts in 7/7
recent CI failures, stranding the next file's createTesters call on a
closed birpc channel (vitest-dev/vitest#10791, no released fix). Add a
custom sequencer that runs that suite last, so a dead session has no
subsequent file to strand.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-array-sort autofix

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@omridevk
omridevk merged commit e2a4859 into main Aug 10, 2026
25 checks passed
@omridevk
omridevk deleted the feat/tool-cards branch August 10, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants