Skip to content

Refactor docs search provider exports#7

Merged
KayleeWilliams merged 3 commits into
mainfrom
KayleeWilliams/byo-ai-gateway
Apr 22, 2026
Merged

Refactor docs search provider exports#7
KayleeWilliams merged 3 commits into
mainfrom
KayleeWilliams/byo-ai-gateway

Conversation

@KayleeWilliams
Copy link
Copy Markdown
Collaborator

Restructures @inth/docs search into provider-neutral, Vercel, TanStack, and Cloudflare entrypoints with explicit BYO gateway wiring. Adds shared stream/error handling, read-only docs filesystem primitives, provider-compatible bash tools, and compatibility aliases for existing search/ai and search/bash imports. Updates package exports, optional peer dependencies, docs, smoke app examples, generated agent docs, generated search data, and coverage for the new providers.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e0e91cba-f7e3-4e88-9cba-de5b10cf8d7e

📥 Commits

Reviewing files that changed from the base of the PR and between 7cf0397 and f047ce9.

📒 Files selected for processing (6)
  • packages/docs/src/search/answer-stream.test.ts
  • packages/docs/src/search/answer-stream.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/docs-bash.ts
  • packages/docs/src/search/tanstack.ts
  • packages/docs/src/search/vercel-bash.ts

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Provider-specific search integrations: Vercel, TanStack, and Cloudflare entrypoints; provider-tailored streaming and bash tooling.
  • Documentation

    • Guides and API docs updated to use provider-specific import paths and integration patterns; examples and workflows refreshed.
  • Refactor

    • Search surface reorganized to replace generic AI/bash entrypoints with provider-specific modules and adjust default model to openai/gpt-5.4-mini.
  • Tests

    • Added/updated tests for provider integrations, bash tooling, and streaming response helpers.

Walkthrough

The PR replaces generic AI/bash entrypoints in the docs search package with provider-specific entrypoints (Vercel, TanStack, Cloudflare), reorganizes streaming and bash tooling into new modules, adds tests and barrel exports, and updates docs, app imports, and package exports accordingly.

Changes

Cohort / File(s) Summary
Docs & Guides
README.md, packages/docs/README.md, apps/docs-smoke/content/docs/*, packages/docs/agent-docs/*, packages/docs/agent-docs/docs/*, packages/docs/agent-docs/docs/search.*
Replaced guidance referencing generic @inth/docs/search/ai and @inth/docs/search/bash with provider-specific entrypoints (vercel, tanstack, cloudflare) and updated examples, runtime instructions, and default model references.
Package surface & build config
packages/docs/package.json, packages/docs/tsup.config.ts, apps/docs-smoke/src/lib/docs.ts
Added exports subpaths for ./search/vercel, ./search/tanstack, ./search/cloudflare; added optional/dev peer deps for TanStack/Cloudflare AI libs; updated tsup to emit new bundles and mark provider libs external.
Vercel provider modules & tests
packages/docs/src/search/vercel.ts, packages/docs/src/search/vercel-index.ts, packages/docs/src/search/vercel-bash.ts, packages/docs/src/search/vercel.test.ts, packages/docs/src/search/vercel-bash.test.ts
Added Vercel-specific streamDocsAnswer, vercel bash-tool creator createDocsBashTool, barrel exports, and tests validating streaming and bash behavior.
TanStack provider modules & tests
packages/docs/src/search/tanstack.ts, packages/docs/src/search/tanstack-index.ts, packages/docs/src/search/tanstack-bash.ts, packages/docs/src/search/tanstack.test.ts, packages/docs/src/search/tanstack-bash.test.ts
Added TanStack streamDocsAnswer (adapter pattern), createDocsBashTools (multi-tool), barrel exports, and tests for streaming and tools.
Cloudflare provider modules & tests
packages/docs/src/search/cloudflare.ts, packages/docs/src/search/cloudflare-index.ts, packages/docs/src/search/cloudflare.test.ts
Added Cloudflare adapter factory createCloudflareDocsAdapter, Cloudflare barrel exports (including re-exported tanstack stream), and tests asserting adapter/provider selection and exports.
Core streaming utilities & tests
packages/docs/src/search/answer-stream.ts, packages/docs/src/search/answer-stream.test.ts
Introduced plain-text streaming helpers (createDocsTextStreamResponse, handlers, error mapping, response-init helpers) and tests covering response-init isolation and reasoning/empty-answer fallbacks.
Bash tooling refactor & tests
packages/docs/src/search/docs-bash.ts, packages/docs/src/search/bash-index.ts, packages/docs/src/search/bash.ts, packages/docs/src/search/docs-bash.test.ts, packages/docs/src/search/tanstack-bash.ts, packages/docs/src/search/tanstack-bash.test.ts
Extracted read-only docs bash environment, file-map generation, unsafe-command blocking, and instruction generation; reorganized re-exports and added TanStack and Vercel bash-tool implementations with tests.
Legacy AI removal & re-exports
packages/docs/src/search/ai.ts (removed), packages/docs/src/search/ai-index.ts
Removed the old generic ai.ts implementation; updated re-exports to route existing ai index symbols to the new provider-specific barrels (vercel).
App integration & tests
apps/docs-smoke/src/routes/api/docs/ask.ts, apps/docs-smoke/src/routes/playground.tsx, apps/docs-smoke/tests/e2e/smoke.e2e.ts
Switched imports to @inth/docs/search/vercel, changed default fallback model to openai/gpt-5.4-mini, updated playground import snippets and E2E expectations for provider-specific entrypoints.
Indexing & re-export barrels
packages/docs/src/search/*-index.ts (vercel-index, tanstack-index, cloudflare-index)
Added new barrel modules consolidating provider APIs for simpler imports.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(200,200,255,0.5)
  participant Client
  end
  rect rgba(200,255,200,0.5)
  participant Server as "App /api/docs/ask"
  end
  rect rgba(255,220,180,0.5)
  participant Provider as "streamDocsAnswer (vercel/tanstack/cloudflare)"
  end
  rect rgba(255,200,200,0.5)
  participant Model as "AI Gateway / Model"
  end

  Client->>Server: POST /api/docs/ask (query + explicit user action)
  Server->>Provider: call streamDocsAnswer(options)
  Provider->>Model: streamText / chat run (adapter or SDK)
  Model-->>Provider: streaming chunks (text, reasoning, errors)
  Provider->>Server: AsyncIterable<chunks>
  Server->>Client: Response stream (createDocsTextStreamResponse)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I hopped through modules, nibbled old AI vines,
Split paths for Vercel, TanStack, Cloudflare shines.
Streams now sing plain text, bash tools guard the land,
New barrels tidy exports, adapters close at hand —
A carrot-coded cheer for the new provider lines!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: refactoring docs search into provider-specific exports, which is the primary objective of this comprehensive PR.
Description check ✅ Passed The description is related to the changeset, detailing the restructuring of @inth/docs search exports and the addition of new functionality across multiple files and modules.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7edbe84b8b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/docs/src/search/index.ts Outdated
Comment on lines +1 to +7
export {
type CreateDocsBashFileMapOptions,
type CreateDocsBashOptions,
createDocsBash,
createDocsBashFileMap,
type DocsBashFileMap,
} from "./docs-bash";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove docs-bash re-export from core search entrypoint

Re-exporting ./docs-bash here makes every @inth/docs/search import load docs-bash, which has a runtime import of just-bash. Because just-bash is declared as an optional peer, consumers that only use search/query helpers (and do not install bash dependencies) will now fail during module resolution before they call any API. Keep bash primitives on a separate subpath or load them lazily so the base search runtime remains dependency-light.

Useful? React with 👍 / 👎.

Comment on lines 1 to +7
export {
type CreateDocsBashFileMapOptions,
type CreateDocsBashOptions,
type CreateDocsBashToolOptions,
createDocsBash,
createDocsBashFileMap,
createDocsBashTool,
type DocsBashFileMap,
type DocsBashToolResult,
type DocsBashTools,
} from "./bash";
} from "./docs-bash";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-export createDocsBashTool from search/bash alias

This alias now exports only docs filesystem primitives, so existing imports like import { createDocsBashTool } from "@inth/docs/search/bash" no longer resolve. That is a breaking regression for current users of the search/bash subpath, resulting in missing-export errors at build/runtime. If search/bash is meant to remain a compatibility alias, it should continue to export createDocsBashTool and its related types.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@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: 12

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/docs/src/search/ai.ts`:
- Around line 1-10: Delete the unused duplicate module file ai.ts (which
re-exports symbols like createDocsBashTool, streamDocsAnswer,
CreateDocsBashToolOptions, DocsProviderOptions, etc.) because ai-index.ts is the
canonical public entry; remove ai.ts from the repository and any incidental
references (imports or package.json exports) if present, then run the test/build
to confirm nothing breaks.

In `@packages/docs/src/search/answer-stream.ts`:
- Around line 25-29: The function createDocsTextStreamResponse currently returns
the shared RESPONSE_INIT object by reference (via returning RESPONSE_INIT),
which lets downstream mutations of headers leak globally; fix by returning a
fresh ResponseInit object instead of the shared constant — e.g., construct and
return a shallow clone of RESPONSE_INIT and ensure headers is copied into a new
Headers instance so changes to the returned init.headers do not mutate
RESPONSE_INIT; update the return site in createDocsTextStreamResponse (and any
similar return paths around lines 86–88) to use the cloned object.

In `@packages/docs/src/search/cloudflare-index.ts`:
- Around line 1-13: Add a top-of-file TSDoc package entry comment (use
`@packageDocumentation`) to describe this module as the Cloudflare docs search
public entrypoint and summarize the exported API (CloudflareDocsProvider,
CreateCloudflareDocsAdapterOptions, createCloudflareDocsAdapter,
StreamDocsAnswerOptions, StreamDocsAnswerResult, streamDocsAnswer and the bash
helpers CreateDocsBashToolsOptions, createDocsBashTools,
DocsTanStackBashResult). Place the comment above the export statements so the
doc generator picks it up, matching the style used in tanstack-index.ts.

In `@packages/docs/src/search/cloudflare.test.ts`:
- Around line 8-22: The tests fail because createCloudflareDocsAdapter returns
raw adapters from the Cloudflare factories that lack a name property; update
createCloudflareDocsAdapter to attach a name field to the returned adapter
(e.g., call the underlying factories like createOpenAiChat or
createWorkersAiChat as before, then return Object.assign(adapter, { name:
"openai" }) or { ...adapter, name: "workers-ai" } based on the provider/model
mapping) so the adapter objects include the expected name; ensure you preserve
all original methods/props and use the same options passed into
createCloudflareDocsAdapter.

In `@packages/docs/src/search/cloudflare.ts`:
- Around line 84-86: The default switch branch currently throws a generic
Error("Unsupported Cloudflare docs provider.") which omits the actual invalid
value; change this to include the runtime provider variable (e.g., `provider`)
in the message and replace the bare throw with an exhaustive-check pattern:
implement/use an `assertNever` helper and call it in the `default` branch so the
thrown error contains the invalid provider value and TypeScript can catch
non-exhaustive handling at compile time; update the `default` branch that
currently contains `throw new Error("Unsupported Cloudflare docs provider.");`
to call `assertNever(provider)` (or include `provider` in the Error message) to
surface the exact invalid provider.

In `@packages/docs/src/search/docs-bash.ts`:
- Around line 306-317: The function blockUnsafeDocsBashCommand currently returns
a string or undefined which is used both as a replacement and as a truthy check;
make the caller use an explicit undefined check instead of truthy/falsy to avoid
ambiguity: replace usages like if (blockUnsafeDocsBashCommand(command)) with
const replacement = blockUnsafeDocsBashCommand(command); if (replacement !==
undefined) { /* use replacement when rewriting, else treat as safe */ }, leaving
blockUnsafeDocsBashCommand(command) behavior unchanged and ensuring callers
treat its return as an optional replacement string rather than a boolean.
- Around line 89-93: UNSAFE_COMMAND_PATTERN currently omits the tee command
which can write files; update the UNSAFE_COMMAND_PATTERN regex to include tee
(e.g., add |tee into the alternation) so commands like "tee" are matched as
unsafe, ensuring it is caught alongside rm, mv, cp, touch, mkdir, chmod, curl,
wget, python, python3, node, js-exec (also verify READ_ONLY_COMMANDS usage
elsewhere if consumers can pass custom commands).

In `@packages/docs/src/search/tanstack-bash.ts`:
- Around line 80-96: readCommandInput and readPathInput currently return "" for
malformed input which hides "no input" vs intentionally empty string; change
readPathInput to return a distinct sentinel (e.g., null) when the args are
invalid instead of "" and update the caller docs_read_file to check for that
sentinel (and bail out or return an explicit error/response) before proceeding
with path normalization; similarly consider making readCommandInput return the
same sentinel and ensure docs_bash still handles the sentinel case. Reference:
functions readCommandInput, readPathInput and the caller docs_read_file (and
docs_bash) in the same module.
- Around line 136-143: The server handler in the .server((args) => { ... })
block uses readPathInput and normalizeDocsFilePath to compute path and then
returns content: fileMap[path] ?? "" which hides missing files; update this code
to detect when fileMap[path] is undefined and return a notFound: true flag
alongside content/path instead of returning an empty string, and update
READ_FILE_OUTPUT_SCHEMA to include an optional boolean notFound property so
consumers can distinguish a missing file from an empty file; keep the existing
keys (content/path) but set content to "" only for present empty files and set
notFound when the file is absent.

In `@packages/docs/src/search/tanstack.ts`:
- Around line 44-49: The function appendToolInstructions is duplicated in
tanstack.ts and vercel.ts; extract it into a shared utility module (e.g.,
answer-stream.ts or answer-utils.ts) as a single exported function and replace
the local definitions by importing appendToolInstructions in both tanstack.ts
and vercel.ts; ensure the exported signature matches the existing one (system:
string, toolInstructions?: string) and update any imports/usages accordingly so
behavior remains identical.

