@mercury-fw/channel-http 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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mercury-fw/channel-http
2
2
 
3
+ ## 0.13.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1e7fdeb: - `POST /turn { resume: true }` with nothing left to resume streams a single `final` whose text says the answer is no longer available, instead of an empty one, which a UI shows like any answer; an empty `final` now always means the model had nothing to add.
8
+ - Needs the framework at 0.61 or later (peer range raised).
9
+
3
10
  ## 0.13.1
4
11
 
5
12
  ### Patch Changes
package/README.md CHANGED
@@ -4,7 +4,7 @@ Gives a [Mercury](https://github.com/lucabro81/mercury-fw) agent an HTTP surface
4
4
 
5
5
  On Mercury's documentation site: [its page](https://lucabro81.github.io/mercury-fw/plugins/channel-http/).
6
6
 
7
- This version is written for version 6 of the channel contract, the one that brings the channels' texts in the person's language, and needs the framework at 0.59 or later, the first whose core gives channels its version (`GET /version`). A core with an older contract skips it, and the log says why.
7
+ This version is written for version 6 of the channel contract, the one that brings the channels' texts in the person's language, and needs the framework at 0.61 or later, the first whose core says when a resumed turn's answer is no longer available (`resume` below); since 0.59 the core gives channels its version (`GET /version`). A core with an older contract skips it, and the log says why.
8
8
 
9
9
  ```bash
10
10
  bun add @mercury-fw/channel-http
@@ -51,7 +51,7 @@ Runs one conversational turn; the reply streams back as Server-Sent Events.
51
51
  |---|---|---|---|
52
52
  | `text` | string | yes, unless `opening` or `resume` | The user message. A bare confirmation token here confirms a staged action (see the `pending` event) without invoking the model; when the action hands its result back to the model, the model's answer streams on this same request. |
53
53
  | `opening` | `true` | no | The assistant speaks first, before the person writes anything: what a UI asks right after someone signs in, when `GET /me` says the assistant doesn't know their name. It introduces itself and asks how to call them, and saves the answer once they give it. For someone it already knows, the stream is a single `final` with an empty text. Needs `conversationId`; `text` is ignored. |
54
- | `resume` | `true` | no | The turn a `POST /confirm` answered `resume: true` for: the model answers on what the confirmed action handed back. Needs `conversationId`; `text` is ignored. With nothing to resume, the stream is a single `final` with an empty text. |
54
+ | `resume` | `true` | no | The turn a `POST /confirm` answered `resume: true` for: the model answers on what the confirmed action handed back. Needs `conversationId`; `text` is ignored. With nothing left to resume (more than five minutes after the confirmation, a restart in between, or a turn already resumed), the stream is a single `final` whose text says the answer is no longer available, in the person's language. |
55
55
  | `conversationId` | string | no | Opaque, client-owned id that continues one of your conversations: letters, digits, `-` and `_`, up to 128 characters (a UUID fits) once surrounding whitespace is trimmed, `400` otherwise. Sent again, however long after, it continues that conversation, rebuilt from the archive if Mercury had freed it (see `HTTP_SURFACE_RESUME_MAX_CHARS`). Omitted ⇒ a fresh one-off session that can't be continued. |
56
56
 
57
57
  **Responses**: `200 text/event-stream` (the events below); `400` if `text` is missing, an opening has no `conversationId`, the body isn't JSON, or `conversationId` has other characters than the ones above.
package/openapi.yaml CHANGED
@@ -80,7 +80,9 @@ info:
80
80
  (a page read after the caller allowed it, for example). Confirming one by
81
81
  `POST /turn` streams the model's answer on that same stream; `POST /confirm`
82
82
  answers `resume: true`, and the client then opens
83
- `POST /turn { resume: true, conversationId }` to hear it.
83
+ `POST /turn { resume: true, conversationId }` to hear it. The answer waits
84
+ five minutes and is heard once: later, after a restart, or a second time,
85
+ that `final`'s text says it's no longer available.
84
86
  security:
85
87
  - bearerAuth: []
86
88
  servers:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercury-fw/channel-http",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,11 +18,11 @@
18
18
  "access": "public"
19
19
  },
20
20
  "peerDependencies": {
21
- "@mercury-fw/channel-types": ">=0.59.0 <1.0.0"
21
+ "@mercury-fw/channel-types": ">=0.61.0 <1.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@mercury-fw/channel-types": "0.59.2",
25
- "@mercury-fw/plugin-types": "0.59.2",
24
+ "@mercury-fw/channel-types": "0.61.0",
25
+ "@mercury-fw/plugin-types": "0.61.0",
26
26
  "@mercury-fw/typescript-config": "*",
27
27
  "@types/bun": "^1.4.2",
28
28
  "typescript": "^6.0.3"