@ai-matrx/desktop-protocol 0.17.6 → 0.17.7

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