@ai-matrx/desktop-protocol 0.17.0 → 0.17.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 +30 -0
- package/dist/client.cjs +18 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +18 -1
- package/dist/client.js.map +1 -1
- package/dist/frame.cjs +18 -1
- package/dist/frame.cjs.map +1 -1
- package/dist/frame.js +18 -1
- package/dist/frame.js.map +1 -1
- package/dist/index.cjs +20 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -8
- package/dist/index.d.ts +3 -8
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/{models-Dj_B9wHj.d.cts → models-QWCUcQuU.d.cts} +8 -2
- package/dist/{models-Dj_B9wHj.d.ts → models-QWCUcQuU.d.ts} +8 -2
- package/dist/react.cjs +71 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +27 -1
- package/dist/react.d.ts +27 -1
- package/dist/react.js +71 -2
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.17.2
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/desktop-protocol/v0.17.1..npm/desktop-protocol/v0.17.2 -- apps/shared/desktop-protocol`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.17.1
|
|
10
|
+
|
|
11
|
+
- buildToolStatus: a uuid in a test name (the agent a chat proof ran) is not part of the proof's
|
|
12
|
+
identity, so the same proof under a new test agent replaces the old agent's result instead of
|
|
13
|
+
standing beside it forever.
|
|
14
|
+
|
|
15
|
+
Consumer action: none.
|
|
16
|
+
|
|
17
|
+
## Unreleased
|
|
18
|
+
|
|
19
|
+
- **`useDesktopRequest(op, params, { refreshMs })`: live data without a hand-rolled poller.** Re-runs
|
|
20
|
+
every `refreshMs` while the page is visible, never while hidden, and at once on return. Matrx 2's
|
|
21
|
+
screens each carried their own `setInterval` loop (five shapes); this is the one. Guard:
|
|
22
|
+
`src/react.test.tsx` ("refreshMs polls while visible …").
|
|
23
|
+
- **Errors keep their code across built entries.** `DesktopProtocolError.from(caught)` recognises an
|
|
24
|
+
error thrown by a sibling entry's copy of the class (each built entry carries its own), so a
|
|
25
|
+
real `NOT_FOUND` "No file at that path" no longer surfaces as a generic `INTERNAL`. The hooks use
|
|
26
|
+
it, and `useDesktopAction` treats `CANCELLED` (the person pressed Stop) as no error. Guard:
|
|
27
|
+
`src/react.test.tsx` ("an error from another copy …").
|
|
28
|
+
- **`useDesktopAction({ onDone })`: a screen's writes.** One `busy` flag and one typed error for
|
|
29
|
+
create/save/remove/open, with a refetch after each success. Replaces the per-screen
|
|
30
|
+
`busy`/`error` `useState` pairs. Guard: `src/react.test.tsx` ("useDesktopAction tracks busy …").
|
|
31
|
+
|
|
3
32
|
## 0.17.0 (protocol 1.6)
|
|
4
33
|
|
|
5
34
|
- The `audio` capability: `audio.devices` (microphones and speakers), `audio.record` (a clip to a
|
|
@@ -277,3 +306,4 @@ Defects found in the draft and fixed here (not preserved):
|
|
|
277
306
|
|
|
278
307
|
None — new package.
|
|
279
308
|
|
|
309
|
+
|
package/dist/client.cjs
CHANGED
|
@@ -34,7 +34,7 @@ module.exports = __toCommonJS(client_exports);
|
|
|
34
34
|
var import_realtime = require("@ai-matrx/realtime");
|
|
35
35
|
|
|
36
36
|
// src/error.ts
|
|
37
|
-
var DesktopProtocolError = class extends Error {
|
|
37
|
+
var DesktopProtocolError = class _DesktopProtocolError extends Error {
|
|
38
38
|
code;
|
|
39
39
|
retryable;
|
|
40
40
|
data;
|
|
@@ -45,6 +45,23 @@ var DesktopProtocolError = class extends Error {
|
|
|
45
45
|
this.retryable = options.retryable ?? false;
|
|
46
46
|
this.data = options.data;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Any thrown value as a DesktopProtocolError, keeping its code, message and data. Each built entry
|
|
50
|
+
* (`.`, `./client`, `./react`) carries its own copy of this class, so `instanceof` alone misses an
|
|
51
|
+
* error thrown by a sibling entry and reports a real NOT_FOUND as INTERNAL; this checks the shape.
|
|
52
|
+
*/
|
|
53
|
+
static from(caught) {
|
|
54
|
+
if (caught instanceof _DesktopProtocolError) return caught;
|
|
55
|
+
const e = caught;
|
|
56
|
+
if (e && typeof e === "object" && e.name === "DesktopProtocolError" && typeof e.code === "string") {
|
|
57
|
+
return new _DesktopProtocolError(e.code, typeof e.message === "string" ? e.message : String(e.code), {
|
|
58
|
+
retryable: e.retryable === true,
|
|
59
|
+
...e.data && typeof e.data === "object" ? { data: e.data } : {},
|
|
60
|
+
cause: caught
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return new _DesktopProtocolError("INTERNAL", caught instanceof Error ? caught.message : String(caught), { cause: caught });
|
|
64
|
+
}
|
|
48
65
|
/** The wire body (ProtocolErrorBody) — what a core or relay sends for this error. */
|
|
49
66
|
toBody() {
|
|
50
67
|
return this.data === void 0 ? { code: this.code, message: this.message, retryable: this.retryable } : { code: this.code, message: this.message, retryable: this.retryable, data: this.data };
|