Add inspect for offline imported-project detection - #1628
Conversation
- Reuse framework and monorepo detection for JSON output - Bypass auth, update checks, and local CLI delegation
|
Warning Review limit reached
Next review available in: 16 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThe CLI adds an offline ChangesInspect command
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
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. Comment |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/storage": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-storage-3.1.14-668e52c.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-opencode-3.1.14-668e52c.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-drizzle-3.1.14-668e52c.tgz",
"@agentuity/hono": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-hono-3.1.14-668e52c.tgz",
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-postgres-3.1.14-668e52c.tgz",
"@agentuity/skills": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-skills-3.1.14-668e52c.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-claude-code-3.1.14-668e52c.tgz",
"@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-queue-3.1.14-668e52c.tgz",
"@agentuity/telemetry": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-telemetry-3.1.14-668e52c.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-server-3.1.14-668e52c.tgz",
"@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-keyvalue-3.1.14-668e52c.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-core-3.1.14-668e52c.tgz",
"@agentuity/api": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-api-3.1.14-668e52c.tgz",
"@agentuity/client": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-client-3.1.14-668e52c.tgz",
"@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-coder-tui-3.1.14-668e52c.tgz",
"@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-schedule-3.1.14-668e52c.tgz",
"@agentuity/adapter": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-adapter-3.1.14-668e52c.tgz",
"@agentuity/stream": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-stream-3.1.14-668e52c.tgz",
"@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-vector-3.1.14-668e52c.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-cli-3.1.14-668e52c.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-runtime-3.1.14-668e52c.tgz",
"create-agentuity": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/create-agentuity-3.1.14-668e52c.tgz",
"@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-webhook-3.1.14-668e52c.tgz",
"@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-email-3.1.14-668e52c.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-coder-3.1.14-668e52c.tgz",
"@agentuity/config": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-config-3.1.14-668e52c.tgz",
"@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-migrate-3.1.14-668e52c.tgz",
"@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-db-3.1.14-668e52c.tgz",
"@agentuity/aigateway": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-aigateway-3.1.14-668e52c.tgz",
"@agentuity/analytics": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-analytics-3.1.14-668e52c.tgz",
"@agentuity/pi": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-pi-3.1.14-668e52c.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-schema-3.1.14-668e52c.tgz",
"@agentuity/vite": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-vite-3.1.14-668e52c.tgz",
"@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-sandbox-3.1.14-668e52c.tgz",
"@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-task-3.1.14-668e52c.tgz",
"@agentuity/genesis": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-genesis-3.1.14-668e52c.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-storage-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-opencode-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-drizzle-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-hono-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-postgres-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-skills-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-claude-code-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-queue-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-telemetry-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-server-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-keyvalue-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-core-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-api-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-client-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-coder-tui-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-schedule-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-adapter-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-stream-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-vector-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-cli-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-runtime-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/create-agentuity-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-webhook-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-email-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-coder-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-config-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-migrate-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-db-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-aigateway-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-analytics-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-pi-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-schema-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-vite-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-sandbox-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-task-3.1.14-668e52c.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.14-668e52c/agentuity-genesis-3.1.14-668e52c.tgz |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/cli/scripts/test-inspect.ts (1)
65-80: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the advertised runtime result.
runtimeis parsed but never checked, so a runtime-detection regression still passes. Assert the expected Vite runtime at minimum.🤖 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/cli/scripts/test-inspect.ts` around lines 65 - 80, Update the assertions in the test-inspect result validation to check the parsed result.runtime field and require the expected Vite runtime value, following the existing framework and command assertions.
🤖 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/cli/src/cmd/inspect.ts`:
- Around line 95-104: Update the output branch in the inspect command handler to
use the shared isJSONMode() helper instead of reading ctx.options.json directly,
while preserving the existing human-readable output behavior and command
details.
In `@packages/cli/src/local-delegate.ts`:
- Around line 46-57: The global value-bearing option set
GLOBAL_OPTIONS_WITH_VALUES must include --profile so local delegation skips its
argument and preserves offline inspect detection. Update
packages/cli/src/local-delegate.ts lines 46-57 accordingly, and add an assertion
in packages/cli/scripts/test-inspect.ts lines 28-33 that ['--profile', 'work',
'--json', 'inspect'] is recognized as an inspect invocation.
---
Nitpick comments:
In `@packages/cli/scripts/test-inspect.ts`:
- Around line 65-80: Update the assertions in the test-inspect result validation
to check the parsed result.runtime field and require the expected Vite runtime
value, following the existing framework and command assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 655c188c-c884-46d6-bf04-d00a7cdabd17
📒 Files selected for processing (6)
packages/cli/package.jsonpackages/cli/scripts/test-inspect.tspackages/cli/src/cmd/index.tspackages/cli/src/cmd/inspect.tspackages/cli/src/local-delegate.tspackages/cli/src/main.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (20)
- GitHub Check: Bun version checks
- GitHub Check: Linux distro install smoke
- GitHub Check: Native install (Linux)
- GitHub Check: Native install (macOS)
- GitHub Check: Installer scenarios
- GitHub Check: Agentuity - docs-docs
- GitHub Check: Queue CLI Tests (bun)
- GitHub Check: Package Installation & Usage Test (bun)
- GitHub Check: Migrate Chain (v1 → v2 → v3)
- GitHub Check: Queue CLI Tests (node)
- GitHub Check: Package Installation & Usage Test (node)
- GitHub Check: Testing Apps (local tests)
- GitHub Check: Postgres SSL Integration Test
- GitHub Check: Framework Demo Tests
- GitHub Check: Service Client Smoke Tests
- GitHub Check: Pack & Upload
- GitHub Check: Windows WSL CLI Smoke Test
- GitHub Check: actionlint
- GitHub Check: OSV Scanner PR
- GitHub Check: Build
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Run
bun run formatusing Biome with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5
Files:
packages/cli/src/cmd/index.tspackages/cli/src/cmd/inspect.tspackages/cli/scripts/test-inspect.tspackages/cli/src/local-delegate.tspackages/cli/src/main.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use TypeScript in strict mode with ESNext target and bundler moduleResolution
UseStructuredErrorfrom@agentuity/corefor error handling
Files:
packages/cli/src/cmd/index.tspackages/cli/src/cmd/inspect.tspackages/cli/scripts/test-inspect.tspackages/cli/src/local-delegate.tspackages/cli/src/main.ts
packages/cli/src/cmd/**/index.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
packages/cli/src/cmd/**/index.ts: Each command must be a directory insrc/cmd/with anindex.tsentry point
Always define interfaces for command options using Zod schemas; never useanyfor type safety
Files:
packages/cli/src/cmd/index.ts
packages/cli/src/**/*.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
packages/cli/src/**/*.ts: Usetui.*helpers for formatted output (header,info,success,warning,error,table,progress)
Usectx.loggerfor logging;logger.fatal()logs and exits with code 1
Useawait readFile(p, 'utf-8')andawait writeFile(p, content)fromnode:fs/promisesfor file I/O
ImportpathExistsfromnode-compat/fsfor file existence checks instead of using Node's built-in
Do not use Bun globals (Bun.file,Bun.spawn,Bun.color,Bun.stringWidth, etc.) in production source code;tsconfig.jsontype checking enforces this
Imports must use explicit.tsextensions for relative paths (e.g.,from './foo.ts', notfrom './foo'); TypeScript'srewriteRelativeImportExtensionswill rewrite them to.jsin output
Always checkisJSONMode()for machine-readable output in command handlers
UserequireAuth(ctx)oroptionalAuth(ctx)for authenticated commands
Files:
packages/cli/src/cmd/index.tspackages/cli/src/cmd/inspect.tspackages/cli/src/local-delegate.tspackages/cli/src/main.ts
🧠 Learnings (3)
📚 Learning: 2026-03-27T23:18:58.450Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 1292
File: packages/keyvalue/package.json:3-3
Timestamp: 2026-03-27T23:18:58.450Z
Learning: In the agentuity/sdk monorepo, subpackage `package.json` files under `packages/` (e.g., `packages/keyvalue`) are allowed to depend on other workspace packages (such as `agentuity/server`) and are not limited to only `agentuity/core` and `zod`. Also, if a subpackage uses `bunx tsc --build --force` as its build script, treat it as a valid/intentional build command and do not flag it as a dependency/build-script violation.
Applied to files:
packages/cli/package.json
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.
Applied to files:
packages/cli/src/cmd/index.tspackages/cli/src/cmd/inspect.tspackages/cli/scripts/test-inspect.tspackages/cli/src/local-delegate.tspackages/cli/src/main.ts
📚 Learning: 2026-02-17T14:23:15.448Z
Learnt from: potofpie
Repo: agentuity/sdk PR: 974
File: packages/cli/src/cmd/git/account/list.ts:39-40
Timestamp: 2026-02-17T14:23:15.448Z
Learning: In the Agentuity CLI framework (packages/cli), when a subcommand declares requires: { auth: true }, the framework will automatically call requireAuth() before invoking the handler. Do not call requireAuth(ctx) manually inside command handlers. This applies to all TypeScript command files under packages/cli/src, including paths like packages/cli/src/cmd/git/account/list.ts.
Applied to files:
packages/cli/src/cmd/index.tspackages/cli/src/cmd/inspect.tspackages/cli/src/local-delegate.tspackages/cli/src/main.ts
🔇 Additional comments (4)
packages/cli/src/cmd/index.ts (1)
15-15: LGTM!packages/cli/src/local-delegate.ts (1)
19-21: LGTM!Also applies to: 242-245
packages/cli/src/main.ts (1)
301-311: LGTM!packages/cli/package.json (1)
30-30: LGTM!Also applies to: 39-39
|
Investigated the two failed install checks. No PR code change is needed.
Recommendation: rerun the failed checks and merge #1628 once required checks are green. The failure is unrelated installer/network flakiness exposed because CLI changes cause the install workflow to run. |
|
Addressed the review and contract findings in
Verification:
|
inspect for imported project detection
|
The latest Agentuity deployment details.
View deployment logs with the Agentuity CLI: |
|
Updated the wording to separate the durable Genesis contract from current implementation details.
No runtime behavior changed. CLI typecheck, tests, build, targeted lint, and formatting pass. Repo-root lint remains blocked by the pre-existing nested Biome configs under |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/cli/scripts/test-inspect.ts (1)
100-173: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider extracting a shared fixture/assert helper for the three framework scenarios.
The vite/tanstack/legacy blocks each write a
package.jsonfixture, callrunInspect, checkexitCode === 0,JSON.parsestdout, then assertframework/confidence/warnings/port. Factoring this into a smallexpectInspect(dir, pkgJson, assertions)helper would cut the duplication and make it easy to add future framework fixtures.♻️ Sketch of a shared helper
async function expectInspectFixture( dir: string, pkgJson: Record<string, unknown>, check: (result: Record<string, unknown>) => void ) { mkdirSync(dir); writeFileSync(join(dir, 'package.json'), JSON.stringify(pkgJson)); const { exitCode, stdout } = await runInspect(dir); if (exitCode !== 0) throw new Error(`inspect exited ${exitCode} for ${dir}`); check(JSON.parse(stdout)); }🤖 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/cli/scripts/test-inspect.ts` around lines 100 - 173, Extract a shared helper near the test scenarios, such as expectInspectFixture, to create the fixture directory and package.json, invoke runInspect, validate a zero exit code, parse stdout, and pass the result to scenario-specific assertions. Refactor the vite, tanstack-start, and agentuity-legacy blocks to use this helper while preserving all existing framework, confidence, warning, and port checks.
🤖 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/cli/scripts/test-inspect.ts`:
- Around line 22-39: Update the Bun.spawn call in runInspect to include a native
timeout option, using an appropriate duration for the inspect command, so
awaiting cli.exited cannot hang indefinitely. Preserve the existing stdout,
stderr, exitCode collection and process configuration.
---
Nitpick comments:
In `@packages/cli/scripts/test-inspect.ts`:
- Around line 100-173: Extract a shared helper near the test scenarios, such as
expectInspectFixture, to create the fixture directory and package.json, invoke
runInspect, validate a zero exit code, parse stdout, and pass the result to
scenario-specific assertions. Refactor the vite, tanstack-start, and
agentuity-legacy blocks to use this helper while preserving all existing
framework, confidence, warning, and port checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 64ba5af4-507a-4481-8c18-567ad4711a4a
📒 Files selected for processing (3)
packages/cli/scripts/test-inspect.tspackages/cli/src/cmd/inspect.tspackages/cli/src/local-delegate.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/cli/src/cmd/inspect.ts
- packages/cli/src/local-delegate.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (19)
- GitHub Check: Bun version checks
- GitHub Check: Native install (macOS)
- GitHub Check: Installer scenarios
- GitHub Check: Native install (Linux)
- GitHub Check: Linux distro install smoke
- GitHub Check: Windows WSL CLI Smoke Test
- GitHub Check: Framework Demo Tests
- GitHub Check: Build
- GitHub Check: Service Client Smoke Tests
- GitHub Check: Postgres SSL Integration Test
- GitHub Check: Package Installation & Usage Test (bun)
- GitHub Check: Queue CLI Tests (bun)
- GitHub Check: Package Installation & Usage Test (node)
- GitHub Check: Migrate Chain (v1 → v2 → v3)
- GitHub Check: Queue CLI Tests (node)
- GitHub Check: Testing Apps (local tests)
- GitHub Check: OSV Scanner PR
- GitHub Check: Pack & Upload
- GitHub Check: Agentuity - docs-docs
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Run
bun run formatusing Biome with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5
Files:
packages/cli/scripts/test-inspect.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use TypeScript in strict mode with ESNext target and bundler moduleResolution
UseStructuredErrorfrom@agentuity/corefor error handling
Files:
packages/cli/scripts/test-inspect.ts
🧠 Learnings (1)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.
Applied to files:
packages/cli/scripts/test-inspect.ts
🔇 Additional comments (4)
packages/cli/scripts/test-inspect.ts (4)
12-20: LGTM!
67-67: LGTM!Also applies to: 83-85
198-201: LGTM!
174-197: 🎯 Functional CorrectnessNo change needed. The
invalidResulttype assertion contains a singleerrorproperty definition.
- Stop the inspect subprocess after 15 seconds. - Share setup and validation across framework fixtures.
- Zod-parse launch.json; derive UserLaunchOverride from schema - throw LaunchConfigError with per-field issue paths - build maps it to CONFIG_INVALID (exit 10), not INTERNAL_ERROR - tolerate JSON null as absent; keep unknown keys passthrough Co-authored-by: Cursor <cursoragent@cursor.com>
- gate pre-dispatch loadConfig and getAuth in main.ts - getAuth() re-loads config internally, so both need the gate Co-authored-by: Cursor <cursoragent@cursor.com>
- add DetectedFramework.buildCommandKind at all producers - extract NO_BUILD_SENTINEL const; adapters unchanged Co-authored-by: Cursor <cursoragent@cursor.com>
- skipConfigLoad: identical output for any profile config state - commands.build: discriminated union; sentinel never public - entrypoints -> detectedServerEntry (singular detector hint) - validate launch.json even when a framework matches - move tests to test/cmd/inspect.test.ts; run in CI test chain - add packed-tarball inspect smoke to install matrix Co-authored-by: Cursor <cursoragent@cursor.com>
inspect for imported project detectioninspect for offline imported-project detection
There was a problem hiding this comment.
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/cli/src/cmd/build/package/launch.ts`:
- Around line 132-163: Convert readUserLaunchOverride to async, replace
existsSync/readFileSync with pathExists and await readFile from the mandated
async I/O modules, and preserve the existing parsing and LaunchConfigError
behavior. Update its async callers, including detectCustomLauncher and the
inspect handler, to await the result.
In `@scripts/test-package-install.sh`:
- Around line 147-155: Update all inspect failure paths in
scripts/test-package-install.sh, including the inspect_exit non-zero branch and
sentinel/framework validation failures, to print the complete inspect-output.log
contents before exiting. Preserve the existing error handling while ensuring cat
inspect-output.log runs for every inspect-related failure, tolerating a missing
log file as currently done.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6c27371c-da70-4295-a549-dde643f28adf
📒 Files selected for processing (15)
packages/cli/package.jsonpackages/cli/src/cmd/build/adapters/generic.tspackages/cli/src/cmd/build/detect/agentuity-legacy.tspackages/cli/src/cmd/build/detect/generic.tspackages/cli/src/cmd/build/detect/index.tspackages/cli/src/cmd/build/detect/types.tspackages/cli/src/cmd/build/detect/util.tspackages/cli/src/cmd/build/index.tspackages/cli/src/cmd/build/package/launch.tspackages/cli/src/cmd/inspect.tspackages/cli/src/main.tspackages/cli/src/types.tspackages/cli/test/cmd/build/package/launch.test.tspackages/cli/test/cmd/inspect.test.tsscripts/test-package-install.sh
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/cli/package.json
- packages/cli/src/cmd/inspect.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (7)
- GitHub Check: Installer scenarios
- GitHub Check: Native install (macOS)
- GitHub Check: Linux distro install smoke
- GitHub Check: Windows WSL CLI Smoke Test
- GitHub Check: Framework Demo Tests
- GitHub Check: Build
- GitHub Check: Agentuity - docs-docs
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Run
bun run formatusing Biome with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5
Files:
packages/cli/src/cmd/build/detect/types.tspackages/cli/test/cmd/build/package/launch.test.tspackages/cli/src/cmd/build/detect/agentuity-legacy.tspackages/cli/src/cmd/build/detect/util.tspackages/cli/src/cmd/build/adapters/generic.tspackages/cli/src/main.tspackages/cli/src/cmd/build/index.tspackages/cli/src/cmd/build/detect/index.tspackages/cli/src/cmd/build/detect/generic.tspackages/cli/src/cmd/build/package/launch.tspackages/cli/src/types.tspackages/cli/test/cmd/inspect.test.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use TypeScript in strict mode with ESNext target and bundler moduleResolution
UseStructuredErrorfrom@agentuity/corefor error handling
Files:
packages/cli/src/cmd/build/detect/types.tspackages/cli/test/cmd/build/package/launch.test.tspackages/cli/src/cmd/build/detect/agentuity-legacy.tspackages/cli/src/cmd/build/detect/util.tspackages/cli/src/cmd/build/adapters/generic.tspackages/cli/src/main.tspackages/cli/src/cmd/build/index.tspackages/cli/src/cmd/build/detect/index.tspackages/cli/src/cmd/build/detect/generic.tspackages/cli/src/cmd/build/package/launch.tspackages/cli/src/types.tspackages/cli/test/cmd/inspect.test.ts
packages/cli/src/**/*.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
packages/cli/src/**/*.ts: Usetui.*helpers for formatted output (header,info,success,warning,error,table,progress)
Usectx.loggerfor logging;logger.fatal()logs and exits with code 1
Useawait readFile(p, 'utf-8')andawait writeFile(p, content)fromnode:fs/promisesfor file I/O
ImportpathExistsfromnode-compat/fsfor file existence checks instead of using Node's built-in
Do not use Bun globals (Bun.file,Bun.spawn,Bun.color,Bun.stringWidth, etc.) in production source code;tsconfig.jsontype checking enforces this
Imports must use explicit.tsextensions for relative paths (e.g.,from './foo.ts', notfrom './foo'); TypeScript'srewriteRelativeImportExtensionswill rewrite them to.jsin output
Always checkisJSONMode()for machine-readable output in command handlers
UserequireAuth(ctx)oroptionalAuth(ctx)for authenticated commands
Files:
packages/cli/src/cmd/build/detect/types.tspackages/cli/src/cmd/build/detect/agentuity-legacy.tspackages/cli/src/cmd/build/detect/util.tspackages/cli/src/cmd/build/adapters/generic.tspackages/cli/src/main.tspackages/cli/src/cmd/build/index.tspackages/cli/src/cmd/build/detect/index.tspackages/cli/src/cmd/build/detect/generic.tspackages/cli/src/cmd/build/package/launch.tspackages/cli/src/types.ts
**/packages/*/test/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/packages/*/test/**/*.{ts,tsx}: Place tests intest/folder parallel tosrc/directory, never insidesrc/or under__tests__/
Import from../src/in test files
Use@agentuity/test-utilsfor shared mocks in tests
Files:
packages/cli/test/cmd/build/package/launch.test.tspackages/cli/test/cmd/inspect.test.ts
packages/cli/src/cmd/**/index.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
packages/cli/src/cmd/**/index.ts: Each command must be a directory insrc/cmd/with anindex.tsentry point
Always define interfaces for command options using Zod schemas; never useanyfor type safety
Files:
packages/cli/src/cmd/build/index.tspackages/cli/src/cmd/build/detect/index.ts
🧠 Learnings (3)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.
Applied to files:
packages/cli/src/cmd/build/detect/types.tspackages/cli/test/cmd/build/package/launch.test.tspackages/cli/src/cmd/build/detect/agentuity-legacy.tspackages/cli/src/cmd/build/detect/util.tspackages/cli/src/cmd/build/adapters/generic.tspackages/cli/src/main.tspackages/cli/src/cmd/build/index.tspackages/cli/src/cmd/build/detect/index.tspackages/cli/src/cmd/build/detect/generic.tspackages/cli/src/cmd/build/package/launch.tspackages/cli/src/types.tspackages/cli/test/cmd/inspect.test.ts
📚 Learning: 2026-02-17T14:23:15.448Z
Learnt from: potofpie
Repo: agentuity/sdk PR: 974
File: packages/cli/src/cmd/git/account/list.ts:39-40
Timestamp: 2026-02-17T14:23:15.448Z
Learning: In the Agentuity CLI framework (packages/cli), when a subcommand declares requires: { auth: true }, the framework will automatically call requireAuth() before invoking the handler. Do not call requireAuth(ctx) manually inside command handlers. This applies to all TypeScript command files under packages/cli/src, including paths like packages/cli/src/cmd/git/account/list.ts.
Applied to files:
packages/cli/src/cmd/build/detect/types.tspackages/cli/src/cmd/build/detect/agentuity-legacy.tspackages/cli/src/cmd/build/detect/util.tspackages/cli/src/cmd/build/adapters/generic.tspackages/cli/src/main.tspackages/cli/src/cmd/build/index.tspackages/cli/src/cmd/build/detect/index.tspackages/cli/src/cmd/build/detect/generic.tspackages/cli/src/cmd/build/package/launch.tspackages/cli/src/types.ts
📚 Learning: 2026-02-21T02:05:57.982Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 1010
File: packages/drizzle/test/proxy.test.ts:594-603
Timestamp: 2026-02-21T02:05:57.982Z
Learning: Do not rely on StructuredError from agentuity/core in test files or simple error handling paths. In tests and straightforward error handling, use plain Error objects to represent failures, reserving StructuredError for more complex error scenarios in application logic.
Applied to files:
packages/cli/test/cmd/build/package/launch.test.tspackages/cli/test/cmd/inspect.test.ts
🔇 Additional comments (13)
packages/cli/test/cmd/build/package/launch.test.ts (1)
7-7: LGTM!Also applies to: 371-423
packages/cli/test/cmd/inspect.test.ts (1)
1-474: LGTM!packages/cli/src/types.ts (1)
368-368: LGTM!Also applies to: 412-412, 434-434
packages/cli/src/main.ts (1)
257-262: LGTM!Also applies to: 305-322
packages/cli/src/cmd/build/detect/util.ts (1)
10-16: LGTM!packages/cli/src/cmd/build/detect/types.ts (1)
50-57: LGTM!packages/cli/src/cmd/build/detect/index.ts (1)
16-21: LGTM!Also applies to: 65-78, 250-268, 277-290
packages/cli/src/cmd/build/detect/generic.ts (1)
86-97: LGTM!packages/cli/src/cmd/build/detect/agentuity-legacy.ts (1)
100-118: LGTM!packages/cli/src/cmd/build/adapters/generic.ts (1)
16-16: LGTM!Also applies to: 194-212, 426-438
packages/cli/src/cmd/build/package/launch.ts (1)
22-121: LGTM!Also applies to: 249-255
packages/cli/src/cmd/build/index.ts (2)
190-198: 🩺 Stability & AvailabilityConfirm
exitWithErrorhalts execution before the fallthrough handler runs.No
return/throwfollows theexitWithErrorcall, so ifexitWithErrordoesn't terminate synchronously (e.g. isn't typednever/ doesn't callprocess.exit), execution would continue into the genericAggregateError/tui.fatalfallback below and double-report the error. This matches the pre-existingFrameworkDetectionError/TypecheckErrorbranches' convention, so likely safe, but worth confirming givenerrors.tsisn't in scope here.
5-5: LGTM!Also applies to: 14-14
- Read launch overrides with async filesystem helpers - Await packaging across build and test callers - Preserve inspect logs when packed smoke checks fail
Mark --dir optional in generated command metadata.\n\nCover the built schema contract with a regression test.
Summary
Fixes TAC-851.
Related: TAC-760, the umbrella for completing the source-fact contract and adopting it in Genesis.
Why
Genesis currently mirrors framework detection and guesses some source-layout facts. That creates drift between what the SDK can build and what Genesis thinks it can preview.
This PR establishes the first half of a single-source-of-truth boundary. It answers what the detector knows before a build. It does not claim to know the final adapter-resolved launch entrypoint.
Implementation
Offline command boundary
inspectopts out of update checks, internal logging, and config loading. This keeps its output independent of local profiles and auth state.The optional directory now has the same default in runtime parsing and generated command metadata:
Honest build-command provenance
The public response distinguishes a package script from a terminal-ready command. Projects with no build step return
null; the internal sentinel never crosses the boundary.Selected response fields:
{ "schemaVersion": 1, "framework": "vite", "runtime": "node", "packageManager": "bun", "detectedServerEntry": null, "commands": { "build": { "kind": "command", "command": "vite build" } } }Validated launch overrides
launch.jsonis parsed with Zod instead of being cast from untrusted JSON. Invalid JSON and invalid field shapes becomeCONFIG_INVALIDerrors with field paths. Unknown keys remain allowed, and historically nullable optional fields remain compatible.The review follow-up also moved override reads to the repository's async filesystem helpers. Packaging and its tests now await that work. Packed-install smoke failures retain the complete inspect log.
How to review
src/main.ts,src/types.tssrc/cmd/inspect.tssrc/cmd/build/detect/src/cmd/build/package/launch.tsscripts/test-package-install.shScope and follow-ups
This PR ships the offline inspection surface. It intentionally leaves two child tasks under TAC-760:
public/heuristic.Azure container packaging, deployment, visibility, and rollback are outside this command's boundary. They consume build artifacts after inspection.
Known gap:
cloud deploy --pack-onlyand the shared step runner still translate malformedlaunch.jsonfailures intoINTERNAL_ERROR.inspectandbuildreturnCONFIG_INVALID; deploy error translation belongs in a separate step-runner change.Sources
detectedServerEntryrather than claiming a final entrypoint.Verification
bun test test/cmd/inspect.test.ts test/cmd/build/package/launch.test.ts test/cmd/build/buildpack-contract.test.ts test/cmd/build/static-assets.test.ts: 73 pass, 0 fail on the final head.bun run typecheck: pass.bun run build: pass.node bin/cli.js --json inspect --describe:dir.requiredisfalseanddir.defaultis".".CLI_RUNTIME=node bash scripts/test-package-install.sh: pass, including packed-tarball inspect with an isolated profile.CLI_RUNTIME=bun bash scripts/test-package-install.sh: pass, including packed-tarball inspect with an isolated profile.bun testbefore the final schema-metadata correction: 831 pass, 4 fail. All four failures are pre-existing, unrelated upgrade/spawn timeout tests; the current-head focused suite above is green.Summary by CodeRabbit
New Features
inspectcommand that analyzes local projects and reports framework, runtime, package manager, server, build, port, and monorepo details.Bug Fixes
launch.jsonfiles.