yats-toolkit 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/benchmark/questions/go/chi/01-routing.md +1 -0
- package/benchmark/questions/go/chi/02-middleware.md +1 -0
- package/benchmark/questions/php/slim/01-routing.md +1 -0
- package/benchmark/questions/php/slim/02-container.md +1 -0
- package/benchmark/questions/python/flask/01-routing.md +1 -0
- package/benchmark/questions/python/flask/02-context.md +1 -0
- package/benchmark/questions/typescript/express/01-middleware.md +1 -0
- package/benchmark/questions/typescript/express/02-router.md +1 -0
- package/benchmark/questions/typescript/koa/01-middleware.md +1 -0
- package/benchmark/questions/typescript/koa/02-context.md +1 -0
- package/benchmark/targets/repos.json +5 -6
- package/package.json +1 -1
- package/src/benchmark.js +1316 -335
- package/src/bridge.js +8 -6
- package/benchmark/questions/go/terraform/01-providers.md +0 -1
- package/benchmark/questions/go/terraform/02-graph.md +0 -1
- package/benchmark/questions/php/laravel/01-container.md +0 -1
- package/benchmark/questions/php/laravel/02-routing.md +0 -1
- package/benchmark/questions/php/symfony/01-dependency-injection.md +0 -1
- package/benchmark/questions/php/symfony/02-event-dispatcher.md +0 -1
- package/benchmark/questions/python/01-middleware.md +0 -8
- package/benchmark/questions/python/02-routing.md +0 -9
- package/benchmark/questions/python/django/01-middleware.md +0 -1
- package/benchmark/questions/python/django/01-orm.md +0 -1
- package/benchmark/questions/typescript/nestjs/01-decorators.md +0 -1
- package/benchmark/questions/typescript/nestjs/02-modules.md +0 -1
- package/benchmark/questions/typescript/nextjs/01-rendering.md +0 -1
- package/benchmark/questions/typescript/nextjs/02-routing.md +0 -1
- /package/benchmark/questions/go/{lab_hub → hub-lab}/01-protocol-translation.md +0 -0
- /package/benchmark/questions/go/{lab_hub → hub-lab}/02-bidirectional-flow.md +0 -0
package/src/bridge.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import http from "node:http";
|
|
21
21
|
import https from "node:https";
|
|
22
22
|
import { createInterface } from "node:readline";
|
|
23
|
-
import { basename } from "node:path";
|
|
23
|
+
import { basename, resolve } from "node:path";
|
|
24
24
|
|
|
25
25
|
// ── Config ──────────────────────────────────────────────
|
|
26
26
|
let yatsUrl = process.env.YATS_URL || "http://localhost:5555";
|
|
@@ -37,8 +37,9 @@ for (let i = 0; i < args.length; i++) {
|
|
|
37
37
|
|
|
38
38
|
const YATS_MCP_URL = yatsUrl.endsWith("/mcp") ? yatsUrl : yatsUrl + "/mcp";
|
|
39
39
|
|
|
40
|
-
// Default repo: env var > cwd
|
|
41
|
-
const
|
|
40
|
+
// Default repo: env var (full path) > cwd (full path). Resolved to absolute.
|
|
41
|
+
const DEFAULT_REPO_PATH = resolve(process.env.YATS_DEFAULT_REPO || process.cwd());
|
|
42
|
+
const DEFAULT_REPO_NAME = basename(DEFAULT_REPO_PATH);
|
|
42
43
|
|
|
43
44
|
// Tools that require a repository parameter
|
|
44
45
|
const REPO_TOOLS = new Set([
|
|
@@ -95,7 +96,7 @@ async function callTool(name, args) {
|
|
|
95
96
|
async function start() {
|
|
96
97
|
log(`Connecting to ${YATS_MCP_URL}...`);
|
|
97
98
|
const tools = await fetchTools();
|
|
98
|
-
log(`Fetched ${tools.length} tools — default repo: "${
|
|
99
|
+
log(`Fetched ${tools.length} tools — default repo: "${DEFAULT_REPO_NAME}" (${DEFAULT_REPO_PATH})`);
|
|
99
100
|
|
|
100
101
|
const rl = createInterface({ input: process.stdin, terminal: false });
|
|
101
102
|
let pending = 0;
|
|
@@ -141,9 +142,10 @@ async function start() {
|
|
|
141
142
|
const toolName = params?.name;
|
|
142
143
|
const toolArgs = params?.arguments || {};
|
|
143
144
|
|
|
144
|
-
// Auto-inject
|
|
145
|
+
// Auto-inject repo (full path) + name if missing
|
|
145
146
|
if (REPO_TOOLS.has(toolName) && !toolArgs.repository && !toolArgs.path) {
|
|
146
|
-
toolArgs.
|
|
147
|
+
toolArgs.path = DEFAULT_REPO_PATH;
|
|
148
|
+
toolArgs.repository = DEFAULT_REPO_NAME;
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
log(`call: ${toolName}(${JSON.stringify(toolArgs).slice(0, 200)})`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Terraform's provider system work? Find how providers are registered, configured, and how the plugin system operates.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Terraform build and walk the dependency graph? Find the graph construction and traversal algorithms.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Laravel's service container work? Find the binding resolution, contextual binding, and automatic injection.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Laravel handle HTTP routing? Find the route registration, middleware pipeline, and controller dispatch.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Symfony's dependency injection container work? Find the compiled container, service definitions, and autowiring.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Symfony's event dispatcher work? Find how events are registered, dispatched, and how listeners/subscribers are resolved.
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## Question: How does middleware work in FastAPI?
|
|
2
|
-
|
|
3
|
-
Find and explain the middleware stack: how middleware is registered, in what order it executes, and what built-in middleware FastAPI provides.
|
|
4
|
-
|
|
5
|
-
### Expected answer should cover:
|
|
6
|
-
- The `build_middleware_stack` method in `fastapi/applications.py`
|
|
7
|
-
- Order: ServerErrorMiddleware → user middleware → ExceptionMiddleware → AsyncExitStackMiddleware
|
|
8
|
-
- How `@app.middleware("http")` registers custom middleware
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
## Question: How is routing implemented in FastAPI?
|
|
2
|
-
|
|
3
|
-
Trace how HTTP routes are registered, stored, and dispatched. Find the key classes and methods involved.
|
|
4
|
-
|
|
5
|
-
### Expected answer should cover:
|
|
6
|
-
- `APIRouter` class and its `add_api_route` method
|
|
7
|
-
- How decorators like `@app.get("/path")` register routes
|
|
8
|
-
- The relationship between `Route`, `APIRoute`, and path operations
|
|
9
|
-
- How dependencies are injected into route handlers
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Django's middleware system work? Find the middleware chain and how request/response processing flows through it.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Django's ORM work? Trace how a model query like `User.objects.filter(name="John")` gets translated to SQL and executed.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does NestJS use decorators for dependency injection and route registration? Find the key decorator implementations.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does NestJS module system work? Trace how modules are defined, imported, and how providers are resolved across module boundaries.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Next.js handle server-side rendering vs static generation? Find the key functions and components involved.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
How does Next.js file-based routing work? Find the routing implementation and how dynamic routes are resolved.
|
|
File without changes
|
|
File without changes
|