Repository navigation
feat(tool-cards): render the element page/extension tools acted on - #348
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe 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. ChangesTool cards and frozen captures
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
Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Adds metadata-driven tool cards so declared page and extension tools no longer fall back to raw tool rendering.
Changes:
- Adds
MetaToolCardand layered card dispatch with approval support. - Expands registry metadata with schemas, errors, and approval details.
- Removes obsolete
conciv_pagecards 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.
There was a problem hiding this comment.
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-containerimplementation 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 necessarilyundefined, so an existingpage.*call temporarily renders throughToolFallback(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
sis an abbreviated identifier, which this repository’s TypeScript conventions prohibit. Rename it to a self-explanatory name such asselectorand 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-containertag 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>insideCollapsible.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>
)}
There was a problem hiding this comment.
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
bodycan persist an unbounded rrweb tree; every session load then returns all such trees throughcaptures.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;takeElementCapturethen 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.
makeCssBundleDeduperremembers 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 PageCaptureBundlehas only onecssBundle, but this loop can capture different stylesheets before and after an edit. The second new hash overwrites the first bundle while thebeforecapture still references its old hash, andToolCaptureViewthen 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-chatentry 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.
There was a problem hiding this comment.
Actionable comments posted: 15
🧹 Nitpick comments (8)
packages/ui-kit-chat/test/element-preview.browser.test.tsx (1)
180-203: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winExercise each hostile execution path.
This test does not click either link. It does not assert that
onerrorandonclickattributes are removed. It only checks the malformedjava\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 thatXSS_FLAGremains 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 winAdd a non-unique
session_idindex and generate the migration.
sessionCapturesanddeleteSessionCapturesfilter bytool_captures.session_id. The composite primary key(tool_call_id, kind)cannot support these lookups, so SQLite scans the table. Declareindex('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 | 🔵 TrivialConsider indexing
tool_captures.session_id.The snapshot declares only the composite primary key
(tool_call_id, kind). Capture reload and session cleanup filter bysession_id, which requires a full table scan without an index. Add an index inpackages/db/src/schema.tsand regenerate the migration if those access paths exist. The same applies tocss_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 winAlso 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 onerrorand theiframe srcdocscript 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 winAssert the tool output and the latency the test name claims.
JSON.stringify(outcome)contains'target'even if the outcome only echoes the inputelementId. The test also states "resolves quickly", but only the 8 s timeout bounds the duration, and the noise stream lasts about 900 ms. Assert theremovedfield 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 winInline only
@conciv/core/cards.
@conciv/coreresolves to the server entry, while the widget uses the browser-safe@conciv/core/cardsentry. The current prefix also inlines@conciv/core/appand 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 valueRemove the
as constassertion.
MIRROR_VERBSis 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 prohibitsas.🤖 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 winThe inherited
captureprop is silently ignored.
ToolCallCardPropsextendsOmit<ToolCardProps, 'addResult'>, so it still declares an optionalcapturefield. Line 35 always resolves the capture fromprops.ctx.captureFor. A caller that passescapturedirectly gets no effect and no type error.Either prefer the explicit prop, or omit
capturefrom 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (185)
.fallowrc.jsonapps/conciv/package.jsonapps/conciv/src/pane/chat-pane.tsxapps/conciv/src/pane/conciv-ui-card.tsxapps/conciv/src/pane/session-captures.tsapps/conciv/src/pane/tool-view-ctx.tsapps/conciv/test/helpers/fake-core-router.tsapps/conciv/test/helpers/fake-core.tsapps/conciv/test/kit-controls.browser.test.tsxapps/conciv/test/tool-card-dispatch.browser.test.tsxapps/conciv/uno.config.tsapps/storybook/.storybook/main.tsapps/storybook/package.jsonapps/storybook/uno.config.tsdocs/superpowers/specs/2026-08-08-page-tool-cards-design.mddocs/superpowers/specs/2026-08-09-conciv-ui-card-unification-design.mdpackages/cli/src/tool-command.tspackages/contract/src/contract.tspackages/core/package.jsonpackages/core/src/api/execute-schemas.tspackages/core/src/api/mcp.tspackages/core/src/api/rpc/router.tspackages/core/src/api/rpc/sessions.tspackages/core/src/app.tspackages/core/src/cards.tsxpackages/core/src/cards/code-run-card.stories.tsxpackages/core/src/cards/code-run-card.tsxpackages/core/src/chat/capabilities.tspackages/core/src/chat/code-mode-parts.tspackages/core/src/chat/code-mode.tspackages/core/src/page-bus.tspackages/core/src/tool-registry.tspackages/core/test/api/page/tool-capture.it.test.tspackages/core/test/builtin-tool-calls.test.tspackages/core/test/chat/approving-call-post-result-traffic.it.test.tspackages/core/test/chat/code-mode-parts.test.tspackages/core/test/chat/code-mode-reload-fold.it.test.tspackages/core/test/client-tool-gate.test.tspackages/core/tsconfig.cards.build.jsonpackages/core/tsconfig.cards.jsonpackages/core/uno.config.tspackages/core/vite.config.tspackages/db/drizzle/20260808214400_tool_captures/migration.sqlpackages/db/drizzle/20260808214400_tool_captures/snapshot.jsonpackages/db/src/capture-queries.tspackages/db/src/index.tspackages/db/src/run-queries.tspackages/db/src/schema.tspackages/db/test/capture-queries.test.tspackages/embed/test/element-capture.it.test.tspackages/embed/test/embed.it.test.tspackages/embed/test/helpers/page-plane-host.tspackages/embed/test/mount-externals.test.tspackages/embed/uno.config.tspackages/embed/vite.config.tspackages/extension-testkit/src/card-harness.tsxpackages/extension/src/collect-client.tspackages/extension/src/define-tool.tspackages/extension/src/tool-registry.tspackages/extension/src/types.tspackages/extension/test/tool-registry.test.tspackages/extensions/page/.gitignorepackages/extensions/page/package.jsonpackages/extensions/page/src/client.tsxpackages/extensions/page/src/client/bodies.tspackages/extensions/page/src/client/cards/act-card.stories.tsxpackages/extensions/page/src/client/cards/act-card.tsxpackages/extensions/page/src/client/cards/console-card.stories.tsxpackages/extensions/page/src/client/cards/console-card.tsxpackages/extensions/page/src/client/cards/edit-live-card.stories.tsxpackages/extensions/page/src/client/cards/edit-live-card.tsxpackages/extensions/page/src/client/cards/effect-card.stories.tsxpackages/extensions/page/src/client/cards/effect-card.tsxpackages/extensions/page/src/client/cards/react-card.stories.tsxpackages/extensions/page/src/client/cards/react-card.tsxpackages/extensions/page/src/client/cards/read-bulk-card.stories.tsxpackages/extensions/page/src/client/cards/read-bulk-card.tsxpackages/extensions/page/src/client/cards/read-value-card.stories.tsxpackages/extensions/page/src/client/cards/read-value-card.tsxpackages/extensions/page/src/client/cards/shared.tsxpackages/extensions/page/src/client/cards/story.fixtures.tspackages/extensions/page/src/client/js-beautify-html.d.tspackages/extensions/page/src/client/page-format.tspackages/extensions/page/src/client/page-result-views.stories.tsxpackages/extensions/page/src/client/page-result-views.tsxpackages/extensions/page/src/shared/defs.tspackages/extensions/page/test/defs.test.tspackages/extensions/page/test/tsconfig.jsonpackages/extensions/page/tsconfig.build.jsonpackages/extensions/page/tsconfig.jsonpackages/extensions/page/tsconfig.refs.jsonpackages/extensions/page/tsdown.config.tspackages/extensions/page/uno.config.tspackages/extensions/page/vite.config.tspackages/extensions/test-runner/test/test-card.browser.test.tsxpackages/extensions/whiteboard/src/client/model/comments.tsxpackages/harness-testkit/src/call-tool.tspackages/page/package.jsonpackages/page/src/css-bundle.tspackages/page/src/element-capture.tspackages/page/src/element-descriptor.tspackages/page/src/page-driver.tspackages/page/src/page-snapshot.tspackages/page/src/page-tool-dispatcher.tspackages/page/test/css-bundle.test.tspackages/page/test/element-capture.browser.test.tspackages/page/test/page-dispatcher.browser.test.tspackages/protocol/package.jsonpackages/protocol/src/chat-types.tspackages/protocol/src/done-types.tspackages/protocol/src/element-capture-types.tspackages/protocol/src/page-types.tspackages/protocol/src/tool-view-types.tspackages/protocol/tsdown.config.tspackages/tools/package.jsonpackages/tools/src/cards.tsxpackages/tools/src/cards/extensions-card.tsxpackages/tools/src/cards/inline-cards.stories.tsxpackages/tools/src/cards/open-card.tsxpackages/tools/src/cards/ui-card.stories.tsxpackages/tools/src/cards/ui-card.tsxpackages/tools/tsconfig.cards.build.jsonpackages/tools/tsconfig.cards.jsonpackages/tools/uno.config.tspackages/tools/vite.config.tspackages/ui-kit-chat-tools/package.jsonpackages/ui-kit-chat-tools/src/index.tsxpackages/ui-kit-chat-tools/src/primitives/tools/inline-tool.tsxpackages/ui-kit-chat-tools/src/primitives/tools/now-title.tspackages/ui-kit-chat-tools/src/styled/done-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/done-card.tsxpackages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/page-action-card.tsxpackages/ui-kit-chat-tools/src/styled/tools/apply-patch-diff.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/bash-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.tspackages/ui-kit-chat-tools/src/styled/tools/discovered-apis-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/file-read-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/inline-tool.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/inline-tool.tsxpackages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.tsxpackages/ui-kit-chat-tools/src/styled/tools/todo-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/tool-chip.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/tool-lookup-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/ui-chip-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/ui-chip-card.tsxpackages/ui-kit-chat-tools/test/catalog-cards.browser.test.tsxpackages/ui-kit-chat-tools/test/new-tool-projection.browser.test.tsxpackages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsxpackages/ui-kit-chat-tools/test/page-tool-cards.browser.test.tsxpackages/ui-kit-chat-tools/test/registry-card-declarations.browser.test.tsxpackages/ui-kit-chat-tools/test/schema-params.test.tspackages/ui-kit-chat/package.jsonpackages/ui-kit-chat/src/index.tsxpackages/ui-kit-chat/src/primitives/message/message.tsxpackages/ui-kit-chat/src/primitives/tools/schema-params.tspackages/ui-kit-chat/src/primitives/tools/tool-presentation.tspackages/ui-kit-chat/src/store/element-capture.fixtures.tspackages/ui-kit-chat/src/store/tool-context.tsxpackages/ui-kit-chat/src/styled/chip.tsxpackages/ui-kit-chat/src/styled/collapsible-card.tsxpackages/ui-kit-chat/src/styled/element-preview.stories.tsxpackages/ui-kit-chat/src/styled/element-preview.tsxpackages/ui-kit-chat/src/styled/json-tree.tsxpackages/ui-kit-chat/src/styled/tool-card.tsxpackages/ui-kit-chat/src/styled/tool-fallback.stories.tsxpackages/ui-kit-chat/src/styled/tool-icon.tsxpackages/ui-kit-chat/src/styled/tools/inline-row.tsxpackages/ui-kit-chat/src/styled/tools/meta-tool-card.stories.tsxpackages/ui-kit-chat/src/styled/tools/meta-tool-card.tsxpackages/ui-kit-chat/src/styled/tools/note-row.tsxpackages/ui-kit-chat/src/styled/tools/permission-card.stories.tsxpackages/ui-kit-chat/src/styled/tools/permission-card.tsxpackages/ui-kit-chat/src/styled/tools/tool-call-card.tsxpackages/ui-kit-chat/test/collapsible-card-shape.browser.test.tsxpackages/ui-kit-chat/test/element-preview.browser.test.tsxpackages/ui-kit-chat/test/meta-tool-card-error.browser.test.tsxpackages/ui-kit-chat/test/schema-params.test.tspackages/ui-kit-chat/test/tool-call-card-dispatch.browser.test.tsxpackages/ui-kit-system/src/index.tsxpackages/ui-kit-system/src/json-tree-view.tsxpackages/ui-kit-system/src/select.tsxpackages/uno-preset/src/index.tspackages/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
There was a problem hiding this comment.
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/hrefURLs, and arbitrary page CSS can containurl()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, sinceinertonly 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.erroris 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'serrors, 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
buildChatToolscreates theToolRequestatpackages/core/src/chat/runtime.ts:102without atoolCallId. Only code-mode calls currently add one, so directpage.*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
bodyor 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.
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
packages/embed/test/element-capture.it.test.ts (1)
19-28: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winCreate a fresh session for each test.
sessionIdis created once inbeforeAll, 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 inbeforeEach/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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (185)
.fallowrc.jsonapps/conciv/package.jsonapps/conciv/src/pane/chat-pane.tsxapps/conciv/src/pane/conciv-ui-card.tsxapps/conciv/src/pane/session-captures.tsapps/conciv/src/pane/tool-view-ctx.tsapps/conciv/test/helpers/fake-core-router.tsapps/conciv/test/helpers/fake-core.tsapps/conciv/test/kit-controls.browser.test.tsxapps/conciv/test/tool-card-dispatch.browser.test.tsxapps/conciv/uno.config.tsapps/storybook/.storybook/main.tsapps/storybook/package.jsonapps/storybook/uno.config.tsdocs/superpowers/specs/2026-08-08-page-tool-cards-design.mddocs/superpowers/specs/2026-08-09-conciv-ui-card-unification-design.mdpackages/cli/src/tool-command.tspackages/contract/src/contract.tspackages/core/package.jsonpackages/core/src/api/execute-schemas.tspackages/core/src/api/mcp.tspackages/core/src/api/rpc/router.tspackages/core/src/api/rpc/sessions.tspackages/core/src/app.tspackages/core/src/cards.tsxpackages/core/src/cards/code-run-card.stories.tsxpackages/core/src/cards/code-run-card.tsxpackages/core/src/chat/capabilities.tspackages/core/src/chat/code-mode-parts.tspackages/core/src/chat/code-mode.tspackages/core/src/page-bus.tspackages/core/src/tool-registry.tspackages/core/test/api/page/tool-capture.it.test.tspackages/core/test/builtin-tool-calls.test.tspackages/core/test/chat/approving-call-post-result-traffic.it.test.tspackages/core/test/chat/code-mode-parts.test.tspackages/core/test/chat/code-mode-reload-fold.it.test.tspackages/core/test/client-tool-gate.test.tspackages/core/tsconfig.cards.build.jsonpackages/core/tsconfig.cards.jsonpackages/core/uno.config.tspackages/core/vite.config.tspackages/db/drizzle/20260808214400_tool_captures/migration.sqlpackages/db/drizzle/20260808214400_tool_captures/snapshot.jsonpackages/db/src/capture-queries.tspackages/db/src/index.tspackages/db/src/run-queries.tspackages/db/src/schema.tspackages/db/test/capture-queries.test.tspackages/embed/test/element-capture.it.test.tspackages/embed/test/embed.it.test.tspackages/embed/test/helpers/page-plane-host.tspackages/embed/test/mount-externals.test.tspackages/embed/uno.config.tspackages/embed/vite.config.tspackages/extension-testkit/src/card-harness.tsxpackages/extension/src/collect-client.tspackages/extension/src/define-tool.tspackages/extension/src/tool-registry.tspackages/extension/src/types.tspackages/extension/test/tool-registry.test.tspackages/extensions/page/.gitignorepackages/extensions/page/package.jsonpackages/extensions/page/src/client.tsxpackages/extensions/page/src/client/bodies.tspackages/extensions/page/src/client/cards/act-card.stories.tsxpackages/extensions/page/src/client/cards/act-card.tsxpackages/extensions/page/src/client/cards/console-card.stories.tsxpackages/extensions/page/src/client/cards/console-card.tsxpackages/extensions/page/src/client/cards/edit-live-card.stories.tsxpackages/extensions/page/src/client/cards/edit-live-card.tsxpackages/extensions/page/src/client/cards/effect-card.stories.tsxpackages/extensions/page/src/client/cards/effect-card.tsxpackages/extensions/page/src/client/cards/react-card.stories.tsxpackages/extensions/page/src/client/cards/react-card.tsxpackages/extensions/page/src/client/cards/read-bulk-card.stories.tsxpackages/extensions/page/src/client/cards/read-bulk-card.tsxpackages/extensions/page/src/client/cards/read-value-card.stories.tsxpackages/extensions/page/src/client/cards/read-value-card.tsxpackages/extensions/page/src/client/cards/shared.tsxpackages/extensions/page/src/client/cards/story.fixtures.tspackages/extensions/page/src/client/js-beautify-html.d.tspackages/extensions/page/src/client/page-format.tspackages/extensions/page/src/client/page-result-views.stories.tsxpackages/extensions/page/src/client/page-result-views.tsxpackages/extensions/page/src/shared/defs.tspackages/extensions/page/test/defs.test.tspackages/extensions/page/test/tsconfig.jsonpackages/extensions/page/tsconfig.build.jsonpackages/extensions/page/tsconfig.jsonpackages/extensions/page/tsconfig.refs.jsonpackages/extensions/page/tsdown.config.tspackages/extensions/page/uno.config.tspackages/extensions/page/vite.config.tspackages/extensions/test-runner/test/test-card.browser.test.tsxpackages/extensions/whiteboard/src/client/model/comments.tsxpackages/harness-testkit/src/call-tool.tspackages/page/package.jsonpackages/page/src/css-bundle.tspackages/page/src/element-capture.tspackages/page/src/element-descriptor.tspackages/page/src/page-driver.tspackages/page/src/page-snapshot.tspackages/page/src/page-tool-dispatcher.tspackages/page/test/css-bundle.test.tspackages/page/test/element-capture.browser.test.tspackages/page/test/page-dispatcher.browser.test.tspackages/protocol/package.jsonpackages/protocol/src/chat-types.tspackages/protocol/src/done-types.tspackages/protocol/src/element-capture-types.tspackages/protocol/src/page-types.tspackages/protocol/src/tool-view-types.tspackages/protocol/tsdown.config.tspackages/tools/package.jsonpackages/tools/src/cards.tsxpackages/tools/src/cards/extensions-card.tsxpackages/tools/src/cards/inline-cards.stories.tsxpackages/tools/src/cards/open-card.tsxpackages/tools/src/cards/ui-card.stories.tsxpackages/tools/src/cards/ui-card.tsxpackages/tools/tsconfig.cards.build.jsonpackages/tools/tsconfig.cards.jsonpackages/tools/uno.config.tspackages/tools/vite.config.tspackages/ui-kit-chat-tools/package.jsonpackages/ui-kit-chat-tools/src/index.tsxpackages/ui-kit-chat-tools/src/primitives/tools/inline-tool.tsxpackages/ui-kit-chat-tools/src/primitives/tools/now-title.tspackages/ui-kit-chat-tools/src/styled/done-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/done-card.tsxpackages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/page-action-card.tsxpackages/ui-kit-chat-tools/src/styled/tools/apply-patch-diff.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/bash-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.tspackages/ui-kit-chat-tools/src/styled/tools/discovered-apis-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/file-read-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/inline-tool.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/inline-tool.tsxpackages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.tsxpackages/ui-kit-chat-tools/src/styled/tools/todo-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/tool-chip.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/tool-lookup-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/ui-chip-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/ui-chip-card.tsxpackages/ui-kit-chat-tools/test/catalog-cards.browser.test.tsxpackages/ui-kit-chat-tools/test/new-tool-projection.browser.test.tsxpackages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsxpackages/ui-kit-chat-tools/test/page-tool-cards.browser.test.tsxpackages/ui-kit-chat-tools/test/registry-card-declarations.browser.test.tsxpackages/ui-kit-chat-tools/test/schema-params.test.tspackages/ui-kit-chat/package.jsonpackages/ui-kit-chat/src/index.tsxpackages/ui-kit-chat/src/primitives/message/message.tsxpackages/ui-kit-chat/src/primitives/tools/schema-params.tspackages/ui-kit-chat/src/primitives/tools/tool-presentation.tspackages/ui-kit-chat/src/store/element-capture.fixtures.tspackages/ui-kit-chat/src/store/tool-context.tsxpackages/ui-kit-chat/src/styled/chip.tsxpackages/ui-kit-chat/src/styled/collapsible-card.tsxpackages/ui-kit-chat/src/styled/element-preview.stories.tsxpackages/ui-kit-chat/src/styled/element-preview.tsxpackages/ui-kit-chat/src/styled/json-tree.tsxpackages/ui-kit-chat/src/styled/tool-card.tsxpackages/ui-kit-chat/src/styled/tool-fallback.stories.tsxpackages/ui-kit-chat/src/styled/tool-icon.tsxpackages/ui-kit-chat/src/styled/tools/inline-row.tsxpackages/ui-kit-chat/src/styled/tools/meta-tool-card.stories.tsxpackages/ui-kit-chat/src/styled/tools/meta-tool-card.tsxpackages/ui-kit-chat/src/styled/tools/note-row.tsxpackages/ui-kit-chat/src/styled/tools/permission-card.stories.tsxpackages/ui-kit-chat/src/styled/tools/permission-card.tsxpackages/ui-kit-chat/src/styled/tools/tool-call-card.tsxpackages/ui-kit-chat/test/collapsible-card-shape.browser.test.tsxpackages/ui-kit-chat/test/element-preview.browser.test.tsxpackages/ui-kit-chat/test/meta-tool-card-error.browser.test.tsxpackages/ui-kit-chat/test/schema-params.test.tspackages/ui-kit-chat/test/tool-call-card-dispatch.browser.test.tsxpackages/ui-kit-system/src/index.tsxpackages/ui-kit-system/src/json-tree-view.tsxpackages/ui-kit-system/src/select.tsxpackages/uno-preset/src/index.tspackages/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
e3c3692 to
7377aa4
Compare
|
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. |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
packages/page/test/element-capture.browser.test.ts (1)
24-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the repeated
as constassertions.Return a contextually typed success literal, or define a typed success-result helper. Confirm that
defineTool().client()retains theok: trueoutput type after this change.
packages/page/test/element-capture.browser.test.ts#L24-L27: removetrue as constfromactFill.packages/page/test/element-capture.browser.test.ts#L36-L39: removetrue as constfromeditText.packages/page/test/element-capture.browser.test.ts#L47-L50: removetrue as constfromeditRemove.packages/page/test/element-capture.browser.test.ts#L58-L66: removetrue as constfromeditStyled.packages/page/test/element-capture.browser.test.ts#L74-L77: removetrue as constfromactMark.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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (192)
.fallowrc.jsonapps/conciv/package.jsonapps/conciv/src/pane/chat-pane.tsxapps/conciv/src/pane/conciv-ui-card.tsxapps/conciv/src/pane/session-captures.tsapps/conciv/src/pane/tool-view-ctx.tsapps/conciv/test/helpers/fake-core-router.tsapps/conciv/test/helpers/fake-core.tsapps/conciv/test/kit-controls.browser.test.tsxapps/conciv/test/tool-card-dispatch.browser.test.tsxapps/conciv/uno.config.tsapps/storybook/.storybook/main.tsapps/storybook/package.jsonapps/storybook/uno.config.tsdocs/superpowers/specs/2026-08-08-page-tool-cards-design.mddocs/superpowers/specs/2026-08-09-conciv-ui-card-unification-design.mdpackages/cli/src/tool-command.tspackages/contract/src/contract.tspackages/core/package.jsonpackages/core/src/api/execute-schemas.tspackages/core/src/api/mcp.tspackages/core/src/api/rpc/router.tspackages/core/src/api/rpc/sessions.tspackages/core/src/app.tspackages/core/src/cards.tsxpackages/core/src/cards/code-run-card.stories.tsxpackages/core/src/cards/code-run-card.tsxpackages/core/src/chat/capabilities.tspackages/core/src/chat/code-mode-parts.tspackages/core/src/chat/code-mode.tspackages/core/src/chat/runtime.tspackages/core/src/page-bus.tspackages/core/src/tool-registry.tspackages/core/test/api/page/tool-capture.it.test.tspackages/core/test/builtin-tool-calls.test.tspackages/core/test/chat/approving-call-post-result-traffic.it.test.tspackages/core/test/chat/code-mode-parts.it.test.tspackages/core/test/chat/code-mode-parts.test.tspackages/core/test/chat/code-mode-reload-fold.it.test.tspackages/core/test/client-tool-gate.test.tspackages/core/test/extension-tool-call-id.it.test.tspackages/core/tsconfig.cards.build.jsonpackages/core/tsconfig.cards.jsonpackages/core/uno.config.tspackages/core/vite.config.tspackages/db/drizzle/20260808214400_tool_captures/migration.sqlpackages/db/drizzle/20260808214400_tool_captures/snapshot.jsonpackages/db/src/capture-queries.tspackages/db/src/index.tspackages/db/src/run-queries.tspackages/db/src/schema.tspackages/db/test/capture-queries.test.tspackages/embed/test/element-capture.it.test.tspackages/embed/test/embed.it.test.tspackages/embed/test/helpers/page-plane-host.tspackages/embed/test/mount-externals.test.tspackages/embed/uno.config.tspackages/embed/vite.config.tspackages/extension-testkit/src/card-harness.tsxpackages/extension/src/collect-client.tspackages/extension/src/define-tool.tspackages/extension/src/tool-registry.tspackages/extension/src/types.tspackages/extension/test/tool-registry.test.tspackages/extensions/page/.gitignorepackages/extensions/page/package.jsonpackages/extensions/page/src/client.tsxpackages/extensions/page/src/client/bodies.tspackages/extensions/page/src/client/cards/act-card.stories.tsxpackages/extensions/page/src/client/cards/act-card.tsxpackages/extensions/page/src/client/cards/console-card.stories.tsxpackages/extensions/page/src/client/cards/console-card.tsxpackages/extensions/page/src/client/cards/edit-live-card.stories.tsxpackages/extensions/page/src/client/cards/edit-live-card.tsxpackages/extensions/page/src/client/cards/effect-card.stories.tsxpackages/extensions/page/src/client/cards/effect-card.tsxpackages/extensions/page/src/client/cards/react-card.stories.tsxpackages/extensions/page/src/client/cards/react-card.tsxpackages/extensions/page/src/client/cards/read-bulk-card.stories.tsxpackages/extensions/page/src/client/cards/read-bulk-card.tsxpackages/extensions/page/src/client/cards/read-value-card.stories.tsxpackages/extensions/page/src/client/cards/read-value-card.tsxpackages/extensions/page/src/client/cards/shared.tsxpackages/extensions/page/src/client/cards/story.fixtures.tspackages/extensions/page/src/client/js-beautify-html.d.tspackages/extensions/page/src/client/page-format.tspackages/extensions/page/src/client/page-result-views.stories.tsxpackages/extensions/page/src/client/page-result-views.tsxpackages/extensions/page/src/shared/defs.tspackages/extensions/page/test/defs.test.tspackages/extensions/page/test/tsconfig.jsonpackages/extensions/page/tsconfig.build.jsonpackages/extensions/page/tsconfig.jsonpackages/extensions/page/tsconfig.refs.jsonpackages/extensions/page/tsdown.config.tspackages/extensions/page/uno.config.tspackages/extensions/page/vite.config.tspackages/extensions/test-runner/test/test-card.browser.test.tsxpackages/extensions/whiteboard/src/client/model/comments.tsxpackages/harness-testkit/src/call-tool.tspackages/harness-testkit/src/scripted-run.tspackages/harness-testkit/test/scripted-run.test.tspackages/page/package.jsonpackages/page/src/css-bundle.tspackages/page/src/element-capture.tspackages/page/src/element-descriptor.tspackages/page/src/page-driver.tspackages/page/src/page-snapshot.tspackages/page/src/page-tool-dispatcher.tspackages/page/test/css-bundle.test.tspackages/page/test/element-capture.browser.test.tspackages/page/test/page-dispatcher.browser.test.tspackages/protocol/package.jsonpackages/protocol/src/chat-types.tspackages/protocol/src/done-types.tspackages/protocol/src/element-capture-sanitize.tspackages/protocol/src/element-capture-types.tspackages/protocol/src/page-types.tspackages/protocol/src/tool-view-types.tspackages/protocol/test/element-capture-sanitize.test.tspackages/protocol/tsdown.config.tspackages/tools/package.jsonpackages/tools/src/cards.tsxpackages/tools/src/cards/extensions-card.tsxpackages/tools/src/cards/inline-cards.stories.tsxpackages/tools/src/cards/open-card.tsxpackages/tools/src/cards/ui-card.stories.tsxpackages/tools/src/cards/ui-card.tsxpackages/tools/tsconfig.cards.build.jsonpackages/tools/tsconfig.cards.jsonpackages/tools/uno.config.tspackages/tools/vite.config.tspackages/ui-kit-chat-tools/package.jsonpackages/ui-kit-chat-tools/src/index.tsxpackages/ui-kit-chat-tools/src/primitives/tools/inline-tool.tsxpackages/ui-kit-chat-tools/src/primitives/tools/now-title.tspackages/ui-kit-chat-tools/src/styled/done-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/done-card.tsxpackages/ui-kit-chat-tools/src/styled/page-action-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/page-action-card.tsxpackages/ui-kit-chat-tools/src/styled/tools/apply-patch-diff.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/bash-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/builtin-tool-cards.tspackages/ui-kit-chat-tools/src/styled/tools/discovered-apis-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/file-read-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/inline-tool.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/inline-tool.tsxpackages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/loaded-tools-card.tsxpackages/ui-kit-chat-tools/src/styled/tools/todo-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/tool-chip.stories.tsxpackages/ui-kit-chat-tools/src/styled/tools/tool-lookup-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/ui-chip-card.stories.tsxpackages/ui-kit-chat-tools/src/styled/ui-chip-card.tsxpackages/ui-kit-chat-tools/test/catalog-cards.browser.test.tsxpackages/ui-kit-chat-tools/test/new-tool-projection.browser.test.tsxpackages/ui-kit-chat-tools/test/page-action-card-title.browser.test.tsxpackages/ui-kit-chat-tools/test/page-tool-cards.browser.test.tsxpackages/ui-kit-chat-tools/test/registry-card-declarations.browser.test.tsxpackages/ui-kit-chat-tools/test/schema-params.test.tspackages/ui-kit-chat/package.jsonpackages/ui-kit-chat/src/index.tsxpackages/ui-kit-chat/src/primitives/message/message.tsxpackages/ui-kit-chat/src/primitives/tools/schema-params.tspackages/ui-kit-chat/src/primitives/tools/tool-presentation.tspackages/ui-kit-chat/src/store/element-capture.fixtures.tspackages/ui-kit-chat/src/store/tool-context.tsxpackages/ui-kit-chat/src/styled/chip.tsxpackages/ui-kit-chat/src/styled/collapsible-card.tsxpackages/ui-kit-chat/src/styled/element-preview.stories.tsxpackages/ui-kit-chat/src/styled/element-preview.tsxpackages/ui-kit-chat/src/styled/json-tree.tsxpackages/ui-kit-chat/src/styled/tool-card.tsxpackages/ui-kit-chat/src/styled/tool-fallback.stories.tsxpackages/ui-kit-chat/src/styled/tool-icon.tsxpackages/ui-kit-chat/src/styled/tools/inline-row.tsxpackages/ui-kit-chat/src/styled/tools/meta-tool-card.stories.tsxpackages/ui-kit-chat/src/styled/tools/meta-tool-card.tsxpackages/ui-kit-chat/src/styled/tools/note-row.tsxpackages/ui-kit-chat/src/styled/tools/permission-card.stories.tsxpackages/ui-kit-chat/src/styled/tools/permission-card.tsxpackages/ui-kit-chat/src/styled/tools/tool-call-card.tsxpackages/ui-kit-chat/test/collapsible-card-shape.browser.test.tsxpackages/ui-kit-chat/test/element-preview.browser.test.tsxpackages/ui-kit-chat/test/meta-tool-card-error.browser.test.tsxpackages/ui-kit-chat/test/schema-params.test.tspackages/ui-kit-chat/test/tool-call-card-dispatch.browser.test.tsxpackages/ui-kit-system/src/index.tsxpackages/ui-kit-system/src/json-tree-view.tsxpackages/ui-kit-system/src/select.tsxpackages/uno-preset/src/index.tspackages/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
…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>
There was a problem hiding this comment.
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
cssvalue and overwrites it in database row order.EditLiveCardthen 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
pumppromise rethrows subscription or abort errors and can replace a successfulrun()result with the approval-pump failure. The earlierpump.catch(() => {})only registers a handler; it does not make subsequentawait pumpnon-throwing. Keep cleanup failures best-effort as before.
… 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>
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, becausepageActionToolmatchedconciv_page— a tool name #284 replaced with 37page.<verb>tools.ToolCallCardmatches onpart.name, nothing matched, so everything fell through toToolFallback.Landed so far
Dispatch.
ToolCallCardresolves 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.ToolFallbacknow only serves tools that declare no meta at all — i.e. foreign harness tools.The wire.
ToolViewMetagainedcategory,hint,positional,approval,inputSchema,outputSchema,errors, so a card can be built from a declaration alone.input/outputwere renamed toinputSchema/outputSchemaso the widget's structural assignment needs no adapter.MetaToolCardin@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.schemaParamsandtool-iconmoved 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 readserror.codeand 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/pageActionTooldeleted. Result views survive aspage-result-views.tsxprimitives (A11yNodeList,PageHtmlBlock,PageValueChip) for the per-verb cards.PermissionCardrenders again for tools reaching the first three layers. TheShowstays —ToolFallbackdraws its own approval buttons and would otherwise double the prompt.nowTitlereadslabel.runningfrom 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.ToolAccentdeleted — dead, and its members never matched thecategoryvalues 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:
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.Treerenders 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 inpresetConcivemitting plain nested CSS.transformerVariantGroupwas 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
@conciv/page(rrweb node + ancestor skeleton + shared CSS bundle, password masking at serialize time)toolCapturesstorage, so captures reach the transcript UI and never the modelElementCapturein protocol and<ElementPreview>in ui-kit-chat.render()conciv_ui/conciv_open/conciv_extensionscards topackages/tools,execute_typescriptto coreGates
19/19 test tasks (99 ui-kit-chat, 199 storybook), typecheck 92/92, lint 0 errors, format clean,
fallow auditverdict pass.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes