Skip to content

feat(a2ui): add a2ui cli prompt generation#2691

Merged
Sherry-hue merged 1 commit into
lynx-family:mainfrom
Sherry-hue:feat/a2ui-cli-prompt
May 22, 2026
Merged

feat(a2ui): add a2ui cli prompt generation#2691
Sherry-hue merged 1 commit into
lynx-family:mainfrom
Sherry-hue:feat/a2ui-cli-prompt

Conversation

@Sherry-hue
Copy link
Copy Markdown
Collaborator

@Sherry-hue Sherry-hue commented May 22, 2026

Summary by CodeRabbit

  • New Features

    • New CLI tool (a2ui-cli) with generate catalog and generate prompt commands and a published executable.
    • Prompts can be built from an embedded basic catalog or from a generated catalog directory.
    • Catalogs may include listed functions (name, return type, parameters, description).
  • Documentation

    • Expanded English/Chinese docs clarifying extractor behavior (does not call an LLM), install as a dev dependency, CLI usage, and local test instructions.

Review Change Stack

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

🦋 Changeset detected

Latest commit: 843f798

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a public a2ui-cli that delegates catalog extraction and prompt generation, introduces @lynx-js/a2ui-prompt to read on-disk catalogs and function specs, extends the A2UI catalog model with functions and rendering, and exposes the catalog-extractor CLI via package exports.

Changes

A2UI CLI and Catalog Functions

Layer / File(s) Summary
Catalog model extension with function specs
packages/genui/server/agent/a2ui-catalog.ts, packages/genui/server/agent/a2ui-prompt.ts
A2UICatalog gains an optional functions array and a new A2UIFunctionSpec interface. createA2UICatalogFromManifests() constructs catalogs from manifests and functions. renderCatalogReference() renders an "Available functions" section. A2UI_SYSTEM_PROMPT gets an explicit string type annotation.
a2ui-prompt library package setup and catalog reading
packages/genui/a2ui-prompt/package.json, packages/genui/a2ui-prompt/rslib.config.ts, packages/genui/a2ui-prompt/tsconfig.json, packages/genui/a2ui-prompt/tsconfig.build.json, packages/genui/a2ui-prompt/turbo.json, packages/genui/a2ui-prompt/src/index.ts, packages/genui/a2ui-prompt/README.md, packages/genui/a2ui-prompt/AGENTS.md
New @lynx-js/a2ui-prompt provides readA2UICatalogFromDirectory() to scan directories for component catalog.json and optional functions/*.json, validates shapes, normalizes function specs, and builds an A2UICatalog. Package re-exports server agent utilities and includes build/tooling config and docs.
a2ui-cli command-line package implementation
packages/genui/a2ui-cli/package.json, packages/genui/a2ui-cli/bin/cli.js, packages/genui/a2ui-cli/README.md, packages/genui/a2ui-cli/AGENTS.md
New @lynx-js/a2ui-cli provides a2ui-cli executable with generate catalog (delegated to @lynx-js/a2ui-catalog-extractor) and generate prompt (built with @lynx-js/a2ui-prompt). The prompt command parses options, loads custom or built-in catalogs, builds system prompts, and writes to stdout or files. Documentation records packaging and local testing guidance.
a2ui-catalog-extractor visibility and CLI export
packages/genui/a2ui-catalog-extractor/package.json, packages/genui/a2ui-catalog-extractor/src/cli.ts, packages/genui/a2ui-catalog-extractor/README.md, packages/genui/a2ui-catalog-extractor/readme.zh_cn.md
Package is no longer private and exposes a ./cli subpath export. CLI parsing ignores a catalog-extractor argv token. READMEs clarify the extractor does not call an LLM, instruct installing it as a dev dependency, and document both the standalone binary and the a2ui-cli generate catalog entrypoint.
a2ui package integration with new CLI
packages/genui/a2ui/package.json, packages/genui/a2ui/tsconfig.build.json, packages/genui/tsconfig.json, biome.jsonc, .changeset/*
build:catalog now runs a2ui-cli generate catalog; devDependency updated to @lynx-js/a2ui-cli. TypeScript build metadata file and workspace tsconfig reference for a2ui-prompt added. Biome ignores generated repl files. A changeset notes no release required.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • lynx-family/lynx-stack#2620: Both PRs touch the server-side A2UI catalog/prompt code—especially packages/genui/server/agent/a2ui-catalog.ts—so this change closely relates to that work.
  • lynx-family/lynx-stack#2527: Related to prior updates to the @lynx-js/a2ui-catalog-extractor package and its CLI surface that this PR builds on.

Suggested reviewers

  • HuJean
  • gaoachao
  • fzx2666-fz
  • PupilTong

Poem

🐰 I hop through code with tiny paws,
new CLI paths and catalog laws,
functions listed, prompts compose,
small packages bloom like spring rose,
carrots clapped for tidy draws.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: adding a new CLI prompt generation feature to the a2ui tooling. It is concise, specific, and clearly conveys the primary purpose of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@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

🧹 Nitpick comments (1)
packages/genui/a2ui-cli/bin/cli.js (1)

121-124: 💤 Low value

Consider simplifying the conditional object spreads.

The double ternary with conditional spreads is harder to read than necessary. Since buildA2UISystemPrompt likely accepts undefined values or has defaults, consider simplifying:

♻️ Simplified approach
  const systemPrompt = buildA2UISystemPrompt({
-   ...(catalog ? { catalog } : {}),
-   ...(options.appendix ? { appendix: options.appendix } : {}),
+   catalog,
+   appendix: options.appendix,
  });

If the function doesn't accept undefined, the current approach is fine.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/genui/a2ui-cli/bin/cli.js` around lines 121 - 124, The object
construction for systemPrompt is overly verbose; simplify the call to
buildA2UISystemPrompt by passing catalog and appendix directly (use catalog and
appendix: options.appendix) instead of conditional spreads, i.e., remove the
...(catalog ? { catalog } : {}) and ...(options.appendix ? { appendix:
options.appendix } : {}) patterns and pass those properties directly to
buildA2UISystemPrompt (unless buildA2UISystemPrompt explicitly rejects
undefined—if so, keep the guards).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/genui/a2ui-cli/bin/cli.js`:
- Around line 112-120: When options.catalogDir is used, validate the result of
readA2UICatalogFromDirectory to ensure the returned catalog contains components
or functions and fail with a clear error if it's empty; specifically after
calling readA2UICatalogFromDirectory (the value assigned to catalog) check
properties like catalog.components and catalog.functions (or equivalent arrays)
for length > 0 and, if both are empty or missing, log an explicit error and
terminate (throw or process.exit with a message) instead of proceeding to use
BASIC_CATALOG or generating a prompt with an empty catalog.

In `@packages/genui/a2ui-prompt/src/index.ts`:
- Around line 47-50: The code is blindly casting readJsonObject(catalogJsonPath)
to Record<string, JsonSchema> and may silently drop extra components; change the
logic around componentManifests and readJsonObject to validate the parsed JSON
is an object with exactly one top-level key: call
readJsonObject(catalogJsonPath), assert it is a non-null object, compute
Object.keys(...) and if keys.length !== 1 throw or return a clear error
mentioning catalogJsonPath, otherwise extract that single entry (or keep the
single-entry object) and push the validated JsonSchema into componentManifests;
reference functions/vars: readJsonObject, catalogJsonPath, componentManifests.

---

Nitpick comments:
In `@packages/genui/a2ui-cli/bin/cli.js`:
- Around line 121-124: The object construction for systemPrompt is overly
verbose; simplify the call to buildA2UISystemPrompt by passing catalog and
appendix directly (use catalog and appendix: options.appendix) instead of
conditional spreads, i.e., remove the ...(catalog ? { catalog } : {}) and
...(options.appendix ? { appendix: options.appendix } : {}) patterns and pass
those properties directly to buildA2UISystemPrompt (unless buildA2UISystemPrompt
explicitly rejects undefined—if so, keep the guards).
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 20e6d028-ff1c-4cd9-89b8-a22601c2c366

📥 Commits

Reviewing files that changed from the base of the PR and between 2d64575 and 36cb75d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • packages/genui/a2ui-catalog-extractor/README.md
  • packages/genui/a2ui-catalog-extractor/package.json
  • packages/genui/a2ui-catalog-extractor/readme.zh_cn.md
  • packages/genui/a2ui-catalog-extractor/src/cli.ts
  • packages/genui/a2ui-cli/AGENTS.md
  • packages/genui/a2ui-cli/README.md
  • packages/genui/a2ui-cli/bin/cli.js
  • packages/genui/a2ui-cli/package.json
  • packages/genui/a2ui-prompt/AGENTS.md
  • packages/genui/a2ui-prompt/README.md
  • packages/genui/a2ui-prompt/package.json
  • packages/genui/a2ui-prompt/rslib.config.ts
  • packages/genui/a2ui-prompt/src/index.ts
  • packages/genui/a2ui-prompt/tsconfig.build.json
  • packages/genui/a2ui-prompt/tsconfig.json
  • packages/genui/a2ui-prompt/turbo.json
  • packages/genui/a2ui/package.json
  • packages/genui/a2ui/tsconfig.build.json
  • packages/genui/server/agent/a2ui-catalog.ts
  • packages/genui/server/agent/a2ui-prompt.ts
  • packages/genui/tsconfig.json

Comment thread packages/genui/a2ui-cli/bin/cli.js
Comment thread packages/genui/a2ui-prompt/src/index.ts Outdated
@Sherry-hue Sherry-hue force-pushed the feat/a2ui-cli-prompt branch from 36cb75d to 613de8f Compare May 22, 2026 07:06
PupilTong
PupilTong previously approved these changes May 22, 2026
Copy link
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (1)
packages/genui/a2ui-prompt/src/index.ts (1)

77-80: 💤 Low value

Consider logging or throwing for malformed function definitions.

The code silently skips function values that aren't records, which could hide malformed function definition files. Consider at least logging a warning or throwing an error with the file path to help developers debug invalid function schemas.

📋 Optional enhancement
     for (const [name, value] of Object.entries(functionRecord)) {
       if (!isRecord(value)) {
+        console.warn(
+          `[a2ui-prompt] Skipping non-object function entry "${name}" in ${entry.name}`,
+        );
         continue;
       }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/genui/a2ui-prompt/src/index.ts` around lines 77 - 80, The loop over
Object.entries(functionRecord) currently skips non-record values silently;
update the block in index.ts (the loop using functionRecord and the isRecord
check) to surface malformed function definitions by logging a warning (including
the name/key and file path or source identifier) or throwing a descriptive
error; ensure the message references the offending key (name) and the
loader/context so developers can locate the invalid schema, and keep the
existing continue/skip behavior behind a flag or only use logging if you don't
want to break runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/genui/a2ui-prompt/src/index.ts`:
- Around line 77-80: The loop over Object.entries(functionRecord) currently
skips non-record values silently; update the block in index.ts (the loop using
functionRecord and the isRecord check) to surface malformed function definitions
by logging a warning (including the name/key and file path or source identifier)
or throwing a descriptive error; ensure the message references the offending key
(name) and the loader/context so developers can locate the invalid schema, and
keep the existing continue/skip behavior behind a flag or only use logging if
you don't want to break runtime.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3200786f-e5b3-43a7-97be-993065b2aef0

📥 Commits

Reviewing files that changed from the base of the PR and between 36cb75d and 613de8f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • packages/genui/a2ui-catalog-extractor/README.md
  • packages/genui/a2ui-catalog-extractor/package.json
  • packages/genui/a2ui-catalog-extractor/readme.zh_cn.md
  • packages/genui/a2ui-catalog-extractor/src/cli.ts
  • packages/genui/a2ui-cli/AGENTS.md
  • packages/genui/a2ui-cli/README.md
  • packages/genui/a2ui-cli/bin/cli.js
  • packages/genui/a2ui-cli/package.json
  • packages/genui/a2ui-prompt/AGENTS.md
  • packages/genui/a2ui-prompt/README.md
  • packages/genui/a2ui-prompt/package.json
  • packages/genui/a2ui-prompt/rslib.config.ts
  • packages/genui/a2ui-prompt/src/index.ts
  • packages/genui/a2ui-prompt/tsconfig.build.json
  • packages/genui/a2ui-prompt/tsconfig.json
  • packages/genui/a2ui-prompt/turbo.json
  • packages/genui/a2ui/package.json
  • packages/genui/a2ui/tsconfig.build.json
  • packages/genui/server/agent/a2ui-catalog.ts
  • packages/genui/server/agent/a2ui-prompt.ts
  • packages/genui/tsconfig.json
✅ Files skipped from review due to trivial changes (4)
  • packages/genui/a2ui-prompt/tsconfig.json
  • packages/genui/a2ui-prompt/README.md
  • packages/genui/a2ui-catalog-extractor/README.md
  • packages/genui/a2ui-catalog-extractor/readme.zh_cn.md

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 22, 2026

Merging this PR will improve performance by 5.14%

⚡ 1 improved benchmark
✅ 80 untouched benchmarks
⏩ 26 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
transform 1000 view elements 47.3 ms 45 ms +5.14%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing Sherry-hue:feat/a2ui-cli-prompt (843f798) with main (11ef105)

Open in CodSpeed

Footnotes

  1. 26 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

React External

#1724 Bundle Size — 698.01KiB (0%).

843f798(current) vs 11ef105 main#1718(baseline)

Bundle metrics  no changes
                 Current
#1724
     Baseline
#1718
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#1724
     Baseline
#1718
No change  Other 698.01KiB 698.01KiB

Bundle analysis reportBranch Sherry-hue:feat/a2ui-cli-promptProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

Web Explorer

#10183 Bundle Size — 903.53KiB (0%).

843f798(current) vs 11ef105 main#10177(baseline)

Bundle metrics  Change 2 changes
                 Current
#10183
     Baseline
#10177
No change  Initial JS 45.06KiB 45.06KiB
No change  Initial CSS 2.22KiB 2.22KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 9 9
No change  Assets 11 11
Change  Modules 229(-1.29%) 232
No change  Duplicate Modules 11 11
Change  Duplicate Code 27.13%(+0.04%) 27.12%
No change  Packages 10 10
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#10183
     Baseline
#10177
No change  JS 499.15KiB 499.15KiB
No change  Other 402.16KiB 402.16KiB
No change  CSS 2.22KiB 2.22KiB

Bundle analysis reportBranch Sherry-hue:feat/a2ui-cli-promptProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

React Example with Element Template

#876 Bundle Size — 201.67KiB (0%).

843f798(current) vs 11ef105 main#870(baseline)

Bundle metrics  no changes
                 Current
#876
     Baseline
#870
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 27.9%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 99 99
No change  Duplicate Modules 30 30
No change  Duplicate Code 39.25% 39.25%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#876
     Baseline
#870
No change  IMG 145.76KiB 145.76KiB
No change  Other 55.91KiB 55.91KiB

Bundle analysis reportBranch Sherry-hue:feat/a2ui-cli-promptProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

React Example

#8607 Bundle Size — 237.81KiB (0%).

843f798(current) vs 11ef105 main#8601(baseline)

Bundle metrics  no changes
                 Current
#8607
     Baseline
#8601
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 200 200
No change  Duplicate Modules 80 80
No change  Duplicate Code 44.68% 44.68%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8607
     Baseline
#8601
No change  IMG 145.76KiB 145.76KiB
No change  Other 92.05KiB 92.05KiB

Bundle analysis reportBranch Sherry-hue:feat/a2ui-cli-promptProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

React MTF Example

#1741 Bundle Size — 208.75KiB (0%).

843f798(current) vs 11ef105 main#1735(baseline)

Bundle metrics  no changes
                 Current
#1741
     Baseline
#1735
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 195 195
No change  Duplicate Modules 77 77
No change  Duplicate Code 44.17% 44.17%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#1741
     Baseline
#1735
No change  IMG 111.23KiB 111.23KiB
No change  Other 97.52KiB 97.52KiB

Bundle analysis reportBranch Sherry-hue:feat/a2ui-cli-promptProject dashboard


Generated by RelativeCIDocumentationReport issue

@Sherry-hue Sherry-hue force-pushed the feat/a2ui-cli-prompt branch 2 times, most recently from 8bf4706 to 1cd15a5 Compare May 22, 2026 09:31
Copy link
Copy Markdown
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/genui/a2ui-cli/README.md`:
- Around line 67-82: Remove monorepo-specific maintainer instructions from the
"Local Development" section of packages/genui/a2ui-cli/README.md: delete the
repo-internal example commands (the `node packages/genui/a2ui-cli/bin/cli.js
generate prompt --out /tmp/a2ui-system-prompt.txt` usage and the `pnpm -C
packages/genui/a2ui-prompt build` rebuild steps) and replace with a concise,
user-facing instruction for installing or running the published CLI (e.g., how
to install the package globally or use npx), ensuring no workspace paths or
maintainer-only build steps remain.

In `@packages/genui/a2ui-prompt/turbo.json`:
- Around line 11-20: Turbo build.inputs for packages/genui/a2ui-prompt is
missing the upstream server agent sources, which can cause stale dist/** after
changes; update the inputs array in turbo.json (the "inputs" entry in
packages/genui/a2ui-prompt/turbo.json) to include the server agent sources that
this package imports (add the matching path pattern for the upstream files such
as ../../server/agent/** or ../server/agent/** depending on repo layout) so
changes to the server agent (imported in src/index.ts and referenced by
tsconfig.json/tsconfig.build.json) will invalidate the cache and rebuild the
package.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 011be767-3aaf-4aea-8fc3-6af734a9e0f4

📥 Commits

Reviewing files that changed from the base of the PR and between 613de8f and 8bf4706.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (22)
  • biome.jsonc
  • packages/genui/a2ui-catalog-extractor/README.md
  • packages/genui/a2ui-catalog-extractor/package.json
  • packages/genui/a2ui-catalog-extractor/readme.zh_cn.md
  • packages/genui/a2ui-catalog-extractor/src/cli.ts
  • packages/genui/a2ui-cli/AGENTS.md
  • packages/genui/a2ui-cli/README.md
  • packages/genui/a2ui-cli/bin/cli.js
  • packages/genui/a2ui-cli/package.json
  • packages/genui/a2ui-prompt/AGENTS.md
  • packages/genui/a2ui-prompt/README.md
  • packages/genui/a2ui-prompt/package.json
  • packages/genui/a2ui-prompt/rslib.config.ts
  • packages/genui/a2ui-prompt/src/index.ts
  • packages/genui/a2ui-prompt/tsconfig.build.json
  • packages/genui/a2ui-prompt/tsconfig.json
  • packages/genui/a2ui-prompt/turbo.json
  • packages/genui/a2ui/package.json
  • packages/genui/a2ui/tsconfig.build.json
  • packages/genui/server/agent/a2ui-catalog.ts
  • packages/genui/server/agent/a2ui-prompt.ts
  • packages/genui/tsconfig.json
✅ Files skipped from review due to trivial changes (6)
  • packages/genui/a2ui-prompt/package.json
  • packages/genui/a2ui/tsconfig.build.json
  • packages/genui/a2ui-prompt/AGENTS.md
  • packages/genui/tsconfig.json
  • packages/genui/a2ui-catalog-extractor/readme.zh_cn.md
  • packages/genui/a2ui-prompt/README.md

Comment thread packages/genui/a2ui-cli/README.md Outdated
Comment thread packages/genui/a2ui-prompt/turbo.json
Copy link
Copy Markdown
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/genui/a2ui-prompt/src/index.ts`:
- Around line 34-38: The code only checks existence with fs.existsSync before
calling fs.readdirSync, which causes an unhelpful ENOTDIR when a file path is
passed; update the checks for catalogDir (and the other directory checked around
lines 67-73) to verify the path is a directory by using
fs.statSync(path).isDirectory() (or fs.lstatSync) and throw a clear Error like
`[a2ui-prompt] Catalog directory is not a directory: ${path}` (or analogous
message for the other dir) if the check fails; also catch stat errors and
rethrow a descriptive A2UI error so readdirSync is only called on confirmed
directories.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 42a84134-ea41-4ac9-9b17-796d4ae55b64

📥 Commits

Reviewing files that changed from the base of the PR and between 8bf4706 and 1cd15a5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (22)
  • biome.jsonc
  • packages/genui/a2ui-catalog-extractor/README.md
  • packages/genui/a2ui-catalog-extractor/package.json
  • packages/genui/a2ui-catalog-extractor/readme.zh_cn.md
  • packages/genui/a2ui-catalog-extractor/src/cli.ts
  • packages/genui/a2ui-cli/AGENTS.md
  • packages/genui/a2ui-cli/README.md
  • packages/genui/a2ui-cli/bin/cli.js
  • packages/genui/a2ui-cli/package.json
  • packages/genui/a2ui-prompt/AGENTS.md
  • packages/genui/a2ui-prompt/README.md
  • packages/genui/a2ui-prompt/package.json
  • packages/genui/a2ui-prompt/rslib.config.ts
  • packages/genui/a2ui-prompt/src/index.ts
  • packages/genui/a2ui-prompt/tsconfig.build.json
  • packages/genui/a2ui-prompt/tsconfig.json
  • packages/genui/a2ui-prompt/turbo.json
  • packages/genui/a2ui/package.json
  • packages/genui/a2ui/tsconfig.build.json
  • packages/genui/server/agent/a2ui-catalog.ts
  • packages/genui/server/agent/a2ui-prompt.ts
  • packages/genui/tsconfig.json
✅ Files skipped from review due to trivial changes (8)
  • biome.jsonc
  • packages/genui/tsconfig.json
  • packages/genui/a2ui-catalog-extractor/README.md
  • packages/genui/a2ui-prompt/AGENTS.md
  • packages/genui/a2ui-prompt/README.md
  • packages/genui/a2ui-catalog-extractor/readme.zh_cn.md
  • packages/genui/server/agent/a2ui-prompt.ts
  • packages/genui/a2ui-prompt/tsconfig.build.json

Comment thread packages/genui/a2ui-prompt/src/index.ts
@Sherry-hue Sherry-hue force-pushed the feat/a2ui-cli-prompt branch 2 times, most recently from f015684 to 6e56865 Compare May 22, 2026 09:42
@Sherry-hue Sherry-hue force-pushed the feat/a2ui-cli-prompt branch from 6e56865 to 843f798 Compare May 22, 2026 09:50
@Sherry-hue Sherry-hue enabled auto-merge (squash) May 22, 2026 09:56
@Sherry-hue Sherry-hue merged commit 762ac6c into lynx-family:main May 22, 2026
87 of 89 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 25, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants