Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
7e41e69 to
6152bcb
Compare
| } else { | ||
| // Auto-detect: if it looks like a URL, it's git; otherwise local | ||
| const isUrl = | ||
| const looksLikeUrl = | ||
| urlOrPath.startsWith('http://') || | ||
| urlOrPath.startsWith('https://') || | ||
| urlOrPath.startsWith('github.com/') || | ||
| urlOrPath.includes('github.com/'); | ||
| resourceType = isUrl ? 'git' : 'local'; | ||
| resourceType = looksLikeUrl ? 'git' : 'local'; | ||
| } |
There was a problem hiding this comment.
Website resources mis-detected
When --type is omitted, resourceType is inferred as 'git' for anything that "looksLikeUrl" (any http(s)://), otherwise 'local' (apps/cli/src/commands/add.ts:431-438). That means passing a website URL like https://docs.example.com will route into the git wizard and then hard-exit with "Invalid GitHub URL". Website URLs should be detected (e.g., non-GitHub URLs) so btca add https://... works without requiring --type website.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/cli/src/commands/add.ts
Line: 431:438
Comment:
**Website resources mis-detected**
When `--type` is omitted, `resourceType` is inferred as `'git'` for anything that "looksLikeUrl" (any `http(s)://`), otherwise `'local'` (`apps/cli/src/commands/add.ts:431-438`). That means passing a website URL like `https://docs.example.com` will route into the git wizard and then hard-exit with "Invalid GitHub URL". Website URLs should be detected (e.g., non-GitHub URLs) so `btca add https://...` works without requiring `--type website`.
How can I resolve this? If you propose a fix, please make it concise.
Additional Comments (1)
After this commit, Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/server/src/config/index.ts
Line: 273:282
Comment:
**Tests failing: error messages**
After this commit, `Config.load()` errors use messages like `"Failed to parse config file - invalid JSON syntax"` (`apps/server/src/config/index.ts:273-282`), but existing tests assert older substrings like `"Failed to parse config file"` / `"Invalid config"`. On `main` server tests pass, but on this SHA `bun test --cwd apps/server` fails multiple assertions due to these message changes. Either update the tests or restore the expected error message substrings so CI stays green.
How can I resolve this? If you propose a fix, please make it concise. |
| const looksLikeUrl = | ||
| urlOrPath.startsWith('http://') || | ||
| urlOrPath.startsWith('https://') || | ||
| urlOrPath.startsWith('github.com/') || | ||
| urlOrPath.includes('github.com/'); | ||
| resourceType = isUrl ? 'git' : 'local'; | ||
| resourceType = looksLikeUrl ? 'git' : 'local'; | ||
| } |
There was a problem hiding this comment.
Auto-detection incorrectly routes website URLs to git handler
The looksLikeUrl check treats any http(s):// URL as a git resource. When users run btca add https://docs.example.com without --type website, it routes to addGitResourceWizard, which then fails with "Invalid GitHub URL" (line 143-145).
Website URLs should be distinguished from GitHub URLs so the wizard routes correctly.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/cli/src/commands/add.ts
Line: 432:438
Comment:
Auto-detection incorrectly routes website URLs to git handler
The `looksLikeUrl` check treats any `http(s)://` URL as a git resource. When users run `btca add https://docs.example.com` without `--type website`, it routes to `addGitResourceWizard`, which then fails with "Invalid GitHub URL" (line 143-145).
Website URLs should be distinguished from GitHub URLs so the wizard routes correctly.
How can I resolve this? If you propose a fix, please make it concise.
first pass on web resource
better web resource setup for now...
Greptile Overview
Greptile Summary
This PR adds comprehensive website resource support to btca, enabling crawling and indexing of documentation sites. The implementation includes:
Core Features
.mdand/.mdURLs)Integration
btca add)WebsiteResourceSchemaTesting
Issues Found
btca add https://docs.example.comwithout--type website)node:fsinstead of Bun APIs in website.ts (style preference per AGENTS.md)The core website resource implementation is solid and well-tested. The URL detection bug in the CLI should be fixed before merge to ensure good UX.
Confidence Score: 4/5
btca addfor website URLs without --type flagImportant Files Changed
Context used:
dashboard- AGENTS.md (source)