@ai-matrx/desktop-protocol 0.21.30 → 0.21.32

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
@@ -2,7 +2,7 @@
2
2
  import { z } from "zod";
3
3
  import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
4
4
  var PROTOCOL_MAJOR = 1;
5
- var PROTOCOL_MINOR = 39;
5
+ var PROTOCOL_MINOR = 42;
6
6
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
7
7
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
8
8
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -394,8 +394,17 @@ var OsPermissionName = z5.enum([
394
394
  "location",
395
395
  "local_network",
396
396
  "bluetooth",
397
- "notifications"
397
+ "notifications",
398
+ // (1.41) Matrx Local's remaining kinds, checked on every OS (its permissions checker): a peer
399
+ // older than 1.41 is never sent these rows (versioning.ts PERMISSIONS_SINCE).
400
+ "reminders",
401
+ "speech_recognition",
402
+ "messages",
403
+ "mail",
404
+ "wifi"
398
405
  ]);
406
+ var OsGrantState = z5.enum(["granted", "denied", "not_determined", "not_applicable"]);
407
+ var OsRequirementName = z5.enum(["secret_storage", "tray", "display_server", "helper_programs", "smart_app_control", "path_length"]);
399
408
  var SysinfoGetParams = z5.strictObject({});
400
409
  var SysinfoGetResult = z5.strictObject({
401
410
  device_id: DeviceId,
@@ -425,9 +434,20 @@ var SysinfoGetResult = z5.strictObject({
425
434
  z5.strictObject({
426
435
  name: OsPermissionName,
427
436
  state: z5.enum(["granted", "denied", "not_determined", "not_applicable"]),
428
- settings_url: z5.string().max(512).nullable()
437
+ settings_url: z5.string().max(512).nullable(),
438
+ /** (1.41) One short fact when the state alone does not say it ("No camera", "Bluetooth is off"); absent when there is none. */
439
+ detail: z5.string().max(256).optional()
429
440
  })
430
- )
441
+ ),
442
+ /** (1.41) The requirements beyond the grants (OsRequirementName), each read when asked. */
443
+ requirements: z5.array(
444
+ z5.strictObject({
445
+ name: OsRequirementName,
446
+ state: OsGrantState,
447
+ settings_url: z5.string().max(512).nullable(),
448
+ detail: z5.string().max(256).nullable()
449
+ })
450
+ ).optional()
431
451
  });
432
452
  var SysinfoHardwareParams = z5.strictObject({});
