Skip to content

Conversation

@mcongrove
Copy link
Member

@mcongrove mcongrove commented Dec 28, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for agent examples to demonstrate input formats
    • Introduced pre-fill functionality with AI-generated mock input suggestions
    • Enhanced error displays with detailed error information and stack traces
  • UI/UX Improvements

    • Redesigned visual theme with improved color system and tokens
    • Improved chat interface layout with better message rendering
    • Enhanced schema display with syntax highlighting for code blocks
    • Added resizable layout panels for flexible workbench organization
    • Improved form input handling and validation feedback
  • Bug Fixes

    • Improved WebSocket reconnection logic with better error recovery

✏️ Tip: You can customize this high-level summary in your review settings.

@mcongrove mcongrove requested a review from potofpie December 28, 2025 02:02
@coderabbitai
Copy link

coderabbitai bot commented Dec 28, 2025

📝 Walkthrough

Walkthrough

This pull request extends the agent system with example inputs support, refactors the workbench UI component structure and styling system, updates runtime span processor initialization, and improves error handling in the execution and WebSocket layers. Changes span build tooling, runtime agent metadata, and UI components.

Changes

Cohort / File(s) Summary
Agent Examples Support
apps/testing/integration-suite/src/agent/basic/basic-async.ts, packages/cli/src/cmd/build/vite/agent-discovery.ts, packages/cli/src/cmd/build/vite/metadata-generator.ts, packages/runtime/src/_metadata.ts, packages/runtime/src/agent.ts
Added optional examples?: unknown[] field to agent schema and metadata interfaces; implemented extraction of examples from createAgent calls in AST parsing; propagated examples through build metadata and runtime agent instances.
Span Processor Initialization
packages/cli/src/cmd/build/entry-generator.ts, packages/runtime/src/_server.ts, packages/runtime/src/_tokens.ts
Refactored TokenSpanProcessor from non-exported internal utility to public export; updated entry generator to call getSpanProcessors() instead of empty array; changed span name detection from exact match to prefix-based check; removed module-level default registration.
Workbench Styling System
packages/workbench/src/base.css, packages/workbench/tailwind.config.js
Replaced semantic color tokens with numeric CSS variables and OKLCH color scales; removed tailwind.config.js and consolidated color mappings in base.css; added responsive breakpoints, typography, border radius, and animation tokens.
Workbench Component Reorganization
packages/workbench/src/components/internal/Chat.tsx, packages/workbench/src/components/internal/chat.tsx, packages/workbench/src/components/internal/header.tsx, packages/workbench/src/components/internal/schema.tsx, packages/workbench/src/components/App.tsx
Removed capitalized Chat.tsx; introduced lowercase chat.tsx with enhanced error handling, example rendering, and message metadata; refactored Header and Schema components with new styling and imports; updated App layout with resizable panel configuration and env-based authentication.
Workbench Input & Editor
packages/workbench/src/components/internal/input-section.tsx, packages/workbench/src/components/internal/json-editor.tsx, packages/workbench/src/components/internal/logo.tsx
Replaced Monaco editor integration with new JsonEditor component; added prefill popover with template and mock input generation; updated InputSection props and validation flow; refactored JsonEditor with auto-resize, Ctrl+Enter submit, and custom theme support.
Workbench Provider & Context
packages/workbench/src/components/internal/workbench-provider.tsx, packages/workbench/src/hooks/useWorkbenchWebsocket.ts, packages/workbench/src/types/config.ts
Extended WorkbenchProvider to accept env prop and expose connection status; updated localStorage keys to hyphenated format; added response envelope handling with error extraction; refactored WebSocket reconnection with backoff strategy, enabled() guard, and server hint callbacks (onAlive, onRestarting); substantially expanded WorkbenchContextType with message, submission, and sample generation APIs.
Workbench Execution & Metadata
packages/runtime/src/workbench.ts, packages/workbench/src/hooks/useAgentSchemas.ts
Changed execution response from raw result to wrapped { success, data } structure; updated error responses to always return 200 with structured error object; added examples field to metadata responses; refactored useAgentSchemas with Authorization header handling and envelope response support.
Workbench UI Primitives
packages/workbench/src/components/ui/avatar.tsx, packages/workbench/src/components/ui/command.tsx, packages/workbench/src/components/ui/dialog.tsx, packages/workbench/src/components/ui/dropdown-menu.tsx, packages/workbench/src/components/ui/hover-card.tsx, packages/workbench/src/components/ui/input-group.tsx, packages/workbench/src/components/ui/input.tsx, packages/workbench/src/components/ui/scroll-area.tsx, packages/workbench/src/components/ui/textarea.tsx, packages/workbench/src/components/ui/theme-provider.tsx, packages/workbench/src/components/ui/tooltip.tsx
Updated React imports to type-only style; normalized string literal quotes to double quotes; adjusted component signatures (e.g., CommandDialog defaultProps, DropdownMenuContent sideOffset, TooltipProvider typing); added Portal wrapper and Arrow to TooltipContent; changed storageKey default to "agentuity-workbench-ui-theme".
Workbench AI Elements & Utils
packages/workbench/src/components/ai-elements/actions.tsx, packages/workbench/src/components/ai-elements/code-block.tsx, packages/workbench/src/components/ai-elements/conversation.tsx, packages/workbench/src/components/ai-elements/message.tsx, packages/workbench/src/components/ai-elements/prompt-input.tsx, packages/workbench/src/components/ai-elements/shimmer.tsx, packages/workbench/src/lib/utils.ts
Normalized quotes to double quotes; refactored CodeBlock with language/theme support and light/dark rendering; added generateTemplateFromSchema and formatErrorForCopy utilities; updated ConversationScrollButton visibility control; introduced PromptInputModelSelect wrapper exports and prefill examples rendering.
Workbench Hooks & Utilities
packages/workbench/src/hooks/useLogger.ts, packages/workbench/src/index.ts, packages/workbench/src/server.ts, packages/workbench/test-app/main.tsx
Minor formatting (blank lines, braces); reorganized public exports with corrected import paths for Chat and Schema; converted WorkbenchConfig import to type-only.
Configuration & Metadata
eslint.config.mts, packages/workbench/package.json, packages/workbench/test-app/index.html, packages/workbench/test-app/styles.css, packages/workbench/test-app/vite.config.ts
Updated ESLint config with react/react-in-jsx-scope off rule; changed author field to "Agentuity"; normalized HTML doctype and title; reordered vite.config imports; removed trailing whitespace.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Pull request contains changes beyond typical workbench UI/UX improvements, including runtime agent metadata, CLI build processes, and core SDK modifications. Verify that agent metadata (examples field), span processor changes, and CLI modifications align with the AGENT-1156 scope. Isolate unrelated changes into separate pull requests if necessary.
Linked Issues check ❓ Inconclusive Insufficient context provided in linked issue to validate specific coding requirements. Review the complete issue description for AGENT-1156 to identify explicit coding requirements and validate implementation completeness.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch workbench-ui-ux

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

Copy link
Member

@jhaynie jhaynie left a comment

Choose a reason for hiding this comment

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

run bun format at the project root

@mcongrove mcongrove changed the title Workbench UI/UX AGENT-1156 Workbench UI/UX Dec 28, 2025
@mcongrove mcongrove marked this pull request as ready for review December 30, 2025 00:39
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 18

Caution

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

⚠️ Outside diff range comments (4)
packages/workbench/src/components/ui/dialog.tsx (1)

1-141: Use single quotes in imports to match Prettier configuration.

The repository's Prettier configuration (.prettierrc) explicitly specifies "singleQuote": true, but this file uses double quotes in imports (lines 1, 2, 5). Update these to single quotes: '@radix-ui/react-dialog', 'lucide-react', and '../../lib/utils'.

packages/workbench/src/components/ui/input-group.tsx (1)

1-170: Convert double quotes to single quotes throughout the file.

The repository's Prettier configuration explicitly requires single quotes ("singleQuote": true), which is also aligned with the coding guidelines. However, this file systematically uses double quotes instead. The file should be reformatted with single quotes to comply with the .prettierrc configuration.

Run Prettier to auto-fix: prettier --write packages/workbench/src/components/ui/input-group.tsx

packages/workbench/src/components/ui/command.tsx (1)

1-182: Coding guideline violation: Use single quotes instead of double quotes.

The coding guidelines explicitly require single quotes for string literals in TypeScript/JavaScript files, but this file uses double quotes throughout (e.g., lines 1, 2, 5, and all JSX attributes). This should be enforced by Prettier configuration.

As per coding guidelines, ensure Prettier is configured with singleQuote: true and reformat the file.

Example corrections
-import { Command as CommandPrimitive } from "cmdk";
-import { SearchIcon } from "lucide-react";
+import { Command as CommandPrimitive } from 'cmdk';
+import { SearchIcon } from 'lucide-react';
packages/workbench/src/components/ai-elements/prompt-input.tsx (1)

1-1352: Critical: Formatting violates coding guidelines - revert to single quotes.

The entire file has been reformatted to use double quotes, which directly contradicts the coding guidelines that explicitly require: "Use Prettier for code formatting with tabs (width 3), single quotes, and semicolons."

This affects:

  • Import statements (lines 1, 3, 13, 14, 36, 37, etc.)
  • String literals throughout (lines 112, 126, 166, 249, 267, 273, 280, 290, etc.)
  • Object properties and type definitions (lines 416-417, 465, 468, 483-484, etc.)
  • All component implementations

Please revert all quote formatting changes and run Prettier with the correct configuration to use single quotes.

</review_comment_end>

♻️ Duplicate comments (4)
packages/workbench/src/components/ui/scroll-area.tsx (1)

1-56: Same quote style inconsistency as other UI components.

This file exhibits the same double-quote usage that conflicts with the coding guidelines specifying single quotes. See the comment on packages/workbench/src/components/ui/input.tsx for details.

packages/workbench/src/components/ui/tooltip.tsx (1)

1-59: Same quote style inconsistency as other UI components.

This file also uses double quotes instead of the single quotes specified in coding guidelines. See the comment on packages/workbench/src/components/ui/input.tsx for details.

packages/workbench/src/components/ui/dropdown-menu.tsx (1)

1-257: Same quote style inconsistency as other UI components.

This file also uses double quotes instead of the single quotes specified in coding guidelines. See the comment on packages/workbench/src/components/ui/input.tsx for details.

packages/workbench/src/components/ui/textarea.tsx (1)

1-18: Same quote style inconsistency as other UI components.

This file also uses double quotes instead of the single quotes specified in coding guidelines. See the comment on packages/workbench/src/components/ui/input.tsx for details.

🧹 Nitpick comments (16)
packages/workbench/src/hooks/useLogger.ts (1)

21-22: Consider adding a comment to document the empty catch block.

The empty catch block is an acceptable pattern for graceful degradation when localStorage is unavailable (e.g., SSR, privacy mode), but a brief comment explaining why errors are silently caught would improve code clarity.

💡 Suggested improvement
 	} catch {
+		// Silently degrade when localStorage is unavailable (e.g., SSR, privacy mode)
 		return null;
 	}
packages/workbench/src/components/ai-elements/conversation.tsx (1)

81-96: Consider adding aria-hidden for better accessibility.

The button is now always rendered but hidden via opacity-0 and pointer-events-none when at the bottom. While this enables smooth transitions, the button remains in the accessibility tree even when hidden, which could confuse screen reader users.

🔎 Proposed fix
 	return (
 		<Button
+			aria-hidden={isAtBottom}
 			className={cn(
 				"absolute bottom-0 left-[50%] translate-x-[-50%] rounded-full transition-all duration-300",
 				isAtBottom
 					? "opacity-0 pointer-events-none -translate-y-1/2"
 					: "opacity-100 translate-y-0",
 				className,
 			)}
 			onClick={handleScrollToBottom}
 			size="icon"
 			type="button"
 			variant="outline"
 			{...props}
 		>
 			<ArrowDownIcon className="size-4" />
 		</Button>
 	);
packages/workbench/test-app/vite.config.ts (1)

1-4: Consider standard import ordering.

The built-in path module appears between external packages. Standard convention groups built-ins first, then external packages (alphabetically).

packages/workbench/src/components/ai-elements/prompt-input.tsx (2)

152-154: Fix typo: "attachements" should be "attachments".

The state variable is named attachements (with an 'e'), which is inconsistent with the rest of the codebase that uses attachments. While this is internal state and doesn't break functionality, fixing the typo would improve code maintainability.

🔎 Proposed fix
-	const [attachements, setAttachements] = useState<
+	const [attachments, setAttachments] = useState<
		(FileUIPart & { id: string })[]
	>([]);

And update references on lines 162, 176, 184, 196, 203.


640-649: Consider adding error handling to blob URL conversion.

The convertBlobUrlToDataUrl function doesn't handle potential errors from the fetch call (e.g., network issues, revoked blob URLs) or the FileReader operation. If conversion fails, the promise will reject, but this could result in the form submission silently failing.

🔎 Suggested enhancement
	const convertBlobUrlToDataUrl = async (url: string): Promise<string> => {
-		const response = await fetch(url);
-		const blob = await response.blob();
-		return new Promise((resolve, reject) => {
-			const reader = new FileReader();
-			reader.onloadend = () => resolve(reader.result as string);
-			reader.onerror = reject;
-			reader.readAsDataURL(blob);
-		});
+		try {
+			const response = await fetch(url);
+			if (!response.ok) {
+				throw new StructuredError({
+					code: 'blob_fetch_failed',
+					message: `Failed to fetch blob: ${response.statusText}`,
+				});
+			}
+			const blob = await response.blob();
+			return new Promise((resolve, reject) => {
+				const reader = new FileReader();
+				reader.onloadend = () => resolve(reader.result as string);
+				reader.onerror = () => reject(new StructuredError({
+					code: 'file_read_failed',
+					message: 'Failed to read file as data URL',
+				}));
+				reader.readAsDataURL(blob);
+			});
+		} catch (error) {
+			throw new StructuredError({
+				code: 'blob_conversion_failed',
+				message: 'Failed to convert blob URL to data URL',
+				cause: error,
+			});
+		}
	};
packages/workbench/src/components/internal/logo.tsx (1)

4-5: Remove unused alt prop from type signature.

The alt prop is declared in the component's props type but is no longer destructured or used. This creates a misleading API where consumers might pass alt expecting it to be applied.

🔎 Proposed fix
-const Logo = forwardRef<SVGSVGElement, { className?: string; alt?: string }>(
-	({ className = '' }, ref) => {
+const Logo = forwardRef<SVGSVGElement, { className?: string }>(
+	({ className = '' }, ref) => {
packages/workbench/src/components/internal/chat.tsx (3)

102-137: Error detection via __agentError marker.

The implementation safely parses JSON to detect agent errors embedded in message text. The try-catch at line 133 handles malformed JSON gracefully.

One minor note: The inline type definition at lines 103-110 duplicates the ErrorInfo interface from @/types/config. Consider importing and reusing that type for consistency.

🔎 Optional: reuse ErrorInfo type
+import type { ErrorInfo } from '../../types/config';
 import { cn, formatErrorForCopy } from '../../lib/utils';
 // ...

-							let errorInfo:
-								| {
-										message: string;
-										stack?: string;
-										code?: string;
-										cause?: unknown;
-								  }
-								| undefined;
+							let errorInfo: ErrorInfo | undefined;

283-292: Clipboard API usage without error handling.

The navigator.clipboard.writeText() call at line 291 may fail (e.g., in non-secure contexts or when clipboard permission is denied). Consider adding error handling.

🔎 Proposed fix: add error handling for clipboard
 onClick={() => {
 	const text = errorInfo
 		? formatErrorForCopy(errorInfo)
 		: parts
 				.filter((part) => part.type === 'text')
 				.map((part) => part.text)
 				.join('');

-	navigator.clipboard.writeText(text);
+	navigator.clipboard.writeText(text).catch(() => {
+		// Silently fail - clipboard API may not be available
+	});
 }}

153-165: Consider keyboard accessibility for the session button.

The button at lines 153-186 has tabIndex={0} but uses disabled={!sessionId}. When disabled, the button should not be focusable. Consider conditionally setting tabIndex:

🔎 Optional: improve keyboard accessibility
 <button
 	type="button"
 	className={cn(...)}
 	onClick={() => sessionId && onSessionOpen?.(sessionId)}
-	tabIndex={0}
+	tabIndex={sessionId && onSessionOpen ? 0 : -1}
 	aria-label="Open session"
 	disabled={!sessionId}
 	style={{ background: 'none' }}
 >
packages/workbench/src/hooks/useAgentSchemas.ts (1)

15-23: Clarify the distinction between agentId and id fields.

The AgentMetadata interface has both agentId: string and id: string. From the relevant snippet in agent-discovery.ts, these appear to be intentionally different (perhaps id is a short identifier and agentId is a UUID). Consider adding documentation comments to clarify their purposes and when each should be used.

packages/workbench/src/components/ai-elements/code-block.tsx (2)

34-34: String literals use double quotes instead of single quotes.

Per coding guidelines, Prettier is configured to use single quotes. This line and others in the file use double quotes for string literals.

🔎 Suggested fix
-type SupportedLanguage = "json" | "javascript" | "typescript";
+type SupportedLanguage = 'json' | 'javascript' | 'typescript';

118-134: Potential stale closure issue with mounted ref check.

The mounted ref is set to false in the cleanup function, but the async highlightCode call may complete after unmount. The current logic correctly prevents state updates after unmount, which is good. However, the ref is reset to false in cleanup but never explicitly set to true on subsequent renders if the component re-mounts with different props.

Consider this edge case: if code, language, or showLineNumbers changes while a previous highlight is in-flight, the new highlight will not set mounted.current = true because the condition !mounted.current will be false after the first successful highlight.

🔎 Suggested fix
 	useEffect(() => {
+		mounted.current = false;
 		highlightCode(code, language, showLineNumbers).then(([light, dark]) => {
 			if (!mounted.current) {
 				setLightHtml(light);
 				setDarkHtml(dark);
 				mounted.current = true;
 			}
 		});

 		return () => {
 			mounted.current = false;
 		};
 	}, [code, language, showLineNumbers]);
packages/workbench/src/components/internal/input-section.tsx (1)

87-87: Consider renaming monacoHasErrors to reflect the abstracted editor.

The state variable monacoHasErrors references Monaco specifically, but the component now uses the abstracted JsonEditor. Consider renaming to editorHasErrors or validationErrors for clarity.

packages/workbench/src/components/internal/json-editor.tsx (1)

173-183: Consider extracting the extensive CSS overrides into a CSS file or Tailwind classes.

The inline style object and the long className string with CSS overrides for Monaco transparency are hard to maintain. While functionally correct, consider extracting these to a dedicated CSS module or using @apply in a Tailwind layer for better maintainability.

packages/workbench/src/components/internal/workbench-provider.tsx (1)

352-419: Consider using StructuredError for consistent error handling.

Per coding guidelines, StructuredError from @agentuity/core should be used for error handling. The error messages created at lines 403-412 and throughout the function could benefit from using this standardized error type.

packages/workbench/src/hooks/useWorkbenchWebsocket.ts (1)

116-119: Consider using null instead of undefined for ref initialization.

Using undefined for ref initialization is valid, but null is more conventional for refs that will hold object references. This is a minor consistency suggestion.

🔎 Suggested fix
-	const reconnectManagerRef = useRef<ReturnType<typeof createReconnectManager> | undefined>(
-		undefined
-	);
-	const wsRef = useRef<WebSocket | undefined>(undefined);
+	const reconnectManagerRef = useRef<ReturnType<typeof createReconnectManager> | null>(null);
+	const wsRef = useRef<WebSocket | null>(null);
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b138368 and b5a7503.

⛔ Files ignored due to path filters (2)
  • apps/testing/cloud-deployment/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/integration-suite/src/generated/app.ts is excluded by !**/generated/**
📒 Files selected for processing (51)
  • apps/testing/integration-suite/src/agent/basic/basic-async.ts
  • eslint.config.mts
  • packages/cli/src/cmd/build/entry-generator.ts
  • packages/cli/src/cmd/build/vite/agent-discovery.ts
  • packages/cli/src/cmd/build/vite/metadata-generator.ts
  • packages/runtime/src/_metadata.ts
  • packages/runtime/src/_server.ts
  • packages/runtime/src/_tokens.ts
  • packages/runtime/src/agent.ts
  • packages/runtime/src/workbench.ts
  • packages/workbench/package.json
  • packages/workbench/src/base.css
  • packages/workbench/src/components/App.tsx
  • packages/workbench/src/components/ai-elements/actions.tsx
  • packages/workbench/src/components/ai-elements/code-block.tsx
  • packages/workbench/src/components/ai-elements/conversation.tsx
  • packages/workbench/src/components/ai-elements/message.tsx
  • packages/workbench/src/components/ai-elements/prompt-input.tsx
  • packages/workbench/src/components/ai-elements/shimmer.tsx
  • packages/workbench/src/components/internal/Chat.tsx
  • packages/workbench/src/components/internal/chat.tsx
  • packages/workbench/src/components/internal/header.tsx
  • packages/workbench/src/components/internal/input-section.tsx
  • packages/workbench/src/components/internal/json-editor.tsx
  • packages/workbench/src/components/internal/logo.tsx
  • packages/workbench/src/components/internal/resizable-provider.tsx
  • packages/workbench/src/components/internal/schema.tsx
  • packages/workbench/src/components/internal/workbench-provider.tsx
  • packages/workbench/src/components/ui/avatar.tsx
  • packages/workbench/src/components/ui/command.tsx
  • packages/workbench/src/components/ui/dialog.tsx
  • packages/workbench/src/components/ui/dropdown-menu.tsx
  • packages/workbench/src/components/ui/hover-card.tsx
  • packages/workbench/src/components/ui/input-group.tsx
  • packages/workbench/src/components/ui/input.tsx
  • packages/workbench/src/components/ui/scroll-area.tsx
  • packages/workbench/src/components/ui/textarea.tsx
  • packages/workbench/src/components/ui/theme-provider.tsx
  • packages/workbench/src/components/ui/tooltip.tsx
  • packages/workbench/src/hooks/useAgentSchemas.ts
  • packages/workbench/src/hooks/useLogger.ts
  • packages/workbench/src/hooks/useWorkbenchWebsocket.ts
  • packages/workbench/src/index.ts
  • packages/workbench/src/lib/utils.ts
  • packages/workbench/src/server.ts
  • packages/workbench/src/types/config.ts
  • packages/workbench/tailwind.config.js
  • packages/workbench/test-app/index.html
  • packages/workbench/test-app/main.tsx
  • packages/workbench/test-app/styles.css
  • packages/workbench/test-app/vite.config.ts
💤 Files with no reviewable changes (3)
  • packages/workbench/src/components/internal/Chat.tsx
  • packages/workbench/tailwind.config.js
  • packages/workbench/test-app/styles.css
🧰 Additional context used
📓 Path-based instructions (9)
apps/testing/integration-suite/src/**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (apps/testing/integration-suite/AGENTS.md)

Use path aliases for imports: @agents/* and @test/* instead of relative paths

Files:

  • apps/testing/integration-suite/src/agent/basic/basic-async.ts
apps/testing/integration-suite/src/agent/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/testing/integration-suite/AGENTS.md)

apps/testing/integration-suite/src/agent/**/*.{ts,tsx}: Schema definitions must use s.record(keyType, valueType) with two arguments, not one
Schema definitions must use s.union(typeA, typeB) with arguments, not array s.union([typeA, typeB])
Agent schema pattern must include input and output objects with operation field for multi-operation agents
Session state uses ctx.session.state.set(key, value) and ctx.session.state.get(key) for request-scoped state
Thread state uses ctx.thread.state.set(key, value) and ctx.thread.state.get(key) for conversation-scoped persistent state
StructuredError uses pattern StructuredError(tag, message)<{ shape }>() with properties accessed directly on error instance
Error handling in agent handlers must use try-catch blocks and can transform errors into success responses
Agent eval creation uses agent.createEval(name, config) with handler returning success:true and metadata:{reason}
Agent eval results use passed:boolean for binary pass/fail or score:number (0.0-1.0) for scored results
Background tasks use ctx.waitUntil() with async function or promise, executing after response is sent
Session event listeners use ctx.session.addEventListener(eventName, callback) for 'completed' event
Thread event listeners use ctx.thread.addEventListener(eventName, callback) for 'destroyed' event
Each agent export must have a unique variable name to prevent naming collisions

Files:

  • apps/testing/integration-suite/src/agent/basic/basic-async.ts
**/*.{ts,tsx,js,jsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier for code formatting with tabs (width 3), single quotes, and semicolons

Files:

  • apps/testing/integration-suite/src/agent/basic/basic-async.ts
  • packages/workbench/src/components/ai-elements/message.tsx
  • packages/runtime/src/_tokens.ts
  • packages/cli/src/cmd/build/vite/metadata-generator.ts
  • packages/workbench/src/components/internal/chat.tsx
  • packages/workbench/src/components/internal/schema.tsx
  • packages/workbench/src/components/ui/input-group.tsx
  • packages/workbench/src/components/ai-elements/actions.tsx
  • packages/workbench/package.json
  • packages/workbench/src/server.ts
  • packages/runtime/src/agent.ts
  • packages/runtime/src/_metadata.ts
  • packages/workbench/src/components/ai-elements/shimmer.tsx
  • packages/workbench/src/lib/utils.ts
  • packages/workbench/src/components/internal/json-editor.tsx
  • packages/workbench/src/components/ui/command.tsx
  • packages/workbench/src/components/ui/textarea.tsx
  • packages/runtime/src/_server.ts
  • packages/cli/src/cmd/build/vite/agent-discovery.ts
  • packages/runtime/src/workbench.ts
  • packages/workbench/src/components/ui/input.tsx
  • packages/workbench/src/components/ui/avatar.tsx
  • packages/workbench/src/components/ui/tooltip.tsx
  • packages/workbench/src/components/ui/dialog.tsx
  • packages/workbench/test-app/main.tsx
  • packages/workbench/src/components/internal/logo.tsx
  • packages/workbench/src/components/ui/scroll-area.tsx
  • packages/workbench/src/components/internal/input-section.tsx
  • packages/workbench/src/components/ai-elements/conversation.tsx
  • packages/workbench/src/components/internal/workbench-provider.tsx
  • packages/workbench/src/hooks/useWorkbenchWebsocket.ts
  • packages/cli/src/cmd/build/entry-generator.ts
  • packages/workbench/src/hooks/useLogger.ts
  • packages/workbench/src/components/ui/theme-provider.tsx
  • packages/workbench/src/components/ui/dropdown-menu.tsx
  • packages/workbench/src/components/ai-elements/code-block.tsx
  • packages/workbench/src/hooks/useAgentSchemas.ts
  • packages/workbench/src/components/internal/header.tsx
  • packages/workbench/src/types/config.ts
  • packages/workbench/src/components/ai-elements/prompt-input.tsx
  • packages/workbench/test-app/vite.config.ts
  • packages/workbench/src/components/ui/hover-card.tsx
  • packages/workbench/src/index.ts
  • packages/workbench/src/components/App.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with ESNext target and bundler moduleResolution

Files:

  • apps/testing/integration-suite/src/agent/basic/basic-async.ts
  • packages/workbench/src/components/ai-elements/message.tsx
  • packages/runtime/src/_tokens.ts
  • packages/cli/src/cmd/build/vite/metadata-generator.ts
  • packages/workbench/src/components/internal/chat.tsx
  • packages/workbench/src/components/internal/schema.tsx
  • packages/workbench/src/components/ui/input-group.tsx
  • packages/workbench/src/components/ai-elements/actions.tsx
  • packages/workbench/src/server.ts
  • packages/runtime/src/agent.ts
  • packages/runtime/src/_metadata.ts
  • packages/workbench/src/components/ai-elements/shimmer.tsx
  • packages/workbench/src/lib/utils.ts
  • packages/workbench/src/components/internal/json-editor.tsx
  • packages/workbench/src/components/ui/command.tsx
  • packages/workbench/src/components/ui/textarea.tsx
  • packages/runtime/src/_server.ts
  • packages/cli/src/cmd/build/vite/agent-discovery.ts
  • packages/runtime/src/workbench.ts
  • packages/workbench/src/components/ui/input.tsx
  • packages/workbench/src/components/ui/avatar.tsx
  • packages/workbench/src/components/ui/tooltip.tsx
  • packages/workbench/src/components/ui/dialog.tsx
  • packages/workbench/test-app/main.tsx
  • packages/workbench/src/components/internal/logo.tsx
  • packages/workbench/src/components/ui/scroll-area.tsx
  • packages/workbench/src/components/internal/input-section.tsx
  • packages/workbench/src/components/ai-elements/conversation.tsx
  • packages/workbench/src/components/internal/workbench-provider.tsx
  • packages/workbench/src/hooks/useWorkbenchWebsocket.ts
  • packages/cli/src/cmd/build/entry-generator.ts
  • packages/workbench/src/hooks/useLogger.ts
  • packages/workbench/src/components/ui/theme-provider.tsx
  • packages/workbench/src/components/ui/dropdown-menu.tsx
  • packages/workbench/src/components/ai-elements/code-block.tsx
  • packages/workbench/src/hooks/useAgentSchemas.ts
  • packages/workbench/src/components/internal/header.tsx
  • packages/workbench/src/types/config.ts
  • packages/workbench/src/components/ai-elements/prompt-input.tsx
  • packages/workbench/test-app/vite.config.ts
  • packages/workbench/src/components/ui/hover-card.tsx
  • packages/workbench/src/index.ts
  • packages/workbench/src/components/App.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use StructuredError from @agentuity/core for error handling
Ensure all errors AND warnings must be zero before committing

Files:

  • apps/testing/integration-suite/src/agent/basic/basic-async.ts
  • packages/workbench/src/components/ai-elements/message.tsx
  • packages/runtime/src/_tokens.ts
  • packages/cli/src/cmd/build/vite/metadata-generator.ts
  • packages/workbench/src/components/internal/chat.tsx
  • packages/workbench/src/components/internal/schema.tsx
  • packages/workbench/src/components/ui/input-group.tsx
  • packages/workbench/src/components/ai-elements/actions.tsx
  • packages/workbench/src/server.ts
  • packages/runtime/src/agent.ts
  • packages/runtime/src/_metadata.ts
  • packages/workbench/src/components/ai-elements/shimmer.tsx
  • packages/workbench/src/lib/utils.ts
  • packages/workbench/src/components/internal/json-editor.tsx
  • packages/workbench/src/components/ui/command.tsx
  • packages/workbench/src/components/ui/textarea.tsx
  • packages/runtime/src/_server.ts
  • packages/cli/src/cmd/build/vite/agent-discovery.ts
  • packages/runtime/src/workbench.ts
  • packages/workbench/src/components/ui/input.tsx
  • packages/workbench/src/components/ui/avatar.tsx
  • packages/workbench/src/components/ui/tooltip.tsx
  • packages/workbench/src/components/ui/dialog.tsx
  • packages/workbench/test-app/main.tsx
  • packages/workbench/src/components/internal/logo.tsx
  • packages/workbench/src/components/ui/scroll-area.tsx
  • packages/workbench/src/components/internal/input-section.tsx
  • packages/workbench/src/components/ai-elements/conversation.tsx
  • packages/workbench/src/components/internal/workbench-provider.tsx
  • packages/workbench/src/hooks/useWorkbenchWebsocket.ts
  • packages/cli/src/cmd/build/entry-generator.ts
  • packages/workbench/src/hooks/useLogger.ts
  • packages/workbench/src/components/ui/theme-provider.tsx
  • packages/workbench/src/components/ui/dropdown-menu.tsx
  • packages/workbench/src/components/ai-elements/code-block.tsx
  • packages/workbench/src/hooks/useAgentSchemas.ts
  • packages/workbench/src/components/internal/header.tsx
  • packages/workbench/src/types/config.ts
  • packages/workbench/src/components/ai-elements/prompt-input.tsx
  • packages/workbench/test-app/vite.config.ts
  • packages/workbench/src/components/ui/hover-card.tsx
  • packages/workbench/src/index.ts
  • packages/workbench/src/components/App.tsx
packages/runtime/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/runtime/AGENTS.md)

packages/runtime/src/**/*.{ts,tsx}: Use ctx.logger for logging instead of console.log
Use agent.validator() for automatic input validation in route handlers
Do NOT add type annotations to handler parameters - let TypeScript infer them from schemas
Every handler must receive AgentContext with logger, tracer, and storage utilities

Files:

  • packages/runtime/src/_tokens.ts
  • packages/runtime/src/agent.ts
  • packages/runtime/src/_metadata.ts
  • packages/runtime/src/_server.ts
  • packages/runtime/src/workbench.ts
packages/cli/src/cmd/**/*.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

packages/cli/src/cmd/**/*.ts: Use tui.* helpers for formatted output instead of raw console logs
Use ctx.logger for logging; call logger.fatal() to log and exit with code 1

Files:

  • packages/cli/src/cmd/build/vite/metadata-generator.ts
  • packages/cli/src/cmd/build/vite/agent-discovery.ts
  • packages/cli/src/cmd/build/entry-generator.ts
packages/cli/src/**/*.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

Use Bun.file(f).exists() instead of existsSync(f) for file existence checks

Files:

  • packages/cli/src/cmd/build/vite/metadata-generator.ts
  • packages/cli/src/cmd/build/vite/agent-discovery.ts
  • packages/cli/src/cmd/build/entry-generator.ts
packages/*/src/index.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use named exports from package index.ts files

Files:

  • packages/workbench/src/index.ts
🧠 Learnings (2)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.

Applied to files:

  • apps/testing/integration-suite/src/agent/basic/basic-async.ts
  • packages/runtime/src/_tokens.ts
  • packages/cli/src/cmd/build/vite/metadata-generator.ts
  • packages/workbench/src/server.ts
  • packages/runtime/src/agent.ts
  • packages/runtime/src/_metadata.ts
  • packages/workbench/src/lib/utils.ts
  • packages/runtime/src/_server.ts
  • packages/cli/src/cmd/build/vite/agent-discovery.ts
  • packages/runtime/src/workbench.ts
  • packages/workbench/src/hooks/useWorkbenchWebsocket.ts
  • packages/cli/src/cmd/build/entry-generator.ts
  • packages/workbench/src/hooks/useLogger.ts
  • packages/workbench/src/hooks/useAgentSchemas.ts
  • packages/workbench/src/types/config.ts
  • packages/workbench/test-app/vite.config.ts
  • packages/workbench/src/index.ts
📚 Learning: 2025-12-13T14:15:18.261Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 168
File: packages/runtime/src/session.ts:536-546
Timestamp: 2025-12-13T14:15:18.261Z
Learning: The agentuity/runtime package is Bun-only; during code reviews, do not replace Bun-native APIs (e.g., Bun.CryptoHasher, Bun.serve, and other Bun namespace APIs) with Node.js alternatives. Review changes with the assumption that runtime runs on Bun, and ensure any edits preserve Bun compatibility and do not introduce Node.js-specific fallbacks. Apply this guidance broadly to files under packages/runtime (e.g., packages/runtime/src/...); if there are conditional environment checks, document why Bun is required and avoid dereferencing Bun-only APIs in non-Bun contexts.

Applied to files:

  • packages/runtime/src/_tokens.ts
  • packages/runtime/src/agent.ts
  • packages/runtime/src/_metadata.ts
  • packages/runtime/src/_server.ts
  • packages/runtime/src/workbench.ts
🧬 Code graph analysis (18)
packages/workbench/src/components/ai-elements/message.tsx (1)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/workbench/src/components/internal/chat.tsx (8)
packages/workbench/src/components/internal/workbench-provider.tsx (1)
  • useWorkbench (13-21)
packages/workbench/src/hooks/useLogger.ts (1)
  • useLogger (41-63)
packages/workbench/src/components/ai-elements/conversation.tsx (2)
  • Conversation (12-20)
  • ConversationContent (26-31)
packages/workbench/src/lib/utils.ts (2)
  • cn (5-7)
  • formatErrorForCopy (162-170)
packages/workbench/src/components/ai-elements/message.tsx (2)
  • Message (11-20)
  • MessageContent (42-54)
packages/workbench/src/components/ai-elements/code-block.tsx (1)
  • CodeBlock (110-172)
packages/workbench/src/components/ai-elements/actions.tsx (2)
  • Actions (15-19)
  • Action (26-65)
packages/workbench/src/components/internal/input-section.tsx (1)
  • InputSection (68-513)
packages/workbench/src/components/internal/schema.tsx (2)
packages/workbench/src/components/ui/scroll-area.tsx (1)
  • ScrollArea (56-56)
packages/workbench/src/components/ai-elements/code-block.tsx (2)
  • CodeBlock (110-172)
  • CodeBlockCopyButton (180-225)
packages/workbench/src/components/ui/input-group.tsx (4)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/workbench/src/components/ui/button.tsx (1)
  • Button (58-58)
packages/workbench/src/components/ui/input.tsx (1)
  • Input (20-20)
packages/workbench/src/components/ui/textarea.tsx (1)
  • Textarea (18-18)
packages/workbench/src/lib/utils.ts (1)
packages/workbench/src/types/config.ts (1)
  • ErrorInfo (41-46)
packages/workbench/src/components/internal/json-editor.tsx (1)
packages/workbench/src/components/ui/theme-provider.tsx (1)
  • useTheme (66-73)
packages/workbench/src/components/ui/command.tsx (1)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/workbench/src/components/ui/textarea.tsx (1)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/runtime/src/_server.ts (1)
packages/runtime/src/_tokens.ts (1)
  • TokenSpanProcessor (53-112)
packages/workbench/src/components/ui/input.tsx (1)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/workbench/src/components/ui/avatar.tsx (1)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/workbench/src/components/ui/dialog.tsx (1)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/workbench/src/components/ui/scroll-area.tsx (1)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/workbench/src/components/internal/input-section.tsx (6)
packages/workbench/src/hooks/useAgentSchemas.ts (1)
  • AgentSchemaData (25-29)
packages/workbench/src/hooks/useLogger.ts (1)
  • useLogger (41-63)
packages/workbench/src/components/internal/workbench-provider.tsx (1)
  • useWorkbench (13-21)
packages/workbench/src/index.ts (1)
  • useWorkbench (5-5)
packages/workbench/src/lib/utils.ts (2)
  • cn (5-7)
  • generateTemplateFromSchema (154-160)
packages/workbench/src/components/internal/json-editor.tsx (1)
  • JsonEditor (111-394)
packages/workbench/src/components/ai-elements/conversation.tsx (2)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/workbench/src/components/ui/button.tsx (1)
  • Button (58-58)
packages/workbench/src/components/internal/workbench-provider.tsx (3)
packages/workbench/src/types/config.ts (1)
  • WorkbenchContextType (15-39)
packages/workbench/src/index.ts (2)
  • useWorkbench (5-5)
  • WorkbenchProvider (5-5)
packages/workbench/src/hooks/useLogger.ts (1)
  • useLogger (41-63)
packages/workbench/src/components/ui/dropdown-menu.tsx (1)
packages/workbench/src/lib/utils.ts (1)
  • cn (5-7)
packages/workbench/src/hooks/useAgentSchemas.ts (1)
packages/cli/src/cmd/build/vite/agent-discovery.ts (1)
  • AgentMetadata (54-65)
🪛 ast-grep (0.40.3)
packages/workbench/src/components/ai-elements/code-block.tsx

[warning] 152-152: Usage of dangerouslySetInnerHTML detected. This bypasses React's built-in XSS protection. Always sanitize HTML content using libraries like DOMPurify before injecting it into the DOM to prevent XSS attacks.
Context: dangerouslySetInnerHTML
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation [REFERENCES]
- https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml
- https://cwe.mitre.org/data/definitions/79.html

(react-unsafe-html-injection)


[warning] 159-159: Usage of dangerouslySetInnerHTML detected. This bypasses React's built-in XSS protection. Always sanitize HTML content using libraries like DOMPurify before injecting it into the DOM to prevent XSS attacks.
Context: dangerouslySetInnerHTML
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation [REFERENCES]
- https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml
- https://cwe.mitre.org/data/definitions/79.html

(react-unsafe-html-injection)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Playwright E2E Smoke Test

Comment on lines +115 to +127
return ctx.json({ success: true, data: result ?? null });
} catch (error) {
return ctx.json(
{
error: 'Internal server error',
message: error instanceof Error ? error.message : String(error),
const err = error instanceof Error ? error : new Error(String(error));
// Return 200 with wrapped error so UI can display it properly
return ctx.json({
success: false,
error: {
message: err.message,
stack: err.stack,
code: 'code' in err && typeof err.code === 'string' ? err.code : 'EXECUTION_ERROR',
cause: err.cause,
},
{ status: 500 }
);
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Consider conditionally omitting stack traces in production.

The error response includes err.stack, which exposes internal file paths and code structure. While helpful for debugging in development, this could leak sensitive implementation details in production environments.

🔎 Proposed fix - conditionally include stack
 			return ctx.json({
 				success: false,
 				error: {
 					message: err.message,
-					stack: err.stack,
+					stack: process.env.NODE_ENV !== 'production' ? err.stack : undefined,
 					code: 'code' in err && typeof err.code === 'string' ? err.code : 'EXECUTION_ERROR',
 					cause: err.cause,
 				},
 			});
🤖 Prompt for AI Agents
In packages/runtime/src/workbench.ts around lines 115 to 127, the error response
always includes err.stack which can leak internal paths; change the response to
include the stack only when the environment indicates non-production (e.g.,
process.env.NODE_ENV !== 'production' or a runtime config flag). Build the error
object first, add message, code and cause as before, and conditionally add stack
when allowed; ensure production responses omit the stack (or replace with
undefined) while preserving development visibility.

--muted-foreground: 240 5% 64.9%;
--accent: 240 3.7% 15.9%;
--accent-foreground: 0 0% 98%;
--destructive: 345, 83%, 41%;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent HSL value syntax may cause parsing issues.

This value uses a comma after the first number (345, 83%, 41%) while all other HSL values in the file use spaces (e.g., 347 77% 50% in :root). Modern CSS hsl() accepts space-separated values, but mixing comma and space syntax may cause inconsistent behavior when used with hsl(var(--destructive)).

🔎 Proposed fix
-	--destructive: 345, 83%, 41%;
+	--destructive: 345 83% 41%;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
--destructive: 345, 83%, 41%;
--destructive: 345 83% 41%;
🤖 Prompt for AI Agents
In packages/workbench/src/base.css around line 55, the CSS custom property
--destructive is defined using comma-separated HSL values ("345, 83%, 41%")
which is inconsistent with the rest of the file that uses space-separated HSL
syntax; update the value to space-separated format ("345 83% 41%") so
hsl(var(--destructive)) parses consistently across browsers and matches the
file's HSL style.

Comment on lines +227 to +230
body {
scrollbar-width: 12px;
scrollbar-color: var(--color-gray-200) transparent;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

scrollbar-width property only accepts keyword values.

The CSS scrollbar-width property accepts only auto, thin, or none—not pixel values. The 12px value will be ignored by standards-compliant browsers. If you need a specific width, consider using WebKit-specific pseudo-elements (::-webkit-scrollbar) or change to a valid keyword.

🔎 Proposed fix
 body {
-	scrollbar-width: 12px;
+	scrollbar-width: thin;
 	scrollbar-color: var(--color-gray-200) transparent;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
body {
scrollbar-width: 12px;
scrollbar-color: var(--color-gray-200) transparent;
}
body {
scrollbar-width: thin;
scrollbar-color: var(--color-gray-200) transparent;
}
🤖 Prompt for AI Agents
In packages/workbench/src/base.css around lines 227 to 230, the rule sets
scrollbar-width: 12px which is invalid because scrollbar-width only accepts the
keywords auto, thin, or none; change the value to a valid keyword (e.g., thin or
auto) or remove the property, or if a specific pixel width is required implement
WebKit-specific pseudo-elements (:: -webkit-scrollbar and related selectors)
with corresponding width settings to target browsers that support it while
keeping a standards-compliant fallback.

Comment on lines +1 to +11
"use client";

import { Button } from '../ui/button';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/tooltip';
import { cn } from '../../lib/utils';
import type { ComponentProps } from 'react';
import type { ComponentProps } from "react";
import { cn } from "../../lib/utils";
import { Button } from "../ui/button";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "../ui/tooltip";
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Revert to single quotes per coding guidelines.

The imports and "use client" directive use double quotes, but the coding guidelines explicitly require single quotes for TypeScript files.

As per coding guidelines, all string literals should use single quotes to maintain consistency with the project's Prettier configuration.

🔎 Proposed fix to use single quotes
-"use client";
+'use client';

-import type { ComponentProps } from "react";
-import { cn } from "../../lib/utils";
+import type { ComponentProps } from 'react';
+import { cn } from '../../lib/utils';
 import {
 	Tooltip,
 	TooltipContent,
 	TooltipProvider,
 	TooltipTrigger,
-} from "../ui/tooltip";
+} from '../ui/tooltip';
🤖 Prompt for AI Agents
packages/workbench/src/components/ai-elements/actions.tsx lines 1-11: the file
uses double quotes for the "use client" directive and import string literals but
the project's TypeScript style requires single quotes; update the file to use
single quotes for the "use client" directive and all import strings (e.g.,
'react', '../../lib/utils', '../ui/button', and tooltip imports) so string
literals conform to the coding guidelines and Prettier configuration.

} from "../ui/tooltip";

export type ActionsProps = ComponentProps<'div'>;
export type ActionsProps = ComponentProps<"div">;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use single quotes in type annotation.

The type parameter uses double quotes but should use single quotes per coding guidelines.

🔎 Proposed fix
-export type ActionsProps = ComponentProps<"div">;
+export type ActionsProps = ComponentProps<'div'>;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export type ActionsProps = ComponentProps<"div">;
export type ActionsProps = ComponentProps<'div'>;
🤖 Prompt for AI Agents
In packages/workbench/src/components/ai-elements/actions.tsx around line 13, the
type parameter uses double quotes (ComponentProps<"div">) but the project coding
guideline requires single quotes; update the type annotation to use single
quotes (ComponentProps<'div'>) so the declaration follows the style guide.

Comment on lines +1 to +11
"use client";

import { cn } from '../../lib/utils';
import { motion } from 'motion/react';
import { type CSSProperties, type ElementType, type JSX, memo, useMemo } from 'react';
import { motion } from "motion/react";
import {
type CSSProperties,
type ElementType,
type JSX,
memo,
useMemo,
} from "react";
import { cn } from "../../lib/utils";
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Inconsistent quote style violates coding guidelines.

The coding guidelines specify using single quotes, but this file uses double quotes throughout the imports. Per the guidelines: "Use Prettier for code formatting with tabs (width 3), single quotes, and semicolons."

The "use client" directive on line 1 is acceptable with double quotes as it's a Next.js convention, but all module imports (lines 3, 11) should use single quotes.

Based on coding guidelines, please ensure Prettier is configured correctly and reformat the file to use single quotes consistently.

🤖 Prompt for AI Agents
In packages/workbench/src/components/ai-elements/shimmer.tsx lines 1 to 11, the
import statements use double quotes which violates the project's single-quote
style (the "use client" directive may remain double-quoted). Update the module
import lines (e.g., the motion import and the react/utils imports) to use single
quotes instead of double quotes, ensure semicolons remain, and re-run Prettier
(configure Prettier to use singleQuotes: true, tabWidth: 3) or your project's
formatter so the file is reformatted consistently.

Comment on lines +39 to 57
animate={{ backgroundPosition: "0% center" }}
className={cn(
'relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent',
'[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]',
className
"relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
"[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",
className,
)}
initial={{ backgroundPosition: '100% center' }}
initial={{ backgroundPosition: "100% center" }}
style={
{
'--spread': `${dynamicSpread}px`,
"--spread": `${dynamicSpread}px`,
backgroundImage:
'var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))',
"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))",
} as CSSProperties
}
transition={{
repeat: Number.POSITIVE_INFINITY,
duration,
ease: 'linear',
ease: "linear",
}}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Quote style violations in JSX and component body.

Multiple string literals use double quotes instead of single quotes as required by the coding guidelines:

  • Line 39: "0% center" should be '0% center'
  • Lines 41-42: All string literals should use single quotes
  • Line 45: "100% center" should be '100% center'
  • Line 48: "--spread" should be '--spread'
  • Line 50: "var(--bg), linear-gradient..." should use single quotes
  • Line 56: "linear" should be 'linear'

The AI summary mentions a "project-wide shift toward double-quoted literals," but this directly contradicts the coding guidelines which explicitly require single quotes. Please clarify the intended quote style and ensure consistency across the project.

🤖 Prompt for AI Agents
packages/workbench/src/components/ai-elements/shimmer.tsx lines 39-57: several
JSX/string literals use double quotes; change them to single quotes to match
project rules (e.g. '0% center', '100% center', '--spread', and the
backgroundImage string and ease value). Update the className array entries to
use single-quoted strings, the initial/animate props to single-quoted values,
and the style object's CSS custom property key/value to single quotes; then run
the linter/formatter and fix any remaining quote violations (or adjust
.eslintrc/.prettier config only if the repo-wide rule is incorrect) to ensure
consistent single-quote usage.

Comment on lines +374 to +396
{selectedAgentData.examples.map((example) => {
const label =
typeof example === 'object' && example !== null
? JSON.stringify(example).substring(0, 60)
: String(example).substring(0, 60);

return (
<CommandItem
key={label}
onSelect={() => {
const formatted =
typeof example === 'object'
? JSON.stringify(example, null, 2)
: String(example);

onChange(formatted);
setPrefillOpen(false);
}}
>
<FileJson className="size-4" />
<span className="truncate font-mono">{label}</span>
</CommandItem>
);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Non-unique key warning: using truncated label as key may cause issues.

The key={label} uses a truncated string (max 60 chars) which may not be unique if multiple examples share the same prefix. Consider using the index or a hash of the full example content.

🔎 Suggested fix
-											{selectedAgentData.examples.map((example) => {
+											{selectedAgentData.examples.map((example, index) => {
 												const label =
 													typeof example === 'object' && example !== null
 														? JSON.stringify(example).substring(0, 60)
 														: String(example).substring(0, 60);

 												return (
 													<CommandItem
-														key={label}
+														key={`example-${index}`}
 														onSelect={() => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{selectedAgentData.examples.map((example) => {
const label =
typeof example === 'object' && example !== null
? JSON.stringify(example).substring(0, 60)
: String(example).substring(0, 60);
return (
<CommandItem
key={label}
onSelect={() => {
const formatted =
typeof example === 'object'
? JSON.stringify(example, null, 2)
: String(example);
onChange(formatted);
setPrefillOpen(false);
}}
>
<FileJson className="size-4" />
<span className="truncate font-mono">{label}</span>
</CommandItem>
);
{selectedAgentData.examples.map((example, index) => {
const label =
typeof example === 'object' && example !== null
? JSON.stringify(example).substring(0, 60)
: String(example).substring(0, 60);
return (
<CommandItem
key={`example-${index}`}
onSelect={() => {
const formatted =
typeof example === 'object'
? JSON.stringify(example, null, 2)
: String(example);
onChange(formatted);
setPrefillOpen(false);
}}
>
<FileJson className="size-4" />
<span className="truncate font-mono">{label}</span>
</CommandItem>
);
🤖 Prompt for AI Agents
In packages/workbench/src/components/internal/input-section.tsx around lines
374-396, the list uses key={label} where label is a truncated (60-char) string
which can collide; replace with a stable unique key derived from the full
example content or an existing unique id: compute a deterministic identifier
(e.g., hash of JSON.stringify(example) or the full stringified example) and use
that or combine it with the item index for uniqueness; if examples have a real
id field use that instead and avoid relying on the truncated label.

Comment on lines +14 to +15
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
className,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Quote style does not match coding guidelines.

The coding guidelines specify single quotes for formatting ('string'), but the file uses double quotes ("string"). Please update all string literals to use single quotes to comply with the Prettier configuration.

🔎 Proposed fix for quote style
  function Avatar({
  	className,
  	...props
  }: React.ComponentProps<typeof AvatarPrimitive.Root>) {
  	return (
  		<AvatarPrimitive.Root
  			data-slot="avatar"
  			className={cn(
-				"relative flex size-8 shrink-0 overflow-hidden rounded-full",
+				'relative flex size-8 shrink-0 overflow-hidden rounded-full',
  				className,
  			)}
  			{...props}
  		/>
  	);
  }

  function AvatarImage({
  	className,
  	...props
  }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
  	return (
  		<AvatarPrimitive.Image
  			data-slot="avatar-image"
-			className={cn("aspect-square size-full", className)}
+			className={cn('aspect-square size-full', className)}
  			{...props}
  		/>
  	);
  }

  function AvatarFallback({
  	className,
  	...props
  }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
  	return (
  		<AvatarPrimitive.Fallback
  			data-slot="avatar-fallback"
  			className={cn(
-				"bg-muted flex size-full items-center justify-center rounded-full",
+				'bg-muted flex size-full items-center justify-center rounded-full',
  				className,
  			)}
  			{...props}
  		/>
  	);
  }

Per coding guidelines, all files matching **/*.{ts,tsx,js,jsx,json} must use single quotes with Prettier.

Also applies to: 29-29, 43-44

🤖 Prompt for AI Agents
packages/workbench/src/components/ui/avatar.tsx lines 14-15 (also apply to 29-29
and 43-44): string literals are using double quotes instead of the project's
single-quote style; update those string literals to use single quotes (e.g.
"..." → '...') across the listed lines, ensure any concatenation or template
usage remains unchanged, and run Prettier/linters to confirm the file matches
the project's formatting rules.

Comment on lines +1 to 14
import type * as React from "react";

import { cn } from '../../lib/utils';
import { cn } from "../../lib/utils";

function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
<input
type={type}
data-slot="input"
className={cn(
'border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
'aria-invalid:focus-visible:ring-0',
className
"border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
"aria-invalid:focus-visible:ring-0",
className,
)}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Check for prettier configuration files
find . -type f \( -name ".prettierrc*" -o -name "prettier.config.*" \) | head -20

Repository: agentuity/sdk

Length of output: 70


🏁 Script executed:

# Check package.json for prettier configuration
cat package.json | grep -A 20 '"prettier"'

Repository: agentuity/sdk

Length of output: 231


🏁 Script executed:

# Examine the actual input.tsx file to verify quote usage
cat packages/workbench/src/components/ui/input.tsx

Repository: agentuity/sdk

Length of output: 1027


🏁 Script executed:

# Check other UI component files for consistency
ls -la packages/workbench/src/components/ui/ | head -20

Repository: agentuity/sdk

Length of output: 1170


🏁 Script executed:

cat .prettierrc

Repository: agentuity/sdk

Length of output: 181


🏁 Script executed:

# Check quote style in a few other UI component files
head -15 packages/workbench/src/components/ui/button.tsx
head -15 packages/workbench/src/components/ui/textarea.tsx

Repository: agentuity/sdk

Length of output: 1730


Run Prettier on this file to enforce configured single quotes.

The .prettierrc configuration requires singleQuote: true, but this file (and other UI components like textarea.tsx) uses double quotes. Reformat with Prettier to comply with the project's formatting standards.

🤖 Prompt for AI Agents
In packages/workbench/src/components/ui/input.tsx around lines 1 to 14 the file
uses double quotes for strings/JSX attributes but the project Prettier config
requires singleQuote: true; reformat the file (and other affected UI components
like textarea.tsx) with the project's Prettier configuration (or run the
configured format script) so all string literals and JSX attributes use single
quotes and whitespace/line breaks match the repo style.

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.

4 participants