@ai-matrx/desktop-protocol 0.21.32 → 0.21.34

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.cjs CHANGED
@@ -108,6 +108,8 @@ __export(src_exports, {
108
108
  AppsSyncStatusResult: () => AppsSyncStatusResult,
109
109
  AppsWindowActionResult: () => AppsWindowActionResult,
110
110
  AppsWindowsAddParams: () => AppsWindowsAddParams,
111
+ AppsWindowsGroupsParams: () => AppsWindowsGroupsParams,
112
+ AppsWindowsGroupsResult: () => AppsWindowsGroupsResult,
111
113
  AppsWindowsListParams: () => AppsWindowsListParams,
112
114
  AppsWindowsListResult: () => AppsWindowsListResult,
113
115
  AppsWindowsOpenParams: () => AppsWindowsOpenParams,
@@ -549,6 +551,16 @@ __export(src_exports, {
549
551
  OsGrantState: () => OsGrantState,
550
552
  OsPermissionName: () => OsPermissionName,
551
553
  OsRequirementName: () => OsRequirementName,
554
+ OutlookAccount: () => OutlookAccount,
555
+ OutlookDraftParams: () => OutlookDraftParams,
556
+ OutlookDraftResult: () => OutlookDraftResult,
557
+ OutlookListParams: () => OutlookListParams,
558
+ OutlookListResult: () => OutlookListResult,
559
+ OutlookMessage: () => OutlookMessage,
560
+ OutlookReadParams: () => OutlookReadParams,
561
+ OutlookReadResult: () => OutlookReadResult,
562
+ OutlookStatusParams: () => OutlookStatusParams,
563
+ OutlookStatusResult: () => OutlookStatusResult,
552
564
  PERMISSIONS_SINCE: () => PERMISSIONS_SINCE,
553
565
  PING_TEXT: () => PING_TEXT,
554
566
  PONG_TEXT: () => PONG_TEXT,
@@ -580,6 +592,7 @@ __export(src_exports, {
580
592
  ProcSort: () => ProcSort,
581
593
  ProjectMoveChat: () => ProjectMoveChat,
582
594
  ProjectMoveGroup: () => ProjectMoveGroup,
595
+ ProjectMoveOutcome: () => ProjectMoveOutcome,
583
596
  ProjectMovePin: () => ProjectMovePin,
584
597
  ProjectMoveSkip: () => ProjectMoveSkip,
585
598
  ProtocolErrorBody: () => ProtocolErrorBody,
@@ -788,6 +801,7 @@ __export(src_exports, {
788
801
  Welcome: () => Welcome,
789
802
  WindowFocusParams: () => WindowFocusParams,
790
803
  WindowFocusResult: () => WindowFocusResult,
804
+ WindowGroup: () => WindowGroup,
791
805
  WindowInfo: () => WindowInfo,
792
806
  WindowListParams: () => WindowListParams,
793
807
  WindowListResult: () => WindowListResult,
@@ -844,7 +858,7 @@ module.exports = __toCommonJS(src_exports);
844
858
  var import_zod = require("zod");
845
859
  var import_uuid = require("@ai-matrx/kit/uuid");
846
860
  var PROTOCOL_MAJOR = 1;
847
- var PROTOCOL_MINOR = 42;
861
+ var PROTOCOL_MINOR = 44;
848
862
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
849
863
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
850
864
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -2307,7 +2321,27 @@ var ProjectMoveGroup = import_zod14.z.strictObject({
2307
2321
  already: nonNegInt.optional(),
2308
2322
  from_other_groups: nonNegInt.optional(),
2309
2323
  /** A group of that name was already there (reused, never doubled). */
2310
- group_exists: import_zod14.z.boolean().optional()
2324
+ group_exists: import_zod14.z.boolean().optional(),
2325
+ /** 1.43: "now" = written into the closed window; "next_close" = queued until that window closes. */
2326
+ when: import_zod14.z.enum(["now", "next_close"]).optional(),
2327
+ /** 1.43: the window's own id of the group used (absent while a new one waits to be made). */
2328
+ group_id: import_zod14.z.string().max(200).optional()
2329
+ });
2330
+ var ProjectMoveOutcome = import_zod14.z.strictObject({
2331
+ chat_id: ChatId,
2332
+ title: import_zod14.z.string().max(300),
2333
+ outcome: import_zod14.z.enum(["copied", "moved", "already", "skipped"]),
2334
+ off: import_zod14.z.array(ChatPlace).max(50),
2335
+ reason: import_zod14.z.string().max(400).nullable(),
2336
+ pin: import_zod14.z.enum(["now", "next_close", "failed"]).nullable(),
2337
+ group: import_zod14.z.enum(["now", "next_close", "failed"]).nullable()
2338
+ });
2339
+ var WindowGroup = import_zod14.z.strictObject({ id: import_zod14.z.string().max(200), name: import_zod14.z.string().max(200), count: nonNegInt });
2340
+ var AppsWindowsGroupsParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace });
2341
+ var AppsWindowsGroupsResult = import_zod14.z.strictObject({
2342
+ window: ChatPlace,
2343
+ open: import_zod14.z.boolean(),
2344
+ groups: import_zod14.z.array(WindowGroup).max(1e3)
2311
2345
  });
2312
2346
  var ProjectMovePin = import_zod14.z.strictObject({
2313
2347
  ok: import_zod14.z.boolean(),
@@ -2328,8 +2362,12 @@ var AppsProjectsToWindowParams = import_zod14.z.strictObject({
2328
2362
  window: ChatPlace,
2329
2363
  /** Also take each chat off its other side windows where safe (never main, the holder, an open window). */
2330
2364
  take_off: import_zod14.z.boolean().default(false),
2331
- /** Also group them under the project's name in that window's sidebar (closed windows only). */
2365
+ /** Also group them under the project's name in that window's sidebar (1.43: an open window's is queued for its next close). */
2332
2366
  group: import_zod14.z.boolean().default(false),
2367
+ /** 1.43: group them into this existing group of the window (apps.windows.groups); implies group. */
2368
+ group_id: import_zod14.z.string().min(1).max(200).optional(),
2369
+ /** 1.43: group them under this name (an existing group of that name is reused, else made); implies group. */
2370
+ group_name: import_zod14.z.string().trim().min(1).max(200).optional(),
2333
2371
  /** 1.32: also pin them in that window (now if closed, else when it next closes). */
2334
2372
  pin: import_zod14.z.boolean().optional(),
2335
2373
  /** 1.36: a batch: exactly these chats of the project and no other (a reused marker is a label, never a sweep). */
@@ -2351,6 +2389,8 @@ var AppsProjectsToWindowResult = import_zod14.z.strictObject({
2351
2389
  group: ProjectMoveGroup.nullable(),
2352
2390
  /** 1.32: the pin in the target window (absent: not asked). */
2353
2391
  pin: ProjectMovePin.optional(),
2392
+ /** 1.43: one row per chat, what happened to it (absent from an older core). */
2393
+ chats: import_zod14.z.array(ProjectMoveOutcome).max(5e3).optional(),
2354
2394
  message: import_zod14.z.string().max(400)
2355
2395
  });
2356
2396
  var ColdChat = import_zod14.z.strictObject({
@@ -4505,6 +4545,70 @@ var MailSendParams = import_zod36.z.strictObject({
4505
4545
  send: import_zod36.z.boolean().default(true)
4506
4546
  });
4507
4547
  var MailSendResult = import_zod36.z.strictObject({ sent: import_zod36.z.boolean() });
4548
+ var OutlookStatusParams = import_zod36.z.strictObject({});
4549
+ var OutlookAccount = import_zod36.z.strictObject({ name: import_zod36.z.string(), email: import_zod36.z.string().nullable() });
4550
+ var OutlookStatusResult = import_zod36.z.strictObject({
4551
+ /** classic_windows: scriptable. new_windows / mac: installed, not scriptable. none: not found. */
4552
+ client: import_zod36.z.enum(["classic_windows", "new_windows", "mac", "none"]),
4553
+ scriptable: import_zod36.z.boolean(),
4554
+ version: import_zod36.z.string().nullable(),
4555
+ accounts: import_zod36.z.array(OutlookAccount),
4556
+ /** Why it is not scriptable here, in a sentence the person can act on; null when it is. */
4557
+ reason: import_zod36.z.string().nullable()
4558
+ });
4559
+ var Address = import_zod36.z.string().min(3).max(320);
4560
+ var OutlookDraftParams = import_zod36.z.strictObject({
4561
+ to: import_zod36.z.array(Address).max(100).default([]),
4562
+ cc: import_zod36.z.array(Address).max(100).default([]),
4563
+ bcc: import_zod36.z.array(Address).max(100).default([]),
4564
+ subject: import_zod36.z.string().max(998).default(""),
4565
+ body: import_zod36.z.string().max(1048576).default(""),
4566
+ body_format: import_zod36.z.enum(["text", "html"]).default("text"),
4567
+ /** Files on this computer to attach (absolute paths). */
4568
+ attachments: import_zod36.z.array(import_zod36.z.string().min(1).max(4096)).max(50).default([]),
4569
+ /** The sending account's address (one of outlook.status's accounts); absent: Outlook's default. */
4570
+ account: Address.optional(),
4571
+ /** true also opens the draft in a window for the person. */
4572
+ display: import_zod36.z.boolean().default(false)
4573
+ });
4574
+ var OutlookDraftResult = import_zod36.z.strictObject({
4575
+ /** The draft's id in Outlook (outlook.read takes it). */
4576
+ id: import_zod36.z.string(),
4577
+ account: import_zod36.z.string().nullable(),
4578
+ folder: import_zod36.z.string(),
4579
+ attachments: nonNegInt,
4580
+ displayed: import_zod36.z.boolean()
4581
+ });
4582
+ var OutlookListParams = import_zod36.z.strictObject({
4583
+ folder: import_zod36.z.enum(["inbox", "sent", "drafts"]).default("inbox"),
4584
+ /** The account's address; absent: the default account. */
4585
+ account: Address.optional(),
4586
+ unread_only: import_zod36.z.boolean().default(false),
4587
+ limit: import_zod36.z.int().min(1).max(200).default(25)
4588
+ });
4589
+ var OutlookMessage = import_zod36.z.strictObject({
4590
+ id: import_zod36.z.string(),
4591
+ subject: import_zod36.z.string(),
4592
+ sender: import_zod36.z.string(),
4593
+ received_at_ms: epochMs.nullable(),
4594
+ read: import_zod36.z.boolean(),
4595
+ has_attachments: import_zod36.z.boolean(),
4596
+ /** The first lines of the message's text. */
4597
+ preview: import_zod36.z.string()
4598
+ });
4599
+ var OutlookListResult = import_zod36.z.strictObject({ folder: import_zod36.z.string(), messages: import_zod36.z.array(OutlookMessage) });
4600
+ var OutlookReadParams = import_zod36.z.strictObject({ id: import_zod36.z.string().min(1).max(1024) });
4601
+ var OutlookReadResult = import_zod36.z.strictObject({
4602
+ id: import_zod36.z.string(),
4603
+ subject: import_zod36.z.string(),
4604
+ sender: import_zod36.z.string(),
4605
+ to: import_zod36.z.array(import_zod36.z.string()),
4606
+ cc: import_zod36.z.array(import_zod36.z.string()),
4607
+ received_at_ms: epochMs.nullable(),
4608
+ /** The plain text body, cut at 1 MiB. */
4609
+ body: import_zod36.z.string(),
4610
+ attachments: import_zod36.z.array(import_zod36.z.strictObject({ name: import_zod36.z.string(), size: nonNegInt }))
4611
+ });
4508
4612
  var MessagesChatsParams = import_zod36.z.strictObject({ limit: import_zod36.z.int().min(1).max(200).default(25) });
4509
4613
  var MessagesChat = import_zod36.z.strictObject({
4510
4614
  chat_id: import_zod36.z.string(),
@@ -5042,6 +5146,7 @@ var OPS = {
5042
5146
  "diag.errors.list": { params: DiagErrorsListParams, result: DiagErrorsListResult, kind: "unary", since: "1.20", errors: ["INTERNAL"] },
5043
5147
  "diag.errors.report": { params: DiagErrorsReportParams, result: DiagErrorsReportResult, kind: "unary", since: "1.20", errors: ["INTERNAL"] },
5044
5148
  // 1.21: what a window's sidebar draws (the Move-all grouping check).
5149
+ "apps.windows.groups": { params: AppsWindowsGroupsParams, result: AppsWindowsGroupsResult, kind: "unary", since: "1.43", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5045
5150
  "apps.windows.shown": { params: AppsWindowsShownParams, result: AppsWindowsShownResult, kind: "unary", since: "1.21", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5046
5151
  // Claude Code history (SPEC §6 coding): served by the `coding` Python service through SERVICES below.
5047
5152
  "coding.history.import_missing": { params: CodingHistoryImportMissingParams, result: CodingHistoryImportMissingResult, kind: "unary", since: "1.5", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "INTERNAL"] },
@@ -5139,6 +5244,10 @@ var OPS = {
5139
5244
  "mail.accounts": { params: MailAccountsParams, result: MailAccountsResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
5140
5245
  "mail.list": { params: MailListParams, result: MailListResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
5141
5246
  "mail.send": { params: MailSendParams, result: MailSendResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
5247
+ "outlook.status": { params: OutlookStatusParams, result: OutlookStatusResult, kind: "unary", since: "1.44", errors: ["TIMEOUT", "INTERNAL"] },
5248
+ "outlook.draft": { params: OutlookDraftParams, result: OutlookDraftResult, kind: "unary", since: "1.44", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
5249
+ "outlook.list": { params: OutlookListParams, result: OutlookListResult, kind: "unary", since: "1.44", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
5250
+ "outlook.read": { params: OutlookReadParams, result: OutlookReadResult, kind: "unary", since: "1.44", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
5142
5251
  "messages.chats": { params: MessagesChatsParams, result: MessagesChatsResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
5143
5252
  "messages.list": { params: MessagesListParams, result: MessagesListResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
5144
5253
  "messages.send": { params: MessagesSendParams, result: MessagesSendResult, kind: "unary", since: "1.37", errors: ["INVALID_PARAMS", "NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
@@ -5686,6 +5795,10 @@ var NAMED_SCHEMAS = {
5686
5795
  ShownSection,
5687
5796
  AppsWindowsShownParams,
5688
5797
  AppsWindowsShownResult,
5798
+ ProjectMoveOutcome,
5799
+ WindowGroup,
5800
+ AppsWindowsGroupsParams,
5801
+ AppsWindowsGroupsResult,
5689
5802
  ColdChat,
5690
5803
  AppsChatsColdParams,
5691
5804
  AppsChatsColdResult,
@@ -5881,6 +5994,16 @@ var NAMED_SCHEMAS = {
5881
5994
  MailListResult,
5882
5995
  MailSendParams,
5883
5996
  MailSendResult,
5997
+ OutlookStatusParams,
5998
+ OutlookAccount,
5999
+ OutlookStatusResult,
6000
+ OutlookDraftParams,
6001
+ OutlookDraftResult,
6002
+ OutlookListParams,
6003
+ OutlookMessage,
6004
+ OutlookListResult,
6005
+ OutlookReadParams,
6006
+ OutlookReadResult,
5884
6007
  MessagesChatsParams,
5885
6008
  MessagesChat,
5886
6009
  MessagesChatsResult,
@@ -5990,8 +6113,9 @@ var FIELDS_SINCE = {
5990
6113
  PowerStatusResult: { energy: "1.24" },
5991
6114
  AppsSpendResult: { days: "1.24" },
5992
6115
  AppsWindowsUpdateStateResult: { closed_by_update: "1.27" },
5993
- AppsProjectsToWindowParams: { pin: "1.32", chat_ids: "1.36", take_off_from: "1.36" },
5994
- AppsProjectsToWindowResult: { pin: "1.32" },
6116
+ AppsProjectsToWindowParams: { pin: "1.32", chat_ids: "1.36", take_off_from: "1.36", group_id: "1.43", group_name: "1.43" },
6117
+ AppsProjectsToWindowResult: { pin: "1.32", chats: "1.43" },
6118
+ ProjectMoveGroup: { when: "1.43", group_id: "1.43" },
5995
6119
  AppsChatsTitlesCheckResult: { stale_windows: "1.33" },
5996
6120
  AccountAgent: { tags: "1.39", model_id: "1.39", access_level: "1.39", organization_id: "1.39", origin: "1.39", is_archived: "1.39", orchestra: "1.39" },
5997
6121
  WebScrapeParams: { engine: "1.40", land: "1.40" },
@@ -6085,7 +6209,8 @@ var RESULT_PATH = /* @__PURE__ */ new Map([
6085
6209
  ["apps.accounts.resets", "AppsAccountsResetsResult"],
6086
6210
  ["apps.windows.update_state", "AppsWindowsUpdateStateResult"],
6087
6211
  ["web.fetch_with_browser", "WebBrowserFetchResult"],
6088
- ["sysinfo.get", "SysinfoGetResult"]
6212
+ ["sysinfo.get", "SysinfoGetResult"],
6213
+ ["apps.projects.to_window", "AppsProjectsToWindowResult"]
6089
6214
  ]);
6090
6215
  var NESTED_RESULTS = /* @__PURE__ */ new Map([
6091
6216
  ["apps.chats.list", [["chats", "ChatRow"]]],
@@ -6100,7 +6225,8 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
6100
6225
  ["stack.state", [["servers", "StackServer"]]],
6101
6226
  ["account.agents.list", [["agents", "AccountAgent"]]],
6102
6227
  ["web.scrape", [["pages", "WebScrapePage"]]],
6103
- ["sysinfo.get", [["permissions", "SysinfoGetResult.permissions[]"]]]
6228
+ ["sysinfo.get", [["permissions", "SysinfoGetResult.permissions[]"]]],
6229
+ ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]]
6104
6230
  ]);
6105
6231
  function stripNested(value, nested, version) {
6106
6232
  if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
@@ -6162,7 +6288,7 @@ function forPeer(op, part, value, version) {
6162
6288
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
6163
6289
 
6164
6290
  // src/contract.ts
6165
- var CONTRACT_SHA256 = "c96c1a43bc4b34d518fa088be9300d96baab63938ce0dbfb9425cdc706097668";
6291
+ var CONTRACT_SHA256 = "0024b25ed8c4984e38962ec31d70ee685f0cf158efdfb12ac7695d192045bc37";
6166
6292
 
6167
6293
  // src/close-policy.ts
6168
6294
  var CLOSE_RULES = {
@@ -6229,6 +6355,7 @@ var TOOL_CATALOG = [
6229
6355
  // ── 3. Personal apps and automation (1.37: the core's `automation`, `personal`, `net` and `schedule` owners) ──
6230
6356
  { name: "desktop_automation", group: "personal_automation", state: "built", path: "device_op", ops: ["automation.script"], platforms: ["darwin", "win32"], summary: "AppleScript or JavaScript for Automation on a Mac, PowerShell on Windows" },
6231
6357
  { name: "desktop_mail", group: "personal_automation", state: "built", path: "device_op", ops: ["mail.accounts", "mail.list", "mail.send"], platforms: ["darwin"], summary: "The Mail app: accounts, messages, send" },
6358
+ { name: "desktop_outlook", group: "personal_automation", state: "built", path: "device_op", ops: ["outlook.status", "outlook.draft", "outlook.list", "outlook.read"], platforms: ["win32"], summary: "The person's own Outlook: drafts with attachments, recent mail, one message" },
6232
6359
  { name: "desktop_messages", group: "personal_automation", state: "built", path: "device_op", ops: ["messages.chats", "messages.list", "messages.send"], platforms: ["darwin"], summary: "The Messages app: chats, messages, send" },
6233
6360
  { name: "desktop_contacts", group: "personal_automation", state: "built", path: "device_op", ops: ["contacts.search", "contacts.get"], platforms: ["darwin"], summary: "Contacts: search, one card" },
6234
6361
  { name: "desktop_calendar", group: "personal_automation", state: "built", path: "device_op", ops: ["calendar.list", "calendar.create", "reminders.list", "reminders.create"], platforms: ["darwin"], summary: "Calendar and Reminders: list and add" },