@ai-matrx/desktop-protocol 0.17.6 → 0.17.8

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-B9tM6Hnx.cjs';
5
- export { i as isDesktopProtocolError } from './models-B9tM6Hnx.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-B2PuTc6a.cjs';
5
+ export { i as isDesktopProtocolError } from './models-B2PuTc6a.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-B9tM6Hnx.js';
5
- export { i as isDesktopProtocolError } from './models-B9tM6Hnx.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-B2PuTc6a.js';
5
+ export { i as isDesktopProtocolError } from './models-B2PuTc6a.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 = 10;
114
+ var PROTOCOL_MINOR = 12;
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_-]+$/);
@@ -1611,9 +1611,19 @@ var AccountReset = z25.strictObject({
1611
1611
  var AppsWindowsListParams = z25.strictObject({ app_key: AppKey });
1612
1612
  var AppsWindowsListResult = z25.strictObject({ app_key: AppKey, windows: z25.array(AppWindowInfo).max(200) });
1613
1613
  var AppsAccountsUsageParams = z25.strictObject({ app_key: AppKey });
1614
- var AppsAccountsUsageResult = z25.strictObject({ app_key: AppKey, accounts: z25.array(AccountUsage).max(500) });
1614
+ var AppsAccountsUsageResult = z25.strictObject({
1615
+ app_key: AppKey,
1616
+ accounts: z25.array(AccountUsage).max(500),
1617
+ /** 1.12: the rows are right but something around them failed (a newly read reset time could not be saved); shown, never hidden. */
1618
+ problem: z25.string().max(400).optional()
1619
+ });
1615
1620
  var AppsAccountsResetsParams = z25.strictObject({ app_key: AppKey });
1616
- var AppsAccountsResetsResult = z25.strictObject({ app_key: AppKey, resets: z25.array(AccountReset).max(200) });
1621
+ var AppsAccountsResetsResult = z25.strictObject({
1622
+ app_key: AppKey,
1623
+ resets: z25.array(AccountReset).max(200),
1624
+ /** 1.12: as on `apps.accounts.usage`. */
1625
+ problem: z25.string().max(400).optional()
1626
+ });
1617
1627
  var AppsWindowActionResult = z25.strictObject({ message: z25.string().max(400) });
1618
1628
  var AppsWindowsOpenParams = z25.strictObject({ app_key: AppKey, window: ChatPlace });
1619
1629
  var AppsWindowsReloadParams = z25.strictObject({ app_key: AppKey, window: ChatPlace });
@@ -1631,6 +1641,106 @@ var AppsProjectsCreateParams = z25.strictObject({ app_key: AppKey, name: z25.str
1631
1641
  var AppsProjectsCreateResult = z25.strictObject({ project: ChatProject });
1632
1642
  var AppsProjectsImportPinsParams = z25.strictObject({ app_key: AppKey });
1633
1643
  var AppsProjectsImportPinsResult = z25.strictObject({ message: z25.string().max(400) });
1644
+ var ColdChat = z25.strictObject({
1645
+ id: ChatId,
1646
+ title: z25.string().max(1e3),
1647
+ repo: z25.string().max(200).nullable(),
1648
+ window: z25.string().max(64).nullable(),
1649
+ account: z25.string().max(320).nullable(),
1650
+ model_name: z25.string().max(120).nullable(),
1651
+ context_tokens: nonNegInt,
1652
+ cold_at_ms: epochMs,
1653
+ /** Waking it once the cache is cold. */
1654
+ cold_cost: z25.number().nullable(),
1655
+ /** Waking it while the cache is warm. */
1656
+ warm_cost: z25.number().nullable(),
1657
+ /** Its account is on extra usage (a 5-minute cache, and real money). */
1658
+ extra_usage: z25.boolean(),
1659
+ /** A scheduled routine's run. */
1660
+ scheduled: z25.boolean(),
1661
+ /** It can be shown in its window (started in the desktop app). */
1662
+ openable: z25.boolean(),
1663
+ /** How its window was decided, or why it can't be opened. */
1664
+ how: z25.string().max(200).nullable()
1665
+ });
1666
+ var AppsChatsColdParams = z25.strictObject({ app_key: AppKey });
1667
+ var AppsChatsColdResult = z25.strictObject({
1668
+ app_key: AppKey,
1669
+ /** Waiting for the person with a warm cache, most urgent first. */
1670
+ waiting: z25.array(ColdChat).max(2e3),
1671
+ /** Went cold in the last while. */
1672
+ recently_cold: z25.array(ColdChat).max(2e3),
1673
+ /** Chats working right now (not waiting). */
1674
+ working: nonNegInt
1675
+ });
1676
+ var AppsChatsOpenParams = z25.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
1677
+ var SpendSplit = z25.strictObject({ main: z25.number(), helpers: z25.number() });
1678
+ var SpendScopes = z25.strictObject({ today: SpendSplit, week: SpendSplit });
1679
+ var SpendAccount = z25.strictObject({
1680
+ account: z25.string().max(320),
1681
+ spend: SpendScopes,
1682
+ last_hour: z25.number().nullable(),
1683
+ last_5h: z25.number().nullable(),
1684
+ five_hour: z25.number().nullable(),
1685
+ weekly: z25.number().nullable(),
1686
+ as_of_ms: epochMs.nullable(),
1687
+ weekly_resets_at_ms: epochMs.nullable(),
1688
+ /** When the 5-hour or weekly limit is projected to be reached at the current burn. */
1689
+ five_hour_full_at_ms: epochMs.nullable(),
1690
+ weekly_full_at_ms: epochMs.nullable(),
1691
+ /** The reading is too old to project. */
1692
+ stale: z25.boolean()
1693
+ });
1694
+ var SpendModel = z25.strictObject({ model: z25.string().max(120), name: z25.string().max(120), spend: SpendScopes });
1695
+ var SpendChat = z25.strictObject({
1696
+ id: ChatId,
1697
+ title: z25.string().max(1e3),
1698
+ repo: z25.string().max(200).nullable(),
1699
+ window: z25.string().max(64).nullable(),
1700
+ spend: SpendScopes,
1701
+ helpers: nonNegInt
1702
+ });
1703
+ var SpendHelper = z25.strictObject({ model: z25.string().max(120), steps: nonNegInt, over_steps: z25.boolean(), description: z25.string().max(400) });
1704
+ var SpendLive = z25.strictObject({ id: ChatId, title: z25.string().max(1e3), window: z25.string().max(64).nullable(), helpers: z25.array(SpendHelper).max(200) });
1705
+ var SpendIdleScope = z25.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: z25.number(), avoidable: z25.number() });
1706
+ var SpendIdle = z25.strictObject({ id: ChatId, chat: z25.string().max(1e3), who: z25.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
1707
+ var SpendStart = z25.strictObject({ repo: z25.string().max(200), count: nonNegInt, median: nonNegInt, latest: z25.array(nonNegInt).max(20), alarm: z25.string().max(400).nullable() });
1708
+ var AppsSpendParams = z25.strictObject({ app_key: AppKey });
1709
+ var AppsSpendResult = z25.strictObject({
1710
+ app_key: AppKey,
1711
+ /** False while older chats are still being read. */
1712
+ complete: z25.boolean(),
1713
+ today_total: z25.number(),
1714
+ week_total: z25.number(),
1715
+ idle_today: z25.number(),
1716
+ idle_week: z25.number(),
1717
+ /** Models with no known list price. */
1718
+ unpriced: z25.array(z25.string().max(120)).max(100),
1719
+ /** Helpers past their step budget, unusual starting sizes. */
1720
+ alarms: z25.array(z25.string().max(400)).max(200),
1721
+ live: z25.array(SpendLive).max(200),
1722
+ accounts: z25.array(SpendAccount).max(200),
1723
+ models: z25.array(SpendModel).max(100),
1724
+ chats: z25.array(SpendChat).max(500),
1725
+ idle: z25.array(SpendIdle).max(500),
1726
+ starts: z25.array(SpendStart).max(200)
1727
+ });
1728
+ var AppsSyncStatusParams = z25.strictObject({ app_key: AppKey });
1729
+ var AppsSyncStatusResult = z25.strictObject({
1730
+ healthy: z25.boolean(),
1731
+ summary: z25.string().max(400),
1732
+ problems: z25.array(z25.string().max(400)).max(200),
1733
+ warnings: z25.array(z25.string().max(400)).max(200),
1734
+ /** Accounts seen with no saved name yet (Save account names fixes them). */
1735
+ unnamed_accounts: z25.array(z25.string().max(80)).max(200),
1736
+ /** The full report. */
1737
+ output: z25.string().max(2e5)
1738
+ });
1739
+ var AppsSyncRunParams = z25.strictObject({ app_key: AppKey });
1740
+ var AppsWindowsProcessesParams = z25.strictObject({ app_key: AppKey });
1741
+ var AppsWindowsProcessesResult = z25.strictObject({ processes: z25.array(z25.string().max(2e3)).max(2e3) });
1742
+ var AppsWindowsAddParams = z25.strictObject({ app_key: AppKey, window: ChatPlace, email: z25.string().min(3).max(320) });
1743
+ var AppsWindowsSaveNamesParams = z25.strictObject({ app_key: AppKey });
1634
1744
 
1635
1745
  // src/schema/registry.ts
1636
1746
  var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
@@ -1689,6 +1799,15 @@ var OPS = {
1689
1799
  "apps.projects.move": { params: AppsProjectsMoveParams, result: AppsProjectsMoveResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1690
1800
  "apps.projects.create": { params: AppsProjectsCreateParams, result: AppsProjectsCreateResult, kind: "unary", since: "1.10", errors: ["INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1691
1801
  "apps.projects.import_pins": { params: AppsProjectsImportPinsParams, result: AppsProjectsImportPinsResult, kind: "unary", since: "1.10", errors: ["CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1802
+ // 1.11: Going cold, Spend, sync health, windows upkeep.
1803
+ "apps.chats.cold": { params: AppsChatsColdParams, result: AppsChatsColdResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1804
+ "apps.chats.open": { params: AppsChatsOpenParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1805
+ "apps.spend": { params: AppsSpendParams, result: AppsSpendResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1806
+ "apps.sync.status": { params: AppsSyncStatusParams, result: AppsSyncStatusResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1807
+ "apps.sync.run": { params: AppsSyncRunParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1808
+ "apps.windows.processes": { params: AppsWindowsProcessesParams, result: AppsWindowsProcessesResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1809
+ "apps.windows.add": { params: AppsWindowsAddParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1810
+ "apps.windows.save_names": { params: AppsWindowsSaveNamesParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1692
1811
  "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1693
1812
  "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1694
1813
  "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },