@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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/schema/primitives.ts
2
2
  import { z } from "zod";
3
3
  var PROTOCOL_MAJOR = 1;
4
- var PROTOCOL_MINOR = 10;
4
+ var PROTOCOL_MINOR = 12;
5
5
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
6
6
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
7
7
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -1101,9 +1101,19 @@ var AccountReset = z13.strictObject({
1101
1101
  var AppsWindowsListParams = z13.strictObject({ app_key: AppKey });
1102
1102
  var AppsWindowsListResult = z13.strictObject({ app_key: AppKey, windows: z13.array(AppWindowInfo).max(200) });
1103
1103
  var AppsAccountsUsageParams = z13.strictObject({ app_key: AppKey });
1104
- var AppsAccountsUsageResult = z13.strictObject({ app_key: AppKey, accounts: z13.array(AccountUsage).max(500) });
1104
+ var AppsAccountsUsageResult = z13.strictObject({
1105
+ app_key: AppKey,
1106
+ accounts: z13.array(AccountUsage).max(500),
1107
+ /** 1.12: the rows are right but something around them failed (a newly read reset time could not be saved); shown, never hidden. */
1108
+ problem: z13.string().max(400).optional()
1109
+ });
1105
1110
  var AppsAccountsResetsParams = z13.strictObject({ app_key: AppKey });
1106
- var AppsAccountsResetsResult = z13.strictObject({ app_key: AppKey, resets: z13.array(AccountReset).max(200) });
1111
+ var AppsAccountsResetsResult = z13.strictObject({
1112
+ app_key: AppKey,
1113
+ resets: z13.array(AccountReset).max(200),
1114
+ /** 1.12: as on `apps.accounts.usage`. */
1115
+ problem: z13.string().max(400).optional()
1116
+ });
1107
1117
  var AppsWindowActionResult = z13.strictObject({ message: z13.string().max(400) });
1108
1118
  var AppsWindowsOpenParams = z13.strictObject({ app_key: AppKey, window: ChatPlace });
1109
1119
  var AppsWindowsReloadParams = z13.strictObject({ app_key: AppKey, window: ChatPlace });
@@ -1121,6 +1131,106 @@ var AppsProjectsCreateParams = z13.strictObject({ app_key: AppKey, name: z13.str
1121
1131
  var AppsProjectsCreateResult = z13.strictObject({ project: ChatProject });
1122
1132
  var AppsProjectsImportPinsParams = z13.strictObject({ app_key: AppKey });
1123
1133
  var AppsProjectsImportPinsResult = z13.strictObject({ message: z13.string().max(400) });
1134
+ var ColdChat = z13.strictObject({
1135
+ id: ChatId,
1136
+ title: z13.string().max(1e3),
1137
+ repo: z13.string().max(200).nullable(),
1138
+ window: z13.string().max(64).nullable(),
1139
+ account: z13.string().max(320).nullable(),
1140
+ model_name: z13.string().max(120).nullable(),
1141
+ context_tokens: nonNegInt,
1142
+ cold_at_ms: epochMs,
1143
+ /** Waking it once the cache is cold. */
1144
+ cold_cost: z13.number().nullable(),
1145
+ /** Waking it while the cache is warm. */
1146
+ warm_cost: z13.number().nullable(),
1147
+ /** Its account is on extra usage (a 5-minute cache, and real money). */
1148
+ extra_usage: z13.boolean(),
1149
+ /** A scheduled routine's run. */
1150
+ scheduled: z13.boolean(),
1151
+ /** It can be shown in its window (started in the desktop app). */
1152
+ openable: z13.boolean(),
1153
+ /** How its window was decided, or why it can't be opened. */
1154
+ how: z13.string().max(200).nullable()
1155
+ });
1156
+ var AppsChatsColdParams = z13.strictObject({ app_key: AppKey });
1157
+ var AppsChatsColdResult = z13.strictObject({
1158
+ app_key: AppKey,
1159
+ /** Waiting for the person with a warm cache, most urgent first. */
1160
+ waiting: z13.array(ColdChat).max(2e3),
1161
+ /** Went cold in the last while. */
1162
+ recently_cold: z13.array(ColdChat).max(2e3),
1163
+ /** Chats working right now (not waiting). */
1164
+ working: nonNegInt
1165
+ });
1166
+ var AppsChatsOpenParams = z13.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
1167
+ var SpendSplit = z13.strictObject({ main: z13.number(), helpers: z13.number() });
1168
+ var SpendScopes = z13.strictObject({ today: SpendSplit, week: SpendSplit });
1169
+ var SpendAccount = z13.strictObject({
1170
+ account: z13.string().max(320),
1171
+ spend: SpendScopes,
1172
+ last_hour: z13.number().nullable(),
1173
+ last_5h: z13.number().nullable(),
1174
+ five_hour: z13.number().nullable(),
1175
+ weekly: z13.number().nullable(),
1176
+ as_of_ms: epochMs.nullable(),
1177
+ weekly_resets_at_ms: epochMs.nullable(),
1178
+ /** When the 5-hour or weekly limit is projected to be reached at the current burn. */
1179
+ five_hour_full_at_ms: epochMs.nullable(),
1180
+ weekly_full_at_ms: epochMs.nullable(),
1181
+ /** The reading is too old to project. */
1182
+ stale: z13.boolean()
1183
+ });
1184
+ var SpendModel = z13.strictObject({ model: z13.string().max(120), name: z13.string().max(120), spend: SpendScopes });
1185
+ var SpendChat = z13.strictObject({
1186
+ id: ChatId,
1187
+ title: z13.string().max(1e3),
1188
+ repo: z13.string().max(200).nullable(),
1189
+ window: z13.string().max(64).nullable(),
1190
+ spend: SpendScopes,
1191
+ helpers: nonNegInt
1192
+ });
1193
+ var SpendHelper = z13.strictObject({ model: z13.string().max(120), steps: nonNegInt, over_steps: z13.boolean(), description: z13.string().max(400) });
1194
+ var SpendLive = z13.strictObject({ id: ChatId, title: z13.string().max(1e3), window: z13.string().max(64).nullable(), helpers: z13.array(SpendHelper).max(200) });
1195
+ var SpendIdleScope = z13.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: z13.number(), avoidable: z13.number() });
1196
+ var SpendIdle = z13.strictObject({ id: ChatId, chat: z13.string().max(1e3), who: z13.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
1197
+ var SpendStart = z13.strictObject({ repo: z13.string().max(200), count: nonNegInt, median: nonNegInt, latest: z13.array(nonNegInt).max(20), alarm: z13.string().max(400).nullable() });
1198
+ var AppsSpendParams = z13.strictObject({ app_key: AppKey });
1199
+ var AppsSpendResult = z13.strictObject({
1200
+ app_key: AppKey,
1201
+ /** False while older chats are still being read. */
1202
+ complete: z13.boolean(),
1203
+ today_total: z13.number(),
1204
+ week_total: z13.number(),
1205
+ idle_today: z13.number(),
1206
+ idle_week: z13.number(),
1207
+ /** Models with no known list price. */
1208
+ unpriced: z13.array(z13.string().max(120)).max(100),
1209
+ /** Helpers past their step budget, unusual starting sizes. */
1210
+ alarms: z13.array(z13.string().max(400)).max(200),
1211
+ live: z13.array(SpendLive).max(200),
1212
+ accounts: z13.array(SpendAccount).max(200),
1213
+ models: z13.array(SpendModel).max(100),
1214
+ chats: z13.array(SpendChat).max(500),
1215
+ idle: z13.array(SpendIdle).max(500),
1216
+ starts: z13.array(SpendStart).max(200)
1217
+ });
1218
+ var AppsSyncStatusParams = z13.strictObject({ app_key: AppKey });
1219
+ var AppsSyncStatusResult = z13.strictObject({
1220
+ healthy: z13.boolean(),
1221
+ summary: z13.string().max(400),
1222
+ problems: z13.array(z13.string().max(400)).max(200),
1223
+ warnings: z13.array(z13.string().max(400)).max(200),
1224
+ /** Accounts seen with no saved name yet (Save account names fixes them). */
1225
+ unnamed_accounts: z13.array(z13.string().max(80)).max(200),
1226
+ /** The full report. */
1227
+ output: z13.string().max(2e5)
1228
+ });
1229
+ var AppsSyncRunParams = z13.strictObject({ app_key: AppKey });
1230
+ var AppsWindowsProcessesParams = z13.strictObject({ app_key: AppKey });
1231
+ var AppsWindowsProcessesResult = z13.strictObject({ processes: z13.array(z13.string().max(2e3)).max(2e3) });
1232
+ var AppsWindowsAddParams = z13.strictObject({ app_key: AppKey, window: ChatPlace, email: z13.string().min(3).max(320) });
1233
+ var AppsWindowsSaveNamesParams = z13.strictObject({ app_key: AppKey });
1124
1234
 
1125
1235
  // src/schema/service.ts
1126
1236
  import { z as z14 } from "zod";
@@ -1765,6 +1875,15 @@ var OPS = {
1765
1875
  "apps.projects.move": { params: AppsProjectsMoveParams, result: AppsProjectsMoveResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1766
1876
  "apps.projects.create": { params: AppsProjectsCreateParams, result: AppsProjectsCreateResult, kind: "unary", since: "1.10", errors: ["INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1767
1877
  "apps.projects.import_pins": { params: AppsProjectsImportPinsParams, result: AppsProjectsImportPinsResult, kind: "unary", since: "1.10", errors: ["CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1878
+ // 1.11: Going cold, Spend, sync health, windows upkeep.
1879
+ "apps.chats.cold": { params: AppsChatsColdParams, result: AppsChatsColdResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1880
+ "apps.chats.open": { params: AppsChatsOpenParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1881
+ "apps.spend": { params: AppsSpendParams, result: AppsSpendResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1882
+ "apps.sync.status": { params: AppsSyncStatusParams, result: AppsSyncStatusResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1883
+ "apps.sync.run": { params: AppsSyncRunParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1884
+ "apps.windows.processes": { params: AppsWindowsProcessesParams, result: AppsWindowsProcessesResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1885
+ "apps.windows.add": { params: AppsWindowsAddParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1886
+ "apps.windows.save_names": { params: AppsWindowsSaveNamesParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1768
1887
  "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1769
1888
  "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1770
1889
  "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },
@@ -2118,7 +2237,30 @@ var NAMED_SCHEMAS = {
2118
2237
  AppsProjectsCreateParams,
2119
2238
  AppsProjectsCreateResult,
2120
2239
  AppsProjectsImportPinsParams,
2121
- AppsProjectsImportPinsResult
2240
+ AppsProjectsImportPinsResult,
2241
+ ColdChat,
2242
+ AppsChatsColdParams,
2243
+ AppsChatsColdResult,
2244
+ AppsChatsOpenParams,
2245
+ SpendSplit,
2246
+ SpendScopes,
2247
+ SpendAccount,
2248
+ SpendModel,
2249
+ SpendChat,
2250
+ SpendHelper,
2251
+ SpendLive,
2252
+ SpendIdleScope,
2253
+ SpendIdle,
2254
+ SpendStart,
2255
+ AppsSpendParams,
2256
+ AppsSpendResult,
2257
+ AppsSyncStatusParams,
2258
+ AppsSyncStatusResult,
2259
+ AppsSyncRunParams,
2260
+ AppsWindowsProcessesParams,
2261
+ AppsWindowsProcessesResult,
2262
+ AppsWindowsAddParams,
2263
+ AppsWindowsSaveNamesParams
2122
2264
  };
2123
2265
 
2124
2266
  // src/versioning.ts
@@ -2128,7 +2270,9 @@ var FIELDS_SINCE = {
2128
2270
  "RelayCallResponse|0": { protocol_version: "1.1" },
2129
2271
  "RelayCallResponse|1": { protocol_version: "1.1" },
2130
2272
  WindowInfo: { app: "1.7", pid: "1.7" },
2131
- AppsChatsListResult: { updating: "1.9", live: "1.9", families: "1.10" }
2273
+ AppsChatsListResult: { updating: "1.9", live: "1.9", families: "1.10" },
2274
+ AppsAccountsUsageResult: { problem: "1.12" },
2275
+ AppsAccountsResetsResult: { problem: "1.12" }
2132
2276
  };
2133
2277
  var NULL_SINCE = {
2134
2278
  "RelayDeviceStatusEvent.since_ms": { since: "1.1", olderPeersGet: 0 }
@@ -2183,7 +2327,9 @@ function strip(value, fields, version) {
2183
2327
  }
2184
2328
  var RESULT_PATH = /* @__PURE__ */ new Map([
2185
2329
  ["fs.patch", "FsPatchResult"],
2186
- ["apps.chats.list", "AppsChatsListResult"]
2330
+ ["apps.chats.list", "AppsChatsListResult"],
2331
+ ["apps.accounts.usage", "AppsAccountsUsageResult"],
2332
+ ["apps.accounts.resets", "AppsAccountsResetsResult"]
2187
2333
  ]);
2188
2334
  var WINDOW_RESULTS = /* @__PURE__ */ new Map([
2189
2335
  ["window.list", "windows"],
@@ -2225,7 +2371,7 @@ function forPeer(op, part, value, version) {
2225
2371
  var VERSIONED_RESULT_OPS = [...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys()];
2226
2372
 
2227
2373
  // src/contract.ts
2228
- var CONTRACT_SHA256 = "f1891d7e5c64c11112bb7baf5db06bd293daccff85a7f5adcdf760b2bbb92bda";
2374
+ var CONTRACT_SHA256 = "179024ee4b3dc7123af1db44f8ce0fb9da7b392eed30a2a2b5bb312da3522bb0";
2229
2375
 
2230
2376
  // src/close-policy.ts
2231
2377
  var CLOSE_RULES = {
@@ -2583,8 +2729,11 @@ export {
2583
2729
  AppsAccountsUsageParams,
2584
2730
  AppsAccountsUsageResult,
2585
2731
  AppsChatsChangedEvent,
2732
+ AppsChatsColdParams,
2733
+ AppsChatsColdResult,
2586
2734
  AppsChatsListParams,
2587
2735
  AppsChatsListResult,
2736
+ AppsChatsOpenParams,
2588
2737
  AppsChatsPlaceParams,
2589
2738
  AppsChatsPlaceResult,
2590
2739
  AppsChatsStarParams,
@@ -2618,13 +2767,22 @@ export {
2618
2767
  AppsProjectsUnfileResult,
2619
2768
  AppsProjectsUpdateParams,
2620
2769
  AppsProjectsUpdateResult,
2770
+ AppsSpendParams,
2771
+ AppsSpendResult,
2772
+ AppsSyncRunParams,
2773
+ AppsSyncStatusParams,
2774
+ AppsSyncStatusResult,
2621
2775
  AppsWindowActionResult,
2776
+ AppsWindowsAddParams,
2622
2777
  AppsWindowsListParams,
2623
2778
  AppsWindowsListResult,
2624
2779
  AppsWindowsOpenParams,
2780
+ AppsWindowsProcessesParams,
2781
+ AppsWindowsProcessesResult,
2625
2782
  AppsWindowsRefreshUsageParams,
2626
2783
  AppsWindowsReloadParams,
2627
2784
  AppsWindowsRestartParams,
2785
+ AppsWindowsSaveNamesParams,
2628
2786
  AudioDevice,
2629
2787
  AudioDevicesParams,
2630
2788
  AudioDevicesResult,
@@ -2667,6 +2825,7 @@ export {
2667
2825
  CodingPlanMissingParams,
2668
2826
  CodingServiceCredentials,
2669
2827
  CodingServiceProgress,
2828
+ ColdChat,
2670
2829
  ContractHash,
2671
2830
  CoreToClientMsg,
2672
2831
  CoreToServiceMsg,
@@ -2864,6 +3023,16 @@ export {
2864
3023
  SessionReleaseParams,
2865
3024
  SessionReleaseResult,
2866
3025
  Signal,
3026
+ SpendAccount,
3027
+ SpendChat,
3028
+ SpendHelper,
3029
+ SpendIdle,
3030
+ SpendIdleScope,
3031
+ SpendLive,
3032
+ SpendModel,
3033
+ SpendScopes,
3034
+ SpendSplit,
3035
+ SpendStart,
2867
3036
  StreamMeta,
2868
3037
  StreamMsg,
2869
3038
  SysinfoGetParams,