In `@packages/docs/src/search/vercel-bash.ts`:
- Around line 34-36: Wrap the dynamic import of BASH_TOOL_PACKAGE (the line that
assigns createBashTool) in a try-catch and handle the module-not-found case: in
the catch, throw or return a clear descriptive error explaining that "bash-tool"
is an optional peer dependency required for this provider and how to install it
(or return null if the entrypoint should degrade gracefully). Update any callers
of createBashTool usage in this module (vercel-bash.ts) to handle the
null/exception path accordingly so importing `@inth/docs/search/vercel` without
bash-tool yields a helpful message instead of a raw import error.

In `@packages/docs/src/search/vercel.ts`:
- Around line 104-114: The onError handler passed into the runStreamText
invocation currently swallows all errors (onError: () => undefined); update the
runStreamText call (the variable runStreamText produced from
options.streamTextImpl or streamText) to provide an onError that surfaces the
error—e.g., log it with console.error or the project logger and/or
rethrow/forward it so callers can handle it—so non-stream errors (network/setup)
are not silently lost; ensure the handler includes context (model or prompt) to
aid debugging.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0f534ae6-4cf3-41cc-828b-40acf1f6dd05

📥 Commits

Reviewing files that changed from the base of the PR and between 6556ed5 and 7edbe84.

⛔ Files ignored due to path filters (3)
  • apps/docs-smoke/src/generated/docs-search-content.json is excluded by !**/generated/**
  • apps/docs-smoke/src/generated/docs-search-index.json is excluded by !**/generated/**
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (35)
  • README.md
  • apps/docs-smoke/content/docs/guides/quickstart.mdx
  • apps/docs-smoke/content/docs/index.mdx
  • apps/docs-smoke/content/docs/search.mdx
  • apps/docs-smoke/src/lib/docs.ts
  • apps/docs-smoke/src/routes/api/docs/ask.ts
  • apps/docs-smoke/src/routes/playground.tsx
  • apps/docs-smoke/tests/e2e/smoke.e2e.ts
  • packages/docs/README.md
  • packages/docs/agent-docs-src/docs/search.mdx
  • packages/docs/agent-docs/docs/llms-full/generation/search.txt
  • packages/docs/agent-docs/docs/search.md
  • packages/docs/package.json
  • packages/docs/src/search/ai-index.ts
  • packages/docs/src/search/ai.ts
  • packages/docs/src/search/answer-stream.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/cloudflare.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/docs-bash.ts
  • packages/docs/src/search/index.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/tanstack-bash.ts
  • packages/docs/src/search/tanstack-index.ts
  • packages/docs/src/search/tanstack.test.ts
  • packages/docs/src/search/tanstack.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/vercel-index.ts
  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/vercel.ts
  • packages/docs/tsup.config.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/docs-bash.test.ts
  • apps/docs-smoke/src/routes/playground.tsx
  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • apps/docs-smoke/tests/e2e/smoke.e2e.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/tanstack.test.ts
  • packages/docs/src/search/ai-index.ts
  • packages/docs/src/search/vercel-index.ts
  • apps/docs-smoke/src/routes/api/docs/ask.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/ai.ts
  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/index.ts
  • apps/docs-smoke/src/lib/docs.ts
  • packages/docs/src/search/answer-stream.ts
  • packages/docs/src/search/tanstack-bash.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/cloudflare.ts
  • packages/docs/src/search/tanstack.ts
  • packages/docs/src/search/vercel.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/docs-bash.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/docs-bash.test.ts
  • apps/docs-smoke/src/routes/playground.tsx
  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • apps/docs-smoke/tests/e2e/smoke.e2e.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/tanstack.test.ts
  • packages/docs/src/search/ai-index.ts
  • packages/docs/src/search/vercel-index.ts
  • apps/docs-smoke/src/routes/api/docs/ask.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/ai.ts
  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/index.ts
  • apps/docs-smoke/src/lib/docs.ts
  • packages/docs/src/search/answer-stream.ts
  • packages/docs/src/search/tanstack-bash.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/cloudflare.ts
  • packages/docs/src/search/tanstack.ts
  • packages/docs/src/search/vercel.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/docs-bash.ts
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{test,spec}.{js,ts,jsx,tsx}: Write assertions inside it() or test() blocks
Avoid done callbacks in async tests - use async/await instead
Don't use .only or .skip in committed code
Keep test suites reasonably flat - avoid excessive describe nesting

Files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/tanstack.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx}: Use function components over class components in React
Call hooks at the top level only, never conditionally
Specify all dependencies in hook dependency arrays correctly
Use the key prop for elements in iterables (prefer unique IDs over array indices)
Nest children between opening and closing tags instead of passing as props
Don't define components inside other components
Avoid dangerouslySetInnerHTML unless absolutely necessary
Use proper image components (e.g., Next.js <Image>) over <img> tags
Use Next.js <Image> component for images
Use next/head or App Router metadata API for head elements in Next.js
Use Server Components for async data fetching instead of async Client Components in Next.js
Use ref as a prop instead of React.forwardRef in React 19+

Files:

  • apps/docs-smoke/src/routes/playground.tsx
**/*.{jsx,tsx,html}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{jsx,tsx,html}: Use semantic HTML and ARIA attributes for accessibility: provide meaningful alt text for images, use proper heading hierarchy, add labels for form inputs, include keyboard event handlers alongside mouse events, use semantic elements instead of divs with roles
Add rel="noopener" when using target="_blank" on links

Files:

  • apps/docs-smoke/src/routes/playground.tsx
**/index.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid barrel files (index files that re-export everything)

Files:

  • packages/docs/src/search/index.ts
🧠 Learnings (56)
📓 Common learnings
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/index.{ts,tsx} : Use `packageDocumentation` for entrypoint docs in TSDoc comments
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Use Vitest for testing framework

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/package.json
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{js,jsx} : Use `module` for module-level docs in JSDoc comments

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/index.ts
  • packages/docs/src/search/tanstack-bash.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/docs-bash.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't use export or module.exports in test files

Applied to files:

  • packages/docs/src/search/vercel.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Write unit tests for components in Elements package using Vitest

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Make sure the assertion function, like expect, is placed inside an it() function call

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Keep test suites reasonably flat - avoid excessive `describe` nesting

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/tanstack.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Use Vitest as the testing framework for Elements package

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Keep test suites reasonably flat - avoid excessive `describe` nesting

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/tanstack.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't nest describe() blocks too deeply in test files

Applied to files:

  • packages/docs/src/search/vercel.test.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/search/vercel.test.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Avoid done callbacks in async tests - use async/await instead

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx} : Avoid done callbacks in async tests - use async/await instead

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Avoid done callbacks in async tests - use async/await instead

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Avoid done callbacks in async tests - use async/await instead

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-01-31T11:24:55.220Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/app/**/*.{ts,tsx} : Use Next.js App Router conventions in the docs app

Applied to files:

  • apps/docs-smoke/src/routes/playground.tsx
  • apps/docs-smoke/tests/e2e/smoke.e2e.ts
