@ai-matrx/desktop-protocol 0.17.5 → 0.17.6

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-Bb87iuvw.cjs';
5
- export { i as isDesktopProtocolError } from './models-Bb87iuvw.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-B9tM6Hnx.cjs';
5
+ export { i as isDesktopProtocolError } from './models-B9tM6Hnx.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-Bb87iuvw.js';
5
- export { i as isDesktopProtocolError } from './models-Bb87iuvw.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-B9tM6Hnx.js';
5
+ export { i as isDesktopProtocolError } from './models-B9tM6Hnx.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 = 9;
114
+ var PROTOCOL_MINOR = 10;
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_-]+$/);
@@ -1474,6 +1474,11 @@ var ChatRow = z24.strictObject({
1474
1474
  warnings: z24.array(z24.string().max(400)).max(20),
1475
1475
  last_use: ChatLastUse.nullable()
1476
1476
  });
1477
+ var ChatFamily = z24.strictObject({
1478
+ id: ChatId,
1479
+ fork_of: ChatId.nullable(),
1480
+ copy_of: ChatId.nullable()
1481
+ });
1477
1482
  var AppsChatsListParams = z24.strictObject({
1478
1483
  app_key: AppKey,
1479
1484
  /** Only these chats (a live update re-reads just what changed). */
@@ -1491,7 +1496,9 @@ var AppsChatsListResult = z24.strictObject({
1491
1496
  /** 1.9: this is the copy saved at the last read, shown while everything is read again. */
1492
1497
  updating: z24.boolean().optional(),
1493
1498
  /** 1.9: false while the folder watches are down (changes are not arriving); `apps.chats.watch_state` says when it changes. */
1494
- live: z24.boolean().optional()
1499
+ live: z24.boolean().optional(),
1500
+ /** 1.10: every listed chat that is a fork or a copy of another (read from the conversations' first lines). */
1501
+ families: z24.array(ChatFamily).max(2e4).optional()
1495
1502
  });
1496
1503
  var AppsChatsWatchParams = z24.strictObject({ app_key: AppKey });
1497
1504
  var AppsChatsWatchResult = z24.strictObject({ resource_id: ResourceId, version: nonNegInt });
@@ -1545,6 +1552,86 @@ var AppsProjectsUnfileResult = z24.strictObject({ chat: ChatRow });
1545
1552
  var AppsChatsStarParams = z24.strictObject({ app_key: AppKey, chat_id: ChatId, starred: z24.boolean() });
1546
1553
  var AppsChatsStarResult = z24.strictObject({ chat: ChatRow });
1547
1554
 
1555
+ // src/schema/apps-accounts.ts
1556
+ import { z as z25 } from "zod";
1557
+ var AppWindowInfo = z25.strictObject({
1558
+ key: ChatPlace,
1559
+ /** The app's default profile (Claude: main, which may sign into any account). */
1560
+ main: z25.boolean(),
1561
+ /** The account the window is meant for (null for main). */
1562
+ account: z25.string().max(320).nullable(),
1563
+ /** The account signed in there now: an email, or the account id while it has no saved name. */
1564
+ signed_in: z25.string().max(320).nullable(),
1565
+ signed_in_is_email: z25.boolean(),
1566
+ /** Signed into another account than the one it is meant for. */
1567
+ mismatch: z25.boolean(),
1568
+ /** Its folder exists. */
1569
+ created: z25.boolean(),
1570
+ /** Open now. */
1571
+ running: z25.boolean(),
1572
+ /** Chats open in it now (a process resuming each one). */
1573
+ open_chats: nonNegInt
1574
+ });
1575
+ var AccountUsage = z25.strictObject({
1576
+ /** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
1577
+ account: z25.string().max(320),
1578
+ org: z25.string().max(80).nullable(),
1579
+ /** False when the org was sampled in several accounts' windows and the vote is not clear (≥ 75 %). */
1580
+ account_certain: z25.boolean(),
1581
+ /** 5-hour use in percent (0 once the reading is over 5 hours old). */
1582
+ five_hour: z25.number().nullable(),
1583
+ five_hour_reset_since: z25.boolean(),
1584
+ /** Weekly use in percent (0 once the week reset after the reading). */
1585
+ weekly: z25.number().nullable(),
1586
+ weekly_reset_since: z25.boolean(),
1587
+ /** Extra-usage spend in percent of its cap, when on. */
1588
+ extra_usage: z25.number().nullable(),
1589
+ extra_usage_as_of_ms: epochMs.nullable(),
1590
+ as_of_ms: epochMs,
1591
+ /** The windows meant for this account (and main when main took the reading). */
1592
+ windows: z25.array(ChatPlace).max(200),
1593
+ /** The window that took the reading is open now and the reading is under 30 minutes old. */
1594
+ live: z25.boolean(),
1595
+ /** The next weekly reset, when known. */
1596
+ weekly_resets_at_ms: epochMs.nullable(),
1597
+ /** That reset time is Claude's own (its reading, or a reset seen in its usage history). */
1598
+ weekly_reset_official: z25.boolean().nullable()
1599
+ });
1600
+ var AccountReset = z25.strictObject({
1601
+ window: ChatPlace,
1602
+ account: z25.string().max(320).nullable(),
1603
+ next_reset_ms: epochMs.nullable(),
1604
+ /** claude: the app's own reading; usage_history: a weekly drop seen in its usage record; your_list: the person's own entry. */
1605
+ source: z25.enum(["claude", "usage_history", "your_list"]).nullable(),
1606
+ /** claude or usage_history. */
1607
+ official: z25.boolean(),
1608
+ /** Set when the person's list disagrees with the official time. */
1609
+ note: z25.string().max(200).nullable()
1610
+ });
1611
+ var AppsWindowsListParams = z25.strictObject({ app_key: AppKey });
1612
+ var AppsWindowsListResult = z25.strictObject({ app_key: AppKey, windows: z25.array(AppWindowInfo).max(200) });
1613
+ var AppsAccountsUsageParams = z25.strictObject({ app_key: AppKey });
1614
+ var AppsAccountsUsageResult = z25.strictObject({ app_key: AppKey, accounts: z25.array(AccountUsage).max(500) });
1615
+ var AppsAccountsResetsParams = z25.strictObject({ app_key: AppKey });
1616
+ var AppsAccountsResetsResult = z25.strictObject({ app_key: AppKey, resets: z25.array(AccountReset).max(200) });
1617
+ var AppsWindowActionResult = z25.strictObject({ message: z25.string().max(400) });
1618
+ var AppsWindowsOpenParams = z25.strictObject({ app_key: AppKey, window: ChatPlace });
1619
+ var AppsWindowsReloadParams = z25.strictObject({ app_key: AppKey, window: ChatPlace });
1620
+ var AppsWindowsRestartParams = z25.strictObject({ app_key: AppKey, window: ChatPlace, force: z25.boolean().default(false) });
1621
+ var AppsWindowsRefreshUsageParams = z25.strictObject({ app_key: AppKey, window: ChatPlace });
1622
+ var AppsProjectsMoveParams = z25.strictObject({
1623
+ app_key: AppKey,
1624
+ chat_id: ChatId,
1625
+ from_project_id: ChatProjectId,
1626
+ to_project_id: ChatProjectId.optional(),
1627
+ new_project_name: z25.string().min(1).max(200).optional()
1628
+ });
1629
+ var AppsProjectsMoveResult = z25.strictObject({ chat: ChatRow, project: ChatProject });
1630
+ var AppsProjectsCreateParams = z25.strictObject({ app_key: AppKey, name: z25.string().min(1).max(200) });
1631
+ var AppsProjectsCreateResult = z25.strictObject({ project: ChatProject });
1632
+ var AppsProjectsImportPinsParams = z25.strictObject({ app_key: AppKey });
1633
+ var AppsProjectsImportPinsResult = z25.strictObject({ message: z25.string().max(400) });
1634
+
1548
1635
  // src/schema/registry.ts
1549
1636
  var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
1550
1637
  var OPS = {
@@ -1591,6 +1678,17 @@ var OPS = {
1591
1678
  "apps.projects.update": { params: AppsProjectsUpdateParams, result: AppsProjectsUpdateResult, kind: "unary", since: "1.9", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1592
1679
  "apps.projects.copy": { params: AppsProjectsCopyParams, result: AppsProjectsCopyResult, kind: "unary", since: "1.9", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1593
1680
  "apps.projects.unfile": { params: AppsProjectsUnfileParams, result: AppsProjectsUnfileResult, kind: "unary", since: "1.8", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1681
+ // 1.10: the app's windows and accounts (usage by vote, weekly resets, window actions), project move/create, Refresh pins.
1682
+ "apps.windows.list": { params: AppsWindowsListParams, result: AppsWindowsListResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1683
+ "apps.windows.open": { params: AppsWindowsOpenParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1684
+ "apps.windows.reload": { params: AppsWindowsReloadParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "CONFLICT", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1685
+ "apps.windows.restart": { params: AppsWindowsRestartParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1686
+ "apps.windows.refresh_usage": { params: AppsWindowsRefreshUsageParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1687
+ "apps.accounts.usage": { params: AppsAccountsUsageParams, result: AppsAccountsUsageResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1688
+ "apps.accounts.resets": { params: AppsAccountsResetsParams, result: AppsAccountsResetsResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1689
+ "apps.projects.move": { params: AppsProjectsMoveParams, result: AppsProjectsMoveResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1690
+ "apps.projects.create": { params: AppsProjectsCreateParams, result: AppsProjectsCreateResult, kind: "unary", since: "1.10", errors: ["INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1691
+ "apps.projects.import_pins": { params: AppsProjectsImportPinsParams, result: AppsProjectsImportPinsResult, kind: "unary", since: "1.10", errors: ["CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1594
1692
  "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1595
1693
  "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1596
1694
  "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },