@ai-matrx/desktop-protocol 0.4.0 → 0.6.0

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, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, C as ClientType } from './registry-CI-NpQ6L.cjs';
5
- export { i as isDesktopProtocolError } from './registry-CI-NpQ6L.cjs';
4
+ import { W as Welcome, D as DesktopProtocolError, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, C as ClientType } from './registry-jTmq1CsI.cjs';
5
+ export { i as isDesktopProtocolError } from './registry-jTmq1CsI.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, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, C as ClientType } from './registry-CI-NpQ6L.js';
5
- export { i as isDesktopProtocolError } from './registry-CI-NpQ6L.js';
4
+ import { W as Welcome, D as DesktopProtocolError, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, C as ClientType } from './registry-jTmq1CsI.js';
5
+ export { i as isDesktopProtocolError } from './registry-jTmq1CsI.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
@@ -94,7 +94,7 @@ import { z as z2 } from "zod";
94
94
  // src/schema/primitives.ts
95
95
  import { z } from "zod";
96
96
  var PROTOCOL_MAJOR = 1;
97
- var PROTOCOL_MINOR = 0;
97
+ var PROTOCOL_MINOR = 1;
98
98
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
99
99
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
100
100
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -473,8 +473,10 @@ var FsPatchResult = z6.strictObject({
473
473
  applied: nonNegInt,
474
474
  size: nonNegInt,
475
475
  mtime_ms: epochMs,
476
- edits_applied: z6.array(FsPatchEditApplied).max(256),
477
- edits_failed: z6.array(FsPatchEditFailure).max(256)
476
+ /** Since 1.1 (FIELDS_SINCE): a 1.0 app sends only `applied`. Always sent to a ≥1.1 peer. */
477
+ edits_applied: z6.array(FsPatchEditApplied).max(256).optional(),
478
+ /** Since 1.1 (FIELDS_SINCE). */
479
+ edits_failed: z6.array(FsPatchEditFailure).max(256).optional()
478
480
  });
479
481
  var FsSearchPathsParams = z6.strictObject({
480
482
  pattern: z6.string().min(1).max(512),
@@ -614,7 +616,11 @@ var SessionControlChangedEvent = z8.strictObject({ controller_client_id: z8.stri
614
616
  import { z as z9 } from "zod";
615
617
  var RelayDeviceStatusEvent = z9.strictObject({
616
618
  online: z9.boolean(),
617
- since_ms: epochMs,
619
+ /**
620
+ * When the device last went online/offline; null = it has never connected (since 1.1 —
621
+ * NULL_SINCE: a 1.0 reader is sent 0, its old meaning).
622
+ */
623
+ since_ms: epochMs.nullable(),
618
624
  app_version: z9.string().max(32).nullable(),
619
625
  protocol_version: ProtocolVersion.nullable()
620
626
  });
@@ -626,8 +632,18 @@ var RelayCallRequest = z9.strictObject({
626
632
  timeout_ms: z9.int().min(100).max(37e5).default(7e4)
627
633
  });
628
634
  var RelayCallResponse = z9.discriminatedUnion("ok", [
629
- z9.strictObject({ ok: z9.literal(true), result: z9.unknown() }),
630
- z9.strictObject({ ok: z9.literal(false), error: ProtocolErrorBody })
635
+ z9.strictObject({
636
+ ok: z9.literal(true),
637
+ result: z9.unknown(),
638
+ /** Since 1.1: the version the device negotiated for this call (its welcome). */
639
+ protocol_version: ProtocolVersion.optional()
640
+ }),
641
+ z9.strictObject({
642
+ ok: z9.literal(false),
643
+ error: ProtocolErrorBody,
644
+ /** Since 1.1, as above (absent when the device never answered hello). */
645
+ protocol_version: ProtocolVersion.optional()
646
+ })
631
647
  ]);
632
648
  var RELAY_CALL_HELLO_ID = "hello";
633
649
  var RELAY_CALL_REQUEST_ID = "call";