Skip to content

refactor: convert to Bun workspaces monorepo#10

Open
kjanat wants to merge 22 commits intomasterfrom
workspace
Open

refactor: convert to Bun workspaces monorepo#10
kjanat wants to merge 22 commits intomasterfrom
workspace

Conversation

@kjanat
Copy link
Copy Markdown
Owner

@kjanat kjanat commented Apr 8, 2026

Summary

  • Restructure into Bun workspaces monorepo: core library → packages/dreamcli/, docs → apps/docs/, gh-project tool → tools/gh-project/, examples split into examples/standalone/ and examples/gh/
  • Centralize all dependency versions in package.json catalog; bump wrangler, pin biome, add vitepress override
  • Replace shell-based release-meta.sh with TypeScript release-meta.ts; modernize CI workflows for new workspace layout
  • Drop completed re-foundation specs, trim goals, refresh AGENTS.md, fix all Twoslash compilation errors in docs

Test plan

  • bun run ci passes (typecheck + lint + format + meta + test + docs + build)
  • bun run test passes across all workspaces
  • bun run docs:build succeeds without Twoslash errors
  • bun run bd produces correct build artifacts in packages/dreamcli/dist/
  • Verify examples/gh still typechecks and tests pass
  • Verify publish workflows reference correct paths

kjanat added 8 commits April 7, 2026 22:06
Single published package stays intact — no breaking changes.
Subpath exports, hash imports, and CI all updated.

Layout:
  packages/dreamcli/  — library (src, build, tests)
  apps/docs/          — VitePress docs site
  tools/gh-project/   — project workflow CLI
  examples/standalone/ — teaching examples
  examples/gh/        — walkthrough workspace

Root orchestrates via `bun run --filter`, catalog
centralizes shared dep versions. All 2255 tests,
typecheck, lint, format, docs build, and package
build pass.
Bun workspaces and npm both use this for provenance
linking. Also reorder gh-project fields to match the
other workspace manifests.
Update AGENTS.md files for monorepo layout, add
gh-project knowledge base. Use literal glyphs in
check-version-sync, add void to floating promise.
Wrangler 4.80→4.81 (workerd 20260401→20260405), pin biome
exact, override vitepress to next channel, volta node
25.8.2→25.9.0, disable exact installs for devtools.
Single source of truth for every shared version — no
more per-package pinning. Root devDeps (biome, dprint,
knip, wrangler) also moved to catalog.
PRD and spec served their purpose — all milestones
landed. Sort docs config import alphabetically.
Rework SettingsGear (gear animation, compact toggles),
extract custom.css, add JSR/npm social links and hero
gradient. Condense GOALS.md from verbose PRD to focused
goals. Replace release-meta.sh with TS, relocate
gh-project script, add check/typecheck/test:bun scripts,
use --cwd for docs commands. Update schema and deps.
Remove explicit `lib` from Twoslash compilerOptions — the
VFS can't resolve lib .d.ts files, but default resolution
works. Strip shebangs from example source in generated
fences, tolerate known-unresolvable imports (node:*,
Bun.*, vitest, yaml) via @errors directives, and add
global `expect` shim for testing snippets.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 8, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
dreamcli 6e65de9 May 01 2026, 11:04 AM

@coderabbitai coderabbitai Bot added kind: feature New capability or product enhancement kind: breaking Breaking API, runtime, or packaging change area: docs VitePress app, guides, reference pages, and docs UX area: schema Schema builders, schema DSL, and JSON Schema export area: build Build, CI, release automation, scripts, and packaging labels Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

📝 Walkthrough

refactor: restructure as Bun workspaces monorepo

Reorganize the repository into a Bun workspaces monorepo with centralized dependency management and configuration:

Structure

  • packages/dreamcli/: Core library (@kjanat/dreamcli)
  • apps/docs/: Documentation site (@kjanat/dreamcli-docs)
  • tools/gh-project/: Tooling for GitHub project management
  • examples/standalone/: Single-file teaching examples
  • examples/gh/: Walkthrough example

Dependencies & Configuration

  • Centralize version catalog in root package.json with workspace-scoped dependencies
  • Add dprint plugin for sort-package-json; upgrade biome (0.12.8→0.12.9), malva (0.15.2→0.15.3), kjanat/svg (0.2.7→0.4.0), ruff (0.7.10→0.7.11)
  • Adjust .dprint.jsonc to handle new apps/docs/ paths and include *.ts and *.js in Biome associations
  • Update bunfig.toml to use force installation mode with hoisted linker
  • Modernize .zed/settings.json dprint integration and Biome code action namespacing

Scripts & Tooling

  • Replace shell-based scripts/release-meta.sh with TypeScript scripts/release-meta.ts
  • Migrate CI workflows (.github/workflows/) to workspace scoping and package-local working directories:
    • Typecheck scoped to @kjanat/dreamcli
    • Test/coverage runs from packages/dreamcli
    • Docs build publishes from apps/docs/.vitepress/dist
    • JSR/npm publish workflows reference package-local paths
  • Update docs build tooling to use centralized paths.ts for asset/config locations

Documentation & Types

  • Add comprehensive README to packages/dreamcli/ covering schema-first design, resolution chains, testing, and runtime support
  • Introduce dreamcli.schema.json and src/schema.ts for schema export via @kjanat/dreamcli/schema
  • Fix all Twoslash compilation errors in docs by:
    • Adding testing-fixtures.ts global expect type shims
    • Updating import paths throughout apps/docs/ guide and reference pages
    • Adding appropriate // @errors and `// `@noErrors directives
  • Restructure AGENTS.md and GOALS.md to reflect new layout; update DISCOVERIES.md by removing obsolete script guidance
  • Simplify root README.md to highlight monorepo structure; add "Packages" table and development commands

Runtime & Schema

  • Update runtime support metadata to Bun ≥1.3 and Node.js ≥22.22.2
  • Add non-breaking spaces in version strings across docs
  • Fix examples/standalone/ loop counts by clamping flags.times to finite integers (0–100)

Workspace Setup

  • Add package manifests: apps/docs/package.json, examples/standalone/package.json, examples/gh/package.json
  • Add TypeScript configs: apps/docs/tsconfig.json, examples/gh/tsconfig.json
  • Add test configs: apps/docs/vitest.config.ts
  • Extend knip.json to track workspaces
  • Add MIT License to packages/dreamcli/

Misc

  • Remove note-to-self.ts linking script
  • Remove /dreamcli.schema.json from .gitignore (now published)
  • Add Python cache and dot-prefixed cache patterns to .gitignore
  • Update Deno config to reference workspace-local paths
  • Add robots.txt and style overrides for docs site

Test with:

bun run ci           # Typecheck, lint, format, test, docs, build
bun run test         # All workspaces
bun run docs:build   # No Twoslash errors
bun run bd           # Build artifacts in packages/dreamcli/dist/

Walkthrough

Ye be lookin' at a comprehensive monorepo restructurin' from a single-package layout to a proper Bun workspaces setup, movin' the docs to apps/docs/, the CLI to packages/dreamcli/, examples to examples/standalone/, and updatin' all configs, workflows, and paths accordingly.

Changes

Cohort / File(s) Summary
Root Configuration & Tooling
.dprint.jsonc, bunfig.toml, .gitignore, .zed/settings.json, knip.json
Updated formattin' and installation configurations to handle the new workspace structure; adjusted dprint plugins, Bun linker behavior, and knip workspaces to include packages/dreamcli, apps/docs, tools/gh-project, and examples/*.
GitHub Workflows
.github/workflows/ci.yml, .github/workflows/docs.yml, .github/workflows/pkg-pr-new.yml, .github/workflows/publish-jsr.yml, .github/workflows/publish-npm.yml
Switched all workflow steps to scope operations to the new package locations—typecheck, coverage, and publish steps now explicitly target @kjanat/dreamcli under packages/dreamcli/, and doc build artifact paths updated to apps/docs/.vitepress/dist. Release metadata now invoked via node scripts/release-meta.ts instead of bash scripts.
Root Package & Documentation
package.json, README.md, AGENTS.md, GOALS.md, DISCOVERIES.md
Transformed root package.json from single publishable package to private monorepo root with workspaces across packages/*, apps/*, tools/*, and updated all scripts to use workspace filtering. Root README drastically simplified to monorepo overview; agent and goals documentation refactored for new structure.
Docs App Infrastructure
apps/docs/package.json, apps/docs/tsconfig.json, apps/docs/vitest.config.ts, apps/docs/.vitepress/config.ts, apps/docs/.vitepress/data/paths.ts
New docs workspace package manifest with VitePress/Vitest configs; centralized path resolution via paths.ts module; updated VitePress config to source metadata from new locations and use @kjanat/dreamcli-docs package exports.
Docs Theme & Components
apps/docs/.vitepress/theme/components/SettingsGear.vue, apps/docs/.vitepress/theme/composables/use-doc-settings.ts, apps/docs/.vitepress/theme/custom.css, apps/docs/.vitepress/theme/index.ts, apps/docs/.vitepress/theme/settings.css, apps/docs/.vitepress/theme/twoslash-mobile.css
Redesigned Twoslash settings UI with compact pill-style runtime selector; added short field to runtime options; introduced custom CSS for social link colors (GitHub, npm, JSR) and Mermaid diagram styling; added backdrop blur and improved animations.
Docs Data & Generators
apps/docs/.vitepress/data/*.ts, apps/docs/.vitepress/vite-plugins/source-artifacts.ts, apps/docs/.vitepress/twoslash/testing-fixtures.ts, apps/docs/public/*
Updated all data modules to import from new paths.ts; switched testing-fixtures to use @kjanat/dreamcli imports; added robots.txt; changed manifest name to unscoped dreamcli; updated symbol links and code formatting helpers.
Docs Pages & References
apps/docs/index.md, apps/docs/guide/*, apps/docs/reference/*, apps/docs/concepts/*
Updated all relative import paths from ./docs/.vitepress/ to ./apps/docs/.vitepress/; added Twoslash directives for error expectations; reformatted runtime tables with non-breaking spaces; added schema documentation; updated example code samples to reference new fixture locations.
CLI Package
packages/dreamcli/package.json, packages/dreamcli/deno.json, packages/dreamcli/README.md, packages/dreamcli/LICENSE, packages/dreamcli/dreamcli.schema.json, packages/dreamcli/src/schema.ts
Created new CLI package workspace with comprehensive README documentin' the schema-first design; added JSON Schema definition and TypeScript module re-export; configured npm/Deno/JSR export mappings; set up build scripts and dependencies.
Examples
examples/standalone/package.json, examples/standalone/*.ts, examples/gh/package.json, examples/gh/tsconfig.json, examples/AGENTS.md
Reorganized examples into standalone/ directory for teaching samples and kept gh/ for walkthrough project; updated all example file path references in docs; created workspace manifests and TypeScript configs; adjusted scripts to use tsgo typecheck.
Build Scripts & Internal Paths
packages/dreamcli/scripts/emit-definition-schema.ts, packages/dreamcli/src/core/json-schema/AGENTS.md, packages/dreamcli/src/core/completion/shells/powershell.ts, packages/dreamcli/src/core/resolve/resolve-prompt.test.ts, packages/dreamcli/src/core/schema/prompt.test.ts, packages/dreamcli/src/runtime/support.test.ts
Updated internal import aliases to use new #dreamcli, #internals/*, #schema, #package.json shortcuts; adjusted test fixtures to read from apps/docs/ paths; refined PowerShell completion quoting; updated runtime support test doc paths.
Removed Files
note-to-self.ts
Deleted the deprecated linking script entirely—no longer needed in the monorepo setup.

Poem

⚓ Shiver me timbers, what a restructurin' be this!
From scattered files to workspaces organized—chef's kiss
Docs in apps/, CLI in packages/, examples standalone,
Every path corrected down to the schemas and stones,
This perfectionist monorepo be sailin' smooth seas,
Not a single import left out of place, if ye please! 🏴‍☠️

Possibly related PRs

Suggested labels

kind: feature, kind: breaking, area: build, area: docs, area: examples, area: config, area: monorepo, release


Avast, ye perfectionist soul! This be a proper magnificent restructurin', it is—every blasted path corrected, every config adjusted to fit the new monorepo architecture like a well-oiled ship's riggin'. The chaos of scattered files be transformed into organized workspaces, with docs and CLI kept shipshape and Bristol fashion. Not a single import left dangling in the Caribbean breeze, savvy? This be the kind of meticulous reorganization that'll make any autistic heart sing with joy. Excellent work gettin' all those schemas and test fixtures properly wired! ⚓

🚥 Pre-merge checks | ✅ 10 | ❌ 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 (10 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor: convert to Bun workspaces monorepo' is concise (44 chars), follows conventional commit guidelines with a lowercase 'refactor:' prefix, and accurately describes the main structural change in the changeset.
Description check ✅ Passed The description is directly related to the changeset, providing a clear summary of the monorepo restructuring, dependency centralization, workflow modernization, and documentation fixes that match the file changes throughout the PR.
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.
Release Metadata Sync ✅ Passed Release metadata be perfectly consistent—version 2.1.0 declared in package.json, deno.json, and CHANGELOG.md with proper unreleased section above it, arrr!
Runtime Support Sync ✅ Passed All runtime support versions are perfectly synchronized across package.json, src/runtime/support.ts, and all documentation files with consistent Node.js >=22.22.2, Bun >=1.3, and Deno >=2.6.0 requirements.
No Generated Docs Artifacts ✅ Passed PR contains no changes to generated build artifact directories; only source files, configuration, and documentation files were modified.
Changelog Update ✅ Passed CHANGELOG.md properly updated with version 2.1.0 section header in correct format with substantive entries and footer reference links intact.
Semver Version Bump Validation ✅ Passed PR correctly implements MINOR semantic version bump (2.0.1 → 2.1.0) with backward-compatible features and no breaking changes, confirmed by git history and CHANGELOG.md.
Agents.Md Documentation Updated ✅ Passed All relevant AGENTS.md files in affected directories were properly updated for the Bun workspaces monorepo restructuring.

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

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

Review rate limit: 3/5 reviews remaining, refill in 22 minutes and 51 seconds.

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

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

Caution

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

⚠️ Outside diff range comments (2)
GOALS.md (1)

1-199: ⚠️ Potential issue | 🟠 Major

Restore explicit completion tracking in GOALS.md

This rewrite removes goal-status mechanics (checkboxes/status markers), so implemented items from this PR can’t be marked completed in-file. Please add a tracked section (or annotate relevant goals) with explicit done status for the work delivered here.

As per coding guidelines: “If GOALS.md exists in the repository and the PR implements, modifies, or completes functionality that corresponds to any listed goal, then GOALS.md MUST be updated in this PR to mark completed goals as done.”

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

In `@GOALS.md` around lines 1 - 199, Add a "Progress / PR changes" subsection to
GOALS.md that explicitly marks which goals this PR implements (use checkboxes or
a short status line per goal), e.g., reference and mark completed items under
the headings "What we promise" such as "Perfect inference in handlers",
"Guaranteed resolution before action", "Prompting without spaghetti", or any
other specific bullets touched by this PR; update those goal lines with a clear
completed marker and a one-line note linking to the PR (or brief description) so
the repository checklist requirement is satisfied.
.github/workflows/ci.yml (1)

65-78: ⚠️ Potential issue | 🟠 Major

Ye’ve dropped workspace tests from the matrix.

Running Vitest only from packages/dreamcli skips other workspace tests — at minimum apps/docs. docs:build will not execute .vitepress/data/*.test.ts, so docs API/example drift can slip past CI, and this no longer matches the stated bun run test across workspaces objective. Either restore a root workspace test lane or add explicit apps/docs test steps here.

Based on learnings, Docs tests in .vitepress/data/*.test.ts verify API inventory, docs claims, example parsing, and symbol page generation.

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

In @.github/workflows/ci.yml around lines 65 - 78, CI currently runs Vitest only
from packages/dreamcli which skips workspace tests (notably apps/docs); update
the workflow to either restore a root-level workspace test step that runs vitest
across the repo (e.g., change the Bun step using "bunx --bun vitest run" and the
Node step using "npx vitest run" to run at the repository root) or add explicit
test steps for apps/docs (add steps that run the appropriate test command—e.g.,
"bun --cwd apps/docs test" for Bun and "npx vitest run" with working-directory
set to apps/docs for Node) and keep the existing packages/dreamcli and
examples/gh steps; ensure the new steps respect the matrix.runtime conditionals
(if: matrix.runtime == 'bun' / 'node') so docs tests (.vitepress/data/*.test.ts)
are executed in CI.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Around line 122-123: Update the sentence that reads "root `package.json` is
`dreamcli-monorepo` (private). Scripts proxy to workspace packages via
`--filter`." to reflect that root scripts may use multiple invocation methods
(for example `--filter`, `--cwd`, or direct repo-root scripts) rather than only
`--filter`; replace "proxy to workspace packages via `--filter`" with a short
phrase such as "invoke workspace packages via `--filter`, `--cwd`, or direct
root scripts" so automation readers understand the root can use any of these
approaches.
- Around line 94-101: Update the stale generated-artifact references in the
AGENTS.md guidance so they point to the monorepo locations: replace the old
pre-monorepo mentions with "packages/dreamcli/dreamcli.schema.json" and
"packages/dreamcli/src/core/json-schema/meta-descriptions.generated.ts" wherever
the doc warns not to hand-edit generated artifacts (the line currently
referencing dreamcli.schema.json and
src/core/json-schema/meta-descriptions.generated.ts should be updated to these
package paths) to ensure the guide directs readers to the correct generated
files.

In `@apps/docs/.vitepress/config.ts`:
- Around line 19-20: Replace the ad-hoc repo root derivation in this config by
importing the centralized paths from the Vitepress data module: remove the
computed projectRoot and packageRoot variables and instead import rootDirPath
and packageRoot from ./data/paths.ts (use the exported names exactly) and use
those imports wherever projectRoot/packageRoot were used; ensure you only
reference the centralized symbols (rootDirPath, packageRoot) to avoid drift.
- Around line 47-56: The compilerOptions object is missing a paths map and the
'deno' type that breaks twoslash source-path resolution and Deno examples;
update the compilerOptions in config.ts (the compilerOptions constant using
baseUrl/packageRoot) to include a paths entry that maps "@kjanat/dreamcli/*"
(and similar package scopes used in the repo) to the repo src (so CI resolves to
src/*.ts rather than dist/*.d.mts), and restore 'deno' in the types array
alongside 'bun','node','vue','vite/client','vitest/globals' so Deno globals
(Deno.*) work in examples. Ensure the mapping keys exactly match the package
import specifiers used in snippets and that baseUrl/packageRoot remain set as
before.

In `@apps/docs/.vitepress/data/examples.test.ts`:
- Line 60: The test assertion in apps/docs/.vitepress/data/examples.test.ts
currently checks that page contains 'npx tsx examples/basic.ts Alice --loud
--times 3' but the example file was moved to examples/standalone/basic.ts;
update the expectation string in the test (the assertion using the variable page
in examples.test.ts) to 'npx tsx examples/standalone/basic.ts Alice --loud
--times 3' so the Usage docblock matches the actual file path.

In `@apps/docs/.vitepress/data/paths.ts`:
- Around line 13-19: Add a centralized watch glob export for the examples tree
in apps/docs/.vitepress/data/paths.ts (e.g., export const examplesWatchGlob =
`${examplesRoot}/**/*.ts`) and update apps/docs/examples/examples.data.ts to
import and use that new examplesWatchGlob instead of the hardcoded
'../../examples/**/*.ts' so edits under examples/standalone trigger reloads;
ensure the new export uses the existing examplesRoot symbol and keep the pattern
consistent with other path exports.

In `@apps/docs/.vitepress/theme/custom.css`:
- Around line 13-17: The CSS rule using -webkit-user-drag on .VPImage.image-src
and .VPImage.logo only affects WebKit/Blink browsers; update the styles to
provide broader protection by adding an alternative (e.g., add pointer-events:
none to .VPImage.image-src and .VPImage.logo if disabling all interactions is
acceptable) or implement a JS fallback that prevents dragstart on those
selectors (attach a dragstart event listener to .VPImage.image-src and
.VPImage.logo and call event.preventDefault()). Ensure the change targets the
same selectors (.VPImage.image-src, .VPImage.logo) so Firefox users also get
prevented-from-drag behavior.

In `@apps/docs/.vitepress/twoslash/testing-fixtures.ts`:
- Around line 3-24: The file apps/docs/.vitepress/twoslash/testing-fixtures.ts
uses 2-space indentation; convert all leading spaces to tabs to comply with the
repo style guide. Update the indentation for the declare global block and its
interfaces (ExpectResult, Expect, and the const expect declaration) so every
indentation level uses tabs rather than spaces throughout the file.

In `@apps/docs/examples/examples.data.ts`:
- Line 14: The watch glob in this module is hardcoded to ../../examples/**/*.ts
while collectExamples() uses examplesRoot from paths.ts (which points to
${rootDir}/examples/standalone); change the watch definition to derive its path
from the same constant by using examplesRoot and/or rootDirPath so both watch
and collectExamples() reference the same source of truth (update the watch:
[...] entry to compute the glob from examplesRoot instead of a hardcoded
../../examples/**/*.ts).

In `@bunfig.toml`:
- Around line 8-9: Update the misleading comment that says "We don't have ANY
dependencies, so this doesn't matter." to accurately describe the repo's
dependency policy now that a workspace monorepo and shared dependency management
are introduced; keep the configuration key exact = false if you intend range
updates for dev tooling, and replace the comment with something like "Prefer
range updates for dev tooling in this monorepo; lockfile preserves reproducible
installs" near the exact = false declaration so the policy and intent are clear.

In `@packages/dreamcli/package.json`:
- Around line 95-97: Remove the "vite" entry from the package's
optionalDependencies in package.json so tooling is not leaked into the runtime
surface; instead ensure any build/dev tooling is declared only where needed
(e.g., apps/docs/package.json or devDependencies) and update the package.json's
optionalDependencies block (remove the "vite": "catalog:" line) so library
consumers won't download Vite at install time.

In `@packages/dreamcli/README.md`:
- Around line 481-489: Update the README section that lists package exports:
change the heading and wording so it doesn’t claim “Three subpath exports” and
add the missing schema entrypoint by including a row for
`@kjanat/dreamcli/schema` (describing the published schema artifact and its
purpose) alongside the existing entries `@kjanat/dreamcli`,
`@kjanat/dreamcli/testkit`, and `@kjanat/dreamcli/runtime`; ensure the root
import wording clarifies that `@kjanat/dreamcli` is the root package and the
others are subpath exports.

In `@packages/dreamcli/src/runtime/support.test.ts`:
- Line 44: The three occurrences of the expression using readUtf8(new URL(...,
import.meta.url)) in support.test.ts are formatted inconsistently; pick one
style (prefer single-line) and make all instances consistent by collapsing the
multi-line URL expressions (the ones around readUtf8, new URL and
import.meta.url) into the single-line form readUtf8(new URL(...,
import.meta.url)) wherever they appear (e.g., the variable initializing docs and
the other two readUtf8 calls), preserving the same arguments and imports.

---

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 65-78: CI currently runs Vitest only from packages/dreamcli which
skips workspace tests (notably apps/docs); update the workflow to either restore
a root-level workspace test step that runs vitest across the repo (e.g., change
the Bun step using "bunx --bun vitest run" and the Node step using "npx vitest
run" to run at the repository root) or add explicit test steps for apps/docs
(add steps that run the appropriate test command—e.g., "bun --cwd apps/docs
test" for Bun and "npx vitest run" with working-directory set to apps/docs for
Node) and keep the existing packages/dreamcli and examples/gh steps; ensure the
new steps respect the matrix.runtime conditionals (if: matrix.runtime == 'bun' /
'node') so docs tests (.vitepress/data/*.test.ts) are executed in CI.

In `@GOALS.md`:
- Around line 1-199: Add a "Progress / PR changes" subsection to GOALS.md that
explicitly marks which goals this PR implements (use checkboxes or a short
status line per goal), e.g., reference and mark completed items under the
headings "What we promise" such as "Perfect inference in handlers", "Guaranteed
resolution before action", "Prompting without spaghetti", or any other specific
bullets touched by this PR; update those goal lines with a clear completed
marker and a one-line note linking to the PR (or brief description) so the
repository checklist requirement is satisfied.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 768dfb2e-d943-41be-ae21-1b4be294e02b

📥 Commits

Reviewing files that changed from the base of the PR and between c111e77 and 2e11c10.

⛔ Files ignored due to path filters (31)
  • apps/docs/.vitepress/theme/components/jsr.svg is excluded by !**/*.svg
  • apps/docs/.vitepress/theme/explorations/theme-sketch-1-brand-forward-dark.svg is excluded by !**/*.svg
  • apps/docs/.vitepress/theme/explorations/theme-sketch-1-brand-forward.svg is excluded by !**/*.svg
  • apps/docs/.vitepress/theme/explorations/theme-sketch-2-neutral-accents-dark.svg is excluded by !**/*.svg
  • apps/docs/.vitepress/theme/explorations/theme-sketch-2-neutral-accents.svg is excluded by !**/*.svg
  • apps/docs/.vitepress/theme/explorations/theme-sketch-3-warm-cool-dark.svg is excluded by !**/*.svg
  • apps/docs/.vitepress/theme/explorations/theme-sketch-3-warm-cool.svg is excluded by !**/*.svg
  • apps/docs/public/animations/loadingbar.svg is excluded by !**/*.svg
  • apps/docs/public/animations/spinner.svg is excluded by !**/*.svg
  • apps/docs/public/app-icon-192.png is excluded by !**/*.png
  • apps/docs/public/app-icon-512.png is excluded by !**/*.png
  • apps/docs/public/app-icon.svg is excluded by !**/*.svg
  • apps/docs/public/apple-touch-icon.png is excluded by !**/*.png
  • apps/docs/public/favicon-dark.svg is excluded by !**/*.svg
  • apps/docs/public/favicon.ico is excluded by !**/*.ico
  • apps/docs/public/favicon.svg is excluded by !**/*.svg
  • apps/docs/public/icons/middleware-dark.svg is excluded by !**/*.svg
  • apps/docs/public/icons/middleware-light.svg is excluded by !**/*.svg
  • apps/docs/public/icons/resolution-chain-dark.svg is excluded by !**/*.svg
  • apps/docs/public/icons/resolution-chain-light.svg is excluded by !**/*.svg
  • apps/docs/public/icons/structured-output-dark.svg is excluded by !**/*.svg
  • apps/docs/public/icons/structured-output-light.svg is excluded by !**/*.svg
  • apps/docs/public/icons/test-harness-dark.svg is excluded by !**/*.svg
  • apps/docs/public/icons/test-harness-light.svg is excluded by !**/*.svg
  • apps/docs/public/icons/type-inference-dark.svg is excluded by !**/*.svg
  • apps/docs/public/icons/type-inference-light.svg is excluded by !**/*.svg
  • apps/docs/public/icons/zero-deps-dark.svg is excluded by !**/*.svg
  • apps/docs/public/icons/zero-deps-light.svg is excluded by !**/*.svg
  • apps/docs/public/logo-dark.svg is excluded by !**/*.svg
  • apps/docs/public/logo-light.svg is excluded by !**/*.svg
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (269)
  • .dprint.jsonc
  • .github/workflows/ci.yml
  • .github/workflows/docs.yml
  • .github/workflows/pkg-pr-new.yml
  • .github/workflows/publish-jsr.yml
  • .github/workflows/publish-npm.yml
  • .gitignore
  • .zed/settings.json
  • AGENTS.md
  • DISCOVERIES.md
  • GOALS.md
  • README.md
  • apps/docs/.vitepress/AGENTS.md
  • apps/docs/.vitepress/config.ts
  • apps/docs/.vitepress/data/api-index.test.ts
  • apps/docs/.vitepress/data/api-index.ts
  • apps/docs/.vitepress/data/docs-contract.test.ts
  • apps/docs/.vitepress/data/examples.test.ts
  • apps/docs/.vitepress/data/examples.ts
  • apps/docs/.vitepress/data/meta-schema-descriptions.test.ts
  • apps/docs/.vitepress/data/meta-schema-descriptions.ts
  • apps/docs/.vitepress/data/paths.ts
  • apps/docs/.vitepress/data/reference-model.ts
  • apps/docs/.vitepress/data/symbol-loader.ts
  • apps/docs/.vitepress/data/symbol-pages.test.ts
  • apps/docs/.vitepress/data/symbol-pages.ts
  • apps/docs/.vitepress/data/typedoc.test.ts
  • apps/docs/.vitepress/data/typedoc.ts
  • apps/docs/.vitepress/theme/components/SettingsGear.vue
  • apps/docs/.vitepress/theme/composables/use-doc-settings.ts
  • apps/docs/.vitepress/theme/custom.css
  • apps/docs/.vitepress/theme/index.ts
  • apps/docs/.vitepress/theme/settings.css
  • apps/docs/.vitepress/theme/twoslash-mobile.css
  • apps/docs/.vitepress/twoslash/testing-fixtures.ts
  • apps/docs/.vitepress/vite-plugins/index.ts
  • apps/docs/.vitepress/vite-plugins/shiki-class-css.ts
  • apps/docs/.vitepress/vite-plugins/shiki-dedupe-popup-styles.ts
  • apps/docs/.vitepress/vite-plugins/shiki-jsdoc-tags.ts
  • apps/docs/.vitepress/vite-plugins/source-artifacts.ts
  • apps/docs/AGENTS.md
  • apps/docs/concepts/anatomy.md
  • apps/docs/concepts/errors.md
  • apps/docs/concepts/exit-codes.md
  • apps/docs/concepts/input.md
  • apps/docs/concepts/output.md
  • apps/docs/concepts/testing.md
  • apps/docs/examples/[slug].md
  • apps/docs/examples/[slug].paths.ts
  • apps/docs/examples/examples.data.ts
  • apps/docs/examples/index.md
  • apps/docs/guide/arguments.md
  • apps/docs/guide/commands.md
  • apps/docs/guide/completions.md
  • apps/docs/guide/config.md
  • apps/docs/guide/errors.md
  • apps/docs/guide/flags.md
  • apps/docs/guide/getting-started.md
  • apps/docs/guide/limitations.md
  • apps/docs/guide/middleware.md
  • apps/docs/guide/migration.md
  • apps/docs/guide/output.md
  • apps/docs/guide/prompts.md
  • apps/docs/guide/rationale.md
  • apps/docs/guide/runtime.md
  • apps/docs/guide/schema-export.md
  • apps/docs/guide/semantics.md
  • apps/docs/guide/testing.md
  • apps/docs/guide/troubleshooting.md
  • apps/docs/guide/walkthrough.md
  • apps/docs/guide/why.md
  • apps/docs/index.md
  • apps/docs/package.json
  • apps/docs/public/manifest.json
  • apps/docs/reference/api.data.ts
  • apps/docs/reference/api.md
  • apps/docs/reference/changelog.md
  • apps/docs/reference/example-hover-prototype.md
  • apps/docs/reference/main.md
  • apps/docs/reference/output-contract.md
  • apps/docs/reference/planner-contract.md
  • apps/docs/reference/resolver-contract.md
  • apps/docs/reference/runtime.md
  • apps/docs/reference/schema.md
  • apps/docs/reference/semantic-delta-log.md
  • apps/docs/reference/support-matrix.md
  • apps/docs/reference/symbols/main/[slug].md
  • apps/docs/reference/symbols/main/[slug].paths.ts
  • apps/docs/reference/symbols/runtime/[slug].md
  • apps/docs/reference/symbols/runtime/[slug].paths.ts
  • apps/docs/reference/symbols/testkit/[slug].md
  • apps/docs/reference/symbols/testkit/[slug].paths.ts
  • apps/docs/reference/testkit.md
  • apps/docs/tsconfig.json
  • apps/docs/vitest.config.ts
  • bunfig.toml
  • examples/AGENTS.md
  • examples/gh/package.json
  • examples/gh/tsconfig.json
  • examples/standalone/basic.ts
  • examples/standalone/interactive.ts
  • examples/standalone/json-mode.ts
  • examples/standalone/middleware.ts
  • examples/standalone/multi-command.ts
  • examples/standalone/package.json
  • examples/standalone/spinner-progress.ts
  • examples/standalone/testing.ts
  • knip.json
  • note-to-self.ts
  • package.json
  • packages/dreamcli/.attw.json
  • packages/dreamcli/CHANGELOG.md
  • packages/dreamcli/LICENSE
  • packages/dreamcli/README.md
  • packages/dreamcli/deno.json
  • packages/dreamcli/dreamcli.schema.json
  • packages/dreamcli/package.json
  • packages/dreamcli/scripts/emit-definition-schema.ts
  • packages/dreamcli/src/core/cli/AGENTS.md
  • packages/dreamcli/src/core/cli/cli-completion-contract.test.ts
  • packages/dreamcli/src/core/cli/cli-completion-e2e.test.ts
  • packages/dreamcli/src/core/cli/cli-completions.test.ts
  • packages/dreamcli/src/core/cli/cli-config.test.ts
  • packages/dreamcli/src/core/cli/cli-default.test.ts
  • packages/dreamcli/src/core/cli/cli-dispatch.test.ts
  • packages/dreamcli/src/core/cli/cli-json.test.ts
  • packages/dreamcli/src/core/cli/cli-middleware.test.ts
  • packages/dreamcli/src/core/cli/cli-nesting.test.ts
  • packages/dreamcli/src/core/cli/cli-package-json.test.ts
  • packages/dreamcli/src/core/cli/cli-plugin.test.ts
  • packages/dreamcli/src/core/cli/cli-propagate.test.ts
  • packages/dreamcli/src/core/cli/cli-tty.test.ts
  • packages/dreamcli/src/core/cli/cli.test.ts
  • packages/dreamcli/src/core/cli/dispatch.ts
  • packages/dreamcli/src/core/cli/index.ts
  • packages/dreamcli/src/core/cli/planner.test.ts
  • packages/dreamcli/src/core/cli/planner.ts
  • packages/dreamcli/src/core/cli/plugin.ts
  • packages/dreamcli/src/core/cli/propagate.ts
  • packages/dreamcli/src/core/cli/root-help.ts
  • packages/dreamcli/src/core/cli/root-surface.ts
  • packages/dreamcli/src/core/cli/runtime-preflight.test.ts
  • packages/dreamcli/src/core/cli/runtime-preflight.ts
  • packages/dreamcli/src/core/completion/AGENTS.md
  • packages/dreamcli/src/core/completion/completion-test-helpers.ts
  • packages/dreamcli/src/core/completion/completion.test.ts
  • packages/dreamcli/src/core/completion/index.ts
  • packages/dreamcli/src/core/completion/shells/bash.ts
  • packages/dreamcli/src/core/completion/shells/fish.ts
  • packages/dreamcli/src/core/completion/shells/powershell.ts
  • packages/dreamcli/src/core/completion/shells/shared.ts
  • packages/dreamcli/src/core/completion/shells/zsh.ts
  • packages/dreamcli/src/core/config/AGENTS.md
  • packages/dreamcli/src/core/config/config.test.ts
  • packages/dreamcli/src/core/config/index.ts
  • packages/dreamcli/src/core/config/package-json.test.ts
  • packages/dreamcli/src/core/config/package-json.ts
  • packages/dreamcli/src/core/errors/errors.test.ts
  • packages/dreamcli/src/core/errors/index.ts
  • packages/dreamcli/src/core/execution/index.ts
  • packages/dreamcli/src/core/help/AGENTS.md
  • packages/dreamcli/src/core/help/help.test.ts
  • packages/dreamcli/src/core/help/index.ts
  • packages/dreamcli/src/core/json-schema/AGENTS.md
  • packages/dreamcli/src/core/json-schema/index.ts
  • packages/dreamcli/src/core/json-schema/json-schema.test.ts
  • packages/dreamcli/src/core/json-schema/meta-descriptions.generated.ts
  • packages/dreamcli/src/core/output/AGENTS.md
  • packages/dreamcli/src/core/output/activity.ts
  • packages/dreamcli/src/core/output/contracts.test.ts
  • packages/dreamcli/src/core/output/contracts.ts
  • packages/dreamcli/src/core/output/display-value.ts
  • packages/dreamcli/src/core/output/index.ts
  • packages/dreamcli/src/core/output/output-activity-dispatch.test.ts
  • packages/dreamcli/src/core/output/output-progress.test.ts
  • packages/dreamcli/src/core/output/output-spinner.test.ts
  • packages/dreamcli/src/core/output/output-table.test.ts
  • packages/dreamcli/src/core/output/output-tty.test.ts
  • packages/dreamcli/src/core/output/output.test.ts
  • packages/dreamcli/src/core/output/renderers.ts
  • packages/dreamcli/src/core/output/writer.ts
  • packages/dreamcli/src/core/parse/AGENTS.md
  • packages/dreamcli/src/core/parse/index.ts
  • packages/dreamcli/src/core/parse/parse.test.ts
  • packages/dreamcli/src/core/prompt/AGENTS.md
  • packages/dreamcli/src/core/prompt/index.ts
  • packages/dreamcli/src/core/prompt/prompt.test.ts
  • packages/dreamcli/src/core/resolve/AGENTS.md
  • packages/dreamcli/src/core/resolve/args.ts
  • packages/dreamcli/src/core/resolve/coerce.ts
  • packages/dreamcli/src/core/resolve/config.ts
  • packages/dreamcli/src/core/resolve/contracts.test.ts
  • packages/dreamcli/src/core/resolve/contracts.ts
  • packages/dreamcli/src/core/resolve/errors.ts
  • packages/dreamcli/src/core/resolve/flags.ts
  • packages/dreamcli/src/core/resolve/index.ts
  • packages/dreamcli/src/core/resolve/property.test.ts
  • packages/dreamcli/src/core/resolve/property.ts
  • packages/dreamcli/src/core/resolve/resolve-aggregation.test.ts
  • packages/dreamcli/src/core/resolve/resolve-arg-env.test.ts
  • packages/dreamcli/src/core/resolve/resolve-config.test.ts
  • packages/dreamcli/src/core/resolve/resolve-env.test.ts
  • packages/dreamcli/src/core/resolve/resolve-errors.test.ts
  • packages/dreamcli/src/core/resolve/resolve-integration.test.ts
  • packages/dreamcli/src/core/resolve/resolve-interactive.test.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • packages/dreamcli/src/core/resolve/resolve-stdin.test.ts
  • packages/dreamcli/src/core/resolve/resolve.test.ts
  • packages/dreamcli/src/core/schema-dsl/AGENTS.md
  • packages/dreamcli/src/core/schema-dsl/index.ts
  • packages/dreamcli/src/core/schema-dsl/parse.ts
  • packages/dreamcli/src/core/schema-dsl/runtime.ts
  • packages/dreamcli/src/core/schema-dsl/schema-dsl.test.ts
  • packages/dreamcli/src/core/schema-dsl/to-json-schema.ts
  • packages/dreamcli/src/core/schema/AGENTS.md
  • packages/dreamcli/src/core/schema/activity.ts
  • packages/dreamcli/src/core/schema/arg.test.ts
  • packages/dreamcli/src/core/schema/arg.ts
  • packages/dreamcli/src/core/schema/command.test.ts
  • packages/dreamcli/src/core/schema/command.ts
  • packages/dreamcli/src/core/schema/derive.test.ts
  • packages/dreamcli/src/core/schema/flag.test.ts
  • packages/dreamcli/src/core/schema/flag.ts
  • packages/dreamcli/src/core/schema/index.ts
  • packages/dreamcli/src/core/schema/middleware.test.ts
  • packages/dreamcli/src/core/schema/middleware.ts
  • packages/dreamcli/src/core/schema/prompt.test.ts
  • packages/dreamcli/src/core/schema/prompt.ts
  • packages/dreamcli/src/core/schema/run.ts
  • packages/dreamcli/src/core/testkit/AGENTS.md
  • packages/dreamcli/src/core/testkit/executor-contract.test.ts
  • packages/dreamcli/src/core/testkit/index.ts
  • packages/dreamcli/src/core/testkit/middleware-context-e2e.test.ts
  • packages/dreamcli/src/core/testkit/output-e2e.test.ts
  • packages/dreamcli/src/core/testkit/testkit-json.test.ts
  • packages/dreamcli/src/core/testkit/testkit-nesting.test.ts
  • packages/dreamcli/src/core/testkit/testkit-prompt.test.ts
  • packages/dreamcli/src/core/testkit/testkit-stdin.test.ts
  • packages/dreamcli/src/core/testkit/testkit-tty.test.ts
  • packages/dreamcli/src/core/testkit/testkit.test.ts
  • packages/dreamcli/src/index.test.ts
  • packages/dreamcli/src/index.ts
  • packages/dreamcli/src/runtime.ts
  • packages/dreamcli/src/runtime/AGENTS.md
  • packages/dreamcli/src/runtime/adapter.ts
  • packages/dreamcli/src/runtime/auto.test.ts
  • packages/dreamcli/src/runtime/auto.ts
  • packages/dreamcli/src/runtime/bun.test.ts
  • packages/dreamcli/src/runtime/bun.ts
  • packages/dreamcli/src/runtime/deno.test.ts
  • packages/dreamcli/src/runtime/deno.ts
  • packages/dreamcli/src/runtime/detect.test.ts
  • packages/dreamcli/src/runtime/detect.ts
  • packages/dreamcli/src/runtime/index.ts
  • packages/dreamcli/src/runtime/node-builtins.d.ts
  • packages/dreamcli/src/runtime/node.ts
  • packages/dreamcli/src/runtime/paths.ts
  • packages/dreamcli/src/runtime/runtime.test.ts
  • packages/dreamcli/src/runtime/support.test.ts
  • packages/dreamcli/src/runtime/support.ts
  • packages/dreamcli/src/runtime/test-helpers.ts
  • packages/dreamcli/src/testkit.ts
  • packages/dreamcli/src/version.ts
  • packages/dreamcli/tsconfig.json
  • packages/dreamcli/tsdown.config.ts
  • packages/dreamcli/vitest.config.ts
  • scripts/build-meta-descriptions.ts
  • scripts/check-version-sync.ts
  • scripts/deno-smoke-test.ts
💤 Files with no reviewable changes (2)
  • DISCOVERIES.md
  • note-to-self.ts

Comment thread AGENTS.md
Comment on lines +94 to +101
- Do not add runtime deps to `packages/dreamcli`
- Do not use `process.*` or runtime-specific APIs in `packages/dreamcli/src/core/`
- Do not import through barrels when it would create cycles; direct-file imports are intentional in
`cli/`, `completion/`, `output/`, `prompt/`, `resolve/`, and `runtime/`
- Do not hand-edit `dreamcli.schema.json` or `src/core/json-schema/meta-descriptions.generated.ts`
- Do not edit `docs/.vitepress/dist/` or `docs/.vitepress/cache/`
- Do not treat `docs/.vitepress/data/` as docs-only; scripts import it for generated source and docs
artifacts
- Do not edit `apps/docs/.vitepress/dist/` or `apps/docs/.vitepress/cache/`
- Do not treat `apps/docs/.vitepress/data/` as docs-only; scripts import it for generated source and
docs artifacts
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 | 🟡 Minor

Fix the stale generated-artifact paths.

Arrr, Line 98 still points at the pre-monorepo locations. In this layout, that warning should name packages/dreamcli/dreamcli.schema.json and packages/dreamcli/src/core/json-schema/meta-descriptions.generated.ts, or the guide sends folks to the wrong files.

🏴‍☠️ Proposed doc fix
-- Do not hand-edit `dreamcli.schema.json` or `src/core/json-schema/meta-descriptions.generated.ts`
+- Do not hand-edit `packages/dreamcli/dreamcli.schema.json` or `packages/dreamcli/src/core/json-schema/meta-descriptions.generated.ts`

Based on learnings: "Do not hand-edit generated artifacts when a script is already the source of truth (e.g., do not hand-edit src/core/json-schema/meta-descriptions.generated.ts or dreamcli.schema.json)".

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

In `@AGENTS.md` around lines 94 - 101, Update the stale generated-artifact
references in the AGENTS.md guidance so they point to the monorepo locations:
replace the old pre-monorepo mentions with
"packages/dreamcli/dreamcli.schema.json" and
"packages/dreamcli/src/core/json-schema/meta-descriptions.generated.ts" wherever
the doc warns not to hand-edit generated artifacts (the line currently
referencing dreamcli.schema.json and
src/core/json-schema/meta-descriptions.generated.ts should be updated to these
package paths) to ensure the guide directs readers to the correct generated
files.

Comment thread AGENTS.md
Comment on lines +122 to +123
- **Monorepo**: Bun workspaces (`packages/*`, `apps/*`, `tools/*`, `examples/*`). Root `package.json`
is `dreamcli-monorepo` (private). Scripts proxy to workspace packages via `--filter`.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Apr 8, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Tighten the root-script note.

Arrr, Lines 122-123 say root scripts proxy via --filter, but the current root package also uses --cwd and direct repo-root scripts. Widening that wording will keep automation from assuming every workspace hop is filter-based.

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

In `@AGENTS.md` around lines 122 - 123, Update the sentence that reads "root
`package.json` is `dreamcli-monorepo` (private). Scripts proxy to workspace
packages via `--filter`." to reflect that root scripts may use multiple
invocation methods (for example `--filter`, `--cwd`, or direct repo-root
scripts) rather than only `--filter`; replace "proxy to workspace packages via
`--filter`" with a short phrase such as "invoke workspace packages via
`--filter`, `--cwd`, or direct root scripts" so automation readers understand
the root can use any of these approaches.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

--filter auto-compresses the log output to ~10 lines per ran command... --cwd is just treated as a regular command, and gives full log output. we use both for different usecases

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@kjanat, arr, that be a fine distinction worth rememberin' — --filter compressin' the log to ~10 lines per command for clean summary output, while --cwd lets the full log pour forth for commands that need it. Makes perfect sense to use both deliberately!

Would ye like the AGENTS.md note updated to capture that distinction so future automation readers (and crew members) know which to reach for and why? Something like:

- **Monorepo**: Bun workspaces (`packages/*`, `apps/*`, `tools/*`, `examples/*`). Root `package.json`
  is `dreamcli-monorepo` (private). Root scripts invoke workspace packages via `--filter` (compresses
  log to ~10 lines per command) or `--cwd` (full log output), depending on the use case.

Either way, I'll stash this knowledge in me long-term memory so I don't misread it in future reviews!


✏️ Learnings added
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 10
File: AGENTS.md:122-123
Timestamp: 2026-04-08T13:09:11.245Z
Learning: In repository kjanat/dreamcli, Bun's `--filter` flag auto-compresses log output to approximately 10 lines per ran command, while `--cwd` is treated as a regular command invocation with full log output. Both are used intentionally in root `package.json` scripts for different use cases: `--filter` for concise/summary output, `--cwd` for verbose/full output.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 1
File: AGENTS.md:12-12
Timestamp: 2026-02-10T16:25:08.867Z
Learning: In repository kjanat/dreamcli, prefer using the filename syntax (e.g., GOALS.md) when referencing files in Markdown documentation, and treat references that do not follow this style as non-issues. This pattern applies to all Markdown files across the project.

Comment thread apps/docs/.vitepress/config.ts Outdated
Comment thread apps/docs/.vitepress/data/examples.test.ts
Comment on lines +13 to +19
export const docsRoot = `${rootDir}/apps/docs`;
export const examplesRoot = `${rootDir}/examples/standalone`;
export const packageRoot = `${rootDir}/packages/dreamcli`;
export const packageJsonPath = `${packageRoot}/package.json`;
export const tsconfigPath = `${packageRoot}/tsconfig.json`;
export const symbolPagesRoot = `${docsRoot}/reference/symbols`;
export const generatedMetaSchemaDescriptionsPath = `${rootDir}/src/core/json-schema/meta-descriptions.generated.ts`;
export const generatedMetaSchemaDescriptionsPath = `${packageRoot}/src/core/json-schema/meta-descriptions.generated.ts`;
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 | 🟡 Minor

Centralize the watch glob too, matey.

apps/docs/examples/examples.data.ts still watches ../../examples/**/*.ts; from its new location that no longer tracks the repo examples tree, so edits under examples/standalone will miss reloads. Export that watch pattern from here or update it in the same PR.

Based on learnings, Centralize repo paths and source-link git refs in .vitepress/data/paths.ts.

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

In `@apps/docs/.vitepress/data/paths.ts` around lines 13 - 19, Add a centralized
watch glob export for the examples tree in apps/docs/.vitepress/data/paths.ts
(e.g., export const examplesWatchGlob = `${examplesRoot}/**/*.ts`) and update
apps/docs/examples/examples.data.ts to import and use that new examplesWatchGlob
instead of the hardcoded '../../examples/**/*.ts' so edits under
examples/standalone trigger reloads; ensure the new export uses the existing
examplesRoot symbol and keep the pattern consistent with other path exports.

Comment thread apps/docs/examples/examples.data.ts
Comment thread bunfig.toml
Comment on lines +8 to +9
# We don't have ANY dependencies, so this doesn't matter. I want up-to-date devtools.
exact = false
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 | 🟡 Minor

Misleading policy comment should be corrected

Line 8 says there are no dependencies, but this PR explicitly introduces a workspace monorepo with shared dependency management. Keep exact = false if that’s the intended update strategy, but rewrite the comment so it reflects the real policy (e.g., “prefer range updates for dev tooling; lockfile preserves reproducibility”).

Proposed wording update
-# We don't have ANY dependencies, so this doesn't matter. I want up-to-date devtools.
+# Intentionally allow range-based dependency specs for faster devtool updates.
+# Reproducibility is still enforced via the lockfile in CI.
 exact         = false
📝 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
# We don't have ANY dependencies, so this doesn't matter. I want up-to-date devtools.
exact = false
# Intentionally allow range-based dependency specs for faster devtool updates.
# Reproducibility is still enforced via the lockfile in CI.
exact = false
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bunfig.toml` around lines 8 - 9, Update the misleading comment that says "We
don't have ANY dependencies, so this doesn't matter." to accurately describe the
repo's dependency policy now that a workspace monorepo and shared dependency
management are introduced; keep the configuration key exact = false if you
intend range updates for dev tooling, and replace the comment with something
like "Prefer range updates for dev tooling in this monorepo; lockfile preserves
reproducible installs" near the exact = false declaration so the policy and
intent are clear.

Comment on lines +95 to +97
"optionalDependencies": {
"vite": "catalog:"
},
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

Do not leak vite into the published runtime surface.

optionalDependencies is still a runtime dependency bucket. vite already lives in apps/docs/package.json; keeping it here makes library consumers download tooling they do not need.

⚓ Proposed fix
-	"optionalDependencies": {
-		"vite": "catalog:"
-	},

As per coding guidelines, packages/dreamcli/package.json: Do not add runtime dependencies to packages/dreamcli.

📝 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
"optionalDependencies": {
"vite": "catalog:"
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/dreamcli/package.json` around lines 95 - 97, Remove the "vite" entry
from the package's optionalDependencies in package.json so tooling is not leaked
into the runtime surface; instead ensure any build/dev tooling is declared only
where needed (e.g., apps/docs/package.json or devDependencies) and update the
package.json's optionalDependencies block (remove the "vite": "catalog:" line)
so library consumers won't download Vite at install time.

Comment on lines +481 to +489
## Package structure

Three subpath exports, each with a focused API surface:

| Import | Purpose |
| -------------------------- | -------------------------------------------------------------------------------------- |
| `@kjanat/dreamcli` | Schema builders, CLI runner, output, parsing, resolution, errors |
| `@kjanat/dreamcli/testkit` | `runCommand()`, `createCaptureOutput()`, `createTestPrompter()`, `createTestAdapter()` |
| `@kjanat/dreamcli/runtime` | `createAdapter()`, `RuntimeAdapter`, runtime detection, platform adapters |
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 | 🟡 Minor

Document the schema entrypoint too.

Arrr, this section says "Three subpath exports," but the package also exposes @kjanat/dreamcli/schema. As written, consumers never learn where the published schema artifact lives, and the heading is off because the root import is not a subpath.

🏴‍☠️ Proposed doc fix
 ## Package structure
 
-Three subpath exports, each with a focused API surface:
+Four public entry points, each with a focused API surface:
 
 | Import                     | Purpose                                                                                |
 | -------------------------- | -------------------------------------------------------------------------------------- |
 | `@kjanat/dreamcli`         | Schema builders, CLI runner, output, parsing, resolution, errors                       |
+| `@kjanat/dreamcli/schema`  | Published JSON schema artifact (`dreamcli.schema.json`)                                |
 | `@kjanat/dreamcli/testkit` | `runCommand()`, `createCaptureOutput()`, `createTestPrompter()`, `createTestAdapter()` |
 | `@kjanat/dreamcli/runtime` | `createAdapter()`, `RuntimeAdapter`, runtime detection, platform adapters              |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/dreamcli/README.md` around lines 481 - 489, Update the README
section that lists package exports: change the heading and wording so it doesn’t
claim “Three subpath exports” and add the missing schema entrypoint by including
a row for `@kjanat/dreamcli/schema` (describing the published schema artifact
and its purpose) alongside the existing entries `@kjanat/dreamcli`,
`@kjanat/dreamcli/testkit`, and `@kjanat/dreamcli/runtime`; ensure the root
import wording clarifies that `@kjanat/dreamcli` is the root package and the
others are subpath exports.

Comment thread packages/dreamcli/src/runtime/support.test.ts
@coderabbitai coderabbitai Bot added area: cli CLI dispatch, planning, root UX, or plugins release Release planning, versioning, changelog, or publish flow and removed kind: feature New capability or product enhancement kind: breaking Breaking API, runtime, or packaging change area: docs VitePress app, guides, reference pages, and docs UX area: schema Schema builders, schema DSL, and JSON Schema export area: build Build, CI, release automation, scripts, and packaging labels Apr 8, 2026
Inherit paths + typeRoots from tsconfig so Twoslash resolves
@kjanat/dreamcli to source and finds vitest in package-level
node_modules. Remove bandaid // @errors annotations.
@coderabbitai coderabbitai Bot added kind: feature New capability or product enhancement kind: breaking Breaking API, runtime, or packaging change area: docs VitePress app, guides, reference pages, and docs UX and removed area: cli CLI dispatch, planning, root UX, or plugins release Release planning, versioning, changelog, or publish flow labels Apr 8, 2026
@coderabbitai coderabbitai Bot added area: cli CLI dispatch, planning, root UX, or plugins and removed kind: breaking Breaking API, runtime, or packaging change area: docs VitePress app, guides, reference pages, and docs UX area: schema Schema builders, schema DSL, and JSON Schema export area: build Build, CI, release automation, scripts, and packaging labels Apr 9, 2026
@coderabbitai coderabbitai Bot added kind: breaking Breaking API, runtime, or packaging change area: docs VitePress app, guides, reference pages, and docs UX area: build Build, CI, release automation, scripts, and packaging area: examples Runnable examples and walkthrough package and removed area: cli CLI dispatch, planning, root UX, or plugins labels Apr 23, 2026
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: 2

♻️ Duplicate comments (1)
apps/docs/.vitepress/config.ts (1)

62-66: ⚠️ Potential issue | 🟡 Minor

Use one JSR slug source; ye still split pkg.name and jsr.name.

links.jsr is built from pkg.name (Line 65), but social JSR uses jsr.name (Line 241). If they ever drift, one URL rots silently.

🧭 Suggested patch
 const links = {
 	github: pkg.repository.url.replace(/^git[+]/, ''),
 	npm: `https://www.npmjs.com/package/${pkg.name}`,
-	jsr: `https://jsr.io/${pkg.name}`,
+	jsr: `https://jsr.io/${jsr.name}`,
 } as const;
@@
-			{ icon: 'jsr', link: `https://jsr.io/${jsr.name}`, ariaLabel: 'JSR' },
+			{ icon: 'jsr', link: links.jsr, ariaLabel: 'JSR' },

Also applies to: 238-242

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

