@cogitator-ai/express 0.13.1 → 0.13.2
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 +2 -2
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -248,9 +248,9 @@ await fetch('/api/agents/support/resume', {
|
|
|
248
248
|
});
|
|
249
249
|
```
|
|
250
250
|
|
|
251
|
-
The body is `{ threadId, decisions?, defaultDecision? }`, where a decision is `{ approved: boolean, reason?: string }
|
|
251
|
+
The body is `{ threadId, decisions?, defaultDecision? }`, where a decision is `{ approved: boolean, reason?: string, updatedArguments?: object, remember?: boolean | { rule?: string, layer?: string } }` (see [Permissions](https://cogitator.app/docs/tools/permissions#always-allow)); malformed bodies get `400 INVALID_INPUT`. The response has the same shape as `/run` and may pause again for calls left without a decision. The run resumes as the authenticated `userId`: a thread with no paused run answers `409 RUN_NOT_PAUSED`, and another user's paused run `403 THREAD_ACCESS_DENIED`. Over WebSocket, send `{ type: 'resume', id, payload: { name, threadId, decisions?, defaultDecision? } }`; a paused run's `complete` event carries `status` and `pendingApprovals`.
|
|
252
252
|
|
|
253
|
-
A tool can also ask the user a question with `context.interrupt()`, which pauses the run the same way. The answer then carries `interrupts` (`{ id, kind, reason, message, responseSchema?, expiresAt?, toolCallId?, toolName? }`), the stream sends `{ type: 'interrupt-required', threadId, interrupts }` instead of `approval-required`, and the client resumes with the answers by interrupt id: `{ threadId, responses: { [id]: answer } }`, over HTTP and WebSocket alike (`payload: { name, threadId, responses }`). An answer that does not match its `responseSchema` is refused with `400 INTERRUPT_ANSWER_INVALID`, and one sent after `expiresAt` with `410 INTERRUPT_EXPIRED` (`/resume/stream` sends both as an `error` event with that `code`).
|
|
253
|
+
A tool can also ask the user a question with `context.interrupt()`, which pauses the run the same way. The answer then carries `interrupts` (`{ id, kind, reason, message, responseSchema?, expiresAt?, toolCallId?, toolName?, details? }`, `kind` one of `input`, `plan` and `budget`), the stream sends `{ type: 'interrupt-required', threadId, interrupts }` instead of `approval-required`, and the client resumes with the answers by interrupt id: `{ threadId, responses: { [id]: answer } }`, over HTTP and WebSocket alike (`payload: { name, threadId, responses }`). An answer that does not match its `responseSchema` is refused with `400 INTERRUPT_ANSWER_INVALID`, and one sent after `expiresAt` with `410 INTERRUPT_EXPIRED` (`/resume/stream` sends both as an `error` event with that `code`).
|
|
254
254
|
|
|
255
255
|
A run or stream body may also name a `multitaskStrategy` for a thread that already has a run going on in this Cogitator: `enqueue` waits for that run, `reject` refuses the new run with `THREAD_BUSY`, `interrupt` stops the running one (it fails with `RUN_INTERRUPTED`) and `rollback` stops it and branches from where it started. `POST /agents/:name/run` answers both codes with `409`. A stream has already answered `200` and sent `start` when its run meets the other runs of the thread, so it gets them as an `error` event instead (`{ type: 'error', message, code: 'THREAD_BUSY' }`), and a WebSocket `run` as an `error` frame. Without one the Cogitator's `multitaskStrategy` applies, and any other value is refused with `400 INVALID_INPUT`. The WebSocket `run` payload takes it too. Swarm routes have no thread queue and ignore `multitaskStrategy`.
|
|
256
256
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cogitator-ai/express",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
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.
|
|
24
|
-
"@cogitator-ai/types": "0.
|
|
25
|
-
"@cogitator-ai/server-shared": "0.
|
|
23
|
+
"@cogitator-ai/core": "0.66.0",
|
|
24
|
+
"@cogitator-ai/types": "0.76.0",
|
|
25
|
+
"@cogitator-ai/server-shared": "0.12.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"express": ">=4.18.0"
|
|
29
29
|
},
|
|
30
30
|
"optionalDependencies": {
|
|
31
|
-
"@cogitator-ai/workflows": "0.14.
|
|
32
|
-
"@cogitator-ai/swarms": "0.14.
|
|
31
|
+
"@cogitator-ai/workflows": "0.14.17",
|
|
32
|
+
"@cogitator-ai/swarms": "0.14.17",
|
|
33
33
|
"ws": "^8.22.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@cogitator-ai/workflows": "0.14.
|
|
37
|
-
"@cogitator-ai/swarms": "0.14.
|
|
36
|
+
"@cogitator-ai/workflows": "0.14.17",
|
|
37
|
+
"@cogitator-ai/swarms": "0.14.17",
|
|
38
38
|
"@types/express": "^5.0.6",
|
|
39
39
|
"@types/supertest": "^7.2.1",
|
|
40
40
|
"@types/ws": "^8.18.2",
|