@ai-matrx/desktop-protocol 0.17.2 → 0.17.4

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-QWCUcQuU.cjs';
5
- export { i as isDesktopProtocolError } from './models-QWCUcQuU.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-9j0ncAJj.cjs';
5
+ export { i as isDesktopProtocolError } from './models-9j0ncAJj.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-QWCUcQuU.js';
5
- export { i as isDesktopProtocolError } from './models-QWCUcQuU.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-9j0ncAJj.js';
5
+ export { i as isDesktopProtocolError } from './models-9j0ncAJj.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
@@ -111,7 +111,7 @@ import { z as z2 } from "zod";
111
111
  // src/schema/primitives.ts
112
112
  import { z } from "zod";
113
113
  var PROTOCOL_MAJOR = 1;
114
- var PROTOCOL_MINOR = 6;
114
+ var PROTOCOL_MINOR = 8;
115
115
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
116
116
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
117
117
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -929,7 +929,15 @@ var WindowInfo = z15.strictObject({
929
929
  x: z15.int(),
930
930
  y: z15.int(),
931
931
  width: z15.int().min(0),
932
- 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()
933
941
  });
934
942
  var WindowListParams = z15.strictObject({
935
943
  /** Case-insensitive substring of the window title. */
@@ -1393,6 +1401,114 @@ var AppsOpenResult = z23.strictObject({
1393
1401
  folder: AbsPath.nullable()
1394
1402
  });
1395
1403
 
1404
+ // src/schema/apps-chats.ts
1405
+ import { z as z24 } from "zod";
1406
+ var ChatId = z24.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
1407
+ var ChatPlace = z24.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
1408
+ var ChatProjectId = z24.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
1409
+ var ChatWindow = z24.strictObject({
1410
+ key: ChatPlace,
1411
+ /** The app's default profile (Claude: the main window, which lists every account's chats). */
1412
+ main: z24.boolean(),
1413
+ /** The account the window is signed into, when known. */
1414
+ account: z24.string().max(320).nullable()
1415
+ });
1416
+ var ChatProject = z24.strictObject({
1417
+ id: ChatProjectId,
1418
+ name: z24.string().min(1).max(200),
1419
+ archived: z24.boolean(),
1420
+ /** Chats in it. */
1421
+ count: nonNegInt
1422
+ });
1423
+ var ChatPin = z24.strictObject({
1424
+ /** The window whose account pins it; an account with no window of its own is named by its email. */
1425
+ window: z24.string().min(1).max(320),
1426
+ /** When that account's pin list was last read; null when the reading has no time. */
1427
+ observed_at_ms: epochMs.nullable()
1428
+ });
1429
+ var ChatRunning = z24.strictObject({
1430
+ window: ChatPlace,
1431
+ /** process: a live process resumed this chat there (exact); activity: that window's own record moved in the last 3 minutes. */
1432
+ how: z24.enum(["process", "activity"])
1433
+ });
1434
+ var ChatHidden = z24.strictObject({
1435
+ window: ChatPlace,
1436
+ reason: z24.string().max(200)
1437
+ });
1438
+ var ChatLastUse = z24.strictObject({
1439
+ /** The conversation's last reply. */
1440
+ at_ms: epochMs,
1441
+ window: ChatPlace.nullable(),
1442
+ account: z24.string().max(320).nullable(),
1443
+ /** How the window was decided (one short line). */
1444
+ how: z24.string().max(120).nullable(),
1445
+ /** The account's 1-hour prompt cache is still warm. */
1446
+ cache_warm: z24.boolean(),
1447
+ cache_minutes_left: nonNegInt
1448
+ });
1449
+ var ChatRow = z24.strictObject({
1450
+ id: ChatId,
1451
+ /** The short id people see (the listing's first 8 characters). */
1452
+ short_id: z24.string().max(16),
1453
+ /** The listing's own name (Claude: local_<id>), null for a chat only in the holder. */
1454
+ record: z24.string().max(160).nullable(),
1455
+ title: z24.string().max(1e3),
1456
+ last_active_ms: epochMs.nullable(),
1457
+ created_ms: epochMs.nullable(),
1458
+ projects: z24.array(ChatProjectId).max(500),
1459
+ starred: z24.boolean(),
1460
+ pinned_in: z24.array(ChatPin).max(200),
1461
+ /** Every place it is listed now: window keys, plus "holder". */
1462
+ places: z24.array(ChatPlace).max(200),
1463
+ held: z24.boolean(),
1464
+ running: z24.array(ChatRunning).max(200),
1465
+ hidden_in: z24.array(ChatHidden).max(200),
1466
+ /** Kept out of the main window on purpose. */
1467
+ hidden_from_main: z24.boolean(),
1468
+ /** Listed in a side window and not yet copied into main. */
1469
+ main_pending: z24.boolean(),
1470
+ /** A scheduled routine's run (its task id). */
1471
+ scheduled: z24.string().max(200).nullable(),
1472
+ /** Created recently and in no project: offered for filing. */
1473
+ new_unfiled: z24.boolean(),
1474
+ warnings: z24.array(z24.string().max(400)).max(20),
1475
+ last_use: ChatLastUse.nullable()
1476
+ });
1477
+ var AppsChatsListParams = z24.strictObject({
1478
+ app_key: AppKey,
1479
+ /** Only these chats (a live update re-reads just what changed). */
1480
+ ids: z24.array(ChatId).max(500).optional()
1481
+ });
1482
+ var AppsChatsListResult = z24.strictObject({
1483
+ app_key: AppKey,
1484
+ /** Bumps on every change the index sees; `apps.chats.changed` carries the same number. */
1485
+ version: nonNegInt,
1486
+ windows: z24.array(ChatWindow).max(200),
1487
+ projects: z24.array(ChatProject).max(5e3),
1488
+ chats: z24.array(ChatRow).max(2e4),
1489
+ /** How long a chat in no project counts as new. */
1490
+ new_window_ms: nonNegInt
1491
+ });
1492
+ var AppsChatsWatchParams = z24.strictObject({ app_key: AppKey });
1493
+ var AppsChatsWatchResult = z24.strictObject({ resource_id: ResourceId, version: nonNegInt });
1494
+ var AppsChatsChangedEvent = z24.strictObject({
1495
+ app_key: AppKey,
1496
+ version: nonNegInt,
1497
+ ids: z24.array(ChatId).max(1e3),
1498
+ all: z24.boolean()
1499
+ });
1500
+ var AppsProjectsFileParams = z24.strictObject({
1501
+ app_key: AppKey,
1502
+ chat_id: ChatId,
1503
+ project_id: ChatProjectId.optional(),
1504
+ new_project_name: z24.string().min(1).max(200).optional()
1505
+ });
1506
+ var AppsProjectsFileResult = z24.strictObject({ chat: ChatRow, project: ChatProject });
1507
+ var AppsProjectsUnfileParams = z24.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
1508
+ var AppsProjectsUnfileResult = z24.strictObject({ chat: ChatRow });
1509
+ var AppsChatsStarParams = z24.strictObject({ app_key: AppKey, chat_id: ChatId, starred: z24.boolean() });
1510
+ var AppsChatsStarResult = z24.strictObject({ chat: ChatRow });
1511
+
1396
1512
  // src/schema/registry.ts
1397
1513
  var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
1398
1514
  var OPS = {
@@ -1430,6 +1546,11 @@ var OPS = {
1430
1546
  "apps.profiles.save": { params: AppsProfilesSaveParams, result: AppsProfilesSaveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "DEVICE_OFFLINE", "INTERNAL"] },
1431
1547
  "apps.profiles.remove": { params: AppsProfilesRemoveParams, result: AppsProfilesRemoveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "DEVICE_OFFLINE", "INTERNAL"] },
1432
1548
  "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] },
1549
+ "apps.chats.list": { params: AppsChatsListParams, result: AppsChatsListResult, kind: "unary", since: "1.8", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1550
+ "apps.chats.watch": { params: AppsChatsWatchParams, result: AppsChatsWatchResult, kind: "resource", since: "1.8", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "RESOURCE_BUSY", "INTERNAL"] },
1551
+ "apps.chats.star": { params: AppsChatsStarParams, result: AppsChatsStarResult, kind: "unary", since: "1.8", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1552
+ "apps.projects.file": { params: AppsProjectsFileParams, result: AppsProjectsFileResult, kind: "unary", since: "1.8", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1553
+ "apps.projects.unfile": { params: AppsProjectsUnfileParams, result: AppsProjectsUnfileResult, kind: "unary", since: "1.8", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1433
1554
  "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1434
1555
  "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1435
1556
  "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },
@@ -1466,6 +1587,7 @@ var OPS = {
1466
1587
  };
1467
1588
  var EVENTS = {
1468
1589
  "fs.changed": FsChangedEvent,
1590
+ "apps.chats.changed": AppsChatsChangedEvent,
1469
1591
  "exec.exited": ExecExitedEvent,
1470
1592
  "exec.title": ExecTitleEvent,
1471
1593
  "exec.cwd": ExecCwdEvent,