@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 +53 -0
- package/README.md +13 -0
- package/dist/client.cjs +230 -30
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +7 -2
- package/dist/client.d.ts +7 -2
- package/dist/client.js +230 -30
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +747 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1048 -5
- package/dist/index.d.ts +1048 -5
- package/dist/index.js +747 -5
- package/dist/index.js.map +1 -1
- package/dist/react.d.cts +286 -1
- package/dist/react.d.ts +286 -1
- package/dist/{registry-Duc_VFN8.d.cts → registry-B3NqARgh.d.cts} +1224 -3
- package/dist/{registry-Duc_VFN8.d.ts → registry-B3NqARgh.d.ts} +1224 -3
- package/generated/desktop-protocol.schema.json +4554 -0
- package/package.json +3 -1
- package/scripts/gen_pydantic.py +335 -0
package/dist/client.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BackoffOptions } from '@ai-matrx/realtime';
|
|
2
2
|
export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType } from './registry-
|
|
5
|
-
export { i as isDesktopProtocolError } from './registry-
|
|
4
|
+
import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType } from './registry-B3NqARgh.cjs';
|
|
5
|
+
export { i as isDesktopProtocolError } from './registry-B3NqARgh.cjs';
|
|
6
6
|
import { FrameHeader } from './frame.cjs';
|
|
7
7
|
|
|
8
8
|
/** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
|
|
@@ -114,6 +114,11 @@ interface DesktopClientOptions {
|
|
|
114
114
|
interface RequestOptions {
|
|
115
115
|
signal?: AbortSignal;
|
|
116
116
|
timeoutMs?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Called with the request's id before it is sent, so progress events for it (e.g.
|
|
119
|
+
* `models.progress`, whose payload carries `request_id`) can be matched to this call.
|
|
120
|
+
*/
|
|
121
|
+
onRequestId?: (id: string) => void;
|
|
117
122
|
}
|
|
118
123
|
type StreamOpName = {
|
|
119
124
|
[N in OpName]: (typeof OPS)[N]["kind"] extends "unary" ? never : N;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BackoffOptions } from '@ai-matrx/realtime';
|
|
2
2
|
export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType } from './registry-
|
|
5
|
-
export { i as isDesktopProtocolError } from './registry-
|
|
4
|
+
import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType } from './registry-B3NqARgh.js';
|
|
5
|
+
export { i as isDesktopProtocolError } from './registry-B3NqARgh.js';
|
|
6
6
|
import { FrameHeader } from './frame.js';
|
|
7
7
|
|
|
8
8
|
/** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
|
|
@@ -114,6 +114,11 @@ interface DesktopClientOptions {
|
|
|
114
114
|
interface RequestOptions {
|
|
115
115
|
signal?: AbortSignal;
|
|
116
116
|
timeoutMs?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Called with the request's id before it is sent, so progress events for it (e.g.
|
|
119
|
+
* `models.progress`, whose payload carries `request_id`) can be matched to this call.
|
|
120
|
+
*/
|
|
121
|
+
onRequestId?: (id: string) => void;
|
|
117
122
|
}
|
|
118
123
|
type StreamOpName = {
|
|
119
124
|
[N in OpName]: (typeof OPS)[N]["kind"] extends "unary" ? never : N;
|
package/dist/client.js
CHANGED
|
@@ -94,7 +94,7 @@ import { z as z2 } from "zod";
|
|
|
94
94
|
// src/schema/primitives.ts
|
|
95
95
|
import { z } from "zod";
|
|
96
96
|
var PROTOCOL_MAJOR = 1;
|
|
97
|
-
var PROTOCOL_MINOR =
|
|
97
|
+
var PROTOCOL_MINOR = 2;
|
|
98
98
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
99
99
|
var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
100
100
|
var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -152,7 +152,22 @@ var ErrorReason = z2.enum([
|
|
|
152
152
|
"resource_expired",
|
|
153
153
|
"control_taken",
|
|
154
154
|
// another client of the same user took control
|
|
155
|
-
"window_exhausted"
|
|
155
|
+
"window_exhausted",
|
|
156
|
+
// 1.2 (REASONS_SINCE): the `models` capability and its supervised Python service
|
|
157
|
+
"runtime_not_installed",
|
|
158
|
+
// NOT_FOUND: install the inference runtime first (models.install)
|
|
159
|
+
"model_not_installed",
|
|
160
|
+
// NOT_FOUND: that model's weights are not on the device
|
|
161
|
+
"unsupported_media",
|
|
162
|
+
// INVALID_PARAMS: the file is not audio or video the decoder reads
|
|
163
|
+
"download_failed",
|
|
164
|
+
// install could not fetch a package or model file
|
|
165
|
+
"service_starting",
|
|
166
|
+
// RESOURCE_BUSY (retryable): the service is starting or restarting
|
|
167
|
+
"service_restarted",
|
|
168
|
+
// RESOURCE_GONE: the service died while this request ran
|
|
169
|
+
"service_failed"
|
|
170
|
+
// INTERNAL: the service could not be started (see models.status)
|
|
156
171
|
]);
|
|
157
172
|
var FsPatchEditFailure = z2.strictObject({ edit_index: nonNegInt, reason: z2.string().max(300) });
|
|
158
173
|
var ProtocolErrorBody = z2.strictObject({
|
|
@@ -635,34 +650,115 @@ var SessionListParams = z8.strictObject({});
|
|
|
635
650
|
var SessionListResult = z8.strictObject({ resources: z8.array(ResourceInfo) });
|
|
636
651
|
var SessionControlChangedEvent = z8.strictObject({ controller_client_id: z8.string().max(64).nullable(), your_mode: z8.enum(["control", "read_only"]) });
|
|
637
652
|
|
|
638
|
-
// src/schema/
|
|
653
|
+
// src/schema/models.ts
|
|
639
654
|
import { z as z9 } from "zod";
|
|
640
|
-
var
|
|
641
|
-
|
|
655
|
+
var TranscriptionModelId = z9.enum(["tiny", "base", "small", "large-v3-turbo"]);
|
|
656
|
+
var MlRuntimeState = z9.enum(["not_installed", "installing", "installed", "failed"]);
|
|
657
|
+
var MlInstallPhase = z9.enum(["packages", "model", "verifying"]);
|
|
658
|
+
var MlInstallProgress = z9.strictObject({
|
|
659
|
+
phase: MlInstallPhase,
|
|
660
|
+
/** What is being fetched now: a package or a model file name. */
|
|
661
|
+
item: z9.string().max(200),
|
|
662
|
+
bytes_done: nonNegInt,
|
|
663
|
+
/** Null while the total is not known yet. */
|
|
664
|
+
bytes_total: nonNegInt.nullable()
|
|
665
|
+
});
|
|
666
|
+
var TranscriptionModelInfo = z9.strictObject({
|
|
667
|
+
id: TranscriptionModelId,
|
|
668
|
+
/** Download size of the weights. */
|
|
669
|
+
size_bytes: nonNegInt,
|
|
670
|
+
multilingual: z9.boolean(),
|
|
671
|
+
installed: z9.boolean()
|
|
672
|
+
});
|
|
673
|
+
var TranscriptSegment = z9.strictObject({
|
|
674
|
+
start_s: z9.number().min(0),
|
|
675
|
+
end_s: z9.number().min(0),
|
|
676
|
+
text: z9.string().max(4e3)
|
|
677
|
+
});
|
|
678
|
+
var MlStatusParams = z9.strictObject({});
|
|
679
|
+
var MlStatusResult = z9.strictObject({
|
|
680
|
+
runtime: MlRuntimeState,
|
|
681
|
+
/** Non-null while runtime or model files are being installed. */
|
|
682
|
+
install: MlInstallProgress.nullable(),
|
|
683
|
+
/** The last install failure, one human line; null when the last install succeeded or none ran. */
|
|
684
|
+
error: z9.string().max(300).nullable(),
|
|
685
|
+
/** Where inference runs once the runtime is installed: `cuda` only when a usable GPU is present. */
|
|
686
|
+
accelerator: z9.enum(["cpu", "cuda"]),
|
|
687
|
+
models: z9.array(TranscriptionModelInfo).max(16),
|
|
688
|
+
default_model: TranscriptionModelId
|
|
689
|
+
});
|
|
690
|
+
var ModelsInstallParams = z9.strictObject({ model: TranscriptionModelId.optional() });
|
|
691
|
+
var ModelsInstallResult = z9.strictObject({ model: TranscriptionModelId, elapsed_ms: nonNegInt });
|
|
692
|
+
var ModelsTranscribeParams = z9.strictObject({
|
|
693
|
+
path: AbsPath,
|
|
694
|
+
model: TranscriptionModelId.optional(),
|
|
695
|
+
language: z9.string().regex(/^[a-z]{2,3}$/).optional(),
|
|
696
|
+
task: z9.enum(["transcribe", "translate"]).default("transcribe")
|
|
697
|
+
});
|
|
698
|
+
var ModelsTranscribeResult = z9.strictObject({
|
|
699
|
+
text: z9.string().max(4e5),
|
|
700
|
+
language: z9.string().max(8),
|
|
701
|
+
language_probability: z9.number().min(0).max(1),
|
|
702
|
+
duration_s: z9.number().min(0),
|
|
703
|
+
model: TranscriptionModelId,
|
|
704
|
+
segments: z9.array(TranscriptSegment).max(2e4),
|
|
705
|
+
elapsed_ms: nonNegInt
|
|
706
|
+
});
|
|
707
|
+
var MlProgress = z9.strictObject({
|
|
708
|
+
kind: z9.enum(["install", "transcribe"]),
|
|
709
|
+
/** 0–1 when known (transcribe: audio covered so far; install: bytes so far). */
|
|
710
|
+
fraction: z9.number().min(0).max(1).nullable(),
|
|
711
|
+
install: MlInstallProgress.nullable(),
|
|
712
|
+
/** The segment just transcribed (transcribe only): text appears as it is recognised. */
|
|
713
|
+
segment: TranscriptSegment.nullable()
|
|
714
|
+
});
|
|
715
|
+
var MlServiceState = z9.enum(["starting", "ready", "restarting", "failed", "stopped"]);
|
|
716
|
+
var MlServiceStatus = z9.strictObject({
|
|
717
|
+
state: MlServiceState,
|
|
718
|
+
pid: nonNegInt.nullable(),
|
|
719
|
+
/** Restarts since the app started (crashes, missed health checks). */
|
|
720
|
+
restarts: nonNegInt,
|
|
721
|
+
/** The bundled interpreter's version once the service has answered, e.g. "3.13.15". */
|
|
722
|
+
python: z9.string().max(32).nullable(),
|
|
723
|
+
/** Why the service is restarting or failed, one human line. */
|
|
724
|
+
error: z9.string().max(300).nullable()
|
|
725
|
+
});
|
|
726
|
+
var ModelsStatusParams = z9.strictObject({});
|
|
727
|
+
var ModelsStatusResult = z9.strictObject({
|
|
728
|
+
service: MlServiceStatus,
|
|
729
|
+
/** Null until the service has answered (starting, restarting, failed). */
|
|
730
|
+
transcription: MlStatusResult.nullable()
|
|
731
|
+
});
|
|
732
|
+
var ModelsProgressEvent = z9.strictObject({ request_id: RequestId, progress: MlProgress });
|
|
733
|
+
|
|
734
|
+
// src/schema/relay.ts
|
|
735
|
+
import { z as z10 } from "zod";
|
|
736
|
+
var RelayDeviceStatusEvent = z10.strictObject({
|
|
737
|
+
online: z10.boolean(),
|
|
642
738
|
/**
|
|
643
739
|
* When the device last went online/offline; null = it has never connected (since 1.1 —
|
|
644
740
|
* NULL_SINCE: a 1.0 reader is sent 0, its old meaning).
|
|
645
741
|
*/
|
|
646
742
|
since_ms: epochMs.nullable(),
|
|
647
|
-
app_version:
|
|
743
|
+
app_version: z10.string().max(32).nullable(),
|
|
648
744
|
protocol_version: ProtocolVersion.nullable()
|
|
649
745
|
});
|
|
650
|
-
var RelayAuthExpiringEvent =
|
|
651
|
-
var RelayCallRequest =
|
|
652
|
-
cap:
|
|
653
|
-
op:
|
|
654
|
-
params:
|
|
655
|
-
timeout_ms:
|
|
746
|
+
var RelayAuthExpiringEvent = z10.strictObject({ expires_at_ms: epochMs });
|
|
747
|
+
var RelayCallRequest = z10.strictObject({
|
|
748
|
+
cap: z10.string().min(1).max(32),
|
|
749
|
+
op: z10.string().min(1).max(64),
|
|
750
|
+
params: z10.unknown(),
|
|
751
|
+
timeout_ms: z10.int().min(100).max(37e5).default(7e4)
|
|
656
752
|
});
|
|
657
|
-
var RelayCallResponse =
|
|
658
|
-
|
|
659
|
-
ok:
|
|
660
|
-
result:
|
|
753
|
+
var RelayCallResponse = z10.discriminatedUnion("ok", [
|
|
754
|
+
z10.strictObject({
|
|
755
|
+
ok: z10.literal(true),
|
|
756
|
+
result: z10.unknown(),
|
|
661
757
|
/** Since 1.1: the version the device negotiated for this call (its welcome). */
|
|
662
758
|
protocol_version: ProtocolVersion.optional()
|
|
663
759
|
}),
|
|
664
|
-
|
|
665
|
-
ok:
|
|
760
|
+
z10.strictObject({
|
|
761
|
+
ok: z10.literal(false),
|
|
666
762
|
error: ProtocolErrorBody,
|
|
667
763
|
/** Since 1.1, as above (absent when the device never answered hello). */
|
|
668
764
|
protocol_version: ProtocolVersion.optional()
|
|
@@ -670,19 +766,111 @@ var RelayCallResponse = z9.discriminatedUnion("ok", [
|
|
|
670
766
|
]);
|
|
671
767
|
var RELAY_CALL_HELLO_ID = "hello";
|
|
672
768
|
var RELAY_CALL_REQUEST_ID = "call";
|
|
673
|
-
var RelayCallHello =
|
|
674
|
-
type:
|
|
675
|
-
id:
|
|
769
|
+
var RelayCallHello = z10.strictObject({
|
|
770
|
+
type: z10.literal("hello"),
|
|
771
|
+
id: z10.literal(RELAY_CALL_HELLO_ID),
|
|
676
772
|
protocolVersion: ProtocolVersion,
|
|
677
|
-
clientType:
|
|
678
|
-
clientVersion:
|
|
773
|
+
clientType: z10.literal("server"),
|
|
774
|
+
clientVersion: z10.string().min(1).max(32)
|
|
775
|
+
});
|
|
776
|
+
var RelayCallEnvelope = z10.strictObject({
|
|
777
|
+
id: z10.literal(RELAY_CALL_REQUEST_ID),
|
|
778
|
+
type: z10.literal("request"),
|
|
779
|
+
cap: z10.string().min(1).max(32),
|
|
780
|
+
op: z10.string().min(1).max(64),
|
|
781
|
+
params: z10.unknown()
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
// src/schema/apps.ts
|
|
785
|
+
import { z as z11 } from "zod";
|
|
786
|
+
var AppKey = z11.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
|
|
787
|
+
var AppProfileId = z11.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}$/);
|
|
788
|
+
var AppProfileLocator = z11.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}$/);
|
|
789
|
+
var AppSupport = z11.enum(["supported", "partial", "unsupported"]);
|
|
790
|
+
var AppFeatureStatus = z11.strictObject({
|
|
791
|
+
status: AppSupport,
|
|
792
|
+
/** One line, set whenever status is not "supported". */
|
|
793
|
+
reason: z11.string().max(140).nullable()
|
|
794
|
+
});
|
|
795
|
+
var AppInfo = z11.strictObject({
|
|
796
|
+
app_key: AppKey,
|
|
797
|
+
name: z11.string().max(64),
|
|
798
|
+
installed: z11.boolean(),
|
|
799
|
+
/** The app's own version string, or null when it is not installed or does not say. */
|
|
800
|
+
version: z11.string().max(64).nullable(),
|
|
801
|
+
/** The install found (an .app bundle, an .exe, a binary), or null. */
|
|
802
|
+
location: AbsPath.nullable(),
|
|
803
|
+
/** Open the app at all on this OS. */
|
|
804
|
+
open: AppFeatureStatus,
|
|
805
|
+
/** Separate profiles (one account each) on this OS. */
|
|
806
|
+
profiles: AppFeatureStatus,
|
|
807
|
+
/** Plan usage read from the app's own files on this OS. */
|
|
808
|
+
usage: AppFeatureStatus
|
|
809
|
+
});
|
|
810
|
+
var AppUsageReading = z11.strictObject({
|
|
811
|
+
window: z11.enum(["five_hour", "weekly", "extra"]),
|
|
812
|
+
/** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
|
|
813
|
+
percent: z11.number().min(0).max(1e4),
|
|
814
|
+
/** When the app recorded it. */
|
|
815
|
+
sampled_at_ms: epochMs,
|
|
816
|
+
/** True when the window has rolled over since the sample, so the figure has reset. */
|
|
817
|
+
reset_since: z11.boolean()
|
|
818
|
+
});
|
|
819
|
+
var AppProfile = z11.strictObject({
|
|
820
|
+
/** The row's id; null for a folder found on disk that no row names yet. */
|
|
821
|
+
id: AppProfileId.nullable(),
|
|
822
|
+
app_key: AppKey,
|
|
823
|
+
display_name: z11.string().min(1).max(120),
|
|
824
|
+
/** The account the person means to be signed in here; null when not stated (never guessed). */
|
|
825
|
+
account_identity: z11.string().min(3).max(320).nullable(),
|
|
826
|
+
profile_locator: AppProfileLocator.nullable(),
|
|
827
|
+
/** The device the row is tied to; null when the row names none. */
|
|
828
|
+
device_id: DeviceId.nullable(),
|
|
829
|
+
/** The folder this profile resolves to on this device; null for a row tied to another device. */
|
|
830
|
+
folder: AbsPath.nullable(),
|
|
831
|
+
/** The folder exists on this device. */
|
|
832
|
+
on_disk: z11.boolean(),
|
|
833
|
+
/** An instance with this profile is running; null when it could not be determined. */
|
|
834
|
+
running: z11.boolean().nullable(),
|
|
835
|
+
/** Usage the app recorded for this profile; null when the app exposes none here. */
|
|
836
|
+
usage: z11.array(AppUsageReading).nullable(),
|
|
837
|
+
last_opened_ms: epochMs.nullable()
|
|
838
|
+
});
|
|
839
|
+
var AppsListParams = z11.strictObject({});
|
|
840
|
+
var AppsListResult = z11.strictObject({ apps: z11.array(AppInfo) });
|
|
841
|
+
var AppsProfilesListParams = z11.strictObject({
|
|
842
|
+
/** Only this app's profiles; every app's when absent. */
|
|
843
|
+
app_key: AppKey.optional()
|
|
844
|
+
});
|
|
845
|
+
var AppsProfilesListResult = z11.strictObject({
|
|
846
|
+
profiles: z11.array(AppProfile),
|
|
847
|
+
/**
|
|
848
|
+
* Whether the saved rows could be read: false while signed out or offline, when only folders
|
|
849
|
+
* found on disk are listed.
|
|
850
|
+
*/
|
|
851
|
+
registry: z11.enum(["ok", "signed_out", "unavailable"])
|
|
852
|
+
});
|
|
853
|
+
var AppsProfilesSaveParams = z11.strictObject({
|
|
854
|
+
id: AppProfileId.optional(),
|
|
855
|
+
app_key: AppKey,
|
|
856
|
+
display_name: z11.string().min(1).max(120),
|
|
857
|
+
account_identity: z11.string().min(3).max(320).nullable(),
|
|
858
|
+
/** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
|
|
859
|
+
profile_locator: AppProfileLocator.nullable(),
|
|
860
|
+
/** On create with profile_locator null: make a new folder named after display_name instead. */
|
|
861
|
+
new_folder: z11.boolean().default(false)
|
|
862
|
+
});
|
|
863
|
+
var AppsProfilesSaveResult = AppProfile;
|
|
864
|
+
var AppsProfilesRemoveParams = z11.strictObject({ id: AppProfileId });
|
|
865
|
+
var AppsProfilesRemoveResult = z11.strictObject({ removed: z11.boolean() });
|
|
866
|
+
var AppsOpenParams = z11.strictObject({
|
|
867
|
+
app_key: AppKey,
|
|
868
|
+
profile_id: AppProfileId.optional()
|
|
679
869
|
});
|
|
680
|
-
var
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
op: z9.string().min(1).max(64),
|
|
685
|
-
params: z9.unknown()
|
|
870
|
+
var AppsOpenResult = z11.strictObject({
|
|
871
|
+
/** True when an instance with this profile was already running; it is brought forward. */
|
|
872
|
+
already_running: z11.boolean(),
|
|
873
|
+
folder: AbsPath.nullable()
|
|
686
874
|
});
|
|
687
875
|
|
|
688
876
|
// src/schema/registry.ts
|
|
@@ -711,7 +899,17 @@ var OPS = {
|
|
|
711
899
|
"session.attach": { params: SessionAttachParams, result: SessionAttachResult, kind: "stream", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN", "RESOURCE_BUSY"] },
|
|
712
900
|
"session.detach": { params: SessionDetachParams, result: SessionDetachResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE"] },
|
|
713
901
|
"session.release": { params: SessionReleaseParams, result: SessionReleaseResult, kind: "unary", since: "1.0", errors: ["RESOURCE_GONE", "AUTH_FORBIDDEN"] },
|
|
714
|
-
"session.list": { params: SessionListParams, result: SessionListResult, kind: "unary", since: "1.0", errors: ["INTERNAL"] }
|
|
902
|
+
"session.list": { params: SessionListParams, result: SessionListResult, kind: "unary", since: "1.0", errors: ["INTERNAL"] },
|
|
903
|
+
// Local models (SPEC §6), served by the `ml` Python service through SERVICES below.
|
|
904
|
+
"models.status": { params: ModelsStatusParams, result: ModelsStatusResult, kind: "unary", since: "1.2", errors: ["INTERNAL"] },
|
|
905
|
+
"models.install": { params: ModelsInstallParams, result: ModelsInstallResult, kind: "unary", since: "1.2", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "TIMEOUT", "CANCELLED", "INTERNAL"] },
|
|
906
|
+
"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"] },
|
|
907
|
+
// Desktop apps and their profiles (SPEC §6 apps); profiles are rows in users.desktop_app_profile.
|
|
908
|
+
"apps.list": { params: AppsListParams, result: AppsListResult, kind: "unary", since: "1.2", errors: ["INTERNAL"] },
|
|
909
|
+
"apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
|
|
910
|
+
"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"] },
|
|
911
|
+
"apps.profiles.remove": { params: AppsProfilesRemoveParams, result: AppsProfilesRemoveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "DEVICE_OFFLINE", "INTERNAL"] },
|
|
912
|
+
"apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] }
|
|
715
913
|
};
|
|
716
914
|
var EVENTS = {
|
|
717
915
|
"fs.changed": FsChangedEvent,
|
|
@@ -719,6 +917,7 @@ var EVENTS = {
|
|
|
719
917
|
"exec.title": ExecTitleEvent,
|
|
720
918
|
"exec.cwd": ExecCwdEvent,
|
|
721
919
|
"session.control_changed": SessionControlChangedEvent,
|
|
920
|
+
"models.progress": ModelsProgressEvent,
|
|
722
921
|
"relay.device_status": RelayDeviceStatusEvent,
|
|
723
922
|
"relay.auth_expiring": RelayAuthExpiringEvent
|
|
724
923
|
};
|
|
@@ -1232,6 +1431,7 @@ function createDesktopClient(options) {
|
|
|
1232
1431
|
}
|
|
1233
1432
|
await ready(opts);
|
|
1234
1433
|
const id = newId("r");
|
|
1434
|
+
if (opts.onRequestId) safeCall("onRequestId", () => opts.onRequestId?.(id));
|
|
1235
1435
|
return new Promise((resolve, reject) => {
|
|
1236
1436
|
const timeoutMs = opts.timeoutMs ?? requestTimeoutMs;
|
|
1237
1437
|
const timer = timers.setTimeout(() => {
|