@ai-matrx/desktop-protocol 0.21.30 → 0.21.31
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 +6 -0
- package/dist/client.cjs +265 -18
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +265 -18
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +372 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +788 -17
- package/dist/index.d.ts +788 -17
- package/dist/index.js +372 -19
- package/dist/index.js.map +1 -1
- package/dist/{models-CzKyJhDP.d.cts → models-C4JytZ8c.d.cts} +1250 -39
- package/dist/{models-CzKyJhDP.d.ts → models-C4JytZ8c.d.ts} +1250 -39
- package/dist/react.d.cts +400 -2
- package/dist/react.d.ts +400 -2
- package/generated/desktop-protocol.schema.json +1319 -81
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -546,7 +546,10 @@ __export(src_exports, {
|
|
|
546
546
|
NotesWriteResult: () => NotesWriteResult,
|
|
547
547
|
OPS: () => OPS,
|
|
548
548
|
OpDescriptor: () => OpDescriptor,
|
|
549
|
+
OsGrantState: () => OsGrantState,
|
|
549
550
|
OsPermissionName: () => OsPermissionName,
|
|
551
|
+
OsRequirementName: () => OsRequirementName,
|
|
552
|
+
PERMISSIONS_SINCE: () => PERMISSIONS_SINCE,
|
|
550
553
|
PING_TEXT: () => PING_TEXT,
|
|
551
554
|
PONG_TEXT: () => PONG_TEXT,
|
|
552
555
|
PROTOCOL_MAJOR: () => PROTOCOL_MAJOR,
|
|
@@ -724,7 +727,13 @@ __export(src_exports, {
|
|
|
724
727
|
ToolPlatform: () => ToolPlatform,
|
|
725
728
|
ToolResultsFile: () => ToolResultsFile,
|
|
726
729
|
ToolTransport: () => ToolTransport,
|
|
730
|
+
ToolsParseFile: () => ToolsParseFile,
|
|
727
731
|
ToolsServiceProgress: () => ToolsServiceProgress,
|
|
732
|
+
ToolsWebBrowserFetchParams: () => ToolsWebBrowserFetchParams,
|
|
733
|
+
ToolsWebBrowserFetchResult: () => ToolsWebBrowserFetchResult,
|
|
734
|
+
ToolsWebScrapePage: () => ToolsWebScrapePage,
|
|
735
|
+
ToolsWebScrapeParams: () => ToolsWebScrapeParams,
|
|
736
|
+
ToolsWebScrapeResult: () => ToolsWebScrapeResult,
|
|
728
737
|
ToolsWebSearchParams: () => ToolsWebSearchParams,
|
|
729
738
|
TranscriptSegment: () => TranscriptSegment,
|
|
730
739
|
TranscriptionModelId: () => TranscriptionModelId,
|
|
@@ -734,11 +743,39 @@ __export(src_exports, {
|
|
|
734
743
|
VaultItemKind: () => VaultItemKind,
|
|
735
744
|
VaultItemSummary: () => VaultItemSummary,
|
|
736
745
|
WEB_MAX_TEXT_CHARS: () => WEB_MAX_TEXT_CHARS,
|
|
746
|
+
WebAttachTarget: () => WebAttachTarget,
|
|
737
747
|
WebBrowserFetchParams: () => WebBrowserFetchParams,
|
|
738
748
|
WebBrowserFetchResult: () => WebBrowserFetchResult,
|
|
739
749
|
WebFetchParams: () => WebFetchParams,
|
|
740
750
|
WebFetchResult: () => WebFetchResult,
|
|
741
751
|
WebHeader: () => WebHeader,
|
|
752
|
+
WebLand: () => WebLand,
|
|
753
|
+
WebLogCaller: () => WebLogCaller,
|
|
754
|
+
WebLogClearParams: () => WebLogClearParams,
|
|
755
|
+
WebLogClearResult: () => WebLogClearResult,
|
|
756
|
+
WebLogEntry: () => WebLogEntry,
|
|
757
|
+
WebLogListParams: () => WebLogListParams,
|
|
758
|
+
WebLogListResult: () => WebLogListResult,
|
|
759
|
+
WebLogResult: () => WebLogResult,
|
|
760
|
+
WebLogVia: () => WebLogVia,
|
|
761
|
+
WebNotSavedReason: () => WebNotSavedReason,
|
|
762
|
+
WebOutboxDiscardParams: () => WebOutboxDiscardParams,
|
|
763
|
+
WebOutboxDiscardResult: () => WebOutboxDiscardResult,
|
|
764
|
+
WebOutboxItem: () => WebOutboxItem,
|
|
765
|
+
WebOutboxListParams: () => WebOutboxListParams,
|
|
766
|
+
WebOutboxListResult: () => WebOutboxListResult,
|
|
767
|
+
WebOutboxRetryParams: () => WebOutboxRetryParams,
|
|
768
|
+
WebOutboxRetryResult: () => WebOutboxRetryResult,
|
|
769
|
+
WebProgressEvent: () => WebProgressEvent,
|
|
770
|
+
WebResearchFetchParams: () => WebResearchFetchParams,
|
|
771
|
+
WebResearchFetchResult: () => WebResearchFetchResult,
|
|
772
|
+
WebResearchItem: () => WebResearchItem,
|
|
773
|
+
WebResearchItemState: () => WebResearchItemState,
|
|
774
|
+
WebResearchQueueParams: () => WebResearchQueueParams,
|
|
775
|
+
WebResearchQueueResult: () => WebResearchQueueResult,
|
|
776
|
+
WebRuntimeParams: () => WebRuntimeParams,
|
|
777
|
+
WebRuntimeState: () => WebRuntimeState,
|
|
778
|
+
WebRuntimeStateName: () => WebRuntimeStateName,
|
|
742
779
|
WebScrapePage: () => WebScrapePage,
|
|
743
780
|
WebScrapeParams: () => WebScrapeParams,
|
|
744
781
|
WebScrapeResult: () => WebScrapeResult,
|
|
@@ -746,6 +783,8 @@ __export(src_exports, {
|
|
|
746
783
|
WebSearchParams: () => WebSearchParams,
|
|
747
784
|
WebSearchQueryResult: () => WebSearchQueryResult,
|
|
748
785
|
WebSearchResult: () => WebSearchResult,
|
|
786
|
+
WebSourceNotice: () => WebSourceNotice,
|
|
787
|
+
WebSourceState: () => WebSourceState,
|
|
749
788
|
Welcome: () => Welcome,
|
|
750
789
|
WindowFocusParams: () => WindowFocusParams,
|
|
751
790
|
WindowFocusResult: () => WindowFocusResult,
|
|
@@ -805,7 +844,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
805
844
|
var import_zod = require("zod");
|
|
806
845
|
var import_uuid = require("@ai-matrx/kit/uuid");
|
|
807
846
|
var PROTOCOL_MAJOR = 1;
|
|
808
|
-
var PROTOCOL_MINOR =
|
|
847
|
+
var PROTOCOL_MINOR = 41;
|
|
809
848
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
810
849
|
var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
811
850
|
var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -1197,8 +1236,17 @@ var OsPermissionName = import_zod5.z.enum([
|
|
|
1197
1236
|
"location",
|
|
1198
1237
|
"local_network",
|
|
1199
1238
|
"bluetooth",
|
|
1200
|
-
"notifications"
|
|
1239
|
+
"notifications",
|
|
1240
|
+
// (1.41) Matrx Local's remaining kinds, checked on every OS (its permissions checker): a peer
|
|
1241
|
+
// older than 1.41 is never sent these rows (versioning.ts PERMISSIONS_SINCE).
|
|
1242
|
+
"reminders",
|
|
1243
|
+
"speech_recognition",
|
|
1244
|
+
"messages",
|
|
1245
|
+
"mail",
|
|
1246
|
+
"wifi"
|
|
1201
1247
|
]);
|
|
1248
|
+
var OsGrantState = import_zod5.z.enum(["granted", "denied", "not_determined", "not_applicable"]);
|
|
1249
|
+
var OsRequirementName = import_zod5.z.enum(["secret_storage", "tray", "display_server", "helper_programs", "smart_app_control", "path_length"]);
|
|
1202
1250
|
var SysinfoGetParams = import_zod5.z.strictObject({});
|
|
1203
1251
|
var SysinfoGetResult = import_zod5.z.strictObject({
|
|
1204
1252
|
device_id: DeviceId,
|
|
@@ -1228,9 +1276,20 @@ var SysinfoGetResult = import_zod5.z.strictObject({
|
|
|
1228
1276
|
import_zod5.z.strictObject({
|
|
1229
1277
|
name: OsPermissionName,
|
|
1230
1278
|
state: import_zod5.z.enum(["granted", "denied", "not_determined", "not_applicable"]),
|
|
1231
|
-
settings_url: import_zod5.z.string().max(512).nullable()
|
|
1279
|
+
settings_url: import_zod5.z.string().max(512).nullable(),
|
|
1280
|
+
/** (1.41) One short fact when the state alone does not say it ("No camera", "Bluetooth is off"); absent when there is none. */
|
|
1281
|
+
detail: import_zod5.z.string().max(256).optional()
|
|
1232
1282
|
})
|
|
1233
|
-
)
|
|
1283
|
+
),
|
|
1284
|
+
/** (1.41) The requirements beyond the grants (OsRequirementName), each read when asked. */
|
|
1285
|
+
requirements: import_zod5.z.array(
|
|
1286
|
+
import_zod5.z.strictObject({
|
|
1287
|
+
name: OsRequirementName,
|
|
1288
|
+
state: OsGrantState,
|
|
1289
|
+
settings_url: import_zod5.z.string().max(512).nullable(),
|
|
1290
|
+
detail: import_zod5.z.string().max(256).nullable()
|
|
1291
|
+
})
|
|
1292
|
+
).optional()
|
|
1234
1293
|
});
|
|
1235
1294
|
var SysinfoHardwareParams = import_zod5.z.strictObject({});
|
|
1236
1295
|
var SysinfoHardwareResult = import_zod5.z.strictObject({
|
|
@@ -2669,10 +2728,12 @@ var GitCloneParams = import_zod19.z.strictObject({
|
|
|
2669
2728
|
});
|
|
2670
2729
|
|
|
2671
2730
|
// src/schema/web.ts
|
|
2731
|
+
var import_uuid4 = require("@ai-matrx/kit/uuid");
|
|
2672
2732
|
var import_zod20 = require("zod");
|
|
2673
2733
|
var WEB_MAX_TEXT_CHARS = 524288;
|
|
2674
2734
|
var WebUrl = import_zod20.z.string().min(1).max(8192).regex(/^https?:\/\//);
|
|
2675
2735
|
var WebText = import_zod20.z.string().max(WEB_MAX_TEXT_CHARS);
|
|
2736
|
+
var OrgId = import_zod20.z.string().regex(import_uuid4.UUID_SHAPE_PATTERN);
|
|
2676
2737
|
var WebHeader = import_zod20.z.strictObject({ name: import_zod20.z.string().min(1).max(256), value: import_zod20.z.string().max(8192) });
|
|
2677
2738
|
var WebFetchParams = import_zod20.z.strictObject({
|
|
2678
2739
|
url: WebUrl,
|
|
@@ -2694,10 +2755,65 @@ var WebFetchResult = import_zod20.z.strictObject({
|
|
|
2694
2755
|
bytes: nonNegInt,
|
|
2695
2756
|
elapsed_ms: nonNegInt
|
|
2696
2757
|
});
|
|
2758
|
+
var WebAttachTarget = import_zod20.z.strictObject({
|
|
2759
|
+
entity_type: import_zod20.z.string().min(1).max(64),
|
|
2760
|
+
entity_id: import_zod20.z.string().min(1).max(128),
|
|
2761
|
+
label: import_zod20.z.string().max(200).optional()
|
|
2762
|
+
});
|
|
2763
|
+
var WebLand = import_zod20.z.strictObject({
|
|
2764
|
+
/** The organization the page is saved in; absent: this computer's active organization. */
|
|
2765
|
+
organization_id: OrgId.optional(),
|
|
2766
|
+
/** Keep it: AI processing starts (chunks, search). Unkept pages are saved and wait. */
|
|
2767
|
+
keep: import_zod20.z.boolean().default(false),
|
|
2768
|
+
attach_to: import_zod20.z.array(WebAttachTarget).max(8).default([])
|
|
2769
|
+
});
|
|
2770
|
+
var WebNotSavedReason = import_zod20.z.enum([
|
|
2771
|
+
/** Nobody is signed in on this computer. Saved on sign-in. */
|
|
2772
|
+
"signed_out",
|
|
2773
|
+
/** AI Matrx could not be reached. Retried on its own. */
|
|
2774
|
+
"offline",
|
|
2775
|
+
/** AI Matrx refused it (the message says why). Kept until the person retries or discards it. */
|
|
2776
|
+
"rejected",
|
|
2777
|
+
/** Waiting its turn behind other pages (retried on its own). */
|
|
2778
|
+
"queued"
|
|
2779
|
+
]);
|
|
2780
|
+
var WebSourceNotice = import_zod20.z.strictObject({ code: import_zod20.z.string().max(120), message: import_zod20.z.string().max(2e3), remedy: import_zod20.z.string().max(120) });
|
|
2781
|
+
var WebSourceState = import_zod20.z.discriminatedUnion("state", [
|
|
2782
|
+
import_zod20.z.strictObject({
|
|
2783
|
+
state: import_zod20.z.literal("saved"),
|
|
2784
|
+
processed_document_id: import_zod20.z.string().min(1).max(64),
|
|
2785
|
+
source_id: import_zod20.z.string().min(1).max(128),
|
|
2786
|
+
/** The page was already saved and nothing changed ("Already saved, no change"). */
|
|
2787
|
+
reused_existing: import_zod20.z.boolean(),
|
|
2788
|
+
/** The page changed: this is a new version of that Source. */
|
|
2789
|
+
new_version_of: import_zod20.z.string().max(64).nullable(),
|
|
2790
|
+
kept: import_zod20.z.boolean(),
|
|
2791
|
+
intelligence: import_zod20.z.enum(["queued", "deferred", "never"]),
|
|
2792
|
+
/** The original page as captured, kept by AI Matrx (null: the organization keeps none). */
|
|
2793
|
+
original_file_id: import_zod20.z.string().max(128).nullable(),
|
|
2794
|
+
/** The organization it was saved in. */
|
|
2795
|
+
organization_id: OrgId,
|
|
2796
|
+
notices: import_zod20.z.array(WebSourceNotice).max(20)
|
|
2797
|
+
}),
|
|
2798
|
+
import_zod20.z.strictObject({
|
|
2799
|
+
state: import_zod20.z.literal("not_saved"),
|
|
2800
|
+
outbox_id: import_zod20.z.string().min(1).max(64),
|
|
2801
|
+
reason: WebNotSavedReason,
|
|
2802
|
+
message: import_zod20.z.string().max(2e3)
|
|
2803
|
+
})
|
|
2804
|
+
]);
|
|
2697
2805
|
var WebScrapeParams = import_zod20.z.strictObject({
|
|
2698
2806
|
urls: import_zod20.z.array(WebUrl).min(1).max(20),
|
|
2699
2807
|
use_cache: import_zod20.z.boolean().default(true),
|
|
2700
|
-
get_links: import_zod20.z.boolean().default(false)
|
|
2808
|
+
get_links: import_zod20.z.boolean().default(false),
|
|
2809
|
+
/**
|
|
2810
|
+
* Since 1.38. `auto` (absent): this computer's scraper (HTTP, its browser only when a page needs
|
|
2811
|
+
* it). `browser`: this computer's own browser renders every page. `server`: AI Matrx's servers
|
|
2812
|
+
* read it (their connection, not this computer's; saved there as a web capture).
|
|
2813
|
+
*/
|
|
2814
|
+
engine: import_zod20.z.enum(["auto", "browser", "server"]).optional(),
|
|
2815
|
+
/** Since 1.38: where the pages are saved (see WebLand). */
|
|
2816
|
+
land: WebLand.optional()
|
|
2701
2817
|
});
|
|
2702
2818
|
var WebScrapePage = import_zod20.z.strictObject({
|
|
2703
2819
|
url: import_zod20.z.string(),
|
|
@@ -2712,7 +2828,9 @@ var WebScrapePage = import_zod20.z.strictObject({
|
|
|
2712
2828
|
/** Why the page failed (blocked, timeout, not found…), in the scraper's words; null when ok. */
|
|
2713
2829
|
error: import_zod20.z.string().nullable(),
|
|
2714
2830
|
/** How the page was fetched (http, browser, cache). */
|
|
2715
|
-
via: import_zod20.z.string().nullable()
|
|
2831
|
+
via: import_zod20.z.string().nullable(),
|
|
2832
|
+
/** Since 1.38: the page's Source (absent from a 1.37 core, and for a page that failed). */
|
|
2833
|
+
source: WebSourceState.optional()
|
|
2716
2834
|
});
|
|
2717
2835
|
var WebScrapeResult = import_zod20.z.strictObject({ pages: import_zod20.z.array(WebScrapePage), elapsed_ms: nonNegInt });
|
|
2718
2836
|
var WebSearchParams = import_zod20.z.strictObject({
|
|
@@ -2736,7 +2854,9 @@ var WebBrowserFetchParams = import_zod20.z.strictObject({
|
|
|
2736
2854
|
wait_for: import_zod20.z.string().max(1024).optional(),
|
|
2737
2855
|
wait_timeout_ms: import_zod20.z.int().min(100).max(12e4).default(3e4),
|
|
2738
2856
|
/** true: readable text; false: the rendered HTML. */
|
|
2739
|
-
extract_text: import_zod20.z.boolean().default(true)
|
|
2857
|
+
extract_text: import_zod20.z.boolean().default(true),
|
|
2858
|
+
/** Since 1.38: where the rendered page is saved (see WebLand). */
|
|
2859
|
+
land: WebLand.optional()
|
|
2740
2860
|
});
|
|
2741
2861
|
var WebBrowserFetchResult = import_zod20.z.strictObject({
|
|
2742
2862
|
url: import_zod20.z.string(),
|
|
@@ -2744,7 +2864,137 @@ var WebBrowserFetchResult = import_zod20.z.strictObject({
|
|
|
2744
2864
|
title: import_zod20.z.string().nullable(),
|
|
2745
2865
|
content: WebText,
|
|
2746
2866
|
truncated: import_zod20.z.boolean(),
|
|
2747
|
-
elapsed_ms: nonNegInt
|
|
2867
|
+
elapsed_ms: nonNegInt,
|
|
2868
|
+
/** Since 1.38: the rendered page's Source (absent from a 1.37 core). */
|
|
2869
|
+
source: WebSourceState.optional()
|
|
2870
|
+
});
|
|
2871
|
+
var ToolsParseFile = import_zod20.z.strictObject({
|
|
2872
|
+
/** Absolute path of the gzipped JSON the core reads, saves and then removes. */
|
|
2873
|
+
path: import_zod20.z.string().min(1).max(4096),
|
|
2874
|
+
bytes: nonNegInt
|
|
2875
|
+
});
|
|
2876
|
+
var ToolsWebScrapeParams = import_zod20.z.strictObject({
|
|
2877
|
+
urls: import_zod20.z.array(WebUrl).min(1).max(20),
|
|
2878
|
+
use_cache: import_zod20.z.boolean().default(true),
|
|
2879
|
+
get_links: import_zod20.z.boolean().default(false),
|
|
2880
|
+
/** `browser`: render every page in this computer's browser, then parse it. */
|
|
2881
|
+
engine: import_zod20.z.enum(["auto", "browser"]).default("auto"),
|
|
2882
|
+
/** Pages read at once (desktop.web/scrape_concurrency). */
|
|
2883
|
+
concurrency: import_zod20.z.int().min(1).max(20).default(5),
|
|
2884
|
+
/** The wait between pages from the same site (desktop.web/request_delay_ms). */
|
|
2885
|
+
delay_ms: import_zod20.z.int().min(0).max(3e4).default(0),
|
|
2886
|
+
/** Where the parse files go (the core's spool folder). */
|
|
2887
|
+
spool_dir: import_zod20.z.string().min(1).max(4096)
|
|
2888
|
+
});
|
|
2889
|
+
var ToolsWebScrapePage = import_zod20.z.strictObject({
|
|
2890
|
+
page: WebScrapePage,
|
|
2891
|
+
/** The page's whole parse, for the door; null when the page failed or had no words. */
|
|
2892
|
+
parse: ToolsParseFile.nullable(),
|
|
2893
|
+
/** The page as fetched, for research (rendered HTML or the HTTP body); null when not kept. */
|
|
2894
|
+
html: ToolsParseFile.nullable()
|
|
2895
|
+
});
|
|
2896
|
+
var ToolsWebScrapeResult = import_zod20.z.strictObject({ pages: import_zod20.z.array(ToolsWebScrapePage), elapsed_ms: nonNegInt });
|
|
2897
|
+
var ToolsWebBrowserFetchParams = import_zod20.z.strictObject({
|
|
2898
|
+
url: WebUrl,
|
|
2899
|
+
wait_for: import_zod20.z.string().max(1024).optional(),
|
|
2900
|
+
wait_timeout_ms: import_zod20.z.int().min(100).max(12e4).default(3e4),
|
|
2901
|
+
extract_text: import_zod20.z.boolean().default(true),
|
|
2902
|
+
spool_dir: import_zod20.z.string().min(1).max(4096)
|
|
2903
|
+
});
|
|
2904
|
+
var ToolsWebBrowserFetchResult = import_zod20.z.strictObject({ result: WebBrowserFetchResult, parse: ToolsParseFile.nullable() });
|
|
2905
|
+
var WebRuntimeStateName = import_zod20.z.enum(["not_installed", "installing", "installed", "failed"]);
|
|
2906
|
+
var WebRuntimeParams = import_zod20.z.strictObject({});
|
|
2907
|
+
var WebRuntimeState = import_zod20.z.strictObject({
|
|
2908
|
+
state: WebRuntimeStateName,
|
|
2909
|
+
/** Why it failed, in the installer's words; null otherwise. */
|
|
2910
|
+
error: import_zod20.z.string().max(2e3).nullable(),
|
|
2911
|
+
/** Bytes the browser takes on this computer (its packages and Chromium); null when unknown. */
|
|
2912
|
+
size_bytes: nonNegInt.nullable(),
|
|
2913
|
+
/** Whether it can show a window while it works (false: only the headless shell is installed). */
|
|
2914
|
+
can_show_window: import_zod20.z.boolean()
|
|
2915
|
+
});
|
|
2916
|
+
var WebOutboxItem = import_zod20.z.strictObject({
|
|
2917
|
+
outbox_id: import_zod20.z.string().min(1).max(64),
|
|
2918
|
+
url: import_zod20.z.string().max(8192),
|
|
2919
|
+
title: import_zod20.z.string().max(500).nullable(),
|
|
2920
|
+
organization_id: OrgId.nullable(),
|
|
2921
|
+
reason: WebNotSavedReason,
|
|
2922
|
+
message: import_zod20.z.string().max(2e3),
|
|
2923
|
+
attempts: nonNegInt,
|
|
2924
|
+
created_at_ms: nonNegInt,
|
|
2925
|
+
last_attempt_at_ms: nonNegInt.nullable(),
|
|
2926
|
+
bytes: nonNegInt
|
|
2927
|
+
});
|
|
2928
|
+
var WebOutboxListParams = import_zod20.z.strictObject({});
|
|
2929
|
+
var WebOutboxListResult = import_zod20.z.strictObject({
|
|
2930
|
+
items: import_zod20.z.array(WebOutboxItem),
|
|
2931
|
+
bytes: nonNegInt,
|
|
2932
|
+
/** The most the outbox holds; past it the oldest pages are dropped (and the log says so). */
|
|
2933
|
+
cap_bytes: nonNegInt
|
|
2934
|
+
});
|
|
2935
|
+
var WebOutboxRetryParams = import_zod20.z.strictObject({ outbox_id: import_zod20.z.string().min(1).max(64).optional() });
|
|
2936
|
+
var WebOutboxRetryResult = import_zod20.z.strictObject({ saved: nonNegInt, waiting: nonNegInt });
|
|
2937
|
+
var WebOutboxDiscardParams = import_zod20.z.strictObject({ outbox_id: import_zod20.z.string().min(1).max(64) });
|
|
2938
|
+
var WebOutboxDiscardResult = import_zod20.z.strictObject({ discarded: import_zod20.z.boolean() });
|
|
2939
|
+
var WebLogVia = import_zod20.z.enum(["this_computer", "browser", "server"]);
|
|
2940
|
+
var WebLogCaller = import_zod20.z.enum(["person", "agent", "research", "phone", "other"]);
|
|
2941
|
+
var WebLogResult = import_zod20.z.enum(["saved", "not_saved", "failed", "blocked", "read"]);
|
|
2942
|
+
var WebLogEntry = import_zod20.z.strictObject({
|
|
2943
|
+
id: import_zod20.z.string().min(1).max(64),
|
|
2944
|
+
at_ms: nonNegInt,
|
|
2945
|
+
caller: WebLogCaller,
|
|
2946
|
+
url: import_zod20.z.string().max(8192),
|
|
2947
|
+
title: import_zod20.z.string().max(500).nullable(),
|
|
2948
|
+
result: WebLogResult,
|
|
2949
|
+
/** One sentence: why it failed or was blocked, or the save's notice. Never page text. */
|
|
2950
|
+
detail: import_zod20.z.string().max(1e3).nullable(),
|
|
2951
|
+
via: WebLogVia,
|
|
2952
|
+
duration_ms: nonNegInt,
|
|
2953
|
+
processed_document_id: import_zod20.z.string().max(64).nullable()
|
|
2954
|
+
});
|
|
2955
|
+
var WebLogListParams = import_zod20.z.strictObject({ since_ms: nonNegInt.optional(), limit: import_zod20.z.int().min(1).max(1e3).default(200) });
|
|
2956
|
+
var WebLogListResult = import_zod20.z.strictObject({ entries: import_zod20.z.array(WebLogEntry) });
|
|
2957
|
+
var WebLogClearParams = import_zod20.z.strictObject({});
|
|
2958
|
+
var WebLogClearResult = import_zod20.z.strictObject({ cleared: nonNegInt });
|
|
2959
|
+
var WebProgressEvent = import_zod20.z.strictObject({
|
|
2960
|
+
request_id: RequestId,
|
|
2961
|
+
phase: import_zod20.z.enum(["installing", "fetching", "saving"]),
|
|
2962
|
+
done: nonNegInt,
|
|
2963
|
+
total: nonNegInt
|
|
2964
|
+
});
|
|
2965
|
+
var WebResearchItemState = import_zod20.z.enum(["waiting", "fetching", "saved", "thin", "failed", "cannot_edit", "blocked"]);
|
|
2966
|
+
var WebResearchItem = import_zod20.z.strictObject({
|
|
2967
|
+
topic_id: import_zod20.z.string().min(1).max(64),
|
|
2968
|
+
topic_name: import_zod20.z.string().max(500),
|
|
2969
|
+
source_id: import_zod20.z.string().min(1).max(64),
|
|
2970
|
+
url: import_zod20.z.string().max(8192),
|
|
2971
|
+
title: import_zod20.z.string().max(500).nullable(),
|
|
2972
|
+
/** The capture level this computer would try (1 quick, 2 scroll); 3+ is the extension's. */
|
|
2973
|
+
level: import_zod20.z.int().min(1).max(4),
|
|
2974
|
+
last_failure: import_zod20.z.string().max(1e3).nullable(),
|
|
2975
|
+
state: WebResearchItemState,
|
|
2976
|
+
/** One sentence after a fetch: what happened. */
|
|
2977
|
+
message: import_zod20.z.string().max(1e3).nullable()
|
|
2978
|
+
});
|
|
2979
|
+
var WebResearchQueueParams = import_zod20.z.strictObject({ topic_id: import_zod20.z.string().min(1).max(64).optional() });
|
|
2980
|
+
var WebResearchQueueResult = import_zod20.z.strictObject({
|
|
2981
|
+
state: import_zod20.z.enum(["ready", "signed_out", "unavailable"]),
|
|
2982
|
+
problem: import_zod20.z.string().max(1e3).nullable(),
|
|
2983
|
+
/** L1/L2 items on topics this person can edit: what this computer can fetch. */
|
|
2984
|
+
items: import_zod20.z.array(WebResearchItem),
|
|
2985
|
+
/** Items on topics the person can view but not add to (shown, never fetched). */
|
|
2986
|
+
view_only: nonNegInt
|
|
2987
|
+
});
|
|
2988
|
+
var WebResearchFetchParams = import_zod20.z.strictObject({
|
|
2989
|
+
topic_id: import_zod20.z.string().min(1).max(64).optional(),
|
|
2990
|
+
source_ids: import_zod20.z.array(import_zod20.z.string().min(1).max(64)).max(200).optional()
|
|
2991
|
+
});
|
|
2992
|
+
var WebResearchFetchResult = import_zod20.z.strictObject({
|
|
2993
|
+
items: import_zod20.z.array(WebResearchItem),
|
|
2994
|
+
saved: nonNegInt,
|
|
2995
|
+
thin: nonNegInt,
|
|
2996
|
+
failed: nonNegInt,
|
|
2997
|
+
cannot_edit: nonNegInt
|
|
2748
2998
|
});
|
|
2749
2999
|
var ToolsServiceProgress = import_zod20.z.strictObject({ phase: import_zod20.z.enum(["fetching", "installing"]), done: nonNegInt, total: nonNegInt });
|
|
2750
3000
|
|
|
@@ -2782,7 +3032,27 @@ var SystemSettingsPane = import_zod21.z.enum([
|
|
|
2782
3032
|
"storage",
|
|
2783
3033
|
"system_report",
|
|
2784
3034
|
/** (1.35) Privacy & Security › Microphone: where the person allows Matrx 2 the microphone. */
|
|
2785
|
-
"microphone"
|
|
3035
|
+
"microphone",
|
|
3036
|
+
// (1.41) Each other privacy grant's own page (Settings › Permissions and privacy's buttons), named
|
|
3037
|
+
// as sysinfo's OsPermissionName so a row opens its pane by its own name. A 1.40 core refuses these
|
|
3038
|
+
// as INVALID_PARAMS, so a client asks only a 1.41 core for them.
|
|
3039
|
+
"full_disk_access",
|
|
3040
|
+
"accessibility",
|
|
3041
|
+
"screen_recording",
|
|
3042
|
+
"camera",
|
|
3043
|
+
"automation",
|
|
3044
|
+
"contacts",
|
|
3045
|
+
"calendars",
|
|
3046
|
+
"reminders",
|
|
3047
|
+
"photos",
|
|
3048
|
+
"location",
|
|
3049
|
+
"local_network",
|
|
3050
|
+
"bluetooth",
|
|
3051
|
+
"wifi",
|
|
3052
|
+
"notifications",
|
|
3053
|
+
"speech_recognition",
|
|
3054
|
+
"messages",
|
|
3055
|
+
"mail"
|
|
2786
3056
|
]);
|
|
2787
3057
|
var SystemOpenSettingsParams = import_zod21.z.strictObject({ pane: SystemSettingsPane });
|
|
2788
3058
|
var SystemOpenSettingsResult = import_zod21.z.strictObject({ pane: SystemSettingsPane });
|
|
@@ -3488,10 +3758,10 @@ var ExecJobListResult = import_zod31.z.strictObject({ jobs: import_zod31.z.array
|
|
|
3488
3758
|
|
|
3489
3759
|
// src/schema/coding.ts
|
|
3490
3760
|
var import_zod32 = require("zod");
|
|
3491
|
-
var
|
|
3761
|
+
var import_uuid5 = require("@ai-matrx/kit/uuid");
|
|
3492
3762
|
var CodingServiceCredentials = import_zod32.z.strictObject({
|
|
3493
3763
|
access_token: import_zod32.z.string().min(16).max(16384),
|
|
3494
|
-
user_id: import_zod32.z.string().regex(
|
|
3764
|
+
user_id: import_zod32.z.string().regex(import_uuid5.UUID_SHAPE_PATTERN),
|
|
3495
3765
|
/** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
|
|
3496
3766
|
server_url: import_zod32.z.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
|
|
3497
3767
|
});
|
|
@@ -4816,6 +5086,16 @@ var OPS = {
|
|
|
4816
5086
|
"web.scrape": { params: WebScrapeParams, result: WebScrapeResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
4817
5087
|
"web.search": { params: WebSearchParams, result: WebSearchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
4818
5088
|
"web.fetch_with_browser": { params: WebBrowserFetchParams, result: WebBrowserFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
5089
|
+
"web.runtime.state": { params: WebRuntimeParams, result: WebRuntimeState, kind: "unary", since: "1.40", errors: ["INTERNAL"] },
|
|
5090
|
+
"web.runtime.install": { params: WebRuntimeParams, result: WebRuntimeState, kind: "unary", since: "1.40", errors: ["TIMEOUT", "RESOURCE_BUSY", "CANCELLED", "INTERNAL"] },
|
|
5091
|
+
"web.runtime.remove": { params: WebRuntimeParams, result: WebRuntimeState, kind: "unary", since: "1.40", errors: ["RESOURCE_BUSY", "INTERNAL"] },
|
|
5092
|
+
"web.outbox.list": { params: WebOutboxListParams, result: WebOutboxListResult, kind: "unary", since: "1.40", errors: ["INTERNAL"] },
|
|
5093
|
+
"web.outbox.retry": { params: WebOutboxRetryParams, result: WebOutboxRetryResult, kind: "unary", since: "1.40", errors: ["NOT_FOUND", "AUTH_REQUIRED", "INTERNAL"] },
|
|
5094
|
+
"web.outbox.discard": { params: WebOutboxDiscardParams, result: WebOutboxDiscardResult, kind: "unary", since: "1.40", errors: ["NOT_FOUND", "INTERNAL"] },
|
|
5095
|
+
"web.log.list": { params: WebLogListParams, result: WebLogListResult, kind: "unary", since: "1.40", errors: ["INVALID_PARAMS"] },
|
|
5096
|
+
"web.log.clear": { params: WebLogClearParams, result: WebLogClearResult, kind: "unary", since: "1.40", errors: ["INTERNAL"] },
|
|
5097
|
+
"web.research.queue": { params: WebResearchQueueParams, result: WebResearchQueueResult, kind: "unary", since: "1.40", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
5098
|
+
"web.research.fetch": { params: WebResearchFetchParams, result: WebResearchFetchResult, kind: "unary", since: "1.40", errors: ["INVALID_PARAMS", "AUTH_REQUIRED", "RESOURCE_BUSY", "CANCELLED", "INTERNAL"] },
|
|
4819
5099
|
// 1.23: the signed-in person's own agents and Vault, read as them (the desktop's Agents library and Vault).
|
|
4820
5100
|
"account.agents.list": { params: AccountAgentsListParams, result: AccountAgentsListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
|
|
4821
5101
|
"account.vault.list": { params: AccountVaultListParams, result: AccountVaultListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
|
|
@@ -4906,7 +5186,9 @@ var EVENTS = {
|
|
|
4906
5186
|
"diag.errors.changed": DiagErrorsChangedEvent,
|
|
4907
5187
|
"browser.invoke": BrowserInvokeEvent,
|
|
4908
5188
|
"browser.sessions_changed": BrowserSessionsChangedEvent,
|
|
4909
|
-
"browser.progress": BrowserProgressEvent
|
|
5189
|
+
"browser.progress": BrowserProgressEvent,
|
|
5190
|
+
"web.log.entry": WebLogEntry,
|
|
5191
|
+
"web.progress": WebProgressEvent
|
|
4910
5192
|
};
|
|
4911
5193
|
var SERVICES = {
|
|
4912
5194
|
ml: {
|
|
@@ -4932,9 +5214,12 @@ var SERVICES = {
|
|
|
4932
5214
|
progress: ToolsServiceProgress,
|
|
4933
5215
|
ops: {
|
|
4934
5216
|
"tools.web_fetch": { params: WebFetchParams, result: WebFetchResult },
|
|
4935
|
-
"tools.web_scrape": { params:
|
|
5217
|
+
"tools.web_scrape": { params: ToolsWebScrapeParams, result: ToolsWebScrapeResult },
|
|
4936
5218
|
"tools.web_search": { params: ToolsWebSearchParams, result: WebSearchResult },
|
|
4937
|
-
"tools.web_browser_fetch": { params:
|
|
5219
|
+
"tools.web_browser_fetch": { params: ToolsWebBrowserFetchParams, result: ToolsWebBrowserFetchResult },
|
|
5220
|
+
"tools.web_runtime_state": { params: WebRuntimeParams, result: WebRuntimeState },
|
|
5221
|
+
"tools.web_runtime_install": { params: WebRuntimeParams, result: WebRuntimeState },
|
|
5222
|
+
"tools.web_runtime_remove": { params: WebRuntimeParams, result: WebRuntimeState }
|
|
4938
5223
|
}
|
|
4939
5224
|
}
|
|
4940
5225
|
};
|
|
@@ -4967,7 +5252,9 @@ var NAMED_SCHEMAS = {
|
|
|
4967
5252
|
RelayMsg,
|
|
4968
5253
|
ClientToCoreMsg,
|
|
4969
5254
|
CoreToClientMsg,
|
|
5255
|
+
OsGrantState,
|
|
4970
5256
|
OsPermissionName,
|
|
5257
|
+
OsRequirementName,
|
|
4971
5258
|
SysinfoGetParams,
|
|
4972
5259
|
SysinfoGetResult,
|
|
4973
5260
|
SysinfoHardwareParams,
|
|
@@ -5456,6 +5743,42 @@ var NAMED_SCHEMAS = {
|
|
|
5456
5743
|
ToolsWebSearchParams,
|
|
5457
5744
|
WebBrowserFetchParams,
|
|
5458
5745
|
WebBrowserFetchResult,
|
|
5746
|
+
WebAttachTarget,
|
|
5747
|
+
WebLand,
|
|
5748
|
+
WebNotSavedReason,
|
|
5749
|
+
WebSourceNotice,
|
|
5750
|
+
WebSourceState,
|
|
5751
|
+
ToolsParseFile,
|
|
5752
|
+
ToolsWebScrapeParams,
|
|
5753
|
+
ToolsWebScrapePage,
|
|
5754
|
+
ToolsWebScrapeResult,
|
|
5755
|
+
ToolsWebBrowserFetchParams,
|
|
5756
|
+
ToolsWebBrowserFetchResult,
|
|
5757
|
+
WebRuntimeStateName,
|
|
5758
|
+
WebRuntimeParams,
|
|
5759
|
+
WebRuntimeState,
|
|
5760
|
+
WebOutboxItem,
|
|
5761
|
+
WebOutboxListParams,
|
|
5762
|
+
WebOutboxListResult,
|
|
5763
|
+
WebOutboxRetryParams,
|
|
5764
|
+
WebOutboxRetryResult,
|
|
5765
|
+
WebOutboxDiscardParams,
|
|
5766
|
+
WebOutboxDiscardResult,
|
|
5767
|
+
WebLogVia,
|
|
5768
|
+
WebLogCaller,
|
|
5769
|
+
WebLogResult,
|
|
5770
|
+
WebLogEntry,
|
|
5771
|
+
WebLogListParams,
|
|
5772
|
+
WebLogListResult,
|
|
5773
|
+
WebLogClearParams,
|
|
5774
|
+
WebLogClearResult,
|
|
5775
|
+
WebProgressEvent,
|
|
5776
|
+
WebResearchItemState,
|
|
5777
|
+
WebResearchItem,
|
|
5778
|
+
WebResearchQueueParams,
|
|
5779
|
+
WebResearchQueueResult,
|
|
5780
|
+
WebResearchFetchParams,
|
|
5781
|
+
WebResearchFetchResult,
|
|
5459
5782
|
ToolsServiceProgress,
|
|
5460
5783
|
AccountRowId,
|
|
5461
5784
|
AccountReadState,
|
|
@@ -5665,7 +5988,13 @@ var FIELDS_SINCE = {
|
|
|
5665
5988
|
AppsProjectsToWindowParams: { pin: "1.32", chat_ids: "1.36", take_off_from: "1.36" },
|
|
5666
5989
|
AppsProjectsToWindowResult: { pin: "1.32" },
|
|
5667
5990
|
AppsChatsTitlesCheckResult: { stale_windows: "1.33" },
|
|
5668
|
-
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" }
|
|
5991
|
+
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" },
|
|
5992
|
+
WebScrapeParams: { engine: "1.40", land: "1.40" },
|
|
5993
|
+
WebScrapePage: { source: "1.40" },
|
|
5994
|
+
WebBrowserFetchParams: { land: "1.40" },
|
|
5995
|
+
WebBrowserFetchResult: { source: "1.40" },
|
|
5996
|
+
SysinfoGetResult: { requirements: "1.41" },
|
|
5997
|
+
"SysinfoGetResult.permissions[]": { detail: "1.41" }
|
|
5669
5998
|
};
|
|
5670
5999
|
var NULL_SINCE = {
|
|
5671
6000
|
"RelayDeviceStatusEvent.since_ms": { since: "1.1", olderPeersGet: 0 }
|
|
@@ -5685,6 +6014,25 @@ var REASONS_SINCE = {
|
|
|
5685
6014
|
awaiting_confirmation: "1.28",
|
|
5686
6015
|
tool_disabled_on_device: "1.34"
|
|
5687
6016
|
};
|
|
6017
|
+
var PERMISSIONS_SINCE = {
|
|
6018
|
+
reminders: "1.41",
|
|
6019
|
+
speech_recognition: "1.41",
|
|
6020
|
+
messages: "1.41",
|
|
6021
|
+
mail: "1.41",
|
|
6022
|
+
wifi: "1.41"
|
|
6023
|
+
};
|
|
6024
|
+
function permissionsForPeer(value, version) {
|
|
6025
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
|
|
6026
|
+
const body = value;
|
|
6027
|
+
if (!Array.isArray(body.permissions)) return value;
|
|
6028
|
+
const since = PERMISSIONS_SINCE;
|
|
6029
|
+
const kept = body.permissions.filter((p) => {
|
|
6030
|
+
const name = p?.name;
|
|
6031
|
+
const added = typeof name === "string" ? since[name] : void 0;
|
|
6032
|
+
return !added || knows(version, added);
|
|
6033
|
+
});
|
|
6034
|
+
return kept.length === body.permissions.length ? value : { ...body, permissions: kept };
|
|
6035
|
+
}
|
|
5688
6036
|
function statusForPeer(status, version) {
|
|
5689
6037
|
const rule = NULL_SINCE["RelayDeviceStatusEvent.since_ms"];
|
|
5690
6038
|
return status.since_ms === null && !knows(version, rule.since) ? { ...status, since_ms: rule.olderPeersGet } : status;
|
|
@@ -5729,7 +6077,9 @@ var RESULT_PATH = /* @__PURE__ */ new Map([
|
|
|
5729
6077
|
["apps.chats.list", "AppsChatsListResult"],
|
|
5730
6078
|
["apps.accounts.usage", "AppsAccountsUsageResult"],
|
|
5731
6079
|
["apps.accounts.resets", "AppsAccountsResetsResult"],
|
|
5732
|
-
["apps.windows.update_state", "AppsWindowsUpdateStateResult"]
|
|
6080
|
+
["apps.windows.update_state", "AppsWindowsUpdateStateResult"],
|
|
6081
|
+
["web.fetch_with_browser", "WebBrowserFetchResult"],
|
|
6082
|
+
["sysinfo.get", "SysinfoGetResult"]
|
|
5733
6083
|
]);
|
|
5734
6084
|
var NESTED_RESULTS = /* @__PURE__ */ new Map([
|
|
5735
6085
|
["apps.chats.list", [["chats", "ChatRow"]]],
|
|
@@ -5742,7 +6092,9 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
|
|
|
5742
6092
|
["apps.accounts.usage", [["accounts", "AccountUsage"]]],
|
|
5743
6093
|
["resources.snapshot", [["disks", "ResourcesDisk"]]],
|
|
5744
6094
|
["stack.state", [["servers", "StackServer"]]],
|
|
5745
|
-
["account.agents.list", [["agents", "AccountAgent"]]]
|
|
6095
|
+
["account.agents.list", [["agents", "AccountAgent"]]],
|
|
6096
|
+
["web.scrape", [["pages", "WebScrapePage"]]],
|
|
6097
|
+
["sysinfo.get", [["permissions", "SysinfoGetResult.permissions[]"]]]
|
|
5746
6098
|
]);
|
|
5747
6099
|
function stripNested(value, nested, version) {
|
|
5748
6100
|
if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
|
|
@@ -5784,7 +6136,8 @@ function forPeer(op, part, value, version) {
|
|
|
5784
6136
|
const windowKey = op ? WINDOW_RESULTS.get(op) : void 0;
|
|
5785
6137
|
if (windowKey) return stripWindows(value, windowKey, version);
|
|
5786
6138
|
const path = op ? RESULT_PATH.get(op) : void 0;
|
|
5787
|
-
const
|
|
6139
|
+
const known = op === "sysinfo.get" ? permissionsForPeer(value, version) : value;
|
|
6140
|
+
const top = path ? strip(known, FIELDS_SINCE[path], version) : known;
|
|
5788
6141
|
const nested = op ? NESTED_RESULTS.get(op) : void 0;
|
|
5789
6142
|
return nested ? stripNested(top, nested, version) : top;
|
|
5790
6143
|
}
|
|
@@ -5803,7 +6156,7 @@ function forPeer(op, part, value, version) {
|
|
|
5803
6156
|
var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
|
|
5804
6157
|
|
|
5805
6158
|
// src/contract.ts
|
|
5806
|
-
var CONTRACT_SHA256 = "
|
|
6159
|
+
var CONTRACT_SHA256 = "a2ea77f45ed3f5421e4c722442205e48fce2bbc5bccc892b54403304eca55443";
|
|
5807
6160
|
|
|
5808
6161
|
// src/close-policy.ts
|
|
5809
6162
|
var CLOSE_RULES = {
|