@ai-matrx/desktop-protocol 0.17.1 → 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 +12 -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 +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -1
- 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 +21 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +6 -0
- package/dist/react.d.ts +6 -0
- package/dist/react.js +21 -3
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
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
|
+
|
|
3
9
|
## 0.17.1
|
|
4
10
|
|
|
5
11
|
- buildToolStatus: a uuid in a test name (the agent a chat proof ran) is not part of the proof's
|
|
@@ -14,6 +20,11 @@ Consumer action: none.
|
|
|
14
20
|
every `refreshMs` while the page is visible, never while hidden, and at once on return. Matrx 2's
|
|
15
21
|
screens each carried their own `setInterval` loop (five shapes); this is the one. Guard:
|
|
16
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 …").
|
|
17
28
|
- **`useDesktopAction({ onDone })`: a screen's writes.** One `busy` flag and one typed error for
|
|
18
29
|
create/save/remove/open, with a refetch after each success. Replaces the per-screen
|
|
19
30
|
`busy`/`error` `useState` pairs. Guard: `src/react.test.tsx` ("useDesktopAction tracks busy …").
|
|
@@ -295,3 +306,4 @@ Defects found in the draft and fixed here (not preserved):
|
|
|
295
306
|
|
|
296
307
|
None — new package.
|
|
297
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 };
|