-
Notifications
You must be signed in to change notification settings - Fork 401
feat(agent): implement fuzzy file search functionality across runtime interfaces #621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,34 @@ const buildOptions: BuildOptions = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| format: 'esm', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| platform: 'node', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| target: 'node16', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| external: ['vscode'], // VSCode extension API should always be external | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| external: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'vscode', // VSCode extension API should always be external | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Node.js built-in modules | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'os', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'path', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'fs', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'util', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'stream', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'events', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'buffer', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'crypto', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'child_process', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'http', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'https', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'url', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'querystring', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'assert', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'zlib', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'tty', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'net', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'dns', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Dependencies to prevent bundling issues | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'fast-glob', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'fuse.js', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'ignore', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'minimatch', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '@stagewise/agent-runtime-interface', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+13
to
+40
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainExternal list: compute Node built-ins programmatically and bundle app deps (avoid over-externalizing).
Apply the following changes:
import { builtinModules } from 'node:module';
const nodeBuiltins = Array.from(
new Set([...builtinModules, ...builtinModules.map((m) => `node:${m}`)])
);
- external: [
- 'vscode', // VSCode extension API should always be external
- // Node.js built-in modules
- 'os',
- 'path',
- 'fs',
- 'util',
- 'stream',
- 'events',
- 'buffer',
- 'crypto',
- 'child_process',
- 'http',
- 'https',
- 'url',
- 'querystring',
- 'assert',
- 'zlib',
- 'tty',
- 'net',
- 'dns',
- // Dependencies to prevent bundling issues
- 'fast-glob',
- 'fuse.js',
- 'ignore',
- 'minimatch',
- '@stagewise/agent-runtime-interface',
- ],
+ external: [
+ 'vscode',
+ ...nodeBuiltins,
+ '@stagewise/agent-runtime-interface',
+ ],If you must keep any third-party lib external due to a demonstrated bundling issue, document the reason in a code comment and ensure it’s listed in Run to verify imports and deps: 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Do we use node: built-ins?
rg -nP --type=ts 'from\s+["'\'']node:' | sed 's/^/node-prefix import: /'
# 2) Are externals declared as runtime-node deps?
RNPKG="$(fd -p package.json -t f agent/runtime-node | head -n1)"
echo "Using package.json: $RNPKG"
jq -r '.dependencies // {} | keys[]' "$RNPKG" | sort > /tmp/deps.txt
printf "%s\n" fast-glob fuse.js ignore minimatch | sort > /tmp/need.txt
echo "Missing externals in dependencies (if you keep them external):"
comm -13 /tmp/deps.txt /tmp/need.txt || trueLength of output: 11152 Generate Node built-ins dynamically and bundle third-party modules --- a/agent/runtime-node/build.ts
+++ b/agent/runtime-node/build.ts
@@ –1,4 +1,9 @@
-import { build } from 'esbuild';
+import { build } from 'esbuild';
+import { builtinModules } from 'node:module';
+
+const nodeBuiltins = Array.from(
+ new Set([...builtinModules, ...builtinModules.map((m) => `node:${m}`)])
+);
export async function createBundle() {
await build({
@@ –13,18 +18,7 @@ export async function createBundle() {
// keep other options...
- external: [
- 'vscode',
- 'os','path','fs','util','stream','events','buffer','crypto',
- 'child_process','http','https','url','querystring','assert',
- 'zlib','tty','net','dns',
- 'fast-glob','fuse.js','ignore','minimatch',
- '@stagewise/agent-runtime-interface',
- ],
+ external: ['vscode', ...nodeBuiltins, '@stagewise/agent-runtime-interface'],
});
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sourcemap: false, // Disable source maps for security | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| minify: true, // Always minify for published packages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| treeShaking: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use POSIX path helpers with memfs to avoid Windows separator issues
Memfs is POSIX-like; node:path may emit backslashes on Windows. Use node:path/posix for consistency across platforms.
📝 Committable suggestion
🤖 Prompt for AI Agents