@mitralab.io/sdk-core 0.2.9-beta.0 → 0.2.9-beta.1
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/CHANGELOG.md +12 -0
- package/README.md +15 -11
- package/contracts/README.md +4 -0
- package/contracts/manifest.json +6 -1
- package/contracts/v0.2.9-beta.1/sdk-parity.json +2902 -0
- package/dist/index.cjs +18 -9
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +18 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.2.9-beta.1
|
|
6
|
+
|
|
7
|
+
- Only a business agent's chat (one with an `agentId`) is created with `runtime: "T3"` and asks
|
|
8
|
+
the Copilot for the direct channel. Any other chat is created and streamed as before: 0.2.9-beta.0
|
|
9
|
+
put T3 on every new chat, which the Copilot refuses outside an agent chat
|
|
10
|
+
(`RUNTIME_REQUIRES_AGENT_APP`).
|
|
11
|
+
- A box event stream answered 200 with a type other than `text/event-stream` is a box without
|
|
12
|
+
the HTTP routes: `channelDeclined` `http_unsupported`, without reading it as a stream.
|
|
13
|
+
`AgentFetchResponse` now carries `headers`.
|
|
14
|
+
- Box refusals follow the final POST contract: 409, 400, 413, 503 and 504 reject with
|
|
15
|
+
`AgentTaskTurnError` and the box's `error_code` and `message`, the 504 included.
|
|
16
|
+
|
|
5
17
|
## 0.2.9-beta.0
|
|
6
18
|
|
|
7
19
|
- Take the chat's direct channel to its box as the Agent session transport. Sessions ask the
|
package/README.md
CHANGED
|
@@ -85,12 +85,15 @@ turn. Use `cancel()` when interruption is intended.
|
|
|
85
85
|
|
|
86
86
|
### Direct channel
|
|
87
87
|
|
|
88
|
-
The direct channel is on when the concrete SDK passes `directChannel.apiUrl
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
The direct channel is on when the concrete SDK passes `directChannel.apiUrl`, and it serves a
|
|
89
|
+
business agent's chat, the one with an `agentId`: only those have a box. Any other chat, or any
|
|
90
|
+
chat without `apiUrl`, stays on the event source and REST inputs, with no channel request and
|
|
91
|
+
no T3 default. A business agent's chat asks the Copilot once where it is served
|
|
92
|
+
(`POST /api/v1/tasks/{id}/channel`, through `agentTasks.channel`) and talks to the box that
|
|
93
|
+
answers. The box runs the turn; the Copilot hands out the channel, admits every turn and
|
|
94
|
+
receives the box log. A new business agent's chat is created with `runtime: "T3"` so it is born
|
|
95
|
+
on its box, unless the session names a runtime; the Copilot refuses T3 for any other chat
|
|
96
|
+
(`RUNTIME_REQUIRES_AGENT_APP`).
|
|
94
97
|
|
|
95
98
|
- **Transport.** `websocket` uses the box socket. `http` uses the box's HTTP routes next to the
|
|
96
99
|
socket path: `POST .../api/mitra/chat/messages` to send and `GET .../api/mitra/chat/events`
|
|
@@ -107,8 +110,8 @@ with `runtime: "T3"` so it is born on its box, unless the session names a runtim
|
|
|
107
110
|
- **Fallback, always visible.** When the Copilot answers 202 or an error (a Copilot without
|
|
108
111
|
`/channel`), the body has no `wsUrl`, the host is outside the rule, a `websocket` session has
|
|
109
112
|
no WebSocket, the box cannot be reached (a handshake that times out or is refused, a proxy
|
|
110
|
-
blocking its host, a network error on the HTTP stream), or the box
|
|
111
|
-
|
|
113
|
+
blocking its host, a network error on the HTTP stream), or the box has no HTTP routes (a 404,
|
|
114
|
+
or a stream that is not `text/event-stream`, from a template older than them), the
|
|
112
115
|
session stays on the event source and REST inputs and first emits a raw `channelDeclined`
|
|
113
116
|
event with `reason` `unavailable`, `body`, `host`, `websocket`, or `http_unsupported`.
|
|
114
117
|
- **Runtimes without WebSocket.** Core uses `directChannel.WebSocket` when given, otherwise
|
|
@@ -119,9 +122,10 @@ with `runtime: "T3"` so it is born on its box, unless the session names a runtim
|
|
|
119
122
|
`stepStart` frame on the stream, or the 200 of the HTTP POST, both the box starting the turn
|
|
120
123
|
the Copilot admitted. The session then emits `accepted`, and from there the turn runs and
|
|
121
124
|
reaches the Copilot's log even if this process goes away. A refusal is reported once through
|
|
122
|
-
`error`: an `error` frame on the stream, or
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
`error`: an `error` frame on the stream, or a POST answered 409 (not admitted), 400 (bad
|
|
126
|
+
frame), 413 (too large), 503 (nobody to admit) or 504 (no admission or turn within 30 s), each
|
|
127
|
+
with `{error_code, message}`, which rejects `sendAndWait` with `AgentTaskTurnError` carrying
|
|
128
|
+
that code and message. A box silent for 35 s with the wire up fails the send; a redial pauses that clock and a successful one
|
|
125
129
|
restarts it. Over REST, `accepted` follows the Copilot's 202. A caller that does not
|
|
126
130
|
wait for the answer, such as a Serverless Function, awaits `accepted` before it returns;
|
|
127
131
|
`sendAndWait` waits for the whole turn.
|
package/contracts/README.md
CHANGED
|
@@ -24,6 +24,10 @@ publishes.
|
|
|
24
24
|
|
|
25
25
|
## Versions
|
|
26
26
|
|
|
27
|
+
- `0.2.9-beta.1` is the `0.2.9-beta.0` parity surface republished with the direct channel
|
|
28
|
+
limited to business agent chats and the box refusals of the final contract. Same parity
|
|
29
|
+
cases; the version exists so a consumer pinning the package can pin a corpus with the same number.
|
|
30
|
+
|
|
27
31
|
- `0.2.9-beta.0` is the `0.2.8` parity surface republished with the direct box channel on the
|
|
28
32
|
Agent session and `agentTasks.channel`, which the parity cases do not cover. Same parity cases;
|
|
29
33
|
the version exists so a consumer pinning the package can pin a corpus with the same number.
|
package/contracts/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contract": "SDK-PARITY-001",
|
|
3
|
-
"current": "0.2.9-beta.
|
|
3
|
+
"current": "0.2.9-beta.1",
|
|
4
4
|
"versions": [
|
|
5
5
|
{
|
|
6
6
|
"version": "0.1.0",
|
|
@@ -75,6 +75,11 @@
|
|
|
75
75
|
"version": "0.2.9-beta.0",
|
|
76
76
|
"path": "v0.2.9-beta.0/sdk-parity.json",
|
|
77
77
|
"sha256": "393142e56660b2fd90d51ab5e00fadd8c4454164783da23f0c1fbb264ccf92e0"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"version": "0.2.9-beta.1",
|
|
81
|
+
"path": "v0.2.9-beta.1/sdk-parity.json",
|
|
82
|
+
"sha256": "f0ec4130c399f7102ad20b6dc54ed50da957003d19d3ab811d013ce89b5cde06"
|
|
78
83
|
}
|
|
79
84
|
]
|
|
80
85
|
}
|