@seclai/handlers 0.0.16 → 0.0.18

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 CHANGED
@@ -8,6 +8,14 @@ Server handlers for running [Seclai](https://seclai.com) agents from a web app.
8
8
  npm install @seclai/handlers
9
9
  ```
10
10
 
11
+ ### Module format
12
+
13
+ `@seclai/handlers` ships as ES modules only. Bundlers and `import` work as usual. CommonJS code can `require` it on Node 22.12 or later, which the package requires; Node 22.12 and Node 23.0 to 23.4 print an `ExperimentalWarning` the first time, and Node 22.13+ and 23.5+ don't.
14
+
15
+ In a TypeScript CommonJS project, set `module` to `nodenext` (TypeScript 5.8+) or `node20` (TypeScript 5.9+), so the compiler allows that `require`. With `node16` or `node18` it reports error TS1479 on the import. `commonjs` with `moduleResolution` `node10` and the `bundler` setting work as they are.
16
+
17
+ Jest's default CommonJS mode doesn't transform packages in `node_modules`, so tell it to transform this one, for example with `transformIgnorePatterns: ["/node_modules/(?!(\\.pnpm/)?@seclai[/+])"]` (the `.pnpm` part covers pnpm's layout), using a transform that converts ES modules to CommonJS, such as `babel-jest` with `@babel/preset-env`. Vitest needs no setup.
18
+
11
19
  ## Usage
12
20
 
13
21
  `createSeclaiHandlers` returns a function per endpoint, each taking a `Request` and returning a `Promise<Response>`, plus `handle`, which serves all of them from one catch-all route.
@@ -349,7 +357,7 @@ The lines never include the API key, the input text, or file contents. A logger
349
357
 
350
358
  ## Runtimes
351
359
 
352
- The handlers need only Web APIs and a global `fetch`, so they are designed for Vercel, Netlify, Cloudflare Workers, Node 18+, Deno and Bun.
360
+ The handlers need only Web APIs and a global `fetch`, so they are designed for Vercel, Netlify, Cloudflare Workers, Node 22.12+, Deno and Bun.
353
361
 
354
362
  On Cloudflare Workers, the `nodejs_compat` flag isn't needed. Create the handlers inside your `fetch` handler, since that's where `env` holds your API key.
355
363
 
package/package.json CHANGED
@@ -1,22 +1,15 @@
1
1
  {
2
2
  "name": "@seclai/handlers",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "Framework-free server handlers for running Seclai agents from a web app: upload, run with SSE relay, and download proxy.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "main": "./dist/index.cjs",
8
- "module": "./dist/index.js",
7
+ "main": "./dist/index.js",
9
8
  "types": "./dist/index.d.ts",
10
9
  "exports": {
11
10
  ".": {
12
- "import": {
13
- "types": "./dist/index.d.ts",
14
- "default": "./dist/index.js"
15
- },
16
- "require": {
17
- "types": "./dist/index.d.cts",
18
- "default": "./dist/index.cjs"
19
- }
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
20
13
  },
21
14
  "./package.json": "./package.json"
22
15
  },
@@ -25,7 +18,7 @@
25
18
  ],
26
19
  "sideEffects": false,
27
20
  "engines": {
28
- "node": ">=18"
21
+ "node": ">=22.12"
29
22
  },
30
23
  "publishConfig": {
31
24
  "access": "public"