@ai-matrx/desktop-protocol 0.21.88 → 0.21.90

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,9 +1,9 @@
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 { D as DesktopProtocolError, O as OpName, a as OpParams, b as OpResult } from './models-D3M1i8vc.cjs';
4
+ import { D as DesktopProtocolError, O as OpName, a as OpParams, b as OpResult } from './models-ABh3Fmsa.cjs';
5
5
  import { Welcome, CloseOutcome, OPS, StreamMeta, EndReason, EVENTS, ClientType, ModelsTranscribeResult, TranscriptionModelId, MlProgress } from './index.cjs';
6
- export { i as isDesktopProtocolError } from './models-D3M1i8vc.cjs';
6
+ export { i as isDesktopProtocolError } from './models-ABh3Fmsa.cjs';
7
7
  import { FrameHeader } from './frame.cjs';
8
8
 
9
9
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.d.ts CHANGED
@@ -1,9 +1,9 @@
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 { D as DesktopProtocolError, O as OpName, a as OpParams, b as OpResult } from './models-D3M1i8vc.js';
4
+ import { D as DesktopProtocolError, O as OpName, a as OpParams, b as OpResult } from './models-ABh3Fmsa.js';
5
5
  import { Welcome, CloseOutcome, OPS, StreamMeta, EndReason, EVENTS, ClientType, ModelsTranscribeResult, TranscriptionModelId, MlProgress } from './index.js';
6
- export { i as isDesktopProtocolError } from './models-D3M1i8vc.js';
6
+ export { i as isDesktopProtocolError } from './models-ABh3Fmsa.js';
7
7
  import { FrameHeader } from './frame.js';
8
8
 
9
9
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  closeRule,
3
3
  knows
