@axlsdk/studio 0.13.8 → 0.14.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 +54 -1
- package/dist/{chunk-YWRYXT7U.js → chunk-HUKUQDYL.js} +232 -90
- package/dist/chunk-HUKUQDYL.js.map +1 -0
- package/dist/{chunk-6VDX5CRP.js → chunk-JGQ3MSIG.js} +5 -2
- package/dist/chunk-JGQ3MSIG.js.map +1 -0
- package/dist/cli.cjs +246 -96
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +8 -3
- package/dist/cli.js.map +1 -1
- package/dist/client/assets/index-7aDhMztu.css +1 -0
- package/dist/client/assets/index-Bzr3vDPz.js +255 -0
- package/dist/client/index.html +2 -2
- package/dist/middleware.cjs +235 -93
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.js +2 -2
- package/dist/server/index.cjs +232 -90
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +1 -1
- package/package.json +5 -4
- package/dist/chunk-6VDX5CRP.js.map +0 -1
- package/dist/chunk-YWRYXT7U.js.map +0 -1
- package/dist/client/assets/index-C_uwupnn.js +0 -221
- package/dist/client/assets/index-DVcH6P9w.css +0 -1
package/README.md
CHANGED
|
@@ -148,7 +148,9 @@ Studio exposes a REST API that the SPA consumes. You can also call these directl
|
|
|
148
148
|
| `GET /api/evals/history` | List eval run history |
|
|
149
149
|
| `POST /api/evals/:name/run` | Run a registered eval by name. Accepts `{ runs: N }` (capped at 25) |
|
|
150
150
|
| `POST /api/evals/:name/rescore` | Re-score a history entry with the eval's current scorers |
|
|
151
|
-
| `POST /api/evals/
|
|
151
|
+
| `POST /api/evals/import` | Import a CLI eval artifact (parsed `EvalResult` JSON) into runtime history |
|
|
152
|
+
| `DELETE /api/evals/history/:id` | Delete a single history entry. Blocked in readOnly |
|
|
153
|
+
| `POST /api/evals/compare` | Compare two eval results by history ID. Body: `{ baselineId, candidateId, options? }` where each ID is `string` (single run) or `string[]` (pooled multi-run). Resolves IDs server-side from `runtime.getEvalHistory()` so the wire payload stays small |
|
|
152
154
|
| `POST /api/playground/chat` | Chat with an agent directly (no workflow required). Accepts `{ message, agent?, sessionId? }`. Streams results via WebSocket |
|
|
153
155
|
| `GET /api/decisions` | List pending decisions |
|
|
154
156
|
| `POST /api/decisions/:id/resolve` | Resolve a pending decision |
|
|
@@ -220,6 +222,57 @@ studio.upgradeWebSocket(server);
|
|
|
220
222
|
|
|
221
223
|
**Note:** `upgradeWebSocket(server)` is required for real-time features (trace streaming, cost updates, execution events, decision resolution). Without it, the Studio SPA loads but panels relying on live data will show no updates. If your framework manages WebSocket connections itself (NestJS gateway, Fastify plugin), use `handleWebSocket()` instead.
|
|
222
224
|
|
|
225
|
+
### Host body limits
|
|
226
|
+
|
|
227
|
+
Studio's API uses small request bodies — the eval comparison flow sends history IDs (~100 bytes), not full result payloads — so the default body limits in Express, NestJS, Fastify, and Koa (typically 100KB) are sufficient for normal use.
|
|
228
|
+
|
|
229
|
+
The one exception is `POST /api/evals/import`, which accepts a full `EvalResult` JSON (typically a CLI artifact from `axl-eval --output result.json`). If you import sizeable eval files through Studio, raise your host framework's JSON body limit *on the Studio sub-mount only*.
|
|
230
|
+
|
|
231
|
+
**Express:**
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
import express from 'express';
|
|
235
|
+
const app = express();
|
|
236
|
+
// Larger limit just for Studio; the rest of the app keeps its defaults.
|
|
237
|
+
app.use('/studio', express.json({ limit: '10mb' }), studio.handler);
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**NestJS:** NestJS registers its own body-parser at bootstrap, so `app.use(express.json(...))` added after `NestFactory.create()` does *not* override it — the built-in parser runs first and still rejects with `PayloadTooLargeError`. Disable the built-in parser and register a conditional one:
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
// main.ts
|
|
244
|
+
import { NestFactory, HttpAdapterHost } from '@nestjs/core';
|
|
245
|
+
import { json } from 'express';
|
|
246
|
+
import { AppModule } from './app.module';
|
|
247
|
+
import { createStudioMiddleware } from '@axlsdk/studio/middleware';
|
|
248
|
+
|
|
249
|
+
async function bootstrap() {
|
|
250
|
+
// Disable Nest's built-in body parser so we control limits ourselves.
|
|
251
|
+
const app = await NestFactory.create(AppModule, { bodyParser: false });
|
|
252
|
+
|
|
253
|
+
// Apply 10 MB limit to the Studio sub-mount only; rest of the app keeps
|
|
254
|
+
// the 100 KB default. This is the maintainer-endorsed pattern for
|
|
255
|
+
// per-route body limits in NestJS (see nestjs/nest#14734).
|
|
256
|
+
const studioJson = json({ limit: '10mb' });
|
|
257
|
+
const defaultJson = json();
|
|
258
|
+
app.use((req, res, next) =>
|
|
259
|
+
req.url.startsWith('/studio') ? studioJson(req, res, next) : defaultJson(req, res, next),
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
const studio = createStudioMiddleware({ runtime });
|
|
263
|
+
const expressApp = app.get(HttpAdapterHost).httpAdapter.getInstance();
|
|
264
|
+
expressApp.use('/studio', studio.handler);
|
|
265
|
+
studio.upgradeWebSocket(app.getHttpServer());
|
|
266
|
+
|
|
267
|
+
await app.listen(3000);
|
|
268
|
+
}
|
|
269
|
+
bootstrap();
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
> `app.useBodyParser('json', { limit })` raises the limit **globally**, not per-route — avoid it if you want the larger limit scoped to Studio.
|
|
273
|
+
|
|
274
|
+
**Fastify:** set `bodyLimit` on the Fastify instance or pass it via `fastify({ bodyLimit: 10 * 1024 * 1024 })`. There's no per-route equivalent as clean as Express's; if Studio is the only route that needs a larger limit, either raise the global limit or mount Studio on a separate Fastify instance.
|
|
275
|
+
|
|
223
276
|
### Framework examples
|
|
224
277
|
|
|
225
278
|
#### NestJS
|