@ai-matrx/desktop-protocol 0.12.0 → 0.14.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/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, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-CxAHZMAM.cjs';
5
- export { i as isDesktopProtocolError } from './models-CxAHZMAM.cjs';
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, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-DqFPqtNS.cjs';
5
+ export { i as isDesktopProtocolError } from './models-DqFPqtNS.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. */
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, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-CxAHZMAM.js';
5
- export { i as isDesktopProtocolError } from './models-CxAHZMAM.js';
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, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-DqFPqtNS.js';
5
+ export { i as isDesktopProtocolError } from './models-DqFPqtNS.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. */
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 = 2;
97
+ var PROTOCOL_MINOR = 3;
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_-]+$/);
@@ -781,23 +781,86 @@ var RelayCallEnvelope = z10.strictObject({
781
781
  params: z10.unknown()
782
782
  });
783
783
 
784
- // src/schema/apps.ts
784
+ // src/schema/clipboard.ts
785
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({
786
+ var ClipboardReadParams = z11.strictObject({});
787
+ var ClipboardReadResult = z11.strictObject({
788
+ /** The clipboard's text ("" when it holds none), cut to 1 MiB. */
789
+ text: z11.string().max(1048576),
790
+ truncated: z11.boolean()
791
+ });
792
+ var ClipboardWriteParams = z11.strictObject({ text: z11.string().max(1048576) });
793
+ var ClipboardWriteResult = z11.strictObject({ bytes: nonNegInt });
794
+
795
+ // src/schema/proc.ts
796
+ import { z as z12 } from "zod";
797
+ var ProcSort = z12.enum(["cpu", "memory", "pid", "name"]);
798
+ var ProcListParams = z12.strictObject({
799
+ /** Case-insensitive substring of the process name or its command line. */
800
+ name: z12.string().min(1).max(128).optional(),
801
+ sort: ProcSort.default("cpu"),
802
+ limit: z12.int().min(1).max(500).default(50)
803
+ });
804
+ var ProcInfo = z12.strictObject({
805
+ pid: z12.int().min(0),
806
+ /** Parent process id; null where the OS does not report it. */
807
+ ppid: z12.int().min(0).nullable(),
808
+ name: z12.string().max(256),
809
+ /** The command line, cut to 1024 characters. */
810
+ command: z12.string().max(1024),
811
+ /** Share of one core, as `ps` and Task Manager report it; null where the OS does not say. */
812
+ cpu_percent: z12.number().min(0).nullable(),
813
+ memory_bytes: nonNegInt.nullable(),
814
+ user: z12.string().max(128).nullable()
815
+ });
816
+ var ProcListResult = z12.strictObject({
817
+ processes: z12.array(ProcInfo).max(500),
818
+ /** Processes that matched before `limit`. */
819
+ total: nonNegInt,
820
+ truncated: z12.boolean()
821
+ });
822
+ var ProcPortsParams = z12.strictObject({
823
+ /** Only this port. */
824
+ port: z12.int().min(1).max(65535).optional()
825
+ });
826
+ var ProcPort = z12.strictObject({
827
+ port: z12.int().min(1).max(65535),
828
+ protocol: z12.enum(["tcp", "udp"]),
829
+ /** The local address it listens on ("127.0.0.1", "*", "::"). */
830
+ address: z12.string().max(64),
831
+ pid: z12.int().min(0).nullable(),
832
+ process: z12.string().max(256).nullable()
833
+ });
834
+ var ProcPortsResult = z12.strictObject({ ports: z12.array(ProcPort).max(4e3) });
835
+ var ProcKillParams = z12.strictObject({
836
+ pid: z12.int().min(1),
837
+ /** Kill outright (SIGKILL; on Windows the same /F) instead of asking it to quit. */
838
+ force: z12.boolean().default(false)
839
+ });
840
+ var ProcKillResult = z12.strictObject({
841
+ pid: z12.int().min(1),
842
+ signal: z12.enum(["SIGTERM", "SIGKILL"]),
843
+ /** True when the process was gone within 3 s. */
844
+ exited: z12.boolean()
845
+ });
846
+
847
+ // src/schema/apps.ts
848
+ import { z as z13 } from "zod";
849
+ var AppKey = z13.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
850
+ var AppProfileId = z13.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}$/);
851
+ var AppProfileLocator = z13.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}$/);
852
+ var AppSupport = z13.enum(["supported", "partial", "unsupported"]);
853
+ var AppFeatureStatus = z13.strictObject({
791
854
  status: AppSupport,
792
855
  /** One line, set whenever status is not "supported". */
793
- reason: z11.string().max(140).nullable()
856
+ reason: z13.string().max(140).nullable()
794
857
  });
795
- var AppInfo = z11.strictObject({
858
+ var AppInfo = z13.strictObject({
796
859
  app_key: AppKey,
797
- name: z11.string().max(64),
798
- installed: z11.boolean(),
860
+ name: z13.string().max(64),
861
+ installed: z13.boolean(),
799
862
  /** The app's own version string, or null when it is not installed or does not say. */
800
- version: z11.string().max(64).nullable(),
863
+ version: z13.string().max(64).nullable(),
801
864
  /** The install found (an .app bundle, an .exe, a binary), or null. */
802
865
  location: AbsPath.nullable(),
803
866
  /** Open the app at all on this OS. */
@@ -807,69 +870,69 @@ var AppInfo = z11.strictObject({
807
870
  /** Plan usage read from the app's own files on this OS. */
808
871
  usage: AppFeatureStatus
809
872
  });
810
- var AppUsageReading = z11.strictObject({
811
- window: z11.enum(["five_hour", "weekly", "extra"]),
873
+ var AppUsageReading = z13.strictObject({
874
+ window: z13.enum(["five_hour", "weekly", "extra"]),
812
875
  /** 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),
876
+ percent: z13.number().min(0).max(1e4),
814
877
  /** When the app recorded it. */
815
878
  sampled_at_ms: epochMs,
816
879
  /** True when the window has rolled over since the sample, so the figure has reset. */
817
- reset_since: z11.boolean()
880
+ reset_since: z13.boolean()
818
881
  });
819
- var AppProfile = z11.strictObject({
882
+ var AppProfile = z13.strictObject({
820
883
  /** The row's id; null for a folder found on disk that no row names yet. */
821
884
  id: AppProfileId.nullable(),
822
885
  app_key: AppKey,
823
- display_name: z11.string().min(1).max(120),
886
+ display_name: z13.string().min(1).max(120),
824
887
  /** 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(),
888
+ account_identity: z13.string().min(3).max(320).nullable(),
826
889
  profile_locator: AppProfileLocator.nullable(),
827
890
  /** The device the row is tied to; null when the row names none. */
828
891
  device_id: DeviceId.nullable(),
829
892
  /** The folder this profile resolves to on this device; null for a row tied to another device. */
830
893
  folder: AbsPath.nullable(),
831
894
  /** The folder exists on this device. */
832
- on_disk: z11.boolean(),
895
+ on_disk: z13.boolean(),
833
896
  /** An instance with this profile is running; null when it could not be determined. */
834
- running: z11.boolean().nullable(),
897
+ running: z13.boolean().nullable(),
835
898
  /** Usage the app recorded for this profile; null when the app exposes none here. */
836
- usage: z11.array(AppUsageReading).nullable(),
899
+ usage: z13.array(AppUsageReading).nullable(),
837
900
  last_opened_ms: epochMs.nullable()
838
901
  });
839
- var AppsListParams = z11.strictObject({});
840
- var AppsListResult = z11.strictObject({ apps: z11.array(AppInfo) });
841
- var AppsProfilesListParams = z11.strictObject({
902
+ var AppsListParams = z13.strictObject({});
903
+ var AppsListResult = z13.strictObject({ apps: z13.array(AppInfo) });
904
+ var AppsProfilesListParams = z13.strictObject({
842
905
  /** Only this app's profiles; every app's when absent. */
843
906
  app_key: AppKey.optional()
844
907
  });
845
- var AppsProfilesListResult = z11.strictObject({
846
- profiles: z11.array(AppProfile),
908
+ var AppsProfilesListResult = z13.strictObject({
909
+ profiles: z13.array(AppProfile),
847
910
  /**
848
911
  * Whether the saved rows could be read: false while signed out or offline, when only folders
849
912
  * found on disk are listed.
850
913
  */
851
- registry: z11.enum(["ok", "signed_out", "unavailable"])
914
+ registry: z13.enum(["ok", "signed_out", "unavailable"])
852
915
  });
853
- var AppsProfilesSaveParams = z11.strictObject({
916
+ var AppsProfilesSaveParams = z13.strictObject({
854
917
  id: AppProfileId.optional(),
855
918
  app_key: AppKey,
856
- display_name: z11.string().min(1).max(120),
857
- account_identity: z11.string().min(3).max(320).nullable(),
919
+ display_name: z13.string().min(1).max(120),
920
+ account_identity: z13.string().min(3).max(320).nullable(),
858
921
  /** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
859
922
  profile_locator: AppProfileLocator.nullable(),
860
923
  /** On create with profile_locator null: make a new folder named after display_name instead. */
861
- new_folder: z11.boolean().default(false)
924
+ new_folder: z13.boolean().default(false)
862
925
  });
863
926
  var AppsProfilesSaveResult = AppProfile;
864
- var AppsProfilesRemoveParams = z11.strictObject({ id: AppProfileId });
865
- var AppsProfilesRemoveResult = z11.strictObject({ removed: z11.boolean() });
866
- var AppsOpenParams = z11.strictObject({
927
+ var AppsProfilesRemoveParams = z13.strictObject({ id: AppProfileId });
928
+ var AppsProfilesRemoveResult = z13.strictObject({ removed: z13.boolean() });
929
+ var AppsOpenParams = z13.strictObject({
867
930
  app_key: AppKey,
868
931
  profile_id: AppProfileId.optional()
869
932
  });
870
- var AppsOpenResult = z11.strictObject({
933
+ var AppsOpenResult = z13.strictObject({
871
934
  /** True when an instance with this profile was already running; it is brought forward. */
872
- already_running: z11.boolean(),
935
+ already_running: z13.boolean(),
873
936
  folder: AbsPath.nullable()
874
937
  });
875
938
 
@@ -909,7 +972,12 @@ var OPS = {
909
972
  "apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
910
973
  "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
974
  "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"] }
975
+ "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] },
976
+ "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
977
+ "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
978
+ "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },
979
+ "clipboard.read": { params: ClipboardReadParams, result: ClipboardReadResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
980
+ "clipboard.write": { params: ClipboardWriteParams, result: ClipboardWriteResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "PAYLOAD_TOO_LARGE", "INTERNAL"] }
913
981
  };
914
982
  var EVENTS = {
915
983
  "fs.changed": FsChangedEvent,