4
- } from "./chunk-server-4UMW5S3S.js";
4
+ } from "./chunk-server-WAAD7CFE.js";
5
5
  import {
6
6
  CloseCode,
7
7
  CoreToClientMsg,
@@ -12,7 +12,7 @@ import {
12
12
  PROTOCOL_MAJOR,
13
13
  PROTOCOL_MINOR,
14
14
  Welcome
15
- } from "./chunk-server-VYJA3PFP.js";
15
+ } from "./chunk-server-YNRFJNST.js";
16
16
  import {
17
17
  DesktopProtocolError,
18
18
  FRAME_VERSION,
@@ -28,7 +28,7 @@ var registry = null;
28
28
  var registryLoad = null;
29
29
  function loadRegistry() {
30
30
  if (registry) return Promise.resolve(registry);
31
- registryLoad ??= import("./chunk-server-MOQ6N2L2.js").then((m) => registry = m);
31
+ registryLoad ??= import("./chunk-server-Z5DQFRML.js").then((m) => registry = m);
32
32
  return registryLoad;
33
33
  }
34
34
  var WS_OPEN = 1;
package/dist/index.cjs CHANGED
@@ -138,6 +138,8 @@ __export(src_exports, {
138
138
  AppsSyncRunParams: () => AppsSyncRunParams,
139
139
  AppsSyncStatusParams: () => AppsSyncStatusParams,
140
140
  AppsSyncStatusResult: () => AppsSyncStatusResult,
141
+ AppsWeightParams: () => AppsWeightParams,
142
+ AppsWeightResult: () => AppsWeightResult,
141
143
  AppsWindowActionResult: () => AppsWindowActionResult,
142
144
  AppsWindowsAddParams: () => AppsWindowsAddParams,
143
145
  AppsWindowsForgetParams: () => AppsWindowsForgetParams,
@@ -898,6 +900,14 @@ __export(src_exports, {
898
900
  WebSearchResult: () => WebSearchResult,
899
901
  WebSourceNotice: () => WebSourceNotice,
900
902
  WebSourceState: () => WebSourceState,
903
+ WeightGuard: () => WeightGuard,
904
+ WeightGuardStop: () => WeightGuardStop,
905
+ WeightMachine: () => WeightMachine,
906
+ WeightOrphan: () => WeightOrphan,
907
+ WeightProcess: () => WeightProcess,
908
+ WeightSession: () => WeightSession,
909
+ WeightThresholds: () => WeightThresholds,
910
+ WeightTotals: () => WeightTotals,
901
911
  Welcome: () => Welcome,
902
912
  WindowFocusParams: () => WindowFocusParams,
903
913
  WindowFocusResult: () => WindowFocusResult,
@@ -960,7 +970,7 @@ module.exports = __toCommonJS(src_exports);
960
970
  var import_zod = require("zod");
961
971
  var import_uuid = require("@ai-matrx/kit/uuid");
962
972
  var PROTOCOL_MAJOR = 1;
963
- var PROTOCOL_MINOR = 81;
973
+ var PROTOCOL_MINOR = 82;
964
974
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
965
975
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
966
976
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -3044,6 +3054,76 @@ var AppsWindowsUpdateAndReopenResult = import_zod14.z.strictObject({
3044
3054
  /** The version installed, null when the install did not happen (or dry_run). */
3045
3055
  installed_version: import_zod14.z.string().max(64).nullable()
3046
3056
  });
3057
+ var WeightProcess = import_zod14.z.strictObject({ cmd: import_zod14.z.string().max(200), gb: import_zod14.z.number(), cpu: import_zod14.z.number() });
3058
+ var WeightSession = import_zod14.z.strictObject({
3059
+ /** The chat's id (its --resume); null for a new chat with no transcript yet. */
3060
+ id: ChatId.nullable(),
3061
+ /** Every window it runs in ("main", "work"); two or more is a duplicate. */
3062
+ windows: import_zod14.z.array(ChatPlace).max(20),
3063
+ /** Hours since its last reply; 0 while working; null when not known (a new chat). */
3064
+ idle_h: import_zod14.z.number().nullable(),
3065
+ /** The engine's word: waiting, idle, working, new. */
3066
+ state: import_zod14.z.string().max(40),
3067
+ title: import_zod14.z.string().max(1e3),
3068
+ gb: import_zod14.z.number(),
3069
+ cpu: import_zod14.z.number(),
3070
+ procs: nonNegInt,
3071
+ /** The heaviest processes of its tree, heaviest first. */
3072
+ top: import_zod14.z.array(WeightProcess).max(10),
3073
+ /** The engine's verdicts: "OLD+HEAVY", "BURNING IDLE", "dup". */
3074
+ flags: import_zod14.z.array(import_zod14.z.string().max(40)).max(10),
3075
+ /** Idle hours x (GB + cores now): the engine's sort order. */
3076
+ score: import_zod14.z.number(),
3077
+ pids: import_zod14.z.array(import_zod14.z.int().min(1)).max(50)
3078
+ });
3079
+ var WeightOrphan = import_zod14.z.strictObject({
3080
+ pid: import_zod14.z.int().min(1),
3081
+ age_h: import_zod14.z.number(),
3082
+ cmd: import_zod14.z.string().max(200),
3083
+ args: import_zod14.z.string().max(2e3),
3084
+ gb: import_zod14.z.number(),
3085
+ cpu: import_zod14.z.number(),
3086
+ procs: nonNegInt,
3087
+ top: import_zod14.z.array(WeightProcess).max(10)
3088
+ });
3089
+ var WeightMachine = import_zod14.z.strictObject({
3090
+ procs: nonNegInt,
3091
+ /** Every process's memory added up, GB. */
3092
+ gb: import_zod14.z.number(),
3093
+ /** Cores busy now (every process's CPU / 100). */
3094
+ cpu_cores: import_zod14.z.number(),
3095
+ /** Load over 1, 5 and 15 minutes. */
3096
+ load: import_zod14.z.array(import_zod14.z.number()).max(3).nullable(),
3097
+ cores: nonNegInt.nullable(),
3098
+ ram_gb: import_zod14.z.number().nullable(),
3099
+ free_gb: import_zod14.z.number().nullable(),
3100
+ compressed_gb: import_zod14.z.number().nullable(),
3101
+ swap_used_gb: import_zod14.z.number().nullable(),
3102
+ /** The kernel's memory pressure level: 1 normal, 2 warning, 4 critical. */
3103
+ pressure: nonNegInt.nullable()
3104
+ });
3105
+ var WeightGuardStop = import_zod14.z.strictObject({ at_ms: epochMs.nullable(), gb: import_zod14.z.number().nullable(), reason: import_zod14.z.string().max(400).nullable(), kind: import_zod14.z.string().max(80).nullable(), session_id: import_zod14.z.string().max(128).nullable() });
3106
+ var WeightGuard = import_zod14.z.strictObject({ daemon_alive: import_zod14.z.boolean(), stops_24h: nonNegInt, last_stops: import_zod14.z.array(WeightGuardStop).max(50) });
3107
+ var WeightThresholds = import_zod14.z.strictObject({ min_idle_h: import_zod14.z.number(), min_gb: import_zod14.z.number(), min_cpu: import_zod14.z.number() });
3108
+ var WeightTotals = import_zod14.z.strictObject({ sessions: nonNegInt, session_gb: import_zod14.z.number(), session_cores: import_zod14.z.number(), flagged: nonNegInt, flagged_gb: import_zod14.z.number(), orphan_gb: import_zod14.z.number(), orphan_cores: import_zod14.z.number() });
3109
+ var AppsWeightParams = import_zod14.z.strictObject({ app_key: AppKey, fresh: import_zod14.z.boolean().optional() });
3110
+ var AppsWeightResult = import_zod14.z.strictObject({
3111
+ app_key: AppKey,
3112
+ /** When the engine took this reading. */
3113
+ taken_at_ms: epochMs,
3114
+ sample_s: import_zod14.z.number(),
3115
+ thresholds: WeightThresholds,
3116
+ machine: WeightMachine,
3117
+ /** Null when this computer has never run the machine guard. */
3118
+ guard: WeightGuard.nullable(),
3119
+ /** Every session, highest score first. */
3120
+ sessions: import_zod14.z.array(WeightSession).max(500),
3121
+ orphans: import_zod14.z.array(WeightOrphan).max(500),
3122
+ totals: WeightTotals,
3123
+ /** When the answer was read (the last reading answers at once) and whether a newer one is being taken. */
3124
+ as_of_ms: epochMs.optional(),
3125
+ refreshing: import_zod14.z.boolean().optional()
3126
+ });
3047
3127
  var AppsChatsCopyToAccountParams = import_zod14.z.strictObject({
3048
3128
  app_key: AppKey,
3049
3129
  origin: ChatPlace,
@@ -5996,6 +6076,8 @@ var OPS = {
5996
6076
  "apps.chats.bring_back": { params: AppsChatsBringBackParams, result: AppsChatsBringBackResult, kind: "unary", since: "1.72", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5997
6077
  "apps.chats.tidy_up": { params: AppsChatsTidyUpParams, result: AppsChatsTidyUpResult, kind: "unary", since: "1.72", errors: ["INVALID_PARAMS", "NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5998
6078
  "apps.spend": { params: AppsSpendParams, result: AppsSpendResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
6079
+ // 1.82: Code › Performance (claude-app weight).
6080
+ "apps.weight": { params: AppsWeightParams, result: AppsWeightResult, kind: "unary", since: "1.82", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
5999
6081
  "apps.sync.status": { params: AppsSyncStatusParams, result: AppsSyncStatusResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
6000
6082
  "apps.sync.run": { params: AppsSyncRunParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
6001
6083
  "apps.windows.processes": { params: AppsWindowsProcessesParams, result: AppsWindowsProcessesResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -6838,6 +6920,16 @@ var NAMED_SCHEMAS = {
6838
6920
  SpendDay,
6839
6921
  AppsSpendParams,
6840
6922
  AppsSpendResult,
6923
+ WeightProcess,
6924
+ WeightSession,
6925
+ WeightOrphan,
6926
+ WeightMachine,
6927
+ WeightGuardStop,
6928
+ WeightGuard,
6929
+ WeightThresholds,
6930
+ WeightTotals,
6931
+ AppsWeightParams,
6932
+ AppsWeightResult,
6841
6933
  AppsSyncStatusParams,
6842
6934
  AppsSyncStatusResult,
6843
6935
  AppsSyncRunParams,
@@ -7471,7 +7563,7 @@ function forPeer(op, part, value, version) {
7471
7563
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
7472
7564
 
7473
7565
  // src/contract.ts
7474
- var CONTRACT_SHA256 = "f88cc7b499a4e0c6f8dd49d8c67b88d009218977e625330423421d231e1cca80";
7566
+ var CONTRACT_SHA256 = "4a4618c98fed42dea8316d756cf0a95cd6b0bbe1d5d8458b09efed2a071475b0";
7475
7567
 
7476
7568
  // src/close-policy.ts
7477
7569
  var CLOSE_RULES = {