433
453
  var SysinfoHardwareResult = z5.strictObject({
@@ -1866,10 +1886,12 @@ var GitCloneParams = z19.strictObject({
1866
1886
  });
1867
1887
 
1868
1888
  // src/schema/web.ts
1889
+ import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN4 } from "@ai-matrx/kit/uuid";
1869
1890
  import { z as z20 } from "zod";
1870
1891
  var WEB_MAX_TEXT_CHARS = 524288;
1871
1892
  var WebUrl = z20.string().min(1).max(8192).regex(/^https?:\/\//);
1872
1893
  var WebText = z20.string().max(WEB_MAX_TEXT_CHARS);
1894
+ var OrgId = z20.string().regex(UUID_SHAPE_PATTERN4);
1873
1895
  var WebHeader = z20.strictObject({ name: z20.string().min(1).max(256), value: z20.string().max(8192) });
1874
1896
  var WebFetchParams = z20.strictObject({
1875
1897
  url: WebUrl,
@@ -1891,10 +1913,65 @@ var WebFetchResult = z20.strictObject({
1891
1913
  bytes: nonNegInt,
1892
1914
  elapsed_ms: nonNegInt
1893
1915
  });
1916
+ var WebAttachTarget = z20.strictObject({
1917
+ entity_type: z20.string().min(1).max(64),
1918
+ entity_id: z20.string().min(1).max(128),
1919
+ label: z20.string().max(200).optional()
1920
+ });
1921
+ var WebLand = z20.strictObject({
1922
+ /** The organization the page is saved in; absent: this computer's active organization. */
1923
+ organization_id: OrgId.optional(),
1924
+ /** Keep it: AI processing starts (chunks, search). Unkept pages are saved and wait. */
1925
+ keep: z20.boolean().default(false),
1926
+ attach_to: z20.array(WebAttachTarget).max(8).default([])
1927
+ });
1928
+ var WebNotSavedReason = z20.enum([
1929
+ /** Nobody is signed in on this computer. Saved on sign-in. */
1930
+ "signed_out",
1931
+ /** AI Matrx could not be reached. Retried on its own. */
1932
+ "offline",
1933
+ /** AI Matrx refused it (the message says why). Kept until the person retries or discards it. */
1934
+ "rejected",
1935
+ /** Waiting its turn behind other pages (retried on its own). */
1936
+ "queued"
1937
+ ]);
1938
+ var WebSourceNotice = z20.strictObject({ code: z20.string().max(120), message: z20.string().max(2e3), remedy: z20.string().max(120) });
1939
+ var WebSourceState = z20.discriminatedUnion("state", [
1940
+ z20.strictObject({
1941
+ state: z20.literal("saved"),
1942
+ processed_document_id: z20.string().min(1).max(64),
1943
+ source_id: z20.string().min(1).max(128),
1944
+ /** The page was already saved and nothing changed ("Already saved, no change"). */
1945
+ reused_existing: z20.boolean(),
1946
+ /** The page changed: this is a new version of that Source. */
1947
+ new_version_of: z20.string().max(64).nullable(),
1948
+ kept: z20.boolean(),
1949
+ intelligence: z20.enum(["queued", "deferred", "never"]),
1950
+ /** The original page as captured, kept by AI Matrx (null: the organization keeps none). */
1951
+ original_file_id: z20.string().max(128).nullable(),
1952
+ /** The organization it was saved in. */
1953
+ organization_id: OrgId,
1954
+ notices: z20.array(WebSourceNotice).max(20)
1955
+ }),
1956
+ z20.strictObject({
1957
+ state: z20.literal("not_saved"),
1958
+ outbox_id: z20.string().min(1).max(64),
1959
+ reason: WebNotSavedReason,
1960
+ message: z20.string().max(2e3)
1961
+ })
1962
+ ]);
1894
1963
  var WebScrapeParams = z20.strictObject({
1895
1964
  urls: z20.array(WebUrl).min(1).max(20),
1896
1965
  use_cache: z20.boolean().default(true),
1897
- get_links: z20.boolean().default(false)
1966
+ get_links: z20.boolean().default(false),
1967
+ /**
1968
+ * Since 1.38. `auto` (absent): this computer's scraper (HTTP, its browser only when a page needs
1969
+ * it). `browser`: this computer's own browser renders every page. `server`: AI Matrx's servers
1970
+ * read it (their connection, not this computer's; saved there as a web capture).
1971
+ */
1972
+ engine: z20.enum(["auto", "browser", "server"]).optional(),
1973
+ /** Since 1.38: where the pages are saved (see WebLand). */
1974
+ land: WebLand.optional()
1898
1975
  });
1899
1976
  var WebScrapePage = z20.strictObject({
1900
1977
  url: z20.string(),
@@ -1909,7 +1986,9 @@ var WebScrapePage = z20.strictObject({
1909
1986
  /** Why the page failed (blocked, timeout, not found…), in the scraper's words; null when ok. */
1910
1987
  error: z20.string().nullable(),
1911
1988
  /** How the page was fetched (http, browser, cache). */
1912
- via: z20.string().nullable()
1989
+ via: z20.string().nullable(),
1990
+ /** Since 1.38: the page's Source (absent from a 1.37 core, and for a page that failed). */
1991
+ source: WebSourceState.optional()
1913
1992
  });
1914
1993
  var WebScrapeResult = z20.strictObject({ pages: z20.array(WebScrapePage), elapsed_ms: nonNegInt });
1915
1994
  var WebSearchParams = z20.strictObject({
@@ -1933,7 +2012,9 @@ var WebBrowserFetchParams = z20.strictObject({
1933
2012
  wait_for: z20.string().max(1024).optional(),
1934
2013
  wait_timeout_ms: z20.int().min(100).max(12e4).default(3e4),
1935
2014
  /** true: readable text; false: the rendered HTML. */
1936
- extract_text: z20.boolean().default(true)
2015
+ extract_text: z20.boolean().default(true),
2016
+ /** Since 1.38: where the rendered page is saved (see WebLand). */
2017
+ land: WebLand.optional()
1937
2018
  });
1938
2019
  var WebBrowserFetchResult = z20.strictObject({
1939
2020
  url: z20.string(),
@@ -1941,7 +2022,137 @@ var WebBrowserFetchResult = z20.strictObject({
1941
2022
  title: z20.string().nullable(),
1942
2023
  content: WebText,
1943
2024
  truncated: z20.boolean(),
1944
- elapsed_ms: nonNegInt
2025
+ elapsed_ms: nonNegInt,
2026
+ /** Since 1.38: the rendered page's Source (absent from a 1.37 core). */
2027
+ source: WebSourceState.optional()
2028
+ });
2029
+ var ToolsParseFile = z20.strictObject({
2030
+ /** Absolute path of the gzipped JSON the core reads, saves and then removes. */
2031
+ path: z20.string().min(1).max(4096),
2032
+ bytes: nonNegInt
2033
+ });
2034
+ var ToolsWebScrapeParams = z20.strictObject({
2035
+ urls: z20.array(WebUrl).min(1).max(20),
2036
+ use_cache: z20.boolean().default(true),
2037
+ get_links: z20.boolean().default(false),
2038
+ /** `browser`: render every page in this computer's browser, then parse it. */
2039
+ engine: z20.enum(["auto", "browser"]).default("auto"),
2040
+ /** Pages read at once (desktop.web/scrape_concurrency). */
2041
+ concurrency: z20.int().min(1).max(20).default(5),
2042
+ /** The wait between pages from the same site (desktop.web/request_delay_ms). */
2043
+ delay_ms: z20.int().min(0).max(3e4).default(0),
2044
+ /** Where the parse files go (the core's spool folder). */
2045
+ spool_dir: z20.string().min(1).max(4096)
2046
+ });
2047
+ var ToolsWebScrapePage = z20.strictObject({
2048
+ page: WebScrapePage,
2049
+ /** The page's whole parse, for the door; null when the page failed or had no words. */
2050
+ parse: ToolsParseFile.nullable(),
2051
+ /** The page as fetched, for research (rendered HTML or the HTTP body); null when not kept. */
2052
+ html: ToolsParseFile.nullable()
2053
+ });
2054
+ var ToolsWebScrapeResult = z20.strictObject({ pages: z20.array(ToolsWebScrapePage), elapsed_ms: nonNegInt });
2055
+ var ToolsWebBrowserFetchParams = z20.strictObject({
2056
+ url: WebUrl,
2057
+ wait_for: z20.string().max(1024).optional(),
2058
+ wait_timeout_ms: z20.int().min(100).max(12e4).default(3e4),
2059
+ extract_text: z20.boolean().default(true),
2060
+ spool_dir: z20.string().min(1).max(4096)
2061
+ });
2062
+ var ToolsWebBrowserFetchResult = z20.strictObject({ result: WebBrowserFetchResult, parse: ToolsParseFile.nullable() });
2063
+ var WebRuntimeStateName = z20.enum(["not_installed", "installing", "installed", "failed"]);
2064
+ var WebRuntimeParams = z20.strictObject({});
2065
+ var WebRuntimeState = z20.strictObject({
2066
+ state: WebRuntimeStateName,
2067
+ /** Why it failed, in the installer's words; null otherwise. */
2068
+ error: z20.string().max(2e3).nullable(),
2069
+ /** Bytes the browser takes on this computer (its packages and Chromium); null when unknown. */
2070
+ size_bytes: nonNegInt.nullable(),
2071
+ /** Whether it can show a window while it works (false: only the headless shell is installed). */
2072
+ can_show_window: z20.boolean()
2073
+ });
2074
+ var WebOutboxItem = z20.strictObject({
2075
+ outbox_id: z20.string().min(1).max(64),
2076
+ url: z20.string().max(8192),
2077
+ title: z20.string().max(500).nullable(),
2078
+ organization_id: OrgId.nullable(),
2079
+ reason: WebNotSavedReason,
2080
+ message: z20.string().max(2e3),
2081
+ attempts: nonNegInt,
2082
+ created_at_ms: nonNegInt,
2083
+ last_attempt_at_ms: nonNegInt.nullable(),
2084
+ bytes: nonNegInt
2085
+ });
2086
+ var WebOutboxListParams = z20.strictObject({});
2087
+ var WebOutboxListResult = z20.strictObject({
2088
+ items: z20.array(WebOutboxItem),
2089
+ bytes: nonNegInt,
2090
+ /** The most the outbox holds; past it the oldest pages are dropped (and the log says so). */
2091
+ cap_bytes: nonNegInt
2092
+ });
2093
+ var WebOutboxRetryParams = z20.strictObject({ outbox_id: z20.string().min(1).max(64).optional() });
2094
+ var WebOutboxRetryResult = z20.strictObject({ saved: nonNegInt, waiting: nonNegInt });
2095
+ var WebOutboxDiscardParams = z20.strictObject({ outbox_id: z20.string().min(1).max(64) });
2096
+ var WebOutboxDiscardResult = z20.strictObject({ discarded: z20.boolean() });
2097
+ var WebLogVia = z20.enum(["this_computer", "browser", "server"]);
2098
+ var WebLogCaller = z20.enum(["person", "agent", "research", "phone", "other"]);
2099
+ var WebLogResult = z20.enum(["saved", "not_saved", "failed", "blocked", "read"]);
2100
+ var WebLogEntry = z20.strictObject({
2101
+ id: z20.string().min(1).max(64),
2102
+ at_ms: nonNegInt,
2103
+ caller: WebLogCaller,
2104
+ url: z20.string().max(8192),
2105
+ title: z20.string().max(500).nullable(),
2106
+ result: WebLogResult,
2107
+ /** One sentence: why it failed or was blocked, or the save's notice. Never page text. */
2108
+ detail: z20.string().max(1e3).nullable(),
2109
+ via: WebLogVia,
2110
+ duration_ms: nonNegInt,
2111
+ processed_document_id: z20.string().max(64).nullable()
2112
+ });
2113
+ var WebLogListParams = z20.strictObject({ since_ms: nonNegInt.optional(), limit: z20.int().min(1).max(1e3).default(200) });
2114
+ var WebLogListResult = z20.strictObject({ entries: z20.array(WebLogEntry) });
2115
+ var WebLogClearParams = z20.strictObject({});
2116
+ var WebLogClearResult = z20.strictObject({ cleared: nonNegInt });
2117
+ var WebProgressEvent = z20.strictObject({
2118
+ request_id: RequestId,
2119
+ phase: z20.enum(["installing", "fetching", "saving"]),
2120
+ done: nonNegInt,
2121
+ total: nonNegInt
2122
+ });
2123
+ var WebResearchItemState = z20.enum(["waiting", "fetching", "saved", "thin", "failed", "cannot_edit", "blocked"]);
2124
+ var WebResearchItem = z20.strictObject({
2125
+ topic_id: z20.string().min(1).max(64),
2126
+ topic_name: z20.string().max(500),
2127
+ source_id: z20.string().min(1).max(64),
2128
+ url: z20.string().max(8192),
2129
+ title: z20.string().max(500).nullable(),
2130
+ /** The capture level this computer would try (1 quick, 2 scroll); 3+ is the extension's. */
2131
+ level: z20.int().min(1).max(4),
2132
+ last_failure: z20.string().max(1e3).nullable(),
2133
+ state: WebResearchItemState,
2134
+ /** One sentence after a fetch: what happened. */
2135
+ message: z20.string().max(1e3).nullable()
2136
+ });
2137
+ var WebResearchQueueParams = z20.strictObject({ topic_id: z20.string().min(1).max(64).optional() });
2138
+ var WebResearchQueueResult = z20.strictObject({
2139
+ state: z20.enum(["ready", "signed_out", "unavailable"]),
2140
+ problem: z20.string().max(1e3).nullable(),
2141
+ /** L1/L2 items on topics this person can edit: what this computer can fetch. */
2142
+ items: z20.array(WebResearchItem),
2143
+ /** Items on topics the person can view but not add to (shown, never fetched). */
2144
+ view_only: nonNegInt
2145
+ });
2146
+ var WebResearchFetchParams = z20.strictObject({
2147
+ topic_id: z20.string().min(1).max(64).optional(),
2148
+ source_ids: z20.array(z20.string().min(1).max(64)).max(200).optional()
2149
+ });
2150
+ var WebResearchFetchResult = z20.strictObject({
2151
+ items: z20.array(WebResearchItem),
2152
+ saved: nonNegInt,
2153
+ thin: nonNegInt,
2154
+ failed: nonNegInt,
2155
+ cannot_edit: nonNegInt
1945
2156
  });
1946
2157
  var ToolsServiceProgress = z20.strictObject({ phase: z20.enum(["fetching", "installing"]), done: nonNegInt, total: nonNegInt });
1947
2158
 
@@ -1979,7 +2190,27 @@ var SystemSettingsPane = z21.enum([
1979
2190
  "storage",
1980
2191
  "system_report",
1981
2192
  /** (1.35) Privacy & Security › Microphone: where the person allows Matrx 2 the microphone. */
1982
- "microphone"
2193
+ "microphone",
2194
+ // (1.41) Each other privacy grant's own page (Settings › Permissions and privacy's buttons), named
2195
+ // as sysinfo's OsPermissionName so a row opens its pane by its own name. A 1.40 core refuses these
2196
+ // as INVALID_PARAMS, so a client asks only a 1.41 core for them.
2197
+ "full_disk_access",
2198
+ "accessibility",
2199
+ "screen_recording",
2200
+ "camera",
2201
+ "automation",
2202
+ "contacts",
2203
+ "calendars",
2204
+ "reminders",
2205
+ "photos",
2206
+ "location",
2207
+ "local_network",
2208
+ "bluetooth",
2209
+ "wifi",
2210
+ "notifications",
2211
+ "speech_recognition",
2212
+ "messages",
2213
+ "mail"
1983
2214
  ]);
1984
2215
  var SystemOpenSettingsParams = z21.strictObject({ pane: SystemSettingsPane });
1985
2216
  var SystemOpenSettingsResult = z21.strictObject({ pane: SystemSettingsPane });
@@ -2685,10 +2916,10 @@ var ExecJobListResult = z31.strictObject({ jobs: z31.array(ExecJobInfo).max(64)
2685
2916
 
2686
2917
  // src/schema/coding.ts
2687
2918
  import { z as z32 } from "zod";
2688
- import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN4 } from "@ai-matrx/kit/uuid";
2919
+ import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN5 } from "@ai-matrx/kit/uuid";
2689
2920
  var CodingServiceCredentials = z32.strictObject({
2690
2921
  access_token: z32.string().min(16).max(16384),
2691
- user_id: z32.string().regex(UUID_SHAPE_PATTERN4),
2922
+ user_id: z32.string().regex(UUID_SHAPE_PATTERN5),
2692
2923
  /** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
2693
2924
  server_url: z32.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
2694
2925
  });
@@ -3459,7 +3690,12 @@ var MessagesListResult = z36.strictObject({ messages: z36.array(MessagesMessage)
3459
3690
  var MessagesSendParams = z36.strictObject({
3460
3691
  /** A phone number or email the person can message. */
3461
3692
  to: z36.string().min(3).max(320),
3462
- text: z36.string().min(1).max(2e4)
3693
+ text: z36.string().min(1).max(2e4),
3694
+ /**
3695
+ * Send only over this service (Matrx Local's SendMessage `service`). Absent: iMessage first, and
3696
+ * SMS when the recipient has no iMessage (since 1.42).
3697
+ */
3698
+ service: z36.enum(["iMessage", "SMS"]).optional()
3463
3699
  });
3464
3700
  var MessagesSendResult = z36.strictObject({ sent: z36.boolean() });
3465
3701
  var ContactsSearchParams = z36.strictObject({
@@ -4013,6 +4249,16 @@ var OPS = {
4013
4249
  "web.scrape": { params: WebScrapeParams, result: WebScrapeResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
4014
4250
  "web.search": { params: WebSearchParams, result: WebSearchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
4015
4251
  "web.fetch_with_browser": { params: WebBrowserFetchParams, result: WebBrowserFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
4252
+ "web.runtime.state": { params: WebRuntimeParams, result: WebRuntimeState, kind: "unary", since: "1.40", errors: ["INTERNAL"] },
4253
+ "web.runtime.install": { params: WebRuntimeParams, result: WebRuntimeState, kind: "unary", since: "1.40", errors: ["TIMEOUT", "RESOURCE_BUSY", "CANCELLED", "INTERNAL"] },
4254
+ "web.runtime.remove": { params: WebRuntimeParams, result: WebRuntimeState, kind: "unary", since: "1.40", errors: ["RESOURCE_BUSY", "INTERNAL"] },
4255
+ "web.outbox.list": { params: WebOutboxListParams, result: WebOutboxListResult, kind: "unary", since: "1.40", errors: ["INTERNAL"] },
4256
+ "web.outbox.retry": { params: WebOutboxRetryParams, result: WebOutboxRetryResult, kind: "unary", since: "1.40", errors: ["NOT_FOUND", "AUTH_REQUIRED", "INTERNAL"] },
4257
+ "web.outbox.discard": { params: WebOutboxDiscardParams, result: WebOutboxDiscardResult, kind: "unary", since: "1.40", errors: ["NOT_FOUND", "INTERNAL"] },
4258
+ "web.log.list": { params: WebLogListParams, result: WebLogListResult, kind: "unary", since: "1.40", errors: ["INVALID_PARAMS"] },
4259
+ "web.log.clear": { params: WebLogClearParams, result: WebLogClearResult, kind: "unary", since: "1.40", errors: ["INTERNAL"] },
4260
+ "web.research.queue": { params: WebResearchQueueParams, result: WebResearchQueueResult, kind: "unary", since: "1.40", errors: ["INVALID_PARAMS", "INTERNAL"] },
4261
+ "web.research.fetch": { params: WebResearchFetchParams, result: WebResearchFetchResult, kind: "unary", since: "1.40", errors: ["INVALID_PARAMS", "AUTH_REQUIRED", "RESOURCE_BUSY", "CANCELLED", "INTERNAL"] },
4016
4262
  // 1.23: the signed-in person's own agents and Vault, read as them (the desktop's Agents library and Vault).
4017
4263
  "account.agents.list": { params: AccountAgentsListParams, result: AccountAgentsListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
4018
4264
  "account.vault.list": { params: AccountVaultListParams, result: AccountVaultListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
@@ -4103,7 +4349,9 @@ var EVENTS = {
4103
4349
  "diag.errors.changed": DiagErrorsChangedEvent,
4104
4350
  "browser.invoke": BrowserInvokeEvent,
4105
4351
  "browser.sessions_changed": BrowserSessionsChangedEvent,
4106
- "browser.progress": BrowserProgressEvent
4352
+ "browser.progress": BrowserProgressEvent,
4353
+ "web.log.entry": WebLogEntry,
4354
+ "web.progress": WebProgressEvent
4107
4355
  };
4108
4356
  var SERVICES = {
4109
4357
  ml: {
@@ -4129,9 +4377,12 @@ var SERVICES = {
4129
4377
  progress: ToolsServiceProgress,
4130
4378
  ops: {
4131
4379
  "tools.web_fetch": { params: WebFetchParams, result: WebFetchResult },
4132
- "tools.web_scrape": { params: WebScrapeParams, result: WebScrapeResult },
4380
+ "tools.web_scrape": { params: ToolsWebScrapeParams, result: ToolsWebScrapeResult },
4133
4381
  "tools.web_search": { params: ToolsWebSearchParams, result: WebSearchResult },
4134
- "tools.web_browser_fetch": { params: WebBrowserFetchParams, result: WebBrowserFetchResult }
4382
+ "tools.web_browser_fetch": { params: ToolsWebBrowserFetchParams, result: ToolsWebBrowserFetchResult },
4383
+ "tools.web_runtime_state": { params: WebRuntimeParams, result: WebRuntimeState },
4384
+ "tools.web_runtime_install": { params: WebRuntimeParams, result: WebRuntimeState },
4385
+ "tools.web_runtime_remove": { params: WebRuntimeParams, result: WebRuntimeState }
4135
4386
  }
4136
4387
  }
4137
4388
  };
@@ -4164,7 +4415,9 @@ var NAMED_SCHEMAS = {
4164
4415
  RelayMsg,
4165
4416
  ClientToCoreMsg,
4166
4417
  CoreToClientMsg,
4418
+ OsGrantState,
4167
4419
  OsPermissionName,
4420
+ OsRequirementName,
4168
4421
  SysinfoGetParams,
4169
4422
  SysinfoGetResult,
4170
4423
  SysinfoHardwareParams,
@@ -4653,6 +4906,42 @@ var NAMED_SCHEMAS = {
4653
4906
  ToolsWebSearchParams,
4654
4907
  WebBrowserFetchParams,
4655
4908
  WebBrowserFetchResult,
4909
+ WebAttachTarget,
4910
+ WebLand,
4911
+ WebNotSavedReason,
4912
+ WebSourceNotice,
4913
+ WebSourceState,
4914
+ ToolsParseFile,
4915
+ ToolsWebScrapeParams,
4916
+ ToolsWebScrapePage,
4917
+ ToolsWebScrapeResult,
4918
+ ToolsWebBrowserFetchParams,
4919
+ ToolsWebBrowserFetchResult,
4920
+ WebRuntimeStateName,
4921
+ WebRuntimeParams,
4922
+ WebRuntimeState,
4923
+ WebOutboxItem,
4924
+ WebOutboxListParams,
4925
+ WebOutboxListResult,
4926
+ WebOutboxRetryParams,
4927
+ WebOutboxRetryResult,
4928
+ WebOutboxDiscardParams,
4929
+ WebOutboxDiscardResult,
4930
+ WebLogVia,
4931
+ WebLogCaller,
4932
+ WebLogResult,
4933
+ WebLogEntry,
4934
+ WebLogListParams,
4935
+ WebLogListResult,
4936
+ WebLogClearParams,
4937
+ WebLogClearResult,
4938
+ WebProgressEvent,
4939
+ WebResearchItemState,
4940
+ WebResearchItem,
4941
+ WebResearchQueueParams,
4942
+ WebResearchQueueResult,
4943
+ WebResearchFetchParams,
4944
+ WebResearchFetchResult,
4656
4945
  ToolsServiceProgress,
4657
4946
  AccountRowId,
4658
4947
  AccountReadState,
@@ -4862,7 +5151,14 @@ var FIELDS_SINCE = {
4862
5151
  AppsProjectsToWindowParams: { pin: "1.32", chat_ids: "1.36", take_off_from: "1.36" },
4863
5152
  AppsProjectsToWindowResult: { pin: "1.32" },
4864
5153
  AppsChatsTitlesCheckResult: { stale_windows: "1.33" },
4865
- 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" }
5154
+ 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" },
5155
+ WebScrapeParams: { engine: "1.40", land: "1.40" },
5156
+ WebScrapePage: { source: "1.40" },
5157
+ WebBrowserFetchParams: { land: "1.40" },
5158
+ WebBrowserFetchResult: { source: "1.40" },
5159
+ SysinfoGetResult: { requirements: "1.41" },
5160
+ "SysinfoGetResult.permissions[]": { detail: "1.41" },
5161
+ MessagesSendParams: { service: "1.42" }
4866
5162
  };
4867
5163
  var NULL_SINCE = {
4868
5164
  "RelayDeviceStatusEvent.since_ms": { since: "1.1", olderPeersGet: 0 }
@@ -4882,6 +5178,25 @@ var REASONS_SINCE = {
4882
5178
  awaiting_confirmation: "1.28",
4883
5179
  tool_disabled_on_device: "1.34"
4884
5180
  };
5181
+ var PERMISSIONS_SINCE = {
5182
+ reminders: "1.41",
5183
+ speech_recognition: "1.41",
5184
+ messages: "1.41",
5185
+ mail: "1.41",
5186
+ wifi: "1.41"
5187
+ };
5188
+ function permissionsForPeer(value, version) {
5189
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
5190
+ const body = value;
5191
+ if (!Array.isArray(body.permissions)) return value;
5192
+ const since = PERMISSIONS_SINCE;
5193
+ const kept = body.permissions.filter((p) => {
5194
+ const name = p?.name;
5195
+ const added = typeof name === "string" ? since[name] : void 0;
5196
+ return !added || knows(version, added);
5197
+ });
5198
+ return kept.length === body.permissions.length ? value : { ...body, permissions: kept };
5199
+ }
4885
5200
  function statusForPeer(status, version) {
4886
5201
  const rule = NULL_SINCE["RelayDeviceStatusEvent.since_ms"];
4887
5202
  return status.since_ms === null && !knows(version, rule.since) ? { ...status, since_ms: rule.olderPeersGet } : status;
@@ -4926,7 +5241,9 @@ var RESULT_PATH = /* @__PURE__ */ new Map([
4926
5241
  ["apps.chats.list", "AppsChatsListResult"],
4927
5242
  ["apps.accounts.usage", "AppsAccountsUsageResult"],
4928
5243
  ["apps.accounts.resets", "AppsAccountsResetsResult"],
4929
- ["apps.windows.update_state", "AppsWindowsUpdateStateResult"]
5244
+ ["apps.windows.update_state", "AppsWindowsUpdateStateResult"],
5245
+ ["web.fetch_with_browser", "WebBrowserFetchResult"],
5246
+ ["sysinfo.get", "SysinfoGetResult"]
4930
5247
  ]);
4931
5248
  var NESTED_RESULTS = /* @__PURE__ */ new Map([
4932
5249
  ["apps.chats.list", [["chats", "ChatRow"]]],
@@ -4939,7 +5256,9 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
4939
5256
  ["apps.accounts.usage", [["accounts", "AccountUsage"]]],
4940
5257
  ["resources.snapshot", [["disks", "ResourcesDisk"]]],
4941
5258
  ["stack.state", [["servers", "StackServer"]]],
4942
- ["account.agents.list", [["agents", "AccountAgent"]]]
5259
+ ["account.agents.list", [["agents", "AccountAgent"]]],
5260
+ ["web.scrape", [["pages", "WebScrapePage"]]],
5261
+ ["sysinfo.get", [["permissions", "SysinfoGetResult.permissions[]"]]]
4943
5262
  ]);
4944
5263
  function stripNested(value, nested, version) {
4945
5264
  if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
@@ -4981,7 +5300,8 @@ function forPeer(op, part, value, version) {
4981
5300
  const windowKey = op ? WINDOW_RESULTS.get(op) : void 0;
4982
5301
  if (windowKey) return stripWindows(value, windowKey, version);
4983
5302
  const path = op ? RESULT_PATH.get(op) : void 0;
4984
- const top = path ? strip(value, FIELDS_SINCE[path], version) : value;
5303
+ const known = op === "sysinfo.get" ? permissionsForPeer(value, version) : value;
5304
+ const top = path ? strip(known, FIELDS_SINCE[path], version) : known;
4985
5305
  const nested = op ? NESTED_RESULTS.get(op) : void 0;
4986
5306
  return nested ? stripNested(top, nested, version) : top;
4987
5307
  }
@@ -5000,7 +5320,7 @@ function forPeer(op, part, value, version) {
5000
5320
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
5001
5321
 
5002
5322
  // src/contract.ts
5003
- var CONTRACT_SHA256 = "542bc69319741eea52154d413b4fe974ee5a56f7aef351e78b866b0562e82753";
5323
+ var CONTRACT_SHA256 = "c96c1a43bc4b34d518fa088be9300d96baab63938ce0dbfb9425cdc706097668";
5004
5324
 
5005
5325
  // src/close-policy.ts
5006
5326
  var CLOSE_RULES = {
@@ -5071,7 +5391,9 @@ var TOOL_CATALOG = [
5071
5391
  { name: "desktop_contacts", group: "personal_automation", state: "built", path: "device_op", ops: ["contacts.search", "contacts.get"], platforms: ["darwin"], summary: "Contacts: search, one card" },
5072
5392
  { 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" },
5073
5393
  { name: "desktop_photos", group: "personal_automation", state: "built", path: "device_op", ops: ["photos.search", "photos.get"], platforms: ["darwin"], summary: "The Photos library: find, export an original" },
5074
- { name: "desktop_location", group: "personal_automation", state: "built", path: "device_op", ops: ["location.get"], platforms: ["darwin", "win32"], summary: "Where the computer is (the OS's location service)" },
5394
+ // Windows comes back once a Windows location fix is proven (plan attack retire-local 2026-10-12, B6):
5395
+ // until then local_mac_apps (macOS-only) is judged on macOS and nothing claims Windows.
5396
+ { name: "desktop_location", group: "personal_automation", state: "built", path: "device_op", ops: ["location.get"], platforms: ["darwin"], summary: "Where the computer is (the OS's location service)" },
5075
5397
  { name: "desktop_net", group: "personal_automation", state: "built", path: "device_op", ops: ["net.info", "net.wifi", "net.bluetooth", "net.devices", "net.mdns", "net.scan", "net.download"], platforms: ALL, summary: "Local network, Wi-Fi, Bluetooth, open ports and downloads" },
5076
5398
  { name: "desktop_schedule", group: "personal_automation", state: "built", path: "device_op", ops: ["schedule.create", "schedule.list", "schedule.cancel"], platforms: ALL, summary: "Run a tool's op on this computer on an interval; list and cancel" },
5077
5399
  // 1.38, code from anywhere: the person's Claude Code and Codex sessions on this computer. Turning
@@ -5902,7 +6224,10 @@ export {
5902
6224
  NotesWriteResult,
5903
6225
  OPS,
5904
6226
  OpDescriptor,
6227
+ OsGrantState,
5905
6228
  OsPermissionName,
6229
+ OsRequirementName,
6230
+ PERMISSIONS_SINCE,
5906
6231
  PING_TEXT,
5907
6232
  PONG_TEXT,
5908
6233
  PROTOCOL_MAJOR,
@@ -6080,7 +6405,13 @@ export {
6080
6405
  ToolPlatform,
6081
6406
  ToolResultsFile,
6082
6407
  ToolTransport,
6408
+ ToolsParseFile,
6083
6409
  ToolsServiceProgress,
6410
+ ToolsWebBrowserFetchParams,
6411
+ ToolsWebBrowserFetchResult,
6412
+ ToolsWebScrapePage,
6413
+ ToolsWebScrapeParams,
6414
+ ToolsWebScrapeResult,
6084
6415
  ToolsWebSearchParams,
6085
6416
  TranscriptSegment,
6086
6417
  TranscriptionModelId,
@@ -6090,11 +6421,39 @@ export {
6090
6421
  VaultItemKind,
6091
6422
  VaultItemSummary,
6092
6423
  WEB_MAX_TEXT_CHARS,
6424
+ WebAttachTarget,
6093
6425
  WebBrowserFetchParams,
6094
6426
  WebBrowserFetchResult,
6095
6427
  WebFetchParams,
6096
6428
  WebFetchResult,
6097
6429
  WebHeader,
6430
+ WebLand,
6431
+ WebLogCaller,
6432
+ WebLogClearParams,
6433
+ WebLogClearResult,
6434
+ WebLogEntry,
6435
+ WebLogListParams,
6436
+ WebLogListResult,
6437
+ WebLogResult,
6438
+ WebLogVia,
6439
+ WebNotSavedReason,
6440
+ WebOutboxDiscardParams,
6441
+ WebOutboxDiscardResult,
6442
+ WebOutboxItem,
6443
+ WebOutboxListParams,
6444
+ WebOutboxListResult,
6445
+ WebOutboxRetryParams,
6446
+ WebOutboxRetryResult,
6447
+ WebProgressEvent,
6448
+ WebResearchFetchParams,
6449
+ WebResearchFetchResult,
6450
+ WebResearchItem,
6451
+ WebResearchItemState,
6452
+ WebResearchQueueParams,
6453
+ WebResearchQueueResult,
6454
+ WebRuntimeParams,
6455
+ WebRuntimeState,
6456
+ WebRuntimeStateName,
6098
6457
  WebScrapePage,
6099
6458
  WebScrapeParams,
6100
6459
  WebScrapeResult,
@@ -6102,6 +6461,8 @@ export {
6102
6461
  WebSearchParams,
6103
6462
  WebSearchQueryResult,
6104
6463
  WebSearchResult,
6464
+ WebSourceNotice,
6465
+ WebSourceState,
6105
6466
  Welcome,
6106
6467
  WindowFocusParams,
6107
6468
  WindowFocusResult,