@ai-matrx/desktop-protocol 0.21.81 → 0.21.83

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/data/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/data/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-BnUudL7J.cjs';
5
- export { i as isDesktopProtocolError } from './models-BnUudL7J.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-DMJ4I-2x.cjs';
5
+ export { i as isDesktopProtocolError } from './models-DMJ4I-2x.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/data/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/data/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-BnUudL7J.js';
5
- export { i as isDesktopProtocolError } from './models-BnUudL7J.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-DMJ4I-2x.js';
5
+ export { i as isDesktopProtocolError } from './models-DMJ4I-2x.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
@@ -12,7 +12,7 @@ import {
12
12
  Welcome,
13
13
  closeRule,
14
14
  knows
15
- } from "./chunk-server-T5RWEV22.js";
15
+ } from "./chunk-server-EKAFTH72.js";
16
16
  import {
17
17
  DesktopProtocolError,
18
18
  FRAME_VERSION,
package/dist/index.cjs CHANGED
@@ -46,6 +46,7 @@ __export(src_exports, {
46
46
  AccountProfile: () => AccountProfile,
47
47
  AccountReadSource: () => AccountReadSource,
48
48
  AccountReadState: () => AccountReadState,
49
+ AccountReadingsKept: () => AccountReadingsKept,
49
50
  AccountReset: () => AccountReset,
50
51
  AccountResetSource: () => AccountResetSource,
51
52
  AccountRowId: () => AccountRowId,
@@ -718,6 +719,7 @@ __export(src_exports, {
718
719
  ResponseMsg: () => ResponseMsg,
719
720
  SERVICES: () => SERVICES,
720
721
  SERVICE_MAX_FRAME_BYTES: () => SERVICE_MAX_FRAME_BYTES,
722
+ SETUP_KINDS_SINCE: () => SETUP_KINDS_SINCE,
721
723
  SUBPROTOCOL: () => SUBPROTOCOL,
722
724
  ScheduleCancelParams: () => ScheduleCancelParams,
723
725
  ScheduleCancelResult: () => ScheduleCancelResult,
@@ -943,7 +945,7 @@ module.exports = __toCommonJS(src_exports);
943
945
  var import_zod = require("zod");
944
946
  var import_uuid = require("@ai-matrx/kit/uuid");
945
947
  var PROTOCOL_MAJOR = 1;
946
- var PROTOCOL_MINOR = 78;
948
+ var PROTOCOL_MINOR = 80;
947
949
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
948
950
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
949
951
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -3085,6 +3087,11 @@ var AccountProfile = import_zod15.z.strictObject({
3085
3087
  /** When the app last fetched them, when it says. */
3086
3088
  as_of_ms: epochMs.nullable()
3087
3089
  });
3090
+ var AccountReadingsKept = import_zod15.z.strictObject({
3091
+ kept: import_zod15.z.number().int().nonnegative(),
3092
+ since_ms: epochMs.nullable(),
3093
+ days: import_zod15.z.array(import_zod15.z.strictObject({ day_ms: epochMs, weekly: import_zod15.z.number().nullable() })).max(31)
3094
+ });
3088
3095
  var AppAccount = import_zod15.z.strictObject({
3089
3096
  app_key: AppKey,
3090
3097
  /** The provider's own account id (Claude's account uuid, ChatGPT's account id); `org:<uuid>` when only its organization is known. */
@@ -3120,7 +3127,9 @@ var AppAccount = import_zod15.z.strictObject({
3120
3127
  /** 1.73: where the newest reading came from (absent = the app itself). */
3121
3128
  read_source: AccountReadSource.optional(),
3122
3129
  /** 1.73: Claude Code: the running session's cost as Claude Code estimates it (US dollars), with a Claude Code reading. */
3123
- session_cost_usd: import_zod15.z.number().nonnegative().optional()
3130
+ session_cost_usd: import_zod15.z.number().nonnegative().optional(),
3131
+ /** 1.79: the readings Matrx kept of this account on this computer (its reading history). */
3132
+ readings: AccountReadingsKept.optional()
3124
3133
  });
3125
3134
  var AppsInstancesListParams = import_zod15.z.strictObject({ app_key: AppKey, fresh: import_zod15.z.boolean().optional() });
3126
3135
  var AppsInstancesListResult = import_zod15.z.strictObject({
@@ -3171,7 +3180,7 @@ var McpServerRow = import_zod15.z.strictObject({
3171
3180
  where: import_zod15.z.string().max(400)
3172
3181
  });
3173
3182
  var SetupFact = import_zod15.z.strictObject({ name: import_zod15.z.string().max(80), value: import_zod15.z.string().max(300) });
3174
- var SetupItemKind = import_zod15.z.enum(["extension", "plugin", "marketplace", "model"]);
3183
+ var SetupItemKind = import_zod15.z.enum(["extension", "plugin", "marketplace", "model", "skill"]);
3175
3184
  var SetupItem = import_zod15.z.strictObject({
3176
3185
  kind: SetupItemKind,
3177
3186
  name: import_zod15.z.string().max(200),
@@ -6181,6 +6190,7 @@ var NAMED_SCHEMAS = {
6181
6190
  AppsAccountsListResult,
6182
6191
  AccountReadSource,
6183
6192
  AccountProfile,
6193
+ AccountReadingsKept,
6184
6194
  McpTransport,
6185
6195
  McpServerRow,
6186
6196
  SetupFact,
@@ -7032,7 +7042,7 @@ var FIELDS_SINCE = {
7032
7042
  SpendIdle: { hidden: "1.78" },
7033
7043
  ChatRow: { app_project: "1.13", tokens: "1.13", original_title: "1.14", title_source: "1.14", title_override: "1.14", archived: "1.15", session_id: "1.59", app_groups: "1.59", parent: "1.59", prior_sessions: "1.59", title_sync: "1.61", moved: "1.62", home: "1.63", hidden: "1.70", pin_sync: "1.72" },
7034
7044
  AccountUsage: { plan: "1.13", credits: "1.13", five_hour_resets_by_ms: "1.25", read_source: "1.73" },
7035
- AppAccount: { profile: "1.73", read_source: "1.73", session_cost_usd: "1.73" },
7045
+ AppAccount: { profile: "1.73", read_source: "1.73", session_cost_usd: "1.73", readings: "1.79" },
7036
7046
  ResourcesDisk: { name: "1.17" },
7037
7047
  StackServer: { cpu_percent: "1.18", memory_bytes: "1.18" },
7038
7048
  AudioDevice: { kind: "1.24" },
@@ -7108,6 +7118,27 @@ var PERMISSIONS_SINCE = {
7108
7118
  mail: "1.41",
7109
7119
  wifi: "1.41"
7110
7120
  };
7121
+ var SETUP_KINDS_SINCE = {
7122
+ skill: "1.80"
7123
+ };
7124
+ function setupItemsForPeer(value, version) {
7125
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
7126
+ const body = value;
7127
+ if (!Array.isArray(body.setups)) return value;
7128
+ const since = SETUP_KINDS_SINCE;
7129
+ const setups = body.setups;
7130
+ const next = setups.map((s) => {
7131
+ const items = s?.items;
7132
+ if (!Array.isArray(items)) return s;
7133
+ const kept = items.filter((i) => {
7134
+ const kind = i?.kind;
7135
+ const added = typeof kind === "string" ? since[kind] : void 0;
7136
+ return !added || knows(version, added);
7137
+ });
7138
+ return kept.length === items.length ? s : { ...s, items: kept };
7139
+ });
7140
+ return next.some((s, i) => s !== setups[i]) ? { ...body, setups: next } : value;
7141
+ }
7111
7142
  function permissionsForPeer(value, version) {
7112
7143
  if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
7113
7144
  const body = value;
@@ -7181,6 +7212,8 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
7181
7212
  ["apps.spend", [["chats", "SpendChat"], ["live", "SpendLive"], ["idle", "SpendIdle"]]],
7182
7213
  ["apps.chats.place", [["chat", "ChatRow"]]],
7183
7214
  ["apps.accounts.usage", [["accounts", "AccountUsage"]]],
7215
+ // 1.73/1.79: the account rows' newer fields (profile, read_source, session_cost_usd, readings).
7216
+ ["apps.accounts.list", [["accounts", "AppAccount"]]],
7184
7217
  ["resources.snapshot", [["disks", "ResourcesDisk"]]],
7185
7218
  ["stack.state", [["servers", "StackServer"]]],
7186
7219
  ["account.agents.list", [["agents", "AccountAgent"]]],
@@ -7311,6 +7344,7 @@ function forPeer(op, part, value, version) {
7311
7344
  const stripped = nested ? stripNested(top, nested, version) : top;
7312
7345
  if (op === "coding.providers") return providersForPeer(stripped, version);
7313
7346
  if (op === "coding.history" || op === "coding.transcript.read") return transcriptItemsForPeer(stripped, version);
7347
+ if (op === "apps.setup.list") return setupItemsForPeer(stripped, version);
7314
7348
  return op === "apps.windows.list" ? windowListRemoteControlForPeer(stripped, version) : stripped;
7315
7349
  }
7316
7350
  if (value === null || typeof value !== "object") return value;
@@ -7328,7 +7362,7 @@ function forPeer(op, part, value, version) {
7328
7362
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
7329
7363
 
7330
7364
  // src/contract.ts
7331
- var CONTRACT_SHA256 = "f3aa46d23626de5c1c5e80517d6f71ed4ba9ecf33991b66bcfc46cc0d48bae17";
7365
+ var CONTRACT_SHA256 = "c416872bf8877ac2f210f9a4da3c7873a49879bfe07d4c58f4f29dc91e09be27";
7332
7366
 
7333
7367
  // src/close-policy.ts
7334
7368
  var CLOSE_RULES = {