📚 Learning: 2026-01-31T11:24:55.220Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/app/**/page.tsx : Place page components in appropriate route segments within the docs app

Applied to files:

  • apps/docs-smoke/src/routes/playground.tsx
  • apps/docs-smoke/tests/e2e/smoke.e2e.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/index.{ts,tsx} : Export type definitions for public API in Elements package

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/ai-index.ts
  • packages/docs/src/search/vercel-index.ts
  • packages/docs/src/search/ai.ts
  • packages/docs/src/search/index.ts
  • packages/docs/package.json
  • apps/docs-smoke/src/lib/docs.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API and avoid TypeScript enums; use const objects or 'as const' assertions instead due to runtime overhead and tree-shaking limitations

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/ai-index.ts
  • packages/docs/src/search/vercel-index.ts
  • packages/docs/src/search/index.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API in TypeScript libraries

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/ai-index.ts
  • packages/docs/src/search/vercel-index.ts
  • packages/docs/src/search/index.ts
  • packages/docs/package.json
  • packages/docs/src/search/tanstack-bash.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Export type definitions for public API

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/ai-index.ts
  • packages/docs/src/search/vercel-index.ts
  • packages/docs/src/search/index.ts
  • packages/docs/package.json
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/index.{ts,tsx} : Use `packageDocumentation` for entrypoint docs in TSDoc comments

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • packages/docs/src/search/index.ts
  • apps/docs-smoke/src/lib/docs.ts
  • packages/docs/README.md
  • apps/docs-smoke/content/docs/index.mdx
  • packages/docs/src/search/docs-bash.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Include TSDoc comments for components in Elements package

Applied to files:

  • packages/docs/tsup.config.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Include TSDoc comments for components

Applied to files:

  • packages/docs/tsup.config.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/vercel-index.ts
  • packages/docs/package.json
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't export empty modules that don't change anything

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx,md} : Include TypeScript examples in Elements package documentation

Applied to files:

  • packages/docs/tsup.config.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/index.{ts,tsx,js,jsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/vercel-index.ts
  • packages/docs/package.json
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/index.{js,ts,jsx,tsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/vercel-index.ts
  • packages/docs/package.json
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/index.{js,jsx,ts,tsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/src/search/tanstack-index.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/vercel-index.ts
  • packages/docs/package.json
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use the `node:` protocol for Node.js builtin modules

Applied to files:

  • packages/docs/tsup.config.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item

Applied to files:

  • packages/docs/tsup.config.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't use specified modules when loaded by import or require

Applied to files:

  • packages/docs/tsup.config.ts
  • packages/docs/package.json
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Include TypeScript examples

Applied to files:

  • packages/docs/tsup.config.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Test accessibility features in Elements package component tests

Applied to files:

  • apps/docs-smoke/tests/e2e/smoke.e2e.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/tanstack.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Test accessibility features

Applied to files:

  • apps/docs-smoke/tests/e2e/smoke.e2e.ts
  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/tanstack.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Include integration tests

Applied to files:

  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack.test.ts
📚 Learning: 2026-03-19T22:58:00.031Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-03-19T22:58:00.031Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Write comprehensive unit tests with clear test case names describing what is being tested

Applied to files:

  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Include unit tests for components, integration tests for component combinations, accessibility tests, and error boundary tests

Applied to files:

  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Include integration tests for Elements package components

Applied to files:

  • packages/docs/src/search/cloudflare.test.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx} : Keep test suites reasonably flat - avoid excessive `describe` nesting

Applied to files:

  • packages/docs/src/search/cloudflare.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Keep test suites reasonably flat - avoid excessive `describe` nesting

Applied to files:

  • packages/docs/src/search/cloudflare.test.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Document expected failures with `throws` in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/search/tanstack-bash.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Write unit tests for components

Applied to files:

  • packages/docs/src/search/tanstack-bash.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Document all props and types in Elements package TypeScript code

Applied to files:

  • packages/docs/src/search/ai-index.ts
  • apps/docs-smoke/src/lib/docs.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Don't use `.only` or `.skip` in committed code

Applied to files:

  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't use disabled tests

Applied to files:

  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `import type` for types

Applied to files:

  • packages/docs/package.json
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `with { type: "json" }` for JSON module imports

Applied to files:

  • packages/docs/package.json
  • apps/docs-smoke/content/docs/search.mdx
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use static Response methods instead of new Response() constructor when possible

Applied to files:

  • packages/docs/src/search/answer-stream.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{js,jsx} : Write JSDoc summaries with intent in JavaScript files

Applied to files:

  • packages/docs/src/search/tanstack-bash.ts
  • packages/docs/src/search/docs-bash.ts
📚 Learning: 2026-03-19T22:57:19.913Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Keep documentation organized by categories

Applied to files:

  • packages/docs/README.md
  • README.md
📚 Learning: 2026-01-31T11:24:55.220Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/app/**/{layout,page}.tsx : Keep layouts and pages separate in the docs app directory

Applied to files:

  • packages/docs/src/search/docs-bash.ts
🔍 Remote MCP Context7

Let me search the web for information about these APIs and the PR changes:Based on my research of the relevant libraries and APIs, I've gathered important context for reviewing this PR. Here's a summary of key findings:

Additional Context for PR #7 Review

TanStack AI Architecture & Adapter Pattern

TanStack AI uses a pluggable adapter system that is provider-agnostic, allowing you to write application logic once and switch between OpenAI, Anthropic, Google Gemini, or Llama without rewriting code. When you use chat(), it returns an async iterable stream of chunks, and the server-side pattern uses chat() with an adapter and toServerSentEventsResponse() to convert the stream to HTTP response.

This aligns with the PR's shift from a single @inth/docs/search/ai entrypoint to provider-specific adapter implementations for Vercel, TanStack, and Cloudflare.

Cloudflare Workers AI & TanStack Integration

The @cloudflare/tanstack-ai package brings Workers AI and AI Gateway support to TanStack AI, providing a framework-agnostic alternative for developers who prefer TanStack's approach. Workers AI adapters support four configuration modes — plain binding (env.AI), plain REST, AI Gateway binding (env.AI.gateway(id)), and AI Gateway REST — across all capabilities including Chat with streaming, tool calling, and structured output.

The PR's createCloudflareDocsAdapter function aligns with this pattern, supporting both Workers AI models and AI Gateway routing for third-party providers.

Streaming & Error Handling Patterns

Full streams support error parts, and you can handle those parts similar to other parts. The PR's new answer-stream.ts module implements custom error handling via createDocsTextStreamResponse, which is consistent with Vercel AI SDK patterns where error handling uses the onError callback for streamText/streamObject to manage errors gracefully.

Tool Definition & Bash Integration

TanStack AI defines tools with a type "function" and optional execute and needsApproval fields, supporting streaming chat with tool calling. The PR's tanstack-bash.ts module follows this pattern by defining docs_bash and docs_read_file tools with JSON schemas and execute functions.

Key PR Alignment Points

  1. Provider-Agnostic Design: The PR's refactoring toward provider-specific entrypoints (vercel-index.ts, tanstack-index.ts, cloudflare-index.ts) aligns with TanStack AI's adapter-based philosophy.

  2. Streaming Architecture: Both Vercel AI SDK and TanStack AI support streaming via chat()AsyncIterable<StreamChunk> conversion to HTTP responses, which the PR implements via createDocsTextStreamResponse.

  3. Tool Compatibility: The bash tools created in tanstack-bash.ts follow TanStack AI's Tool interface pattern with JSON schemas and execute functions.

  4. Read-Only Filesystem: The PR's ReadOnlyDocsFileSystem wrapper blocking write mutations is a sensible security pattern for agent tools.

[::web_search::],

Comment thread packages/docs/src/search/ai.ts Outdated
Comment thread packages/docs/src/search/answer-stream.ts
Comment thread packages/docs/src/search/cloudflare-index.ts
Comment on lines +8 to +22
expect(
createCloudflareDocsAdapter({
model: "gpt-4o",
options,
provider: "openai",
})
).toMatchObject({ name: "openai" });

expect(
createCloudflareDocsAdapter({
model: "@cf/meta/llama-3.1-8b-instruct",
options,
provider: "workers-ai",
})
).toMatchObject({ name: "workers-ai" });
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify if the adapter objects returned by createCloudflareDocsAdapter have a `name` property

# Check the cloudflare.ts implementation for any name property assignment
ast-grep --pattern 'function createCloudflareDocsAdapter($_) {
  $$$
}'

# Check if the underlying adapter creation functions set a name property
rg -n "name.*:" packages/docs/src/search/cloudflare.ts

# Check the type definitions for adapter return types
rg -nA5 "type.*Adapter" packages/docs/src/search/cloudflare.ts

Repository: inthhq/docs

Length of output: 486


🌐 Web query:

Does @cloudflare/tanstack-ai createOpenAiChat return an adapter with a name property?

💡 Result:

No, @cloudflare/tanstack-ai's createOpenAiChat does not return an adapter with a name property. It returns a TanStack AI chat adapter instance compatible with the chat function, similar to standard TanStack AI adapters like openaiText(model). Official documentation and examples consistently show it assigned to variables named "adapter" or "openai" without any mention or usage of a .name property. TanStack AI core adapters have a .selectedModel property but no standard .name property on the adapter object itself. The Cloudflare variant follows the same factory pattern: createOpenAiChat(model, config) -> adapter for use in chat({ adapter }). No source code or docs indicate a name property.

Citations:


🏁 Script executed:

# View the createCloudflareDocsAdapter implementation
cat packages/docs/src/search/cloudflare.ts

Repository: inthhq/docs

Length of output: 2384


🏁 Script executed:

# View the complete test file
cat packages/docs/src/search/cloudflare.test.ts

Repository: inthhq/docs

Length of output: 905


🏁 Script executed:

# Find and view cloudflare-index file
fd -e ts -e js "cloudflare-index" packages/docs/src/search/

Repository: inthhq/docs

Length of output: 99


🏁 Script executed:

# If cloudflare-index.ts exists, view its contents
if [ -f "packages/docs/src/search/cloudflare-index.ts" ]; then
  cat packages/docs/src/search/cloudflare-index.ts
fi

Repository: inthhq/docs

Length of output: 398


Test assertions expect name property that adapters don't have.

The test expects adapters to have { name: "openai" } and { name: "workers-ai" }, but createCloudflareDocsAdapter returns adapters directly from underlying Cloudflare factory functions (e.g., createOpenAiChat, createWorkersAiChat) without adding a name property. The @cloudflare/tanstack-ai adapters do not include a name property, so these assertions will fail.

Either add the name property to the returned adapters in createCloudflareDocsAdapter, or update the test assertions to match the actual adapter structure.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/docs/src/search/cloudflare.test.ts` around lines 8 - 22, The tests
fail because createCloudflareDocsAdapter returns raw adapters from the
Cloudflare factories that lack a name property; update
createCloudflareDocsAdapter to attach a name field to the returned adapter
(e.g., call the underlying factories like createOpenAiChat or
createWorkersAiChat as before, then return Object.assign(adapter, { name:
"openai" }) or { ...adapter, name: "workers-ai" } based on the provider/model
mapping) so the adapter objects include the expected name; ensure you preserve
all original methods/props and use the same options passed into
createCloudflareDocsAdapter.

Comment on lines +84 to +86
default:
throw new Error("Unsupported Cloudflare docs provider.");
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Improve error message to include the invalid provider value.

The error message doesn't indicate which provider was passed, making debugging harder if this is reached at runtime. Consider adding the provider to the message and using an exhaustiveness check pattern.

♻️ Suggested improvement
+    default: {
+      const exhaustiveCheck: never = options;
+      throw new Error(
+        `Unsupported Cloudflare docs provider: ${(exhaustiveCheck as CreateCloudflareDocsAdapterOptions).provider}`
+      );
+    }
-    default:
-      throw new Error("Unsupported Cloudflare docs provider.");
📝 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
default:
throw new Error("Unsupported Cloudflare docs provider.");
}
default: {
const exhaustiveCheck: never = options;
throw new Error(
`Unsupported Cloudflare docs provider: ${(exhaustiveCheck as CreateCloudflareDocsAdapterOptions).provider}`
);
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/docs/src/search/cloudflare.ts` around lines 84 - 86, The default
switch branch currently throws a generic Error("Unsupported Cloudflare docs
provider.") which omits the actual invalid value; change this to include the
runtime provider variable (e.g., `provider`) in the message and replace the bare
throw with an exhaustive-check pattern: implement/use an `assertNever` helper
and call it in the `default` branch so the thrown error contains the invalid
provider value and TypeScript can catch non-exhaustive handling at compile time;
update the `default` branch that currently contains `throw new
Error("Unsupported Cloudflare docs provider.");` to call `assertNever(provider)`
(or include `provider` in the Error message) to surface the exact invalid
provider.

Comment thread packages/docs/src/search/tanstack-bash.ts Outdated
Comment thread packages/docs/src/search/tanstack-bash.ts
Comment thread packages/docs/src/search/tanstack.ts Outdated
Comment thread packages/docs/src/search/vercel-bash.ts Outdated
Comment thread packages/docs/src/search/vercel.ts
Copy link
Copy Markdown

@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: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/docs/src/search/answer-stream.ts`:
- Around line 39-63: The loop in the stream consumer currently calls
handlers.getText and continues before recording finish metadata and before
checking reasoning, so finishReason set by handlers.getFinishReason may be lost
and reasoning parts with text are treated as normal text; modify the for-await
loop in answer-stream.ts to call handlers.getFinishReason(part) at the top
(assign to finishReason prior to any continue), then call
handlers.isReasoning?.(part) before handlers.getText(part) and skip enqueueing
text for reasoning parts (set streamedReasoning and continue), keeping the
existing error handling and text handling after these checks.

In `@packages/docs/src/search/docs-bash.ts`:
- Around line 103-108: The current behavior in createDocsBash (and the
CreateDocsBashOptions handling at the other occurrence) dangerously lets callers
replace the safe allowlist by doing options.commands ?? [...READ_ONLY_COMMANDS];
instead, validate options.commands against READ_ONLY_COMMANDS: if
options.commands is provided, ensure every entry exists in READ_ONLY_COMMANDS
and reject (throw/return error) or remove unsupported entries (prefer rejecting
to avoid silent narrowing) so the effective command set is always a subset of
READ_ONLY_COMMANDS; update the logic around options.commands in createDocsBash
and the same pattern at the other occurrence (around lines mentioned) to perform
this validation rather than wholesale replacement.

In `@packages/docs/src/search/tanstack.ts`:
- Around line 88-99: Add a short inline comment above the double cast explaining
why it's necessary: note that runChat is the result of options.chatImpl ?? chat
(a union of a ChatLike and the library chat function) so TypeScript cannot infer
the precise return type and we intentionally cast the argument to ChatOptions
and the result to AsyncIterable<StreamChunk>; reference the runChat call, the
ChatOptions type, the StreamChunk type, and the options.chatImpl ?? chat
expression so maintainers understand this is an intentional workaround, not a
mistake.

In `@packages/docs/src/search/vercel-bash.ts`:
- Around line 35-43: The current catch around the dynamic import of
BASH_TOOL_PACKAGE swallows all errors; change the catch to capture the thrown
error (e.g., catch (err)) and only convert it to the "install bash-tool" Error
when the failure is a missing-module error (check err.code ===
'MODULE_NOT_FOUND' or err.message includes 'Cannot find module' to cover
runtimes); if the error is not a module-not-found, rethrow the original error so
syntax/evaluation errors inside the imported package surface; apply this change
around the import that assigns createBashTool from the imported module.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ffe1e6df-2b2a-456c-9d94-363aa840a068

📥 Commits

Reviewing files that changed from the base of the PR and between 7edbe84 and 7cf0397.

⛔ Files ignored due to path filters (2)
  • apps/docs-smoke/src/generated/docs-search-content.json is excluded by !**/generated/**
  • apps/docs-smoke/src/generated/docs-search-index.json is excluded by !**/generated/**
📒 Files selected for processing (23)
  • README.md
  • apps/docs-smoke/content/docs/index.mdx
  • apps/docs-smoke/content/docs/search.mdx
  • apps/docs-smoke/src/lib/docs.ts
  • packages/docs/README.md
  • packages/docs/agent-docs-src/docs/search.mdx
  • packages/docs/agent-docs/docs/llms-full/generation/search.txt
  • packages/docs/agent-docs/docs/search.md
  • packages/docs/src/search/ai.ts
  • packages/docs/src/search/answer-stream.test.ts
  • packages/docs/src/search/answer-stream.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/cloudflare.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/docs-bash.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/tanstack-bash.ts
  • packages/docs/src/search/tanstack.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/vercel.ts
💤 Files with no reviewable changes (1)
  • packages/docs/src/search/ai.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Prefer unknown over any when the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions

Files:

  • packages/docs/src/search/answer-stream.test.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/answer-stream.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/tanstack-bash.ts
  • apps/docs-smoke/src/lib/docs.ts
  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/cloudflare.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/vercel.ts
  • packages/docs/src/search/tanstack.ts
  • packages/docs/src/search/docs-bash.ts
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't use eval() or assign directly to document.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types for meaningful naming
Add comments for complex logic, but prefer self-documenting code

Files:

  • packages/docs/src/search/answer-stream.test.ts
  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/answer-stream.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/tanstack-bash.ts
  • apps/docs-smoke/src/lib/docs.ts
  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/cloudflare.ts
  • packages/docs/src/search/docs-bash.test.ts
  • packages/docs/src/search/vercel.ts
  • packages/docs/src/search/tanstack.ts
  • packages/docs/src/search/docs-bash.ts
**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{test,spec}.{js,ts,jsx,tsx}: Write assertions inside it() or test() blocks
Avoid done callbacks in async tests - use async/await instead
Don't use .only or .skip in committed code
Keep test suites reasonably flat - avoid excessive describe nesting

Files:

  • packages/docs/src/search/answer-stream.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/docs-bash.test.ts
🧠 Learnings (60)
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Write unit tests for components in Elements package using Vitest

Applied to files:

  • packages/docs/src/search/answer-stream.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/search/answer-stream.test.ts
  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/index.{ts,tsx} : Export type definitions for public API in Elements package

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/bash-index.ts
  • apps/docs-smoke/src/lib/docs.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/index.{ts,tsx,js,jsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/docs-bash.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/index.{js,ts,jsx,tsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/bash.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/bash.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Export type definitions for public API

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/index.{js,jsx,ts,tsx} : Avoid barrel files (index files that re-export everything)

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/bash.ts
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API in TypeScript libraries

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/bash-index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/index.{ts,tsx} : Use `packageDocumentation` for entrypoint docs in TSDoc comments

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
  • apps/docs-smoke/content/docs/index.mdx
  • apps/docs-smoke/src/lib/docs.ts
  • packages/docs/src/search/docs-bash.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Write clear summary sentences in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Include TSDoc comments for components

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Use `see` for related APIs in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx} : Apply release tags consistently in TSDoc comments

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{js,jsx} : Write JSDoc summaries with intent in JavaScript files

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Include TSDoc comments for components in Elements package

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{js,jsx} : Document constructors and classes clearly in JSDoc comments

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Document components with purpose and use case, required and optional props, context requirements, example usage, and common pitfalls

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{js,jsx} : Use `module` for module-level docs in JSDoc comments

Applied to files:

  • packages/docs/src/search/cloudflare-index.ts
  • packages/docs/src/search/bash-index.ts
  • packages/docs/src/search/docs-bash.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Use Vitest for testing framework

Applied to files:

  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Use Vitest as the testing framework for Elements package

Applied to files:

  • packages/docs/src/search/vercel-bash.test.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Write assertions inside `it()` or `test()` blocks

Applied to files:

  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Make sure the assertion function, like expect, is placed inside an it() function call

Applied to files:

  • packages/docs/src/search/vercel-bash.test.ts
  • packages/docs/src/search/tanstack-bash.test.ts
  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-03-19T22:58:00.031Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-03-19T22:58:00.031Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Write comprehensive unit tests with clear test case names describing what is being tested

Applied to files:

  • packages/docs/src/search/tanstack-bash.test.ts
📚 Learning: 2026-03-19T22:57:33.411Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:33.411Z
Learning: Applies to packages/elements/**/*.{test,spec}.{ts,tsx} : Test accessibility features in Elements package component tests

Applied to files:

  • packages/docs/src/search/tanstack-bash.test.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Keep test suites reasonably flat - avoid excessive `describe` nesting

Applied to files:

  • packages/docs/src/search/tanstack-bash.test.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.test.{ts,tsx} : Write unit tests for components

Applied to files:

  • packages/docs/src/search/tanstack-bash.test.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Keep test suites reasonably flat - avoid excessive `describe` nesting

Applied to files:

  • packages/docs/src/search/tanstack-bash.test.ts
📚 Learning: 2026-03-19T22:57:19.913Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Keep documentation organized by categories

Applied to files:

  • README.md
  • packages/docs/README.md
📚 Learning: 2026-03-19T22:57:19.913Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:19.913Z
Learning: Applies to apps/docs/**/*.mdx : Use MDX for documentation pages

Applied to files:

  • README.md
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't export empty modules that don't change anything

Applied to files:

  • packages/docs/src/search/bash-index.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx} : Export type definitions for public API and avoid TypeScript enums; use const objects or 'as const' assertions instead due to runtime overhead and tree-shaking limitations

Applied to files:

  • packages/docs/src/search/bash-index.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use static Response methods instead of new Response() constructor when possible

Applied to files:

  • packages/docs/src/search/answer-stream.ts
📚 Learning: 2026-01-31T11:24:55.220Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/docs-rules.mdc:0-0
Timestamp: 2026-01-31T11:24:55.220Z
Learning: Applies to apps/docs/app/**/{layout,page}.tsx : Keep layouts and pages separate in the docs app directory

Applied to files:

  • packages/docs/src/search/bash.ts
  • packages/docs/src/search/docs-bash.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Handle errors appropriately in async code with try-catch blocks

Applied to files:

  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/vercel.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Handle errors appropriately in async code with try-catch blocks

Applied to files:

  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/vercel.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Handle errors appropriately in async code with try-catch blocks

Applied to files:

  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/vercel.ts
📚 Learning: 2026-03-19T22:58:00.031Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2026-03-19T22:58:00.031Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Handle errors explicitly and avoid silent failures or unhandled promise rejections

Applied to files:

  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/vercel.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use `try-catch` blocks meaningfully - don't catch errors just to rethrow them

Applied to files:

  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/vercel.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Use `try-catch` blocks meaningfully - don't catch errors just to rethrow them

Applied to files:

  • packages/docs/src/search/vercel-bash.ts
  • packages/docs/src/search/vercel.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{ts,tsx,js,jsx} : Document expected failures with `throws` in TSDoc and JSDoc comments

Applied to files:

  • packages/docs/src/search/vercel-bash.ts
📚 Learning: 2026-02-19T01:12:44.177Z
Learnt from: CR
Repo: consentdotio/agent-skills PR: 0
File: tsdoc-jsdoc-authoring/AGENTS.md:0-0
Timestamp: 2026-02-19T01:12:44.177Z
Learning: Applies to tsdoc-jsdoc-authoring/**/*.{js,jsx} : Document error contracts with `throws` in JSDoc comments

Applied to files:

  • packages/docs/src/search/vercel-bash.ts
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{tsx,jsx} : Use descriptive error messages that guide developers

Applied to files:

  • packages/docs/src/search/cloudflare.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Make sure to pass a message value when creating a built-in error

Applied to files:

  • packages/docs/src/search/cloudflare.ts
  • packages/docs/src/search/vercel.ts
📚 Learning: 2026-03-19T22:57:45.114Z
Learnt from: CR
Repo: consentdotio/GDPRish PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2026-03-19T22:57:45.114Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Provide clear error messages for development, implement runtime checks for required context/props, and use descriptive error messages that guide developers

Applied to files:

  • packages/docs/src/search/cloudflare.ts
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{tsx,jsx} : Provide clear error messages for development in components

Applied to files:

  • packages/docs/src/search/cloudflare.ts
📚 Learning: 2025-07-23T12:51:10.961Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/elements-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:10.961Z
Learning: Applies to packages/elements/**/*.{ts,tsx} : Provide clear error messages

Applied to files:

  • packages/docs/src/search/cloudflare.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{js,ts,jsx,tsx} : Throw `Error` objects with descriptive messages, not strings or other values

Applied to files:

  • packages/docs/src/search/cloudflare.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Throw `Error` objects with descriptive messages, not strings or other values

Applied to files:

  • packages/docs/src/search/cloudflare.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Throw `Error` objects with descriptive messages, not strings or other values

Applied to files:

  • packages/docs/src/search/cloudflare.ts
📚 Learning: 2025-07-23T12:51:43.299Z
Learnt from: CR
Repo: consentdotio/monorepo PR: 0
File: .cursor/rules/global-rules.mdc:0-0
Timestamp: 2025-07-23T12:51:43.299Z
Learning: Applies to **/*.{tsx,jsx} : Provide clear error messages when components are used outside of context, missing required props, have invalid prop combinations, or runtime validation failures

Applied to files:

  • packages/docs/src/search/cloudflare.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Don't nest describe() blocks too deeply in test files

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-04-18T15:01:52.722Z
Learnt from: CR
Repo: inthhq/docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-18T15:01:52.722Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx} : Avoid done callbacks in async tests - use async/await instead

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Avoid done callbacks in async tests - use async/await instead

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-04-16T03:27:04.353Z
Learnt from: CR
Repo: inthhq/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-16T03:27:04.353Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Avoid done callbacks in async tests - use async/await instead

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2026-02-20T14:21:40.180Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T14:21:40.180Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Avoid done callbacks in async tests - use async/await instead

Applied to files:

  • packages/docs/src/search/docs-bash.test.ts
📚 Learning: 2025-12-17T14:48:41.563Z
Learnt from: CR
Repo: consentdotio/c15t-docs PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-17T14:48:41.563Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `with { type: "json" }` for JSON module imports

Applied to files:

  • apps/docs-smoke/content/docs/search.mdx
📚 Learning: 2026-02-20T14:21:19.208Z
Learnt from: CR
Repo: consentdotio/dsar PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2026-02-20T14:21:19.208Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `try-catch` blocks meaningfully - don't catch errors just to rethrow them

Applied to files:

  • packages/docs/src/search/vercel.ts
🔇 Additional comments (26)
packages/docs/src/search/answer-stream.test.ts (1)

4-19: Good regression test for response init/header isolation.

This directly protects against shared-header mutations across calls and matches the helper’s contract.

packages/docs/src/search/docs-bash.test.ts (1)

75-78: Nice focused unit check for unsafe command normalization.

The new assertion validates the exact blocked command path before execution, which is the critical guard boundary.

README.md (1)

11-15: Docs surface update looks consistent with provider-specific exports.

The README now reflects the split entrypoints and runtime wiring guidance clearly.

Also applies to: 118-118

packages/docs/README.md (1)

11-16: Provider-specific README examples are coherent and well-scoped.

The updated import paths and gateway notes match the new API split and reduce ambiguity for consumers.

Also applies to: 132-162

packages/docs/src/search/vercel-bash.test.ts (1)

18-59: Strong compatibility + safety coverage for the Vercel adapter path.

Alias parity and blocked-command behavior are both validated with clear expectations.

packages/docs/src/search/cloudflare-index.ts (1)

1-18: Entrypoint exports and package-level TSDoc are in good shape.

This is a clean, explicit public surface for Cloudflare consumers.

packages/docs/agent-docs/docs/search.md (1)

32-47: Agent docs update is aligned with the new provider entrypoint model.

The split between runtime search helpers and provider-specific streaming/bash adapters is clearly documented.

Also applies to: 125-201

packages/docs/src/search/tanstack-bash.test.ts (2)

17-31: Great coverage on read-only execution and unsafe-command blocking.

The tests exercise both happy-path inspection commands and the write-blocking guard behavior.

Also applies to: 68-82


42-47: No changes needed—readFileTool?.execute() is synchronous.

The docs_read_file tool uses a synchronous handler (.server((args) => ...)), which means execute() returns the value directly, not a Promise. The tests correctly use .toMatchObject() without awaiting. In contrast, docs_bash uses an async handler, which is why its execute() calls use .resolves.toMatchObject() to await the Promise.

			> Likely an incorrect or invalid review comment.
apps/docs-smoke/src/lib/docs.ts (1)

82-105: LGTM!

The updated packageSurfaces entries correctly reflect the new provider-specific entrypoints. The import paths (@inth/docs/search/vercel, @inth/docs/search/tanstack, @inth/docs/search/cloudflare) match the actual package.json exports, and the descriptions accurately summarize each module's exports.

packages/docs/src/search/bash-index.ts (1)

1-13: LGTM!

The re-export split is logical: ./docs-bash provides base filesystem utilities while ./vercel-bash provides Vercel-specific tool wrappers. Type exports are correctly included for the public API.

packages/docs/agent-docs-src/docs/search.mdx (2)

31-46: LGTM!

The entrypoint documentation accurately maps use cases to their respective imports. The provider-specific imports with aliases (streamVercelDocsAnswer, etc.) provide clear disambiguation for projects using multiple providers.


124-200: LGTM!

The streaming and bash tools documentation accurately reflects the implementation:

  • Vercel uses model string parameter with default "openai/gpt-5.4-mini"
  • TanStack/Cloudflare use explicit adapter parameter
  • Cloudflare requires createCloudflareDocsAdapter for provider mapping
  • Bash tooling correctly distinguishes createDocsBashTool (Vercel) from createDocsBashTools (TanStack/Cloudflare)
apps/docs-smoke/content/docs/index.mdx (2)

35-52: LGTM!

The package surfaces table correctly reflects the new provider-specific entrypoints with accurate lifecycle designations (optional runtime) and descriptions matching the actual module exports.


69-71: LGTM!

The guidance correctly directs users to add a provider-specific entrypoint (e.g., @inth/docs/search/vercel) only when explicit answer streaming is needed, maintaining the separation between core search functionality and AI integration.

apps/docs-smoke/content/docs/search.mdx (3)

14-22: LGTM!

The entrypoints table provides a clear, concise mapping of use cases to import paths, consistent with the agent docs and package surface definitions.


59-112: LGTM!

The source-grounded answers section correctly demonstrates:

  • Vercel: model string with default fallback
  • TanStack: explicit adapter parameter
  • Cloudflare: createCloudflareDocsAdapter with provider/model/binding configuration

The examples match the actual function signatures in the implementation files.


130-150: LGTM!

The bash tools documentation correctly shows the explicit tools and toolInstructions parameters being passed to streamDocsAnswer, reflecting the design decision that tools are never created inside streamDocsAnswer.

packages/docs/agent-docs/docs/llms-full/generation/search.txt (2)

40-55: LGTM!

The generated LLM documentation correctly reflects the provider-specific entrypoints table from the source MDX.


133-209: LGTM!

The streaming and bash tools sections accurately mirror the source documentation, providing agents with correct guidance for each provider integration pattern.

packages/docs/src/search/vercel.ts (3)

1-28: LGTM!

Clean imports and well-defined constants. The DEFAULT_TIMEOUT using as const satisfies TimeoutConfiguration correctly ensures type safety while preserving literal types.


30-88: LGTM!

The type definitions are comprehensive:

  • DocsTextStreamPart correctly models the union of stream part types with a catch-all variant
  • StreamTextLike enables dependency injection for testing
  • Exported types (StreamDocsAnswerOptions, StreamDocsAnswerResult) provide clear public API contracts

90-134: The onError concern from previous review has been addressed.

The error handler now logs errors via log.error() with a formatted message, providing observability for provider errors during streaming setup. The implementation correctly:

  • Creates answer context with merged defaults
  • Supports dependency injection via streamTextImpl
  • Falls back to toTextStreamResponse when fullStream is unavailable
  • Maps stream parts to the PlainTextStreamHandlers interface
packages/docs/src/search/tanstack.ts (3)

1-18: LGTM!

Imports are clean. Note that appendToolInstructions is now correctly imported from ./answer-stream, addressing the previous review comment about duplication.


47-75: LGTM!

The helper functions provide robust chunk processing:

  • getChunkText correctly guards for TEXT_MESSAGE_CONTENT and validates delta is a string
  • getChunkError handles multiple error shapes (message, error property) with a fallback
  • getChunkFinishReason uses nullish coalescing to convert null to undefined
  • isReasoningChunk cleanly identifies reasoning content

77-110: LGTM overall - well-structured streaming implementation.

The function correctly:

  • Creates answer context with merged defaults
  • Supports dependency injection via chatImpl
  • Passes tools and appends tool instructions to system prompts
  • Maps stream chunks through createDocsTextStreamResponse with appropriate handlers

Comment thread packages/docs/src/search/answer-stream.ts Outdated
Comment thread packages/docs/src/search/docs-bash.ts
Comment thread packages/docs/src/search/tanstack.ts
Comment thread packages/docs/src/search/vercel-bash.ts Outdated
@KayleeWilliams KayleeWilliams merged commit 3138c30 into main Apr 22, 2026
1 of 2 checks passed
KayleeWilliams added a commit that referenced this pull request Apr 26, 2026
Integrates main's component-ownership refactor (PR #8) and AI search
work (#5/#7). Adapts the c15t-compat changes from d289d82 onto the new
component locations under apps/docs-smoke/src/components/docs-mdx/:

  - Callout: keeps `type` alias and `warn`/`note` mapping. Inlined
    normalizeVariant/titleCase since the component now lives in the app
    (no shared internal/ helpers needed).
  - Card: keeps `icon`, `variant`, `CardVariant` type.
  - Tabs: keeps `groupId` prop with JSDoc.
  - CommandTabs: takes main's design wholesale (`mode: run|install|create`,
    discriminated union). Drops the duplicate PackageCommandTabs.

Drops `packages/docs/src/internal/{callout-variant,package-managers}.{ts,test.ts}`
since main's design has the component app-owned (with its own table)
and main's command-tabs.remark.ts is self-contained.

Keeps the new remark plugins (section, details, remove-jsx-comments) and
the warn/note alias in callout.remark.ts. Updates remark-output tests to
use the renamed convertMdxToMarkdown.
@coderabbitai coderabbitai Bot mentioned this pull request May 9, 2026
8 tasks
@KayleeWilliams KayleeWilliams deleted the KayleeWilliams/byo-ai-gateway branch May 9, 2026 02:30
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.

1 participant