agentic-server 0.30.2 → 0.30.3
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/esm/server.js +3 -1
- package/package.json +2 -2
- package/server.d.ts +2 -0
- package/server.js +4 -2
- package/types.d.ts +5 -0
package/esm/server.js
CHANGED
|
@@ -13,13 +13,15 @@ const IDENTITY_HEADERS = [
|
|
|
13
13
|
'x-attempt',
|
|
14
14
|
'x-run-id'
|
|
15
15
|
];
|
|
16
|
+
/** An image arrives inside the JSON body as base64, a third larger than its bytes. */
|
|
17
|
+
export const DEFAULT_BODY_LIMIT = '32mb';
|
|
16
18
|
/**
|
|
17
19
|
* Create a standalone Express app for the agentic server.
|
|
18
20
|
* Used by both standalone mode and integration tests.
|
|
19
21
|
*/
|
|
20
22
|
export const createAgenticServer = (options) => {
|
|
21
23
|
const app = express();
|
|
22
|
-
app.use(express.json());
|
|
24
|
+
app.use(express.json({ limit: options.bodyLimit ?? DEFAULT_BODY_LIMIT }));
|
|
23
25
|
// When isPublic === true, strip identity headers from all incoming requests.
|
|
24
26
|
// Public deployments cannot trust client-supplied tenant context.
|
|
25
27
|
// When isPublic === false (default), the server is on a private network
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-server",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.3",
|
|
4
4
|
"description": "Standalone OpenAI-compatible LLM gateway — multi-provider proxy with pluggable inference metering",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"metering",
|
|
52
52
|
"constructive"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "ec9e10035b145bbdedb8b61e83252dff41a5baf0"
|
|
55
55
|
}
|
package/server.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { AgenticServerOptions } from './types';
|
|
|
3
3
|
export interface AgenticServerStartOptions extends AgenticServerOptions {
|
|
4
4
|
port?: number;
|
|
5
5
|
}
|
|
6
|
+
/** An image arrives inside the JSON body as base64, a third larger than its bytes. */
|
|
7
|
+
export declare const DEFAULT_BODY_LIMIT = "32mb";
|
|
6
8
|
/**
|
|
7
9
|
* Create a standalone Express app for the agentic server.
|
|
8
10
|
* Used by both standalone mode and integration tests.
|
package/server.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createAgenticServer = void 0;
|
|
6
|
+
exports.createAgenticServer = exports.DEFAULT_BODY_LIMIT = void 0;
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
8
|
const router_1 = require("./router");
|
|
9
9
|
/** Identity + task-correlation headers trusted only when isPublic === false
|
|
@@ -19,13 +19,15 @@ const IDENTITY_HEADERS = [
|
|
|
19
19
|
'x-attempt',
|
|
20
20
|
'x-run-id'
|
|
21
21
|
];
|
|
22
|
+
/** An image arrives inside the JSON body as base64, a third larger than its bytes. */
|
|
23
|
+
exports.DEFAULT_BODY_LIMIT = '32mb';
|
|
22
24
|
/**
|
|
23
25
|
* Create a standalone Express app for the agentic server.
|
|
24
26
|
* Used by both standalone mode and integration tests.
|
|
25
27
|
*/
|
|
26
28
|
const createAgenticServer = (options) => {
|
|
27
29
|
const app = (0, express_1.default)();
|
|
28
|
-
app.use(express_1.default.json());
|
|
30
|
+
app.use(express_1.default.json({ limit: options.bodyLimit ?? exports.DEFAULT_BODY_LIMIT }));
|
|
29
31
|
// When isPublic === true, strip identity headers from all incoming requests.
|
|
30
32
|
// Public deployments cannot trust client-supplied tenant context.
|
|
31
33
|
// When isPublic === false (default), the server is on a private network
|
package/types.d.ts
CHANGED
|
@@ -33,6 +33,11 @@ export interface AgenticServerOptions {
|
|
|
33
33
|
* When true, identity headers are stripped from incoming requests
|
|
34
34
|
* (external clients cannot set tenant context). */
|
|
35
35
|
isPublic?: boolean;
|
|
36
|
+
/** Largest JSON request body accepted, as express.json's `limit` (bytes, or
|
|
37
|
+
* a string such as '32mb'). A request carries an image as base64 — an embed
|
|
38
|
+
* input, a chat image part — so express's 100kb default refuses any real
|
|
39
|
+
* one with a 413. Default: '32mb'. */
|
|
40
|
+
bodyLimit?: number | string;
|
|
36
41
|
}
|
|
37
42
|
export interface ResolvedProvider {
|
|
38
43
|
name?: string;
|