@ai-matrx/desktop-protocol 0.17.1 → 0.17.3

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/dist/client.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BackoffOptions } from '@ai-matrx/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
3
3
  import { z } from 'zod';
4
- import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-Dj_B9wHj.cjs';
5
- export { i as isDesktopProtocolError } from './models-Dj_B9wHj.cjs';
4
+ import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-BiquRLLO.cjs';
5
+ export { i as isDesktopProtocolError } from './models-BiquRLLO.cjs';
6
6
  import { FrameHeader } from './frame.cjs';
7
7
 
8
8
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BackoffOptions } from '@ai-matrx/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
3
3
  import { z } from 'zod';
4
- import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-Dj_B9wHj.js';
5
- export { i as isDesktopProtocolError } from './models-Dj_B9wHj.js';
4
+ import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-BiquRLLO.js';
5
+ export { i as isDesktopProtocolError } from './models-BiquRLLO.js';
6
6
  import { FrameHeader } from './frame.js';
7
7
 
8
8
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { RECONNECT_ALARM_ATTEMPTS, createBackoff } from "@ai-matrx/realtime";
3
3
 
4
4
  // src/error.ts
5
- var DesktopProtocolError = class extends Error {
5
+ var DesktopProtocolError = class _DesktopProtocolError extends Error {
6
6
  code;
7
7
  retryable;
8
8
  data;
@@ -13,6 +13,23 @@ var DesktopProtocolError = class extends Error {
13
13
  this.retryable = options.retryable ?? false;
14
14
  this.data = options.data;
15
15
  }
16
+ /**
17
+ * Any thrown value as a DesktopProtocolError, keeping its code, message and data. Each built entry
18
+ * (`.`, `./client`, `./react`) carries its own copy of this class, so `instanceof` alone misses an
19
+ * error thrown by a sibling entry and reports a real NOT_FOUND as INTERNAL; this checks the shape.
20
+ */
21
+ static from(caught) {
22
+ if (caught instanceof _DesktopProtocolError) return caught;
23
+ const e = caught;
24
+ if (e && typeof e === "object" && e.name === "DesktopProtocolError" && typeof e.code === "string") {
25
+ return new _DesktopProtocolError(e.code, typeof e.message === "string" ? e.message : String(e.code), {
26
+ retryable: e.retryable === true,
27
+ ...e.data && typeof e.data === "object" ? { data: e.data } : {},
28
+ cause: caught
29
+ });
30
+ }
31
+ return new _DesktopProtocolError("INTERNAL", caught instanceof Error ? caught.message : String(caught), { cause: caught });
32
+ }
16
33
  /** The wire body (ProtocolErrorBody) — what a core or relay sends for this error. */
17
34
  toBody() {
18
35
  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 };
@@ -94,7 +111,7 @@ import { z as z2 } from "zod";
94
111
  // src/schema/primitives.ts
95
112
  import { z } from "zod";
96
113
  var PROTOCOL_MAJOR = 1;
97
- var PROTOCOL_MINOR = 6;
114
+ var PROTOCOL_MINOR = 7;
98
115
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
99
116
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
100
117
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -912,7 +929,15 @@ var WindowInfo = z15.strictObject({
912
929
  x: z15.int(),
913
930
  y: z15.int(),
914
931
  width: z15.int().min(0),
915
- height: z15.int().min(0)
932
+ height: z15.int().min(0),
933
+ /**
934
+ * The application that owns the window, by the name the OS shows people; absent when the OS does
935
+ * not say. Optional (never null, the schema rule) because it was added in protocol 1.7: an older
936
+ * app's answer has no such field (FIELDS_SINCE).
937
+ */
938
+ app: z15.string().max(256).optional(),
939
+ /** The owning process id; absent when the OS does not say. Added in protocol 1.7. */
940
+ pid: z15.int().min(0).optional()
916
941
  });
917
942
  var WindowListParams = z15.strictObject({
918
943
  /** Case-insensitive substring of the window title. */