@ai-matrx/desktop-protocol 0.18.0 → 0.19.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.0 (protocol 1.19)
4
+
5
+ - **A whole project into one window.** `apps.projects.to_window {app_key, project_id, window, take_off, group, dry_run}` puts every chat of a project into one window in one pass. `take_off` also takes each off its other side windows where safe (never main, the holder, a window where it is open, or its last place); every chat left alone comes back in `skipped` with the window and the reason. `group` files them under a sidebar group named after the project in that window (only while it is closed; `group.reason` says why not). `dry_run` returns the plan and writes nothing. Additive; older peers never call it.
6
+ - Includes protocol 1.18 (a local server's `cpu_percent`, `memory_bytes`).
7
+
8
+ **Consumer action:** none (new op).
9
+
3
10
  ## 0.18.0
4
11
 
5
12
  The three UUID-shaped ids (`DeviceId`, the desktop app profile id, a coding session's `user_id`) take their pattern from `@ai-matrx/kit/uuid`'s `UUID_SHAPE_PATTERN` instead of spelling the regex. The generated JSON Schema and Pydantic models are byte-identical (`generate --check` contract hash unchanged). New dependency: `@ai-matrx/kit`.
package/dist/client.cjs CHANGED
@@ -144,7 +144,7 @@ var import_zod2 = require("zod");
144
144
  var import_zod = require("zod");
145
145
  var import_uuid = require("@ai-matrx/kit/uuid");
146
146
  var PROTOCOL_MAJOR = 1;
147
- var PROTOCOL_MINOR = 17;
147
+ var PROTOCOL_MINOR = 19;
148
148
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
149
149
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
150
150
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -1325,7 +1325,11 @@ var StackServer = import_zod20.z.strictObject({
1325
1325
  started_at_ms: epochMs.nullable(),
1326
1326
  restarts: nonNegInt,
1327
1327
  exit_code: import_zod20.z.int().nullable(),
1328
- pid: import_zod20.z.int().nullable()
1328
+ pid: import_zod20.z.int().nullable(),
1329
+ /** (1.18) CPU of the server's process and everything under it, in percent of one core; absent when it is not running. */
1330
+ cpu_percent: import_zod20.z.number().min(0).optional(),
1331
+ /** (1.18) Memory of the same processes: the physical footprint (Activity Monitor's Memory) summed; absent when it is not running. */
1332
+ memory_bytes: nonNegInt.optional()
1329
1333
  });
1330
1334
  var StackEvent = import_zod20.z.strictObject({
1331
1335
  at_ms: epochMs,
@@ -1899,6 +1903,43 @@ var AppsProjectsCreateParams = import_zod26.z.strictObject({ app_key: AppKey, na
1899
1903
  var AppsProjectsCreateResult = import_zod26.z.strictObject({ project: ChatProject });
1900
1904
  var AppsProjectsImportPinsParams = import_zod26.z.strictObject({ app_key: AppKey });
1901
1905
  var AppsProjectsImportPinsResult = import_zod26.z.strictObject({ message: import_zod26.z.string().max(400) });
1906
+ var ProjectMoveChat = import_zod26.z.strictObject({ chat_id: ChatId, title: import_zod26.z.string().max(300) });
1907
+ var ProjectMoveSkip = import_zod26.z.strictObject({ chat_id: ChatId, title: import_zod26.z.string().max(300), window: ChatPlace.nullable(), reason: import_zod26.z.string().max(400) });
1908
+ var ProjectMoveGroup = import_zod26.z.strictObject({
1909
+ ok: import_zod26.z.boolean(),
1910
+ name: import_zod26.z.string().max(200),
1911
+ /** Why it is not (or was not) grouped — e.g. the window is open. */
1912
+ reason: import_zod26.z.string().max(400).optional(),
1913
+ /** Chats that get (or got) the group; already in it; taken from another group of the window. */
1914
+ assign: nonNegInt.optional(),
1915
+ already: nonNegInt.optional(),
1916
+ from_other_groups: nonNegInt.optional(),
1917
+ /** A group of that name was already there (reused, never doubled). */
1918
+ group_exists: import_zod26.z.boolean().optional()
1919
+ });
1920
+ var AppsProjectsToWindowParams = import_zod26.z.strictObject({
1921
+ app_key: AppKey,
1922
+ project_id: ChatProjectId,
1923
+ window: ChatPlace,
1924
+ /** Also take each chat off its other side windows where safe (never main, the holder, an open window). */
1925
+ take_off: import_zod26.z.boolean().default(false),
1926
+ /** Also group them under the project's name in that window's sidebar (closed windows only). */
1927
+ group: import_zod26.z.boolean().default(false),
1928
+ dry_run: import_zod26.z.boolean().default(false)
1929
+ });
1930
+ var AppsProjectsToWindowResult = import_zod26.z.strictObject({
1931
+ project_id: ChatProjectId,
1932
+ window: ChatPlace,
1933
+ dry_run: import_zod26.z.boolean(),
1934
+ place: import_zod26.z.array(ProjectMoveChat).max(5e3),
1935
+ already: import_zod26.z.array(ProjectMoveChat).max(5e3),
1936
+ take_off: import_zod26.z.array(ProjectMoveChat.extend({ window: ChatPlace })).max(2e4),
1937
+ skipped: import_zod26.z.array(ProjectMoveSkip).max(2e4),
1938
+ /** Chats of the project from other apps (no windows to place into), left as they are. */
1939
+ other_apps: nonNegInt,
1940
+ group: ProjectMoveGroup.nullable(),
1941
+ message: import_zod26.z.string().max(400)
1942
+ });
1902
1943
  var ColdChat = import_zod26.z.strictObject({
1903
1944
  id: ChatId,
1904
1945
  title: import_zod26.z.string().max(1e3),
@@ -2057,6 +2098,7 @@ var OPS = {
2057
2098
  "apps.projects.move": { params: AppsProjectsMoveParams, result: AppsProjectsMoveResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2058
2099
  "apps.projects.create": { params: AppsProjectsCreateParams, result: AppsProjectsCreateResult, kind: "unary", since: "1.10", errors: ["INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2059
2100
  "apps.projects.import_pins": { params: AppsProjectsImportPinsParams, result: AppsProjectsImportPinsResult, kind: "unary", since: "1.10", errors: ["CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2101
+ "apps.projects.to_window": { params: AppsProjectsToWindowParams, result: AppsProjectsToWindowResult, kind: "unary", since: "1.19", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2060
2102
  // 1.11: Going cold, Spend, sync health, windows upkeep.
2061
2103
  "apps.chats.cold": { params: AppsChatsColdParams, result: AppsChatsColdResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2062
2104
  "apps.chats.open": { params: AppsChatsOpenParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },