@cogitator-ai/express 0.8.16 → 0.8.17

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.
Files changed (2) hide show
  1. package/README.md +1 -1
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -60,7 +60,7 @@ POST /api/agents/:name/resume - Resume a run paused for tool approvals
60
60
 
61
61
  Run/stream body: `{ input: string; context?: object; threadId?: string }`. `input` must contain more than whitespace and `threadId`, when sent, must be a non-empty string (`400 INVALID_INPUT` otherwise, before the model is called). The validator comes from `@cogitator-ai/server-shared`, so Express, Fastify, Hono and Koa refuse exactly the same bodies. The `usage` of a run answer carries `inputTokens`, `outputTokens` and `totalTokens`, plus `reasoningTokens`, `cachedInputTokens` and `cacheWriteTokens` when the model reported them, the same shape as every other adapter. The `finish` event of an agent stream carries the same `usage` (never the run's cost or duration). The agent list exposes `config.description`, never the agent instructions. The authenticated `userId` (from `auth`) is passed to the run, and the run is aborted when the client disconnects.
62
62
 
63
- - A run puts `context` into the system prompt, and the model reads a `system` thread message as operator instructions, so clients may set neither unless the server allows it: `acceptContext` lists the `context` keys clients may send (`true` accepts any key, for clients trusted like your own code), and `threadMessageRoles` the roles of `POST /threads/:id/messages` (`user` and `assistant` by default). Anything else is refused with `400 INVALID_INPUT`, over HTTP and WebSocket alike.
63
+ - A run sends `context` to the model as data the application supplied, and the model reads a `system` thread message as operator instructions, so clients may set neither unless the server allows it: `acceptContext` lists the `context` keys clients may send (`true` accepts any key, for clients trusted like your own code), and `threadMessageRoles` the roles of `POST /threads/:id/messages` (`user` and `assistant` by default). Anything else is refused with `400 INVALID_INPUT`, over HTTP and WebSocket alike.
64
64
  - A `POST` body that is not JSON (`text/plain`, a form) is refused with `415 UNSUPPORTED_MEDIA_TYPE` before it is parsed: browsers send those across origins without a CORS preflight.
65
65
  - `POST /agents/:name/run` and `/resume` answer `toAgentRunResponse()` of `@cogitator-ai/server-shared`: `output`, `threadId`, `usage`, `toolCalls` (`{ id, name, arguments }`), `status` and `traceId`, plus `reasoning`, `pendingApprovals`, `structured`, `structuredError`, `truncated`, `blocked` and `iterationLimitReached` when they apply. The WebSocket `complete` event carries the same object, never the system prompt, the history, trace spans or a paused run's checkpoint.
66
66
  - The `start` event of an agent stream names the run's thread (the request's `threadId`, or a new one), and `finish` repeats it with the run's outcome, so a client that sent no thread continues the conversation with this one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cogitator-ai/express",
3
- "version": "0.8.16",
3
+ "version": "0.8.17",
4
4
  "description": "Express.js server adapter for Cogitator AI runtime",
5
5
  "type": "module",
6
6
  "exports": {
@@ -20,21 +20,21 @@
20
20
  "node": ">=22.12.0"
21
21
  },
22
22
  "dependencies": {
23
- "@cogitator-ai/core": "0.49.0",
24
- "@cogitator-ai/types": "0.51.0",
25
- "@cogitator-ai/server-shared": "0.5.16"
23
+ "@cogitator-ai/core": "0.50.0",
24
+ "@cogitator-ai/types": "0.52.0",
25
+ "@cogitator-ai/server-shared": "0.5.17"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "express": ">=4.18.0"
29
29
  },
30
30
  "optionalDependencies": {
31
- "@cogitator-ai/workflows": "0.13.3",
32
- "@cogitator-ai/swarms": "0.13.3",
31
+ "@cogitator-ai/workflows": "0.13.4",
32
+ "@cogitator-ai/swarms": "0.13.4",
33
33
  "ws": "^8.22.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@cogitator-ai/workflows": "0.13.3",
37
- "@cogitator-ai/swarms": "0.13.3",
36
+ "@cogitator-ai/workflows": "0.13.4",
37
+ "@cogitator-ai/swarms": "0.13.4",
38
38
  "@types/express": "^5.0.6",
39
39
  "@types/supertest": "^7.2.1",
40
40
  "@types/ws": "^8.18.2",