@ai-matrx/desktop-protocol 0.7.0 → 0.10.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,58 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0
4
+
5
+ Protocol 1.2 adds the `apps` capability (SPEC §6): the desktop apps a person uses (Claude, Codex,
6
+ Cursor, VS Code, Antigravity), their profiles (one account each, opened side by side) and usage.
7
+
8
+ - Ops `apps.list`, `apps.profiles.list`, `apps.profiles.save`, `apps.profiles.remove`, `apps.open`
9
+ (`src/schema/apps.ts`). A profile is a row of `users.desktop_app_profile`; folders found on disk
10
+ that no row names yet are listed with `id: null`. Each app reports `open`, `profiles` and `usage`
11
+ as supported, partial or unsupported on the device's OS, with a one-line reason.
12
+ - `AppProfileLocator`: a profile folder relative to the app's data root; never absolute, no segment
13
+ starting with a dot.
14
+
15
+ Consumer action: none for existing ops.
16
+
17
+ ## 0.9.0
18
+
19
+ Protocol 1.2: the `models` capability (local transcription) and the contract for supervised Python
20
+ services (SPEC §3.10).
21
+
22
+ - Ops `models.status`, `models.install`, `models.transcribe` and the event `models.progress`
23
+ (`src/schema/models.ts`). Install and transcribe report progress to the requesting client;
24
+ transcribe streams each recognised segment as it lands.
25
+ - `SERVICES` (registry.ts) and the service envelope (`src/schema/service.ts`): the length-framed
26
+ JSON a core speaks to a Python service over its local socket — `hello` with a per-launch token and
27
+ `CONTRACT_SHA256`, `request`/`response`/`error`/`progress`/`cancel`, `ping`/`pong`, `shutdown`.
28
+ A forwarded Router op uses the same schemas as its service op.
29
+ - `CONTRACT_SHA256` (`src/contract.ts`, generated): the schema file's hash. The generated Python
30
+ module carries the same value, plus `SERVICES`, `SERVICE_PROGRESS` and a typed handler
31
+ `Protocol` per service (`MlServiceHandlers`), so `pyright --strict` fails a service that drifts.
32
+ - Error reasons `runtime_not_installed`, `model_not_installed`, `unsupported_media`,
33
+ `download_failed`, `service_starting`, `service_restarted`, `service_failed`, listed in
34
+ `REASONS_SINCE`; `forPeer` drops a reason an older peer does not know.
35
+ - The tarball ships `generated/desktop-protocol.schema.json` and `scripts/gen_pydantic.py`, so a
36
+ consumer that runs Python (matrx-desktop's services) generates its Pydantic twin with the one
37
+ generator, from the exact schema it installed.
38
+
39
+ Consumer action: none for existing ops. Python consumers regenerate from the installed package
40
+ (`gen_pydantic.py --schema node_modules/@ai-matrx/desktop-protocol/generated/desktop-protocol.schema.json`).
41
+
42
+ ## 0.8.0
43
+
44
+ - Local tool proof records (SPEC §10): `ToolLevel`, `ToolOutcome`, `ToolPlatform`, `ToolTransport`,
45
+ `ToolName`, `ToolLevelResult`, `ToolResultsFile` (`src/schema/tools.ts`), generated into the
46
+ Pydantic twin, so the desktop's vitest harnesses and aidream's live pytest write one shape.
47
+ - `TOOL_CATALOG`, `TOOL_GROUPS`, `LEGACY_ACTIONS`, `LEGACY_DISPATCHERS` (`src/tools/catalog.ts`):
48
+ every tool a platform agent calls on a computer, the ops it reaches, its group, and what became of
49
+ each of matrx-local's 139 handlers.
50
+ - `buildToolStatus(files)` and `renderToolStatusMarkdown(status)` (`src/tools/status.ts`): the
51
+ generated tool × level × platform table. Level 2 reads `pass` only with localhost, the relay and
52
+ the relay from another network; a tool is working only when all three levels pass.
53
+
54
+ Consumer action: cite tool status only from `buildToolStatus`; never hand-write a status.
55
+
3
56
  ## 0.7.0
4
57
 
5
58
  - `CLOSE_RULES` / `closeRule(code)` / `isTerminalClose(code)` (`src/close-policy.ts`): the one table
package/README.md CHANGED
@@ -88,6 +88,19 @@ params = validate_wire(FsListParams, raw_json) # same verdict as zod, always
88
88
  `validate_wire` is the one Python entry point: strict (no `"2"` → 2) and JavaScript-faithful
89
89
  (`2.0` is the integer 2). `OPS` maps every op to its params/result models, kind and errors.
90
90
 
91
+ ## Python services (matrx-desktop)
92
+
93
+ The desktop's supervised Python services generate their models from the installed package with
94
+ the same generator, so the core and the service can never drift:
95
+
96
+ ```bash
97
+ python3 node_modules/@ai-matrx/desktop-protocol/scripts/gen_pydantic.py \
98
+ --schema node_modules/@ai-matrx/desktop-protocol/generated/desktop-protocol.schema.json --out <module>.py
99
+ ```
100
+
101
+ The module carries `SERVICES`, a typed handler `Protocol` per service (`MlServiceHandlers`) and
102
+ `CONTRACT_SHA256`, which must equal the core's (`import { CONTRACT_SHA256 }`) in the service hello.
103
+
91
104
  ## Changing the protocol
92
105
 
93
106
  Edit `src/schema/*.ts`, then `pnpm generate` and commit all three files. Rules (enforced by
package/dist/client.cjs CHANGED
@@ -124,7 +124,7 @@ var import_zod2 = require("zod");
124
124
  // src/schema/primitives.ts
125
125
  var import_zod = require("zod");
126
126
  var PROTOCOL_MAJOR = 1;
127
- var PROTOCOL_MINOR = 1;
127
+ var PROTOCOL_MINOR = 2;
128
128
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
129
129
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
130
130
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -182,7 +182,22 @@ var ErrorReason = import_zod2.z.enum([
182
182
  "resource_expired",
183
183
  "control_taken",
184
184
  // another client of the same user took control
185
- "window_exhausted"
185
+ "window_exhausted",
186
+ // 1.2 (REASONS_SINCE): the `models` capability and its supervised Python service
187
+ "runtime_not_installed",
188
+ // NOT_FOUND: install the inference runtime first (models.install)
189
+ "model_not_installed",
190
+ // NOT_FOUND: that model's weights are not on the device
191
+ "unsupported_media",
192
+ // INVALID_PARAMS: the file is not audio or video the decoder reads
193
+ "download_failed",
194
+ // install could not fetch a package or model file
195
+ "service_starting",
196
+ // RESOURCE_BUSY (retryable): the service is starting or restarting
197
+ "service_restarted",
198
+ // RESOURCE_GONE: the service died while this request ran
199
+ "service_failed"
200
+ // INTERNAL: the service could not be started (see models.status)
186
201
  ]);
187
202
  var FsPatchEditFailure = import_zod2.z.strictObject({ edit_index: nonNegInt, reason: import_zod2.z.string().max(300) });
188
203
  var ProtocolErrorBody = import_zod2.z.strictObject({
@@ -665,34 +680,115 @@ var SessionListParams = import_zod8.z.strictObject({});
665
680
  var SessionListResult = import_zod8.z.strictObject({ resources: import_zod8.z.array(ResourceInfo) });
666
681
  var SessionControlChangedEvent = import_zod8.z.strictObject({ controller_client_id: import_zod8.z.string().max(64).nullable(), your_mode: import_zod8.z.enum(["control", "read_only"]) });
667
682
 
668
- // src/schema/relay.ts
683
+ // src/schema/models.ts
669
684
  var import_zod9 = require("zod");
670
- var RelayDeviceStatusEvent = import_zod9.z.strictObject({
671
- online: import_zod9.z.boolean(),
685
+ var TranscriptionModelId = import_zod9.z.enum(["tiny", "base", "small", "large-v3-turbo"]);
686
+ var MlRuntimeState = import_zod9.z.enum(["not_installed", "installing", "installed", "failed"]);
687
+ var MlInstallPhase = import_zod9.z.enum(["packages", "model", "verifying"]);
688
+ var MlInstallProgress = import_zod9.z.strictObject({
689
+ phase: MlInstallPhase,
690
+ /** What is being fetched now: a package or a model file name. */
691
+ item: import_zod9.z.string().max(200),
692
+ bytes_done: nonNegInt,
693
+ /** Null while the total is not known yet. */
694
+ bytes_total: nonNegInt.nullable()
695
+ });
696
+ var TranscriptionModelInfo = import_zod9.z.strictObject({
697
+ id: TranscriptionModelId,
698
+ /** Download size of the weights. */
699
+ size_bytes: nonNegInt,
700
+ multilingual: import_zod9.z.boolean(),
701
+ installed: import_zod9.z.boolean()
702
+ });
703
+ var TranscriptSegment = import_zod9.z.strictObject({
704
+ start_s: import_zod9.z.number().min(0),
705
+ end_s: import_zod9.z.number().min(0),
706
+ text: import_zod9.z.string().max(4e3)
707
+ });
708
+ var MlStatusParams = import_zod9.z.strictObject({});
709
+ var MlStatusResult = import_zod9.z.strictObject({
710
+ runtime: MlRuntimeState,
711
+ /** Non-null while runtime or model files are being installed. */
712
+ install: MlInstallProgress.nullable(),
713
+ /** The last install failure, one human line; null when the last install succeeded or none ran. */
714
+ error: import_zod9.z.string().max(300).nullable(),
715
+ /** Where inference runs once the runtime is installed: `cuda` only when a usable GPU is present. */
716
+ accelerator: import_zod9.z.enum(["cpu", "cuda"]),
717
+ models: import_zod9.z.array(TranscriptionModelInfo).max(16),
718
+ default_model: TranscriptionModelId
719
+ });
720
+ var ModelsInstallParams = import_zod9.z.strictObject({ model: TranscriptionModelId.optional() });
721
+ var ModelsInstallResult = import_zod9.z.strictObject({ model: TranscriptionModelId, elapsed_ms: nonNegInt });
722
+ var ModelsTranscribeParams = import_zod9.z.strictObject({
723
+ path: AbsPath,
724
+ model: TranscriptionModelId.optional(),
725
+ language: import_zod9.z.string().regex(/^[a-z]{2,3}$/).optional(),
726
+ task: import_zod9.z.enum(["transcribe", "translate"]).default("transcribe")
727
+ });
728
+ var ModelsTranscribeResult = import_zod9.z.strictObject({
729
+ text: import_zod9.z.string().max(4e5),
730
+ language: import_zod9.z.string().max(8),
731
+ language_probability: import_zod9.z.number().min(0).max(1),
732
+ duration_s: import_zod9.z.number().min(0),
733
+ model: TranscriptionModelId,
734
+ segments: import_zod9.z.array(TranscriptSegment).max(2e4),
735
+ elapsed_ms: nonNegInt
736
+ });
737
+ var MlProgress = import_zod9.z.strictObject({
738
+ kind: import_zod9.z.enum(["install", "transcribe"]),
739
+ /** 0–1 when known (transcribe: audio covered so far; install: bytes so far). */
740
+ fraction: import_zod9.z.number().min(0).max(1).nullable(),
741
+ install: MlInstallProgress.nullable(),
742
+ /** The segment just transcribed (transcribe only): text appears as it is recognised. */
743
+ segment: TranscriptSegment.nullable()
744
+ });
745
+ var MlServiceState = import_zod9.z.enum(["starting", "ready", "restarting", "failed", "stopped"]);
746
+ var MlServiceStatus = import_zod9.z.strictObject({
747
+ state: MlServiceState,
748
+ pid: nonNegInt.nullable(),
749
+ /** Restarts since the app started (crashes, missed health checks). */
750
+ restarts: nonNegInt,
751
+ /** The bundled interpreter's version once the service has answered, e.g. "3.13.15". */
752
+ python: import_zod9.z.string().max(32).nullable(),
753
+ /** Why the service is restarting or failed, one human line. */
754
+ error: import_zod9.z.string().max(300).nullable()
755
+ });
756
+ var ModelsStatusParams = import_zod9.z.strictObject({});
757
+ var ModelsStatusResult = import_zod9.z.strictObject({
758
+ service: MlServiceStatus,
759
+ /** Null until the service has answered (starting, restarting, failed). */
760
+ transcription: MlStatusResult.nullable()
761
+ });
762
+ var ModelsProgressEvent = import_zod9.z.strictObject({ request_id: RequestId, progress: MlProgress });
763
+
764
+ // src/schema/relay.ts
765
+ var import_zod10 = require("zod");
766
+ var RelayDeviceStatusEvent = import_zod10.z.strictObject({
767
+ online: import_zod10.z.boolean(),
672
768
  /**
673
769
  * When the device last went online/offline; null = it has never connected (since 1.1 —
674
770
  * NULL_SINCE: a 1.0 reader is sent 0, its old meaning).
675
771
  */
676
772
  since_ms: epochMs.nullable(),
677
- app_version: import_zod9.z.string().max(32).nullable(),
773
+ app_version: import_zod10.z.string().max(32).nullable(),
678
774
  protocol_version: ProtocolVersion.nullable()
679
775
  });
680
- var RelayAuthExpiringEvent = import_zod9.z.strictObject({ expires_at_ms: epochMs });
681
- var RelayCallRequest = import_zod9.z.strictObject({
682
- cap: import_zod9.z.string().min(1).max(32),
683
- op: import_zod9.z.string().min(1).max(64),
684
- params: import_zod9.z.unknown(),
685
- timeout_ms: import_zod9.z.int().min(100).max(37e5).default(7e4)
776
+ var RelayAuthExpiringEvent = import_zod10.z.strictObject({ expires_at_ms: epochMs });
777
+ var RelayCallRequest = import_zod10.z.strictObject({
778
+ cap: import_zod10.z.string().min(1).max(32),
779
+ op: import_zod10.z.string().min(1).max(64),
780
+ params: import_zod10.z.unknown(),
781
+ timeout_ms: import_zod10.z.int().min(100).max(37e5).default(7e4)
686
782
  });
687
- var RelayCallResponse = import_zod9.z.discriminatedUnion("ok", [
688
- import_zod9.z.strictObject({
689
- ok: import_zod9.z.literal(true),
690
- result: import_zod9.z.unknown(),
783
+ var RelayCallResponse = import_zod10.z.discriminatedUnion("ok", [
784
+ import_zod10.z.strictObject({
785
+ ok: import_zod10.z.literal(true),
786
+ result: import_zod10.z.unknown(),
691
787
  /** Since 1.1: the version the device negotiated for this call (its welcome). */
692
788
  protocol_version: ProtocolVersion.optional()
693
789
  }),
694
- import_zod9.z.strictObject({
695
- ok: import_zod9.z.literal(false),
790
+ import_zod10.z.strictObject({
791
+ ok: import_zod10.z.literal(false),
696
792
  error: ProtocolErrorBody,
697
793
  /** Since 1.1, as above (absent when the device never answered hello). */
698
794
  protocol_version: ProtocolVersion.optional()
@@ -700,19 +796,111 @@ var RelayCallResponse = import_zod9.z.discriminatedUnion("ok", [
700
796
  ]);
701
797
  var RELAY_CALL_HELLO_ID = "hello";
702
798
  var RELAY_CALL_REQUEST_ID = "call";
703
- var RelayCallHello = import_zod9.z.strictObject({
704
- type: import_zod9.z.literal("hello"),
705
- id: import_zod9.z.literal(RELAY_CALL_HELLO_ID),
799
+ var RelayCallHello = import_zod10.z.strictObject({
800
+ type: import_zod10.z.literal("hello"),
801
+ id: import_zod10.z.literal(RELAY_CALL_HELLO_ID),
706
802
  protocolVersion: ProtocolVersion,
707
- clientType: import_zod9.z.literal("server"),
708
- clientVersion: import_zod9.z.string().min(1).max(32)
803
+ clientType: import_zod10.z.literal("server"),
804
+ clientVersion: import_zod10.z.string().min(1).max(32)
805
+ });
806
+ var RelayCallEnvelope = import_zod10.z.strictObject({
807
+ id: import_zod10.z.literal(RELAY_CALL_REQUEST_ID),
808
+ type: import_zod10.z.literal("request"),
809
+ cap: import_zod10.z.string().min(1).max(32),
810
+ op: import_zod10.z.string().min(1).max(64),
811
+ params: import_zod10.z.unknown()
812
+ });
813
+
814
+ // src/schema/apps.ts
815
+ var import_zod11 = require("zod");
816
+ var AppKey = import_zod11.z.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
817
+ var AppProfileId = import_zod11.z.string().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/);
818
+ var AppProfileLocator = import_zod11.z.string().min(1).max(512).regex(/^[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}(\/[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}){0,7}$/);
819
+ var AppSupport = import_zod11.z.enum(["supported", "partial", "unsupported"]);
820
+ var AppFeatureStatus = import_zod11.z.strictObject({
821
+ status: AppSupport,
822
+ /** One line, set whenever status is not "supported". */
823
+ reason: import_zod11.z.string().max(140).nullable()
824
+ });
825
+ var AppInfo = import_zod11.z.strictObject({
826
+ app_key: AppKey,
827
+ name: import_zod11.z.string().max(64),
828
+ installed: import_zod11.z.boolean(),
829
+ /** The app's own version string, or null when it is not installed or does not say. */
830
+ version: import_zod11.z.string().max(64).nullable(),
831
+ /** The install found (an .app bundle, an .exe, a binary), or null. */
832
+ location: AbsPath.nullable(),
833
+ /** Open the app at all on this OS. */
834
+ open: AppFeatureStatus,
835
+ /** Separate profiles (one account each) on this OS. */
836
+ profiles: AppFeatureStatus,
837
+ /** Plan usage read from the app's own files on this OS. */
838
+ usage: AppFeatureStatus
839
+ });
840
+ var AppUsageReading = import_zod11.z.strictObject({
841
+ window: import_zod11.z.enum(["five_hour", "weekly", "extra"]),
842
+ /** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
843
+ percent: import_zod11.z.number().min(0).max(1e4),
844
+ /** When the app recorded it. */
845
+ sampled_at_ms: epochMs,
846
+ /** True when the window has rolled over since the sample, so the figure has reset. */
847
+ reset_since: import_zod11.z.boolean()
848
+ });
849
+ var AppProfile = import_zod11.z.strictObject({
850
+ /** The row's id; null for a folder found on disk that no row names yet. */
851
+ id: AppProfileId.nullable(),
852
+ app_key: AppKey,
853
+ display_name: import_zod11.z.string().min(1).max(120),
854
+ /** The account the person means to be signed in here; null when not stated (never guessed). */
855
+ account_identity: import_zod11.z.string().min(3).max(320).nullable(),
856
+ profile_locator: AppProfileLocator.nullable(),
857
+ /** The device the row is tied to; null when the row names none. */
858
+ device_id: DeviceId.nullable(),
859
+ /** The folder this profile resolves to on this device; null for a row tied to another device. */
860
+ folder: AbsPath.nullable(),
861
+ /** The folder exists on this device. */
862
+ on_disk: import_zod11.z.boolean(),
863
+ /** An instance with this profile is running; null when it could not be determined. */
864
+ running: import_zod11.z.boolean().nullable(),
865
+ /** Usage the app recorded for this profile; null when the app exposes none here. */
866
+ usage: import_zod11.z.array(AppUsageReading).nullable(),
867
+ last_opened_ms: epochMs.nullable()
868
+ });
869
+ var AppsListParams = import_zod11.z.strictObject({});
870
+ var AppsListResult = import_zod11.z.strictObject({ apps: import_zod11.z.array(AppInfo) });
871
+ var AppsProfilesListParams = import_zod11.z.strictObject({
872
+ /** Only this app's profiles; every app's when absent. */
873
+ app_key: AppKey.optional()
874
+ });
875
+ var AppsProfilesListResult = import_zod11.z.strictObject({
876
+ profiles: import_zod11.z.array(AppProfile),
877
+ /**
878
+ * Whether the saved rows could be read: false while signed out or offline, when only folders
879
+ * found on disk are listed.
880
+ */
881
+ registry: import_zod11.z.enum(["ok", "signed_out", "unavailable"])
882
+ });
883
+ var AppsProfilesSaveParams = import_zod11.z.strictObject({
884
+ id: AppProfileId.optional(),
885
+ app_key: AppKey,
886
+ display_name: import_zod11.z.string().min(1).max(120),
887
+ account_identity: import_zod11.z.string().min(3).max(320).nullable(),
888
+ /** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
889
+ profile_locator: AppProfileLocator.nullable(),
890
+ /** On create with profile_locator null: make a new folder named after display_name instead. */
891
+ new_folder: import_zod11.z.boolean().default(false)
892
+ });
893
+ var AppsProfilesSaveResult = AppProfile;
894
+ var AppsProfilesRemoveParams = import_zod11.z.strictObject({ id: AppProfileId });
895
+ var AppsProfilesRemoveResult = import_zod11.z.strictObject({ removed: import_zod11.z.boolean() });
896
+ var AppsOpenParams = import_zod11.z.strictObject({
897
+ app_key: AppKey,
898
+ profile_id: AppProfileId.optional()
709
899
  });
710
- var RelayCallEnvelope = import_zod9.z.strictObject({
711
- id: import_zod9.z.literal(RELAY_CALL_REQUEST_ID),
712
- type: import_zod9.z.literal("request"),
713
- cap: import_zod9.z.string().min(1).max(32),
714
- op: import_zod9.z.string().min(1).max(64),
715
- params: import_zod9.z.unknown()
900
+ var AppsOpenResult = import_zod11.z.strictObject({
901
+ /** True when an instance with this profile was already running; it is brought forward. */
902
+ already_running: import_zod11.z.boolean(),
903
+ folder: AbsPath.nullable()
716
904
  });
717
905
 
718
906
  // src/schema/registry.ts
@@ -741,7 +929,17 @@ var OPS = {
741
929
  "session.attach": { params: SessionAttachParams, result: SessionAttachResult, kind: "stream", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN", "RESOURCE_BUSY"] },
742
930
  "session.detach": { params: SessionDetachParams, result: SessionDetachResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE"] },
743
931
  "session.release": { params: SessionReleaseParams, result: SessionReleaseResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN"] },
744
- "session.list": { params: SessionListParams, result: SessionListResult, kind: "unary", since: "1.0", errors: ["INTERNAL"] }
932
+ "session.list": { params: SessionListParams, result: SessionListResult, kind: "unary", since: "1.0", errors: ["INTERNAL"] },
933
+ // Local models (SPEC §6), served by the `ml` Python service through SERVICES below.
934
+ "models.status": { params: ModelsStatusParams, result: ModelsStatusResult, kind: "unary", since: "1.2", errors: ["INTERNAL"] },
935
+ "models.install": { params: ModelsInstallParams, result: ModelsInstallResult, kind: "unary", since: "1.2", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "TIMEOUT", "CANCELLED", "INTERNAL"] },
936
+ "models.transcribe": { params: ModelsTranscribeParams, result: ModelsTranscribeResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "PERMISSION_DENIED_OS", "RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
937
+ // Desktop apps and their profiles (SPEC §6 apps); profiles are rows in users.desktop_app_profile.
938
+ "apps.list": { params: AppsListParams, result: AppsListResult, kind: "unary", since: "1.2", errors: ["INTERNAL"] },
939
+ "apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
940
+ "apps.profiles.save": { params: AppsProfilesSaveParams, result: AppsProfilesSaveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "DEVICE_OFFLINE", "INTERNAL"] },
941
+ "apps.profiles.remove": { params: AppsProfilesRemoveParams, result: AppsProfilesRemoveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "DEVICE_OFFLINE", "INTERNAL"] },
942
+ "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] }
745
943
  };
746
944
  var EVENTS = {
747
945
  "fs.changed": FsChangedEvent,
@@ -749,6 +947,7 @@ var EVENTS = {
749
947
  "exec.title": ExecTitleEvent,
750
948
  "exec.cwd": ExecCwdEvent,
751
949
  "session.control_changed": SessionControlChangedEvent,
950
+ "models.progress": ModelsProgressEvent,
752
951
  "relay.device_status": RelayDeviceStatusEvent,
753
952
  "relay.auth_expiring": RelayAuthExpiringEvent
754
953
  };
@@ -1262,6 +1461,7 @@ function createDesktopClient(options) {
1262
1461
  }
1263
1462
  await ready(opts);
1264
1463
  const id = newId("r");
1464
+ if (opts.onRequestId) safeCall("onRequestId", () => opts.onRequestId?.(id));
1265
1465
  return new Promise((resolve, reject) => {
1266
1466
  const timeoutMs = opts.timeoutMs ?? requestTimeoutMs;
1267
1467
  const timer = timers.setTimeout(() => {