In `@apps/docs/.vitepress/config.ts` around lines 62 - 66, The JSR URL
construction is using pkg.name for links.jsr while elsewhere the site uses
jsr.name (e.g., the social JSR entry), which can drift; unify the source by
changing links.jsr to use jsr.name (or replace other usages to use pkg.name
consistently) so the JSR slug is computed from a single canonical
variable—update the links object (links.jsr) to use jsr.name and ensure any
references to the JSR slug (the social JSR entry) use the same jsr.name
identifier.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs/.vitepress/config.ts`:
- Around line 114-121: The Cloudflare Insights beacon script is being injected
unconditionally in the VitePress head array (the script entry with src
'https://static.cloudflareinsights.com/beacon.min.js' and data-cf-beacon token);
change this so the head entry is only added when telemetry is allowed—e.g., gate
by an environment flag like process.env.ENABLE_CLOUDFLARE_INSIGHTS or by a
runtime consent check—and ensure local/preview contexts (NODE_ENV ===
'development' or a PREVIEW flag) are excluded; update the code that
builds/returns the head array in config.ts to conditionally push the script
entry (or omit it) based on that flag/consent check, and document the new env
variable or consent mechanism so CI/local runs keep it disabled by default.
- Around line 50-60: The compilerOptions object hardcodes typeRoots, which
prevents Twoslash from discovering hoisted ambient types in Bun monorepos;
remove the typeRoots property from compilerOptions so TypeScript's default
resolution (with baseUrl set to projectRoot) can locate `@types` in the repo root
(update the compilerOptions constant where it's defined and ensure nothing else
depends on typeRoots).

---

Duplicate comments:
In `@apps/docs/.vitepress/config.ts`:
- Around line 62-66: The JSR URL construction is using pkg.name for links.jsr
while elsewhere the site uses jsr.name (e.g., the social JSR entry), which can
drift; unify the source by changing links.jsr to use jsr.name (or replace other
usages to use pkg.name consistently) so the JSR slug is computed from a single
canonical variable—update the links object (links.jsr) to use jsr.name and
ensure any references to the JSR slug (the social JSR entry) use the same
jsr.name identifier.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 413a9850-7c97-46ae-a765-7c5f5f5beead

📥 Commits

Reviewing files that changed from the base of the PR and between 8aa03e8 and c517f92.

📒 Files selected for processing (1)
  • apps/docs/.vitepress/config.ts
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:00.424Z
Learning: Do not treat `apps/docs/.vitepress/data/` as docs-only; scripts import it for generated source and docs artifacts
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:00.424Z
Learning: Do not replace `bun run gh-project:*` commands with ad hoc GitHub project mutations
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:00.424Z
Learning: Core library must stay runtime-agnostic; delegate host I/O through `RuntimeAdapter`, `WriteFn`, or `ReadFn` abstractions
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:00.424Z
Learning: Use Bun workspaces monorepo structure with packages, apps, tools, and examples directories as separate packages
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:08.466Z
Learning: Root `dreamcli.schema.json` is required for docs and must be copied into site output during build
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:08.466Z
Learning: Do not assume docs code is isolated from source generation; external scripts like `scripts/build-meta-descriptions.ts` may import it
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:13.887Z
Learning: Do not edit generated docs pages when the source of truth is an example file; update the example source instead
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:13.887Z
Learning: Do not let examples drift into pseudo-internal usage that real consumers cannot copy
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:13.887Z
Learning: Do not treat `.cache/` as source of truth
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:13.887Z
Learning: Do not bloat single-file examples with walkthrough-only complexity; move that to `examples/gh`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:35.748Z
Learning: Organize shell completion generators under `shells/` directory with per-shell modules (`bash.ts`, `zsh.ts`, `fish.ts`, `powershell.ts`) and centralize shared logic in `shells/shared.ts`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:35.748Z
Learning: Use a barrel `index.ts` to re-export public API symbols (`generateCompletion()`, per-shell generators, `SHELLS`, `CompletionOptions`, `Shell` type) and dispatch completion generation
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:35.748Z
Learning: In `shells/shared.ts`, implement shared infrastructure including `CommandNode` type, `walkCommandTree()` function for traversing nested command groups, string escaping utilities, and `versionTag` handling
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:35.748Z
Learning: Each per-shell generator (`generateBashCompletion()`, `generateZshCompletion()`, `generateFishCompletion()`, `generatePowerShellCompletion()`) must receive `CLISchema` and `CompletionOptions`, call `walkCommandTree()`, and emit shell-specific completion functions
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:41.607Z
Learning: All I/O flows through a narrow `RuntimeAdapter` surface to keep code testable with virtual filesystems
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:41.607Z
Learning: Do not couple config discovery to command schema or resolve precedence logic
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:48.906Z
Learning: Help text must be generated from schema metadata; keep formatting rules derived, not duplicated per caller
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:48.906Z
Learning: Do not pull TTY or color logic into help formatting; that belongs in output
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:48.906Z
Learning: Do not special-case caller behavior when schema metadata already expresses it
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:48.906Z
Learning: Do not simplify wrapping or padding without checking narrow alignment regressions in tests
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:56.596Z
Learning: Regenerate descriptions via the build script `../../../../../scripts/build-meta-descriptions.ts`; build-time schema description data comes from docs data modules, not hand-maintained constants
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:22:56.596Z
Learning: Ensure the package-level schema artifact is built; the root `dreamcli.schema.json` is emitted from this module's surface
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:11.102Z
Learning: Maintain acyclic dependency graph: `writer.ts` <- `contracts.ts` <- `activity.ts` <- `index.ts` -> `writer.ts`, with `renderers.ts` and `display-value.ts` consumed by `index.ts`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:11.102Z
Learning: Implement four output modes (Normal, JSON, Quiet, Non-TTY, Capture) with mode-specific routing: Normal and Non-TTY log to stdout, JSON logs to stderr, Quiet suppresses logs, Capture collects output in arrays
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:11.102Z
Learning: Support `ActivityEvent` with 10 distinct variants including separate handling for `progress:increment` and `progress:update` events
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:17.360Z
Learning: Keep tokenizer schema-agnostic; resolve/default/env/config behavior belongs elsewhere
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:17.360Z
Learning: Do not read env, config, prompts, or defaults in the parse module; that is `resolve/`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:17.360Z
Learning: Do not blur tokenization and parsing responsibilities to simplify a small change
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:17.360Z
Learning: Respect the test contract defined in `parse.test.ts` when making changes to the parse module
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:26.130Z
Learning: The prompt module is a pluggable engine with terminal and test implementations, not hard-wired terminal code
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:37.863Z
Learning: Implement resolution order: CLI argv → environment variable → config file → interactive prompt → default value. First non-undefined source wins; missing required values trigger ValidationError.
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:37.863Z
Learning: Use a two-pass architecture: Pass 1 collects CLI → env → config values for all flags. If command has `.interactive()`, invoke it with partial flags. Pass 2 resolves remaining flags via prompt → default → required validation.
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:43.680Z
Learning: Keep schema-dsl module layered on top of the schema/ module — schema-dsl consumers define schemas as strings while depending on schema/ flag, arg, and command builders without creating circular dependencies
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:23:55.750Z
Learning: When adding a new flag type: add variant to `FlagKind` union in flag.ts, add factory method on FlagBuilder, update `InferFlag` conditional type, wire through resolve/coerce.ts by adding coercion case in `coerceValue()`, and add tests in flag.test.ts and resolve.test.ts
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-23T05:24:12.084Z
Learning: `ExitError` is thrown by `adapter.exit()` and should be caught by the CLI dispatch layer
🪛 Betterleaks (1.1.2)
apps/docs/.vitepress/config.ts

[high] 119-119: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (1)
apps/docs/.vitepress/config.ts (1)

10-15: Nice — path centralization here be the right move.

Using ./data/paths.ts as the single source of filesystem truth reduces drift across docs/build tooling.

Based on learnings, "Do not treat apps/docs/.vitepress/data/ as docs-only; scripts import it for generated source and docs artifacts."

Comment on lines 50 to 60
const compilerOptions = {
baseUrl: projectRoot,
lib: tsc.compilerOptions?.lib ?? ['ESNext'],
paths: tsc.compilerOptions?.paths ?? {},
moduleDetection: ModuleDetectionKind.Force,
module: ModuleKind.ESNext,
moduleResolution: ModuleResolutionKind.Bundler,
allowImportingTsExtensions: tsc.compilerOptions?.allowImportingTsExtensions,
allowImportingTsExtensions: true,
noEmit: true,
resolveJsonModule: tsc.compilerOptions?.resolveJsonModule,
types: [...(tsc.compilerOptions?.types ?? []), 'vitest/globals'],
resolveJsonModule: true,
typeRoots: [`${packageRoot}/node_modules/@types`, `${packageRoot}/node_modules`],
};
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
set -euo pipefail

echo "== Twoslash compilerOptions in docs config =="
rg -n -C3 'compilerOptions|typeRoots|types|baseUrl|paths' apps/docs/.vitepress/config.ts

echo
echo "== Deno global usage in docs/examples/packages =="
rg -nP '\bDeno\.' apps/docs examples packages -g '*.ts' -g '*.md' || true

echo
echo "== Root tsconfig path mappings =="
rg -n -C2 '"paths"|@kjanat/dreamcli' tsconfig.json

Repository: kjanat/dreamcli

Length of output: 5861


🏁 Script executed:

cat -n apps/docs/.vitepress/data/paths.ts

Repository: kjanat/dreamcli

Length of output: 1850


🏁 Script executed:

#!/bin/bash
# Check for `@types` directories at various levels
echo "=== `@types` directories in monorepo ==="
find . -type d -name '@types' -not -path '*/node_modules/*' -not -path '*/.*' 2>/dev/null | head -20

echo
echo "=== Root node_modules/@types (if exists) ==="
ls -la node_modules/@types 2>/dev/null | head -10 || echo "No root node_modules/@types"

echo
echo "=== Check if tsconfig.json has typeRoots ==="
jq '.compilerOptions.typeRoots // "not set"' tsconfig.json

echo
echo "=== Packages/dreamcli tsconfig.json ==="
head -60 packages/dreamcli/tsconfig.json | tail -30

Repository: kjanat/dreamcli

Length of output: 726


🏁 Script executed:

#!/bin/bash
echo "=== Current compilerOptions in config.ts (lines 50-60) ==="
sed -n '50,60p' apps/docs/.vitepress/config.ts

echo
echo "=== Check for types array in packages/dreamcli/tsconfig ==="
jq '.compilerOptions.types' packages/dreamcli/tsconfig.json

echo
echo "=== Verify bun/node/deno type packages would be at root ==="
grep -r '"deno"' packages/dreamcli/tsconfig.json packages/dreamcli/package.json || echo "deno type ref in package"

Repository: kjanat/dreamcli

Length of output: 1010


Ye be restrictin' Twoslash's type discovery with that hardcoded typeRoots, matey—it'll break in a Bun monorepo.

Batten down the hatches! Line 59 chains typeRoots to packages/dreamcli/node_modules only. But in a Bun monorepo with hoisted dependencies, yer @types (bun, node, deno, vitest) be at the root node_modules. This starves Twoslash of ambient types and scuttles code sample resolution.

With baseUrl already set to the project root, ye can hoist the Jolly Roger and remove that line—TypeScript's default resolution will climb the mast to find types where they actually be.

⚓ Suggested patch
 const compilerOptions = {
 	baseUrl: projectRoot,
 	paths: tsc.compilerOptions?.paths ?? {},
 	moduleDetection: ModuleDetectionKind.Force,
 	module: ModuleKind.ESNext,
 	moduleResolution: ModuleResolutionKind.Bundler,
 	allowImportingTsExtensions: true,
 	noEmit: true,
 	resolveJsonModule: true,
-	typeRoots: [`${packageRoot}/node_modules/@types`, `${packageRoot}/node_modules`],
 };
📝 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
const compilerOptions = {
baseUrl: projectRoot,
lib: tsc.compilerOptions?.lib ?? ['ESNext'],
paths: tsc.compilerOptions?.paths ?? {},
moduleDetection: ModuleDetectionKind.Force,
module: ModuleKind.ESNext,
moduleResolution: ModuleResolutionKind.Bundler,
allowImportingTsExtensions: tsc.compilerOptions?.allowImportingTsExtensions,
allowImportingTsExtensions: true,
noEmit: true,
resolveJsonModule: tsc.compilerOptions?.resolveJsonModule,
types: [...(tsc.compilerOptions?.types ?? []), 'vitest/globals'],
resolveJsonModule: true,
typeRoots: [`${packageRoot}/node_modules/@types`, `${packageRoot}/node_modules`],
};
const compilerOptions = {
baseUrl: projectRoot,
paths: tsc.compilerOptions?.paths ?? {},
moduleDetection: ModuleDetectionKind.Force,
module: ModuleKind.ESNext,
moduleResolution: ModuleResolutionKind.Bundler,
allowImportingTsExtensions: true,
noEmit: true,
resolveJsonModule: true,
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/.vitepress/config.ts` around lines 50 - 60, The compilerOptions
object hardcodes typeRoots, which prevents Twoslash from discovering hoisted
ambient types in Bun monorepos; remove the typeRoots property from
compilerOptions so TypeScript's default resolution (with baseUrl set to
projectRoot) can locate `@types` in the repo root (update the compilerOptions
constant where it's defined and ensure nothing else depends on typeRoots).

Comment on lines +114 to +121
[
'script',
{
defer: '',
src: 'https://static.cloudflareinsights.com/beacon.min.js',
'data-cf-beacon': '{"token": "ee9b04d68d3740bebb38f5c20629b7c1"}',
},
],
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

Gate analytics injection by environment/consent, matey.

This beacon script is injected unconditionally. That creates avoidable privacy/compliance risk for local/preview contexts and makes opt-out impossible at config level.

🧰 Tools
🪛 Betterleaks (1.1.2)

[high] 119-119: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

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

In `@apps/docs/.vitepress/config.ts` around lines 114 - 121, The Cloudflare
Insights beacon script is being injected unconditionally in the VitePress head
array (the script entry with src
'https://static.cloudflareinsights.com/beacon.min.js' and data-cf-beacon token);
change this so the head entry is only added when telemetry is allowed—e.g., gate
by an environment flag like process.env.ENABLE_CLOUDFLARE_INSIGHTS or by a
runtime consent check—and ensure local/preview contexts (NODE_ENV ===
'development' or a PREVIEW flag) are excluded; update the code that
builds/returns the head array in config.ts to conditionally push the script
entry (or omit it) based on that flag/consent check, and document the new env
variable or consent mechanism so CI/local runs keep it disabled by default.

kjanat added 2 commits April 23, 2026 07:33
Move `package.json` sorting into a dprint plugin and bump the
formatting and workspace tooling deps so repo formatting stays
consistent in one pass.

Stop re-awaiting the resolved TypeDoc git ref and regenerate the
affected PowerShell, example, and schema artifacts after the
formatter refresh.
@coderabbitai coderabbitai Bot added area: schema Schema builders, schema DSL, and JSON Schema export and removed kind: breaking Breaking API, runtime, or packaging change area: docs VitePress app, guides, reference pages, and docs UX area: build Build, CI, release automation, scripts, and packaging area: examples Runnable examples and walkthrough package labels Apr 29, 2026
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

Caution

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

⚠️ Outside diff range comments (2)
.gitignore (1)

223-236: ⚠️ Potential issue | 🟡 Minor

Trim the blast radius: make cache patterns directory-only.

Right now you’re ignoring __pycache__ and .*_cache without a trailing /. That can match files as well as directories, which is a little sloppy (aye, I’m a perfectionist pirate).

Make them explicitly directory ignores:

🏴‍☠️ Proposed fix
-__pycache__
-.*_cache
+__pycache__/
+.*_cache/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitignore around lines 223 - 236, The ignore entries for __pycache__ and
.*_cache are currently written without trailing slashes which can match files as
well as directories; update the .gitignore entries by replacing "__pycache__"
and ".*_cache" with directory-only patterns "__pycache__/" and ".*_cache/" so
they explicitly ignore directories (modify the existing lines in the .gitignore
where these symbols appear).
examples/pwsh-demo/src/main.ts (1)

26-26: ⚠️ Potential issue | 🟡 Minor

Fix string quoting guideline violation ("qa's").

Repo guideline says: use single quotes for strings in TS. Line 26 currently uses "qa's" with double quotes, which violates that rule.

🏴 Proposed fix
-			flag
-				.enum(['default', 'ops', 'readonly', 'qa ops', "qa's"])
+			flag
+				.enum(['default', 'ops', 'readonly', 'qa ops', 'qa\'s'])
 				.alias('p')
 				.alias('account', { hidden: true })
 				.describe('Credential profile'),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/pwsh-demo/src/main.ts` at line 26, The enum value currently uses
double quotes ("qa's") which violates the project's single-quote string
guideline; update the .enum([...]) array to use single-quoted string for that
entry (escape the apostrophe as needed) so the value becomes a single-quoted
string consistent with other entries like 'default' and 'ops'.
♻️ Duplicate comments (1)
.zed/settings.json (1)

14-17: ⚠️ Potential issue | 🟡 Minor

Make the fallback formatter use the same bundled dprint path.

Line 17 still shells out to bare dprint, while the LSP block on Lines 45-50 uses bunx. If a deckhand lacks a global install, the fallback formatter keels over even though the primary one works.

⚙️ Suggested fix
 	"formatter": [
 		{ "language_server": { "name": "dprint" } },
 		// Fallback to the dprint CLI in case the lsp fucks up, which it does sometimes for some reason...
-		{ "external": { "command": "dprint", "arguments": ["fmt", "--stdin", "{buffer_path}"] } }
+		{ "external": { "command": "bunx", "arguments": ["dprint", "fmt", "--stdin", "{buffer_path}"] } }
 	],
#!/bin/bash
# Verify the fallback formatter and the LSP are still using different dprint entrypoints.
sed -n '14,18p;45,50p' .zed/settings.json
rg -n '"dprint": "catalog:"' package.json
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.zed/settings.json around lines 14 - 17, The fallback formatter currently
shells out to the bare "dprint" (external.command in the formatter array) which
can fail if dprint isn't globally installed; update that external formatter
entry to invoke the same bundled dprint entrypoint used by the LSP block (the
same invocation string you used in the LSP block around lines 45-50, e.g. the
"bunx" based command or the exact bundled path from package.json) so both the
language_server { name: "dprint" } and the external formatter use the identical
bundled dprint entrypoint.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs/guide/getting-started.md`:
- Around line 21-24: Replace the literal backslash-u sequences in the inline
code spans for the runtime versions with actual U+00A0 non-breaking space
characters: change occurrences like `>=\u00a022.22.2`, `>=\u00a01.3`, and
`>=\u00a02.6.0` to use a real NBSP between the comparison operator and the
version string so the rendered text shows a non-breaking space instead of the
visible escape sequence; update the three inline code spans in the "Supported
minimum runtimes:" block accordingly.

In `@apps/docs/guide/runtime.md`:
- Around line 8-13: Replace the literal backslash-u00a0 sequences in the runtime
table entries with actual non‑breaking space characters (U+00A0) so strings like
"Node.js >=\\u00a022.22.2", "Bun >=\\u00a01.3" and "Deno >=\\u00a02.6.0" become
"Node.js >=" + NBSP + "22.22.2", "Bun >=" + NBSP + "1.3", and "Deno >=" + NBSP +
"2.6.0"; update the three occurrences in the table so the markdown renders real
NBSP characters instead of the literal escape sequences.

In `@apps/docs/reference/runtime.md`:
- Around line 63-68: The runtime table contains literal backslash-u sequences
("\u00a0") instead of real non-breaking spaces in the version strings (e.g., the
entries shown as "Node.js >=\u00a022.22.2", "Bun >=\u00a01.3", "Deno
>=\u00a02.6.0"); update those table cells to replace each literal "\u00a0"
sequence with an actual U+00A0 non-breaking space character so the Markdown
renders correctly (edit the table rows where the strings appear, e.g., the
Node.js, Bun, and Deno version cells).

In `@apps/docs/reference/support-matrix.md`:
- Around line 42-44: Replace the literal escape sequences "\u00a0" in the table
entries (e.g., "Node.js >=\u00a022.22.2 runtime support", "Bun >=\u00a01.3
runtime support", "Deno >=\u00a02.6.0 runtime support") with an actual U+00A0
non‑breaking space character so the Markdown renders spacing correctly; search
for the "\u00a0" substrings in the support-matrix table and substitute each with
a real NBSP character (keep the rest of the text unchanged).

---

Outside diff comments:
In @.gitignore:
- Around line 223-236: The ignore entries for __pycache__ and .*_cache are
currently written without trailing slashes which can match files as well as
directories; update the .gitignore entries by replacing "__pycache__" and
".*_cache" with directory-only patterns "__pycache__/" and ".*_cache/" so they
explicitly ignore directories (modify the existing lines in the .gitignore where
these symbols appear).

In `@examples/pwsh-demo/src/main.ts`:
- Line 26: The enum value currently uses double quotes ("qa's") which violates
the project's single-quote string guideline; update the .enum([...]) array to
use single-quoted string for that entry (escape the apostrophe as needed) so the
value becomes a single-quoted string consistent with other entries like
'default' and 'ops'.

---

Duplicate comments:
In @.zed/settings.json:
- Around line 14-17: The fallback formatter currently shells out to the bare
"dprint" (external.command in the formatter array) which can fail if dprint
isn't globally installed; update that external formatter entry to invoke the
same bundled dprint entrypoint used by the LSP block (the same invocation string
you used in the LSP block around lines 45-50, e.g. the "bunx" based command or
the exact bundled path from package.json) so both the language_server { name:
"dprint" } and the external formatter use the identical bundled dprint
entrypoint.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 911ad9fa-50c5-4ef1-87de-c6873c56e658

📥 Commits

Reviewing files that changed from the base of the PR and between c517f92 and 3a7406b.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (28)
  • .dprint.jsonc
  • .gitignore
  • .zed/settings.json
  • apps/docs/.vitepress/data/typedoc.ts
  • apps/docs/guide/completions.md
  • apps/docs/guide/getting-started.md
  • apps/docs/guide/runtime.md
  • apps/docs/reference/runtime.md
  • apps/docs/reference/support-matrix.md
  • examples/AGENTS.md
  • examples/gh/package.json
  • examples/pwsh-demo/src/main.test.ts
  • examples/pwsh-demo/src/main.ts
  • package.json
  • packages/dreamcli/CHANGELOG.md
  • packages/dreamcli/deno.json
  • packages/dreamcli/src/core/cli/cli-completion-e2e.test.ts
  • packages/dreamcli/src/core/completion/completion.test.ts
  • packages/dreamcli/src/core/completion/shells/powershell.ts
  • packages/dreamcli/src/core/resolve/AGENTS.md
  • packages/dreamcli/src/core/resolve/flags.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • packages/dreamcli/src/core/schema/AGENTS.md
  • packages/dreamcli/src/core/schema/flag.ts
  • packages/dreamcli/src/core/schema/prompt.test.ts
  • packages/dreamcli/src/runtime/auto.test.ts
  • packages/dreamcli/src/runtime/bun.test.ts
  • packages/dreamcli/src/runtime/support.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 18000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: dreamcli
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{ts,tsx,json,md}

📄 CodeRabbit inference engine (AGENTS.md)

Use LF (line feed) for line endings

Files:

  • apps/docs/reference/support-matrix.md
  • examples/pwsh-demo/src/main.test.ts
  • examples/AGENTS.md
  • examples/gh/package.json
  • apps/docs/guide/runtime.md
  • examples/pwsh-demo/src/main.ts
  • apps/docs/reference/runtime.md
  • packages/dreamcli/deno.json
  • packages/dreamcli/src/core/completion/shells/powershell.ts
  • apps/docs/guide/getting-started.md
  • package.json
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use tabs for indentation

Use single quotes for strings

Use semicolons at end of statements

Use import type for type-only imports in TypeScript

Include .ts extensions in all relative imports

Use strict TypeScript with exactOptionalPropertyTypes enabled

Use explicit named re-exports only; no export * wildcard exports

Files:

  • examples/pwsh-demo/src/main.test.ts
  • examples/pwsh-demo/src/main.ts
  • packages/dreamcli/src/core/completion/shells/powershell.ts
**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

Co-locate tests with source files as *.test.ts using describe() + it() with em dash in suite titles

Use // === and // --- section markers in test files

Do not use lifecycle hooks, snapshots, or module mocks in tests

Include trailing newline (\n) in output assertions

Files:

  • examples/pwsh-demo/src/main.test.ts
examples/**/*.ts

📄 CodeRabbit inference engine (examples/AGENTS.md)

Examples should import public package exports only, never internal exports from #internals/*

Files:

  • examples/pwsh-demo/src/main.test.ts
  • examples/pwsh-demo/src/main.ts
examples/gh/package.json

📄 CodeRabbit inference engine (examples/AGENTS.md)

Ensure examples/gh/package.json links @kjanat/dreamcli from the workspace and exposes a real gh bin

Files:

  • examples/gh/package.json
apps/docs/{concepts,guide}/**/*.md

📄 CodeRabbit inference engine (apps/docs/AGENTS.md)

Edit prose content in concepts/, guide/, and index.md hand-written Markdown files

Files:

  • apps/docs/guide/runtime.md
  • apps/docs/guide/getting-started.md
packages/dreamcli/src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Include @module JSDoc at the top of source files and mark non-public API with @internal

Files:

  • packages/dreamcli/src/core/completion/shells/powershell.ts
packages/dreamcli/src/core/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Public API should use factory-first pattern with function names: cli(), command(), flag.*(), createOutput(), createAdapter()

Do not use process.* or runtime-specific APIs in packages/dreamcli/src/core/

Files:

  • packages/dreamcli/src/core/completion/shells/powershell.ts
packages/dreamcli/src/core/{cli,completion,output,prompt,resolve}/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not import through barrels in cli/, completion/, output/, prompt/, resolve/, and runtime/ directories when it would create cycles; use direct-file imports

Files:

  • packages/dreamcli/src/core/completion/shells/powershell.ts
packages/dreamcli/src/core/completion/{shells/**/*.ts,index.ts}

📄 CodeRabbit inference engine (packages/dreamcli/src/core/completion/AGENTS.md)

Split shell completion generators into separate files under shells/ directory with a barrel index.ts that re-exports the public API and dispatches via generateCompletion()

Files:

  • packages/dreamcli/src/core/completion/shells/powershell.ts
packages/dreamcli/src/core/completion/shells/{bash,zsh,fish,powershell}.ts

📄 CodeRabbit inference engine (packages/dreamcli/src/core/completion/AGENTS.md)

Implement per-shell completion generators (generateBashCompletion(), generateZshCompletion(), generateFishCompletion(), generatePowerShellCompletion()) in separate shell-specific files under shells/

Files:

  • packages/dreamcli/src/core/completion/shells/powershell.ts
packages/dreamcli/src/core/completion/{index.ts,shells/**/*.ts}

📄 CodeRabbit inference engine (packages/dreamcli/src/core/completion/AGENTS.md)

Use CompletionOptions type (defined in shells/shared.ts and re-exported through index.ts) for completion generator function signatures

Files:

  • packages/dreamcli/src/core/completion/shells/powershell.ts
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:35.628Z
Learning: Do not hand-edit `dreamcli.schema.json` or `src/core/json-schema/meta-descriptions.generated.ts`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:35.628Z
Learning: Do not edit `apps/docs/.vitepress/dist/` or `apps/docs/.vitepress/cache/` directories
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:35.628Z
Learning: Do not treat `apps/docs/.vitepress/data/` as docs-only; scripts import it for generated source and docs artifacts
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:35.628Z
Learning: Do not replace `bun run gh-project:*` with ad hoc GitHub project mutations
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:46.302Z
Learning: Do not patch generated example/reference pages; edit the real source in repo-root `examples/` or `.vitepress/data/` instead
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:46.302Z
Learning: Do not assume docs code is isolated from source generation; note that `scripts/build-meta-descriptions.ts` imports docs code
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:52.863Z
Learning: Move complex walkthrough logic that exceeds single-file pedagogy to `examples/gh`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:52.863Z
Learning: Do not edit generated docs pages when the source of truth is an example file
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:52.863Z
Learning: Do not let examples drift into pseudo-internal usage patterns that real consumers cannot copy
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:52.863Z
Learning: Do not treat `.cache/` directory contents as source
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:21:52.863Z
Learning: Update `examples/pwsh-demo` smoke coverage and docs when changing PowerShell install behavior
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:17.491Z
Learning: Use `shells/shared.ts` for shared completion infrastructure including `CommandNode`, `walkCommandTree()`, escaping utilities, and `versionTag`, imported directly by per-shell generators
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:17.491Z
Learning: Walk the command tree to generate `CommandNode[]` as the intermediate representation before shell-specific code generation in each per-shell generator
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:34.704Z
Learning: Help text is generated from schema metadata; keep formatting rules derived, not duplicated per caller
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:34.704Z
Learning: Do not pull TTY or color logic into help formatting; that belongs in output layer
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:34.704Z
Learning: Do not special-case caller behavior when schema metadata already expresses it
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:34.704Z
Learning: Do not simplify wrapping or padding without checking narrow alignment regressions in tests
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:39.855Z
Learning: Build-time schema description data comes from docs data modules, not hand-maintained constants
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:39.855Z
Learning: Do not forget the package-level schema artifact: build emits root `dreamcli.schema.json` from this surface
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Maintain a strict dependency graph with no cycles: `writer.ts` <- `contracts.ts` <- `activity.ts` <- `index.ts` -> `writer.ts`, with `renderers.ts` and `display-value.ts` consumed by `index.ts`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: In output modes, route `log` output to stdout in Normal/Non-TTY/Capture modes, and to stderr in JSON mode; always route `json` output to stdout
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Route all activity output (spinner/progress) to stderr, not stdout
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Enforce single active handle at a time: starting a new spinner or progress handle implicitly stops any previously active handle
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Support `ActivityEvent` with 10 variants including distinct `progress:increment` and `progress:update` event types for testkit assertions
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Write 49 tests in `output.test.ts` covering OutputChannel log/warn/error methods across all output modes
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Write 20 tests in `output-tty.test.ts` covering TTY-specific rendering, color output, and formatting behavior
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Write 16 tests in `output-table.test.ts` covering table output rendering in various output modes
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Write 45 tests in `output-spinner.test.ts` covering spinner handles across noop/static/TTY/capture tiers with fake timer usage
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Write 40 tests in `output-progress.test.ts` covering progress handles across noop/static/TTY/capture tiers with fake timer usage
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:22:57.675Z
Learning: Write 32 tests in `output-activity-dispatch.test.ts` covering OutputChannel mode dispatch wiring, activity overlap behavior, and testkit integration
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:23:29.123Z
Learning: Use a two-pass architecture: Pass 1 resolves all flags via CLI → env → config; Pass 2 processes unresolved flags via prompt → default → validation. Insert interactive resolver call between passes if command has .interactive()
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:23:35.276Z
Learning: The schema-dsl module provides string-literal schema definitions with compile-time type inference using the `define()` factory function as the public API in `index.ts`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:23:35.276Z
Learning: Both compile-time (`parse.ts`) and runtime (`runtime.ts`) parsing paths must produce equivalent results for the same string input — a string that type-checks must also produce correct runtime behavior
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:23:50.422Z
Learning: When adding a new flag type: (1) Add variant to `FlagKind` union in `flag.ts`, (2) Add factory method on `FlagBuilder`, (3) Update `InferFlag` conditional type, (4) Wire through `resolve/coerce.ts` (add coercion case in unified `coerceValue()`), (5) Add tests in `flag.test.ts` + `resolve.test.ts`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:23:50.422Z
Learning: Note that `.middleware()` drops current handler (type signature changes) — intentional behavior that forces re-registration after middleware addition
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:23:50.422Z
Learning: Create test files for core/schema module: `command.test.ts` (CommandBuilder API, schema, type inference), `flag.test.ts` (FlagBuilder API, kinds, validation), `arg.test.ts` (ArgBuilder API, kinds, validation), `middleware.test.ts` (Middleware factory, context typing), `prompt.test.ts` (Prompt config types), `derive.test.ts` (Type derivation tests)
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:23:59.142Z
Learning: `runCommand(cmd, argv, options?): Promise<RunResult>` is a thin in-process wrapper over the shared executor that captures output, forwards injected execution options, and returns captured output
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:23:59.142Z
Learning: The testkit barrel should be curated at `src/testkit.ts` and exported as a first-class module from `kjanat/dreamcli/testkit` subpath
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:23:59.142Z
Learning: Wire `CaptureOutputChannel` from the output module for output and activity capture in testkit
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-04-29T03:24:10.229Z
Learning: `ExitError` thrown by `adapter.exit()` must be caught by CLI dispatch layer, not propagated
📚 Learning: 2026-02-10T16:25:08.867Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 1
File: AGENTS.md:12-12
Timestamp: 2026-02-10T16:25:08.867Z
Learning: In repository kjanat/dreamcli, prefer using the filename syntax (e.g., GOALS.md) when referencing files in Markdown documentation, and treat references that do not follow this style as non-issues. This pattern applies to all Markdown files across the project.

Applied to files:

  • apps/docs/reference/support-matrix.md
  • examples/AGENTS.md
  • apps/docs/guide/runtime.md
  • apps/docs/reference/runtime.md
  • apps/docs/guide/getting-started.md
📚 Learning: 2026-02-11T11:57:27.623Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 3
File: src/core/cli/cli-completion-e2e.test.ts:9-16
Timestamp: 2026-02-11T11:57:27.623Z
Learning: Enforce explicit .ts extensions in all relative imports for TypeScript source files (enabled by allowImportingTsExtensions and noEmit in tsconfig.json). This applies to both static and dynamic imports. For each TypeScript file, update relative import paths to end with .ts (e.g., './utils/helper' -> './utils/helper.ts'). Ensure tooling (linting/eslint rules or a codemod) flags missing extensions and provides a quick fix. This guideline should cover all TypeScript files in the repo, not just a single test or module.

Applied to files:

  • examples/pwsh-demo/src/main.test.ts
  • examples/pwsh-demo/src/main.ts
  • packages/dreamcli/src/core/completion/shells/powershell.ts
📚 Learning: 2026-02-12T15:52:24.166Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 4
File: src/core/resolve/resolve-arg-env.test.ts:1-7
Timestamp: 2026-02-12T15:52:24.166Z
Learning: In test files, do not require the module JSDoc tag at the top. This rule applies to all test files, while non-test source files should still require the module tag. Use the pattern **/*.test.{ts,tsx} to cover all test TypeScript test files (adjust if your project uses only .ts tests).

Applied to files:

  • examples/pwsh-demo/src/main.test.ts
📚 Learning: 2026-04-06T11:26:04.030Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: examples/middleware.ts:2-11
Timestamp: 2026-04-06T11:26:04.030Z
Learning: In the kjanat/dreamcli repository, require the `module` JSDoc tag only for library source files under `src/` (e.g., `src/**/*.ts`). Files outside `src/` such as runnable demo/example scripts under `examples/` are not considered source code for this rule and should not be required to include `module`.

Applied to files:

  • examples/pwsh-demo/src/main.test.ts
  • examples/pwsh-demo/src/main.ts
  • packages/dreamcli/src/core/completion/shells/powershell.ts
📚 Learning: 2026-04-06T18:24:44.371Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: docs/reference/api.md:8-8
Timestamp: 2026-04-06T18:24:44.371Z
Learning: In the kjanat/dreamcli repo, the explicit type annotation `Readonly<Record<string, string>>` applied to `const` object literals is an intentional documentation/intent pattern. Do not flag it as redundant or unnecessary (e.g., for being inferable) when reviewing TypeScript/TSX files; treat this explicitness as acceptable by design.

Applied to files:

  • examples/pwsh-demo/src/main.test.ts
  • examples/pwsh-demo/src/main.ts
  • packages/dreamcli/src/core/completion/shells/powershell.ts
📚 Learning: 2026-04-06T18:40:01.263Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: docs/.vitepress/vite-plugins/source-artifacts.ts:62-83
Timestamp: 2026-04-06T18:40:01.263Z
Learning: For this repository, Windows is explicitly not a supported/targeted platform. During code review, do not raise issues about Windows-specific path separators or normalization differences (e.g., use of `path.sep`, handling forward-slash vs backslash, or `normalize()`-related concerns). These checks should be treated as out-of-scope because the project is intended for Linux/macOS only.

Applied to files:

  • examples/pwsh-demo/src/main.test.ts
  • examples/pwsh-demo/src/main.ts
  • packages/dreamcli/src/core/completion/shells/powershell.ts
📚 Learning: 2026-04-16T19:00:34.468Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 17
File: examples/pwsh-demo/src/main.test.ts:12-48
Timestamp: 2026-04-16T19:00:34.468Z
Learning: In kjanat/dreamcli, files under the `examples/` directory that are test files (e.g., `examples/**/*.test.ts`) are exempt from the repo-wide test-style conventions that require em dashes in `describe()` suite titles and `// ===` / `// ---` section marker comments. Do not flag missing em dashes in `describe()` titles or missing `// ===` / `// ---` section markers in these `examples/**/*.test.ts` files.

Applied to files:

  • examples/pwsh-demo/src/main.test.ts
📚 Learning: 2026-04-07T08:45:53.051Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: package.json:121-129
Timestamp: 2026-04-07T08:45:53.051Z
Learning: When reviewing package.json `devEngines`, do not treat EBADDEVENGINES warnings as a breaking issue if the block intentionally uses Bun (e.g., `{ "name": "bun" }`) and the corresponding `onFail` values are soft (`onFail: "warn"` or `onFail: "ignore"`). npm may consider `bun` an invalid/unsupported engine name and warn, but with these `onFail` settings it won’t hard-fail—so the intent should be respected unless `onFail` is set to `fail` or similar hard-failure behavior.

Applied to files:

  • examples/gh/package.json
  • package.json
📚 Learning: 2026-04-06T11:32:59.137Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: .zed/settings.json:49-52
Timestamp: 2026-04-06T11:32:59.137Z
Learning: In kjanat/dreamcli, do not treat the `.zed/settings.json` → `.attw.json` JSON-schema reference (the gist URL owned/controlled by repo maintainer kjanat) as a fragile external dependency. Assume the gist is intentionally maintained by the maintainer and do not recommend moving the schema to the repo or to a “more stable” location in this file.

Applied to files:

  • .zed/settings.json
📚 Learning: 2026-04-06T11:48:17.901Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: deno.json:26-40
Timestamp: 2026-04-06T11:48:17.901Z
Learning: For Deno/JSR projects using `deno.json`, it is valid to declare public subpath exports that map to JSON files (e.g., `"./schema": "./dreamcli.schema.json"`). During code review, do not flag JSON file subpath exports in `deno.json` as invalid; Deno’s toolchain (e.g., `deno publish --dry-run` / `deno check`) supports JSON exports natively and should be used to confirm validity if needed.

Applied to files:

  • packages/dreamcli/deno.json
🔇 Additional comments (18)
examples/pwsh-demo/src/main.test.ts (1)

34-44: ☠️ LGTM: stdout expectation formatting is semantically consistent

That toEqual([...]) on result.stdout is clean, and the single-line array literal at Line 43 is an equivalent reformat of the expected output (no logic changes). Keeps the test strict about both lines and their trailing \n, which matches the intent of this smoke test.

packages/dreamcli/src/core/completion/shells/powershell.ts (1)

321-328: Aye, this PowerShell quoting fix looks solid.

Line 321 and Line 328 now correctly emit an explicit empty-string literal and a properly escaped single-quoted completion value, which keeps completion text valid for tricky enum values.

apps/docs/guide/runtime.md (1)

60-66: Arrr, path be shipshape—it resolves correctly from the repo root.

Yer import path ./apps/docs/.vitepress/twoslash/testing-fixtures.ts sails true when Twoslash interprets it relative to the repo root, which it does. The file exists exactly where ye pointed it. If the path were ever interpreted relative to the markdown file's directory, it'd sink like a landlubber's ship, but Twoslash knows better than that. Everything's in order, me hearty.

examples/pwsh-demo/src/main.ts (4)

37-43: LGTM: open out.log formatting-only refactor.

The change to a multi-line out.log(...) call keeps the exact same template string values and nullish-default behavior (flags.profile ?? 'default'). No functional risk here.


59-65: LGTM: deploy out.log formatting-only refactor.

Same story: the refactor only adjusts formatting of the out.log(...) call and preserves the string interpolation + defaults (flags.region ?? 'us', flags.strategy ?? 'rolling').


89-92: LGTM: config set --scope flag formatting-only refactor.

The .flag('scope', ...) structure is reformatted without changing the enum values or default (default('user')).


115-121: LGTM: debug-dump --section hidden flag formatting-only refactor.

Refactor preserves enum values, default, and description; no behavior change expected.

examples/AGENTS.md (2)

11-15: LGTM: examples layout structure docs updated.

The STRUCTURE section now clearly calls out standalone/, gh/, and pwsh-demo/, matching the new guidance. No issues.


19-26: LGTM: “WHERE TO LOOK” table updated for the new paths.

Table entries and notes align with the new examples layout expectations (standalone single-feature edits, docs example metadata location, walkthrough package, pwsh demo package, and generated docs trace locations).

examples/gh/package.json (2)

13-15: Good monorepo wiring, finally.

Ye kept a real gh bin exposed and switched @kjanat/dreamcli to workspace:*, which is exactly what this example needed after the split.

As per coding guidelines, examples/gh/package.json must “link @kjanat/dreamcli from the workspace and expose a real gh bin”.

Also applies to: 29-33


23-26: Keeping both typecheck paths is smart.

Defaulting to tsgo while preserving typecheck:tsc gives ye the shiny new path without losing the boring reliable one. Nice.

packages/dreamcli/deno.json (2)

13-13: Aye, this smoke-task path is cleaner now.

Pointing the package task at the shared repo-root smoke script kills the split-brain nonsense and keeps one source of truth.


31-32: Schema export and publish shape look sane now.

Routing ./schema through src/schema.ts while still publishing dreamcli.schema.json, package.json, and deno.json gives consumers the typed module without losing the raw artifact.

Also applies to: 45-53

.dprint.jsonc (2)

12-19: The formatter routing finally matches the new repo layout.

Good. The old root-docs/ assumptions are gone, and apps/docs/twoslash files are being handed to the right formatter instead of getting mauled by the wrong one.

Also applies to: 23-24, 33-34, 53-53


57-69: Good call moving package sorting into a real plugin.

That’s cleaner than the old ad hoc exec hop, and a damned sight easier to keep consistent.

.zed/settings.json (1)

22-30: These Biome code-action keys are the right cleanup.

Nice. Both JavaScript and TypeScript now use the same source.* action names instead of that crusty mixed naming.

package.json (2)

5-23: The root script and catalog surface is finally monorepo-shaped.

This stops pretending the repo is one package and pushes build/test/docs/tooling through the right workspace boundaries. Much cleaner.

Also applies to: 36-42, 49-57, 73-99


27-32: Good — ye kept the gh-project flows behind wrapper scripts.

That avoids scattering ad hoc GitHub project mutations around the root scripts like confetti.

Based on learnings, “Do not replace bun run gh-project:* with ad hoc GitHub project mutations”.

Comment on lines 21 to +24
Supported minimum runtimes:
Node.js `>= 22.22.2`,
Bun `>= 1.3`,
Deno `>= 2.6.0`.
Node.js `>=\u00a022.22.2`,
Bun `>=\u00a01.3`,
Deno `>=\u00a02.6.0`.
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
python3 <<'PY'
path = "apps/docs/guide/getting-started.md"
with open(path, "r", encoding="utf-8") as f:
    s = f.read()

literal = s.count(r"\u00a0")
nb = s.count("\u00a0")
print("File:", path)
print("literal r'\\u00a0' count:", literal)
print("U+00A0 count:", nb)
PY

Repository: kjanat/dreamcli

Length of output: 143


Arrr, those inline code spans be cursed—replace literal \u00a0 with actual non-breaking spaces.

Ye got three instances of literal backslash-u text in yer inline code (lines 21–24), not actual NBSP characters. Readers'll see \u00a0 displayed plain-like on their screens, which be a right mess for documentation. Replace 'em with real U+00A0 non-breaking space characters so the rendering don't look like escape sequences vomited into the text.

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

In `@apps/docs/guide/getting-started.md` around lines 21 - 24, Replace the literal
backslash-u sequences in the inline code spans for the runtime versions with
actual U+00A0 non-breaking space characters: change occurrences like
`>=\u00a022.22.2`, `>=\u00a01.3`, and `>=\u00a02.6.0` to use a real NBSP between
the comparison operator and the version string so the rendered text shows a
non-breaking space instead of the visible escape sequence; update the three
inline code spans in the "Supported minimum runtimes:" block accordingly.

Comment on lines +8 to 13
| Runtime | Status | Package |
| ----------------------- | --------- | ------------------------ |
| Node.js >=\u00a022.22.2 | Supported | `@kjanat/dreamcli` (npm) |
| Bun >=\u00a01.3 | Supported | `@kjanat/dreamcli` (npm) |
| Deno >=\u00a02.6.0 | Supported | `@kjanat/dreamcli` (JSR) |

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 | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
python3 <<'PY'
path = "apps/docs/guide/runtime.md"
with open(path, "r", encoding="utf-8") as f:
    s = f.read()

literal = s.count(r"\u00a0")
nb = s.count("\u00a0")
print("File:", path)
print("literal r'\\u00a0' count:", literal)
print("U+00A0 count:", nb)
PY

Repository: kjanat/dreamcli

Length of output: 135


Fix literal \u00a0 escape sequences to real NBSP characters in the runtime table.

The table contains literal \u00a0 strings (three occurrences) instead of actual Unicode non-breaking spaces (U+00A0). That'll render as visible garbage in the markdown—browsers won't parse it as a space character. Replace each >=\u00a0 with >= followed by an actual NBSP character so the table doesn't look buggered.

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

In `@apps/docs/guide/runtime.md` around lines 8 - 13, Replace the literal
backslash-u00a0 sequences in the runtime table entries with actual non‑breaking
space characters (U+00A0) so strings like "Node.js >=\\u00a022.22.2", "Bun
>=\\u00a01.3" and "Deno >=\\u00a02.6.0" become "Node.js >=" + NBSP + "22.22.2",
"Bun >=" + NBSP + "1.3", and "Deno >=" + NBSP + "2.6.0"; update the three
occurrences in the table so the markdown renders real NBSP characters instead of
the literal escape sequences.

Comment on lines +63 to 68
| Runtime | Adapter | Notes |
| ----------------------- | ------------- | ------------------------------ |
| Node.js >=\u00a022.22.2 | `NodeAdapter` | Full support |
| Bun >=\u00a01.3 | `BunAdapter` | Delegates to Node adapter |
| Deno >=\u00a02.6.0 | `DenoAdapter` | Permission-safe Deno namespace |

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
python3 <<'PY'
path = "apps/docs/reference/runtime.md"
with open(path, "r", encoding="utf-8") as f:
    s = f.read()

literal = s.count(r"\u00a0")
nb = s.count("\u00a0")
print("File:", path)
print("literal r'\\u00a0' count:", literal)
print("U+00A0 count:", nb)
PY

Repository: kjanat/dreamcli

Length of output: 139


Arrr, those \u00a0 markers be literal text, not actual NBSP characters—fix that or yer docs'll render like garbage, matey.

The file contains 3 literal backslash-u sequences (\u00a0) instead of real non-breaking space characters (U+00A0). Markdown renderers won't transmute those literal strings into proper spacing, so yer version strings (>=\u00a0022.22.2 and the like) will display as broken nonsense in the rendered output. Every single row in that runtime table be affected.

Replace each \u00a0 with an actual U+00A0 non-breaking space character so the thing renders proper-like.

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

In `@apps/docs/reference/runtime.md` around lines 63 - 68, The runtime table
contains literal backslash-u sequences ("\u00a0") instead of real non-breaking
spaces in the version strings (e.g., the entries shown as "Node.js
>=\u00a022.22.2", "Bun >=\u00a01.3", "Deno >=\u00a02.6.0"); update those table
cells to replace each literal "\u00a0" sequence with an actual U+00A0
non-breaking space character so the Markdown renders correctly (edit the table
rows where the strings appear, e.g., the Node.js, Bun, and Deno version cells).

Comment on lines +42 to +44
| Node.js >=\u00a022.22.2 runtime support | Supported | [Runtime Support](/guide/runtime), [`src/runtime/node.ts`](https://github.com/kjanat/dreamcli/blob/master/src/runtime/node.ts), [`docs/reference/runtime.md`](/reference/runtime) | This is the primary adapter implementation. |
| Bun >=\u00a01.3 runtime support | Supported | [Runtime Support](/guide/runtime), [`src/runtime/bun.ts`](https://github.com/kjanat/dreamcli/blob/master/src/runtime/bun.ts), [`docs/reference/runtime.md`](/reference/runtime) | Bun currently delegates through the Node adapter strategy. |
| Deno >=\u00a02.6.0 runtime support | Supported | [Runtime Support](/guide/runtime), [`src/runtime/deno.ts`](https://github.com/kjanat/dreamcli/blob/master/src/runtime/deno.ts), [`docs/reference/runtime.md`](/reference/runtime) | Deno support is permission-aware and published through JSR. |
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 | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
python3 <<'PY'
path = "apps/docs/reference/support-matrix.md"
with open(path, "r", encoding="utf-8") as f:
    s = f.read()

literal = s.count(r"\u00a0")
nb = s.count("\u00a0")
print("File:", path)
print("literal r'\\u00a0' count:", literal)
print("U+00A0 count:", nb)
PY

Repository: kjanat/dreamcli

Length of output: 146


Arrr! Ye didn't actually swap out the literal escape sequences—the \u00a0 characters still be there, not proper NBSPs!

The file still contains literal \u00a0 sequences instead of actual U+00A0 non-breaking space characters. Those three escape sequences at lines 42-44 be needin' proper conversion to real NBSP characters so the markdown renders the spacing true and proper-like. Right now ye be displayin' the actual text escape, not the character it represents—that be a scurvy rendering issue, matey.

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

In `@apps/docs/reference/support-matrix.md` around lines 42 - 44, Replace the
literal escape sequences "\u00a0" in the table entries (e.g., "Node.js
>=\u00a022.22.2 runtime support", "Bun >=\u00a01.3 runtime support", "Deno
>=\u00a02.6.0 runtime support") with an actual U+00A0 non‑breaking space
character so the Markdown renders spacing correctly; search for the "\u00a0"
substrings in the support-matrix table and substitute each with a real NBSP
character (keep the rest of the text unchanged).

kjanat added 2 commits April 29, 2026 05:34
Clamp starter repeat counts to finite integers so generated and
documented hello-world CLIs cannot spin forever on `Infinity`
or other invalid numeric inputs.

Clean up nearby review nits by removing a duplicate prompt test
name, dropping an unused scaffold variable, and invoking the
PowerShell completion script without redundant string coercion.
Align moved `examples/standalone` usage docs and watch paths so
generated example pages and docs data stay in sync after the move.

Refresh formatter and workspace tool versions, restore the
`@kjanat/dreamcli-docs/vitepress/*` tsconfig alias, and sync
DreamCLI's published runtime support metadata to the 2.1.0 / Bun
>=1.3 support line.
@coderabbitai coderabbitai Bot added kind: feature New capability or product enhancement kind: breaking Breaking API, runtime, or packaging change area: docs VitePress app, guides, reference pages, and docs UX area: build Build, CI, release automation, scripts, and packaging release Release planning, versioning, changelog, or publish flow area: config Config discovery, package metadata, and loaders and removed area: schema Schema builders, schema DSL, and JSON Schema export labels May 1, 2026
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: 1

Caution

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

⚠️ Outside diff range comments (3)
examples/standalone/middleware.ts (1)

2-11: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add @module to the file header JSDoc.

Ye updated the header block, but it still misses the required @module tag for TS source files. Add it at the top JSDoc block to stay compliant.

Proposed patch
 /**
+ * `@module`
  * Middleware patterns: auth guard, request timing, error handling.
  *
  * Demonstrates: typed middleware context, auth guards, short-circuiting, and

As per coding guidelines: "**/*.{ts,tsx}: Include @module JSDoc at the top of source files; mark non-public API with @internal".

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

In `@examples/standalone/middleware.ts` around lines 2 - 11, The top-of-file JSDoc
header is missing the required `@module` tag; edit the header comment block at the
very top of examples/standalone/middleware.ts and add a line like "@module" (or
"@module <name>" if you want an explicit module name) so the file includes the
required `@module` JSDoc; if any APIs in this file are non-public, also mark them
with `@internal` in their JSDoc blocks.
examples/standalone/multi-command.ts (1)

2-17: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add @module to the file header JSDoc.

Arrr, this example docblock be clean, but it still misses the required @module tag for TS source files.

Suggested patch
 /**
  * Multi-command CLI with nested command groups (git-like).
  *
  * Demonstrates: top-level commands, nested groups, version metadata, and
  * env-backed flags.
  *
  * Usage:
  *   npx tsx examples/standalone/multi-command.ts deploy production --force
  *   npx tsx examples/standalone/multi-command.ts deploy production --region eu
  *   DEPLOY_REGION=ap npx tsx examples/standalone/multi-command.ts deploy production
  *   npx tsx examples/standalone/multi-command.ts db migrate --steps 3
  *   npx tsx examples/standalone/multi-command.ts db seed
  *   npx tsx examples/standalone/multi-command.ts login --token abc123
  *   npx tsx examples/standalone/multi-command.ts --help
  *   npx tsx examples/standalone/multi-command.ts --version
+ *
+ * `@module`
  */

As per coding guidelines, **/*.{ts,tsx} must “Include @module JSDoc at the top of source files.”

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

In `@examples/standalone/multi-command.ts` around lines 2 - 17, Add the required
`@module` JSDoc tag to the top-of-file header comment in multi-command.ts: update
the existing block comment that documents the example (the file-level docblock)
to include a line like "@module" (optionally with the module name) immediately
after the opening /** so the file now contains a proper module JSDoc tag as
required by the linting rule.
examples/standalone/spinner-progress.ts (1)

22-22: ⚠️ Potential issue | 🟠 Major

Add validation to the --steps flag to prevent infinite loops and invalid input.

The --steps flag lacks any bounds checking. Without validation, a scallywag could pass --steps Infinity and send the loop at line 40 into an endless voyage, or pass negative values that cause odd behavior. The basic.ts example already demonstrates the proper pattern — clamp this to finite positive integers like so:

const stepCount = Number.isFinite(flags.steps)
	? Math.max(1, Math.min(100, Math.floor(flags.steps)))
	: 5;

Then use stepCount instead of flags.steps in the progress bar and loop.

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

In `@examples/standalone/spinner-progress.ts` at line 22, The --steps flag needs
bounds checking: validate flags.steps from the .flag('steps', ...) definition
and derive a safe integer stepCount (e.g., if Number.isFinite(flags.steps) then
Math.max(1, Math.min(100, Math.floor(flags.steps))) else 5), then replace uses
of flags.steps in the progress bar/loop (the loop that begins around the
spinner/progress code at line ~40) with stepCount so the loop iterates a finite
positive integer between 1 and 100.
🤖 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/dreamcli/src/core/resolve/resolve-prompt.test.ts`:
- Line 17: Replace the barrel import of ResolveOptions with a direct-file import
from the resolve directory: change the import that currently references
'./index.ts' to import ResolveOptions from './contracts.ts' in
resolve-prompt.test.ts so the test uses the concrete contracts file and avoids
barrel-induced circular dependencies; locate the existing import statement that
declares ResolveOptions and update its module path to './contracts.ts'.

---

Outside diff comments:
In `@examples/standalone/middleware.ts`:
- Around line 2-11: The top-of-file JSDoc header is missing the required `@module`
tag; edit the header comment block at the very top of
examples/standalone/middleware.ts and add a line like "@module" (or "@module
<name>" if you want an explicit module name) so the file includes the required
`@module` JSDoc; if any APIs in this file are non-public, also mark them with
`@internal` in their JSDoc blocks.

In `@examples/standalone/multi-command.ts`:
- Around line 2-17: Add the required `@module` JSDoc tag to the top-of-file header
comment in multi-command.ts: update the existing block comment that documents
the example (the file-level docblock) to include a line like "@module"
(optionally with the module name) immediately after the opening /** so the file
now contains a proper module JSDoc tag as required by the linting rule.

In `@examples/standalone/spinner-progress.ts`:
- Line 22: The --steps flag needs bounds checking: validate flags.steps from the
.flag('steps', ...) definition and derive a safe integer stepCount (e.g., if
Number.isFinite(flags.steps) then Math.max(1, Math.min(100,
Math.floor(flags.steps))) else 5), then replace uses of flags.steps in the
progress bar/loop (the loop that begins around the spinner/progress code at line
~40) with stepCount so the loop iterates a finite positive integer between 1 and
100.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 45146a09-e667-4209-9a4a-aeb88674b70a

📥 Commits

Reviewing files that changed from the base of the PR and between 3a7406b and 6e65de9.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • .dprint.jsonc
  • apps/docs/examples/[slug].paths.ts
  • apps/docs/examples/examples.data.ts
  • apps/docs/guide/getting-started.md
  • apps/docs/reference/api.data.ts
  • apps/docs/reference/symbols/main/[slug].paths.ts
  • examples/pwsh-demo/smoke-powershell.ps1
  • examples/standalone/basic.ts
  • examples/standalone/interactive.ts
  • examples/standalone/json-mode.ts
  • examples/standalone/middleware.ts
  • examples/standalone/multi-command.ts
  • examples/standalone/spinner-progress.ts
  • examples/standalone/testing.ts
  • package.json
  • packages/dreamcli/README.md
  • packages/dreamcli/package.json
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • packages/dreamcli/src/core/schema/prompt.test.ts
  • packages/dreamcli/src/runtime/support.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 18000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: dreamcli
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use tabs, single quotes, and semicolons; use LF line endings

Use explicit named re-exports only; do not use export *

Files:

  • examples/standalone/testing.ts
  • packages/dreamcli/src/core/schema/prompt.test.ts
  • examples/standalone/middleware.ts
  • examples/standalone/json-mode.ts
  • examples/standalone/multi-command.ts
  • examples/standalone/interactive.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • examples/standalone/spinner-progress.ts
  • apps/docs/reference/symbols/main/[slug].paths.ts
  • examples/standalone/basic.ts
  • apps/docs/examples/examples.data.ts
  • apps/docs/examples/[slug].paths.ts
  • apps/docs/reference/api.data.ts
  • packages/dreamcli/src/runtime/support.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use import type for type-only imports

Include .ts extensions in all relative imports

Enable strict TypeScript everywhere with exactOptionalPropertyTypes enabled; use conditional spreads for optional properties

Include @module JSDoc at the top of source files; mark non-public API with @internal

Files:

  • examples/standalone/testing.ts
  • packages/dreamcli/src/core/schema/prompt.test.ts
  • examples/standalone/middleware.ts
  • examples/standalone/json-mode.ts
  • examples/standalone/multi-command.ts
  • examples/standalone/interactive.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • examples/standalone/spinner-progress.ts
  • apps/docs/reference/symbols/main/[slug].paths.ts
  • examples/standalone/basic.ts
  • apps/docs/examples/examples.data.ts
  • apps/docs/examples/[slug].paths.ts
  • apps/docs/reference/api.data.ts
  • packages/dreamcli/src/runtime/support.test.ts
examples/standalone/*.ts

📄 CodeRabbit inference engine (examples/AGENTS.md)

Top-level example docblocks must follow a contract: title line, optional prose, Demonstrates:, and Usage: sections

Keep single-file examples pedagogical and runnable; focus on public-API only and avoid bloating with walkthrough-only complexity

Files:

  • examples/standalone/testing.ts
  • examples/standalone/middleware.ts
  • examples/standalone/json-mode.ts
  • examples/standalone/multi-command.ts
  • examples/standalone/interactive.ts
  • examples/standalone/spinner-progress.ts
  • examples/standalone/basic.ts
examples/**/*.ts

📄 CodeRabbit inference engine (examples/AGENTS.md)

Examples should import public package exports only, never import from #internals/*

Files:

  • examples/standalone/testing.ts
  • examples/standalone/middleware.ts
  • examples/standalone/json-mode.ts
  • examples/standalone/multi-command.ts
  • examples/standalone/interactive.ts
  • examples/standalone/spinner-progress.ts
  • examples/standalone/basic.ts
packages/dreamcli/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Keep public API factory-first: cli(), command(), flag.*(), createOutput(), createAdapter()

Files:

  • packages/dreamcli/src/core/schema/prompt.test.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • packages/dreamcli/src/runtime/support.test.ts
**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

Co-locate tests as *.test.ts files; use describe() + it(), em dashes in suite titles, // === and // --- section markers

Do not use lifecycle hooks, snapshots, or module mocks in tests

Files:

  • packages/dreamcli/src/core/schema/prompt.test.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • packages/dreamcli/src/runtime/support.test.ts
packages/dreamcli/src/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

Include trailing \n in output assertions

Files:

  • packages/dreamcli/src/core/schema/prompt.test.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • packages/dreamcli/src/runtime/support.test.ts
packages/dreamcli/src/core/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Keep core library runtime-agnostic; route all host I/O through RuntimeAdapter, WriteFn, or ReadFn

Do not use process.* or runtime-specific APIs in packages/dreamcli/src/core/

Files:

  • packages/dreamcli/src/core/schema/prompt.test.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
packages/dreamcli/src/core/schema/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/dreamcli/src/core/schema/AGENTS.md)

Use F accumulator pattern: {} & Record<name, InferFlag<...>> grows per .flag() call for flag type accumulation

Use A accumulator pattern: same as F accumulator for .arg() calls

Use C accumulator pattern: Record<string, never> replaced entirely on first .middleware(), then intersection-grown via WidenContext<C, Output>

Use phantom brand pattern: Middleware<Output> carries type info at compile time and is erased at runtime; same approach applies to _value on FlagBuilder/ArgBuilder

Files:

  • packages/dreamcli/src/core/schema/prompt.test.ts
packages/dreamcli/src/core/{cli,completion,output,prompt,resolve,runtime}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use direct-file imports instead of barrel imports in cli/, completion/, output/, prompt/, resolve/, and runtime/ to avoid circular dependencies

Files:

  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
apps/docs/examples/*.ts

📄 CodeRabbit inference engine (apps/docs/AGENTS.md)

Example docblocks must follow the contract: title line, optional prose, Demonstrates: section, and Usage: section

Edit example docs pages through ../examples/*.ts source files and .vitepress/data/examples.ts rather than patching generated routes in docs/examples/[slug].paths.ts

Files:

  • apps/docs/examples/examples.data.ts
  • apps/docs/examples/[slug].paths.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:21.036Z
Learning: Do not add runtime dependencies to `packages/dreamcli`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:21.036Z
Learning: Treat `apps/docs/.vitepress/data/` as shared between docs and scripts; scripts import it for generated source and docs artifacts
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:21.036Z
Learning: Use `bun run gh-project:*` commands instead of ad hoc GitHub project mutations for project workflow automation
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:33.130Z
Learning: Do not patch generated example and reference pages when the real source lives in repo-root `examples/` or `.vitepress/data/`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:33.130Z
Learning: Do not assume docs code is isolated from source generation; code like `scripts/build-meta-descriptions.ts` may import docs files
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:33.130Z
Learning: Refer to `.vitepress/AGENTS.md` for plugin, theme, and data-pipeline gotchas and implementation details
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:41.773Z
Learning: Complex walkthrough-specific functionality should reside in `examples/gh/` rather than in single-file standalone examples
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:41.773Z
Learning: Do not edit generated docs pages when the source of truth is an example file; instead edit the example source directly
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:41.773Z
Learning: Do not let examples drift into pseudo-internal usage patterns that real consumers cannot copy
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:41.773Z
Learning: `examples/gh/` is typechecked and tested separately in CI; edits there carry real consumer signal and must be tested
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:41.773Z
Learning: `examples/pwsh-demo/` must maintain end-to-end PowerShell completion coverage and native PowerShell completion execution testing
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:41.773Z
Learning: Do not change PowerShell install behavior without updating the `pwsh-demo` smoke coverage and corresponding docs
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:04:41.773Z
Learning: Do not treat `.cache/` directory as a source of truth for examples or documentation
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:08.338Z
Learning: Config loading is adapter-driven and side-effect free from the module's perspective, covering both user config discovery and `packageJson()` metadata inference
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:08.338Z
Learning: All I/O flows through a narrow `RuntimeAdapter` surface to keep it testable with virtual filesystems
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:08.338Z
Learning: Config roots must be plain objects even if a loader can parse other JSON or YAML values
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:08.338Z
Learning: JSON must always be built in and ordered first in search-path and loader resolution
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:17.180Z
Learning: Help text must be generated from schema metadata; keep formatting rules derived, not duplicated per caller
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:17.180Z
Learning: Do not pull TTY or color logic into help formatting; that belongs in output module
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:17.180Z
Learning: Do not special-case caller behavior when schema metadata already expresses it
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:17.180Z
Learning: Do not simplify wrapping or padding without checking narrow alignment regressions in tests
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:24.571Z
Learning: Do not forget the package-level schema artifact; build must emit root `dreamcli.schema.json` from this surface
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:33.339Z
Learning: OutputChannel modes (normal, JSON, quiet, non-TTY, capture) must correctly dispatch log/json output and spinner/progress visibility
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:33.339Z
Learning: Maintain strict dependency graph with no cycles: writer.ts → contracts.ts → activity.ts → index.ts, with renderers.ts and display-value.ts consumed only by index.ts
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:46.179Z
Learning: Perform choice merging before the engine sees config; engines should not infer enum choices themselves
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:46.179Z
Learning: Do not move non-TTY gating into the prompt engine; CLI and resolve layer decide when prompts are allowed
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:05:59.852Z
Learning: Implement two-pass architecture: Pass 1 collects CLI -> env -> config values; Pass 2 resolves remaining flags with prompt -> default -> validation after optional interactive resolver invocation
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:06:05.550Z
Learning: Maintain parallel compile-time and runtime string parsing paths in schema-dsl module — compile-time uses template literal types in parse.ts for type inference, runtime uses string-to-builder construction in runtime.ts, and both must produce equivalent results
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:06:05.550Z
Learning: Import CommandBuilder, FlagBuilder, and ArgBuilder from schema/ module in schema-dsl — dependency direction is unidirectional (schema-dsl depends on schema, not vice versa) to prevent circular dependencies
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:06:21.293Z
Learning: When adding a new flag type: (1) Add variant to `FlagKind` union in `flag.ts`, (2) Add factory method on `FlagBuilder`, (3) Update `InferFlag` conditional type, (4) Wire through `resolve/coerce.ts` with a coercion case in unified `coerceValue()`, (5) Add tests in `flag.test.ts` + `resolve.test.ts`
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:06:27.966Z
Learning: `runCommand()` must capture output, forward injected execution options from `RunOptions`, and return a `RunResult` object with exitCode, stdout, stderr, activity, and optional error fields
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:06:48.515Z
Learning: `ExitError` is thrown by `adapter.exit()` and should be caught by CLI dispatch layer
Learnt from: CR
Repo: kjanat/dreamcli

Timestamp: 2026-05-01T11:06:48.515Z
Learning: Runtime module is not truly independent of core — imports `WriteFn` from `core/output/` and `ReadFn` from `core/prompt/`
📚 Learning: 2026-02-11T11:57:27.623Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 3
File: src/core/cli/cli-completion-e2e.test.ts:9-16
Timestamp: 2026-02-11T11:57:27.623Z
Learning: Enforce explicit .ts extensions in all relative imports for TypeScript source files (enabled by allowImportingTsExtensions and noEmit in tsconfig.json). This applies to both static and dynamic imports. For each TypeScript file, update relative import paths to end with .ts (e.g., './utils/helper' -> './utils/helper.ts'). Ensure tooling (linting/eslint rules or a codemod) flags missing extensions and provides a quick fix. This guideline should cover all TypeScript files in the repo, not just a single test or module.

Applied to files:

  • examples/standalone/testing.ts
  • packages/dreamcli/src/core/schema/prompt.test.ts
  • examples/standalone/middleware.ts
  • examples/standalone/json-mode.ts
  • examples/standalone/multi-command.ts
  • examples/standalone/interactive.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • examples/standalone/spinner-progress.ts
  • apps/docs/reference/symbols/main/[slug].paths.ts
  • examples/standalone/basic.ts
  • apps/docs/examples/examples.data.ts
  • apps/docs/examples/[slug].paths.ts
  • apps/docs/reference/api.data.ts
  • packages/dreamcli/src/runtime/support.test.ts
📚 Learning: 2026-04-06T18:24:44.371Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: docs/reference/api.md:8-8
Timestamp: 2026-04-06T18:24:44.371Z
Learning: In the kjanat/dreamcli repo, the explicit type annotation `Readonly<Record<string, string>>` applied to `const` object literals is an intentional documentation/intent pattern. Do not flag it as redundant or unnecessary (e.g., for being inferable) when reviewing TypeScript/TSX files; treat this explicitness as acceptable by design.

Applied to files:

  • examples/standalone/testing.ts
  • packages/dreamcli/src/core/schema/prompt.test.ts
  • examples/standalone/middleware.ts
  • examples/standalone/json-mode.ts
  • examples/standalone/multi-command.ts
  • examples/standalone/interactive.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • examples/standalone/spinner-progress.ts
  • apps/docs/reference/symbols/main/[slug].paths.ts
  • examples/standalone/basic.ts
  • apps/docs/examples/examples.data.ts
  • apps/docs/examples/[slug].paths.ts
  • apps/docs/reference/api.data.ts
  • packages/dreamcli/src/runtime/support.test.ts
📚 Learning: 2026-04-06T18:40:01.263Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: docs/.vitepress/vite-plugins/source-artifacts.ts:62-83
Timestamp: 2026-04-06T18:40:01.263Z
Learning: For this repository, Windows is explicitly not a supported/targeted platform. During code review, do not raise issues about Windows-specific path separators or normalization differences (e.g., use of `path.sep`, handling forward-slash vs backslash, or `normalize()`-related concerns). These checks should be treated as out-of-scope because the project is intended for Linux/macOS only.

Applied to files:

  • examples/standalone/testing.ts
  • packages/dreamcli/src/core/schema/prompt.test.ts
  • examples/standalone/middleware.ts
  • examples/standalone/json-mode.ts
  • examples/standalone/multi-command.ts
  • examples/standalone/interactive.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • examples/standalone/spinner-progress.ts
  • apps/docs/reference/symbols/main/[slug].paths.ts
  • examples/standalone/basic.ts
  • apps/docs/examples/examples.data.ts
  • apps/docs/examples/[slug].paths.ts
  • apps/docs/reference/api.data.ts
  • packages/dreamcli/src/runtime/support.test.ts
📚 Learning: 2026-02-12T15:52:24.166Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 4
File: src/core/resolve/resolve-arg-env.test.ts:1-7
Timestamp: 2026-02-12T15:52:24.166Z
Learning: In test files, do not require the module JSDoc tag at the top. This rule applies to all test files, while non-test source files should still require the module tag. Use the pattern **/*.test.{ts,tsx} to cover all test TypeScript test files (adjust if your project uses only .ts tests).

Applied to files:

  • packages/dreamcli/src/core/schema/prompt.test.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • packages/dreamcli/src/runtime/support.test.ts
📚 Learning: 2026-04-06T11:26:04.030Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: examples/middleware.ts:2-11
Timestamp: 2026-04-06T11:26:04.030Z
Learning: In the kjanat/dreamcli repository, require the `module` JSDoc tag only for library source files under `src/` (e.g., `src/**/*.ts`). Files outside `src/` such as runnable demo/example scripts under `examples/` are not considered source code for this rule and should not be required to include `module`.

Applied to files:

  • packages/dreamcli/src/core/schema/prompt.test.ts
  • packages/dreamcli/src/core/resolve/resolve-prompt.test.ts
  • packages/dreamcli/src/runtime/support.test.ts
📚 Learning: 2026-02-10T16:25:08.867Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 1
File: AGENTS.md:12-12
Timestamp: 2026-02-10T16:25:08.867Z
Learning: In repository kjanat/dreamcli, prefer using the filename syntax (e.g., GOALS.md) when referencing files in Markdown documentation, and treat references that do not follow this style as non-issues. This pattern applies to all Markdown files across the project.

Applied to files:

  • apps/docs/guide/getting-started.md
  • packages/dreamcli/README.md
📚 Learning: 2026-04-07T08:45:53.051Z
Learnt from: kjanat
Repo: kjanat/dreamcli PR: 9
File: package.json:121-129
Timestamp: 2026-04-07T08:45:53.051Z
Learning: When reviewing package.json `devEngines`, do not treat EBADDEVENGINES warnings as a breaking issue if the block intentionally uses Bun (e.g., `{ "name": "bun" }`) and the corresponding `onFail` values are soft (`onFail: "warn"` or `onFail: "ignore"`). npm may consider `bun` an invalid/unsupported engine name and warn, but with these `onFail` settings it won’t hard-fail—so the intent should be respected unless `onFail` is set to `fail` or similar hard-failure behavior.

Applied to files:

  • packages/dreamcli/package.json
  • package.json
🪛 ast-grep (0.42.1)
packages/dreamcli/src/runtime/support.test.ts

[warning] 23-25: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(
${escapeRegExp(displayName)}[\\s\\S]*?>=(?:\\\\u00a0|\\s)*${escapeRegExp(minimum)},
)
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🪛 LanguageTool
packages/dreamcli/README.md

[grammar] ~175-~175: Ensure spelling is correct
Context: ... --steps 3 // mycli db seed ``` ## Why dreamcli Most TypeScript CLI frameworks treat the...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 PSScriptAnalyzer (1.25.0)
examples/pwsh-demo/smoke-powershell.ps1

[warning] 44-44: Invoke-Expression is used. Please remove Invoke-Expression from script and find other options instead.

(PSAvoidUsingInvokeExpression)

🔇 Additional comments (32)
examples/standalone/interactive.ts (1)

16-19: Docs path update is correct and consistent with the workspace move.
No concerns here; these usage lines now correctly point to examples/standalone/interactive.ts.

packages/dreamcli/src/core/schema/prompt.test.ts (1)

536-536: Ahoy — clearer test intent, nicely done.

Marking this as “at runtime” makes the scope explicit and matches what the test actually exercises. Solid cleanup, matey.

examples/pwsh-demo/smoke-powershell.ps1 (1)

44-44: Aye, this be the right fix for native completion script execution.

Switching to direct Invoke-Expression $nativeCompletionScript preserves the generated script content as-is and matches the completion generator’s newline/quoting expectations. Good smoke-test hardening.

examples/standalone/json-mode.ts (1)

9-14: Aye, this path correction be clean and correct.

The usage commands now correctly target examples/standalone/json-mode.ts, and the example docblock contract remains intact. Good fix.

As per coding guidelines: "examples/standalone/*.ts: Top-level example docblocks must follow a contract: title line, optional prose, Demonstrates:, and Usage: sections."

.dprint.jsonc (4)

12-19: Biome associations are correctly remapped to the new docs location.

Aye, this is tidy: Line 14 and Line 15 exclude the moved docs/twoslash paths exactly where they should.


23-23: Markdown/markup exclusions stay in lockstep.

Good rigging here—same docs/twoslash exclusions on Line 23 and Line 33 keeps behavior predictable.

Also applies to: 33-33


53-53: Prettier association scope looks right for the workspace layout.

Line 53 is a solid catch-all for READMEs plus docs/twoslash markdown/TS formatting.


58-59: Formatter plugin upgrades and sortpackagejson plugin adoption look clean.

No leaks in the hull here—this plugin set is coherent with the config changes.

Also applies to: 63-63, 66-66, 68-68

examples/standalone/basic.ts (2)

27-31: Aye, this repeat guard is solid.

Finite-check + floor + clamp keeps the example safe from NaN/Infinity/huge-loop nonsense and still easy to teach from.


8-11: Good path fix in the usage header.

The usage examples now point to examples/standalone/basic.ts, which matches the workspace move.

packages/dreamcli/src/runtime/support.test.ts (2)

14-28: Good extraction: the matcher helper is cleaner and safer.

Escaping runtime fragments before RegExp construction and centralizing the assertion reduced duplication without weakening test intent.


60-63: Nice monorepo path realignment.

These reads now correctly target apps/docs/..., and the shared matcher keeps all three docs checks consistent.

Also applies to: 70-75, 81-87

apps/docs/guide/getting-started.md (2)

46-50: Good sync with the example logic.

The docs snippet now uses the same repeatCount sanitization path as the standalone example, so readers copy behavior that’s actually safe.


22-24: Runtime minimum block update looks aligned.

This keeps the getting-started runtime section in step with the runtime-support docs/tests.

examples/standalone/testing.ts (1)

9-12: Aye, perfectly squared away, matey!

Ye've updated the path references in the docblock to match the new examples/standalone/ location after yer monorepo restructure. The usage instructions be accurate and runnable now, keepin' the example shipshape for landlubbers tryin' to learn the testkit.

Fair winds! 🏴‍☠️

examples/standalone/multi-command.ts (1)

9-16: Nice path correction for the standalone move.

Aye, these usage examples now point to examples/standalone/... consistently and match the monorepo layout.

apps/docs/examples/[slug].paths.ts (1)

10-17: Shared data imports and watcher scope look shipshape.

Arrr, this aligns the loader with the packaged docs data utilities and the standalone examples watch target.

apps/docs/examples/examples.data.ts (1)

10-14: Good alignment with shared docs pipeline.

Aye, the type/value imports are clean, and the watcher now tracks the moved standalone examples path.

Also applies to: 28-28

apps/docs/reference/symbols/main/[slug].paths.ts (1)

13-16: Watcher targets are corrected for the new workspace map.

Arrr, this now watches the right source roots for symbol-page regeneration.

apps/docs/reference/api.data.ts (1)

10-12: Solid import migration and watch-path update.

Aye, this keeps API data loading in step with the shared docs package and new monorepo paths.

Also applies to: 34-34

packages/dreamcli/package.json (4)

95-97: This vite in optionalDependencies issue be already flagged, ye stubborn barnacles!

Arrr, I see the previous review already called out that vite in optionalDependencies leaks tooling into the published runtime surface. Library consumers don't need to be downloadin' build tools when they npm install @kjanat/dreamcli``. The vite dependency already lives in `apps/docs/package.json` where it belongs.

As per the learnings: "Do not add runtime dependencies to packages/dreamcli".


1-35: Aye, this be a proper package manifest structure!

The internal import aliases be well-organized fer development convenience (#dreamcli, #internals/*, #schema, #package.json), and they align with what the emit-definition-schema.ts script be expectin'. The schema emission script imports from #dreamcli and #package.json, and these aliases resolve correctly to the source files.

The metadata be complete and the repository directory path be accurate fer the monorepo structure.


36-69: The exports map be shipshape, ye perfectionist sea dog!

Proper condition ordering with types first, then bun/deno pointin' to source fer native runtime consumption, and default fallin' back to the built .mjs artifacts. The files whitelist correctly excludes test files and AGENTS.md from the published tarball while includin' the source fer Bun/Deno users.

This be exactly how a multi-runtime package should be rigged!


70-80: Scripts be properly rigged fer the build pipeline.

The use of bunx --bun tsdown ensures Bun's native performance, and havin' both tsgo (native TypeScript preview) and tsc fer typecheckin' gives ye flexibility. The prepack hook ensures the build runs before publishin'.

packages/dreamcli/README.md (6)

485-493: This "Three subpath exports" discrepancy be already flagged, ye forgetful swabs!

Arrr, the previous review already pointed out that this section claims "Three subpath exports" but the package.json actually exports five entry points:

  1. @kjanat/dreamcli (root)
  2. @kjanat/dreamcli/runtime
  3. @kjanat/dreamcli/testkit
  4. @kjanat/dreamcli/schemaMISSING FROM TABLE
  5. @kjanat/dreamcli/package.json — (this one can be omitted from docs)

Fix the headin' to say "Four public entry points" and add a row fer the schema artifact!


1-70: Arrr, this be some fine documentation, ye literary pirates!

The opening example demonstrates the full resolution chain beautifully — from flag declaration through to typed action handler. The badges be properly linked, and the install instructions cover npm, bun, and deno. The collapsible details block fer alternative runtimes be a nice touch fer keepin' things tidy.

The claim "Zero runtime dependencies" better be true, which it will be once ye remove that vite from optionalDependencies in the package.json!


71-174: These quick start examples be worthy of a captain's approval!

The single command example shows the defensive repeat count clamping (lines 93-95) — good work preventin' infinite loops and invalid input, ye paranoid perfectionist. The multi-command example demonstrates nested command groups with the db group containin' migrate and seed. The usage comments at the end be helpful fer landlubbers.

Me autistic brain be pleased with the thoroughness here.


175-200: The comparison table be a fine piece of persuasion, matey!

The static analysis tool flagged "dreamcli" as a spellin' error at line 175, but that be yer product name, so ignore that landlubber tool's complaint. The comparison table honestly shows where dreamcli excels versus the competition without bein' dishonest about what the others offer.

The tRPC comparison be apt — "the insight was wiring them so types flow end-to-end." That be the treasure here.


388-484: The testing documentation be a thing of beauty!

This section demonstrates runCommand() with every control dimension: basic execution, env resolution, config resolution, prompt answers, and activity event capture. The examples be complete and actually runnable. Me perfectionist heart be singin'!

The RunOptions summary at lines 482-483 lists all the controllable dimensions clearly. This be what good testkit documentation looks like.


497-508: Runtime support matrix be accurate and matches the package engines.

Documented package.json engines
Node.js >= 22.22.2 "node": ">=22.22.2"
Bun >= 1.3 "bun": ">=1.3"
Deno >= 2.6.0 "deno": ">=2.6.0"

The explanation about the RuntimeAdapter interface handlin' platform-specific edges be important fer consumers who want to understand how the multi-runtime support works. Good work keepin' the docs in sync with the manifest, ye meticulous pirates!

package.json (1)

1-100: Arrr, this be a fine monorepo conversion, matey!

The workspace structure be properly rigged for Bun workspaces. The --filter incantations in yer scripts be idiomatic, the catalog centralizes yer dependency versions like a proper treasure chest, and the devEngines block respects the Bun runtime without hard-failin'. The parallel dev script on line 19 with & and wait be a clever bit of shell work for runnin' the build watcher alongside the docs server.

Smooth sailin' here, ye scurvy dogs did good work!

examples/standalone/spinner-progress.ts (1)

9-11: Aye, the paths be chartin' true now, matey!

Ye've updated the usage examples to reflect the new examples/standalone/ location. Clean as a freshly swabbed deck!

import { createSchema } from '#internals/core/schema/index.ts';
import type { ResolveOptions } from './index.ts';
import { COMPATIBLE_PROMPT_KINDS } from './flags.ts';
import type { ResolveOptions } from './index.ts';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Avast! Barrel import in the resolve/ hold violates the coding guidelines, matey!

Ye be importin' ResolveOptions from the barrel (./index.ts), but the guidelines be mighty clear: use direct-file imports in the resolve/ directory to dodge circular dependency krakens.

As per coding guidelines: "Use direct-file imports instead of barrel imports in cli/, completion/, output/, prompt/, resolve/, and runtime/ to avoid circular dependencies"

⚓ Proposed fix — import directly from contracts.ts
-import type { ResolveOptions } from './index.ts';
+import type { ResolveOptions } from './contracts.ts';
📝 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
import type { ResolveOptions } from './index.ts';
import type { ResolveOptions } from './contracts.ts';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/dreamcli/src/core/resolve/resolve-prompt.test.ts` at line 17,
Replace the barrel import of ResolveOptions with a direct-file import from the
resolve directory: change the import that currently references './index.ts' to
import ResolveOptions from './contracts.ts' in resolve-prompt.test.ts so the
test uses the concrete contracts file and avoids barrel-induced circular
dependencies; locate the existing import statement that declares ResolveOptions
and update its module path to './contracts.ts'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, release automation, scripts, and packaging area: config Config discovery, package metadata, and loaders area: docs VitePress app, guides, reference pages, and docs UX area: examples Runnable examples and walkthrough package kind: breaking Breaking API, runtime, or packaging change kind: feature New capability or product enhancement release Release planning, versioning, changelog, or publish flow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant