@ai-matrx/desktop-protocol 0.21.42 → 0.21.44

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-Ut2nuRzV.cjs';
5
- export { i as isDesktopProtocolError } from './models-Ut2nuRzV.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-CCRnwbz8.cjs';
5
+ export { i as isDesktopProtocolError } from './models-CCRnwbz8.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-Ut2nuRzV.js';
5
- export { i as isDesktopProtocolError } from './models-Ut2nuRzV.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-CCRnwbz8.js';
5
+ export { i as isDesktopProtocolError } from './models-CCRnwbz8.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
@@ -112,7 +112,7 @@ import { z as z2 } from "zod";
112
112
  import { z } from "zod";
113
113
  import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
114
114
  var PROTOCOL_MAJOR = 1;
115
- var PROTOCOL_MINOR = 47;
115
+ var PROTOCOL_MINOR = 49;
116
116
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
117
117
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
118
118
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -764,7 +764,8 @@ var SessionControlChangedEvent = z8.strictObject({ controller_client_id: z8.stri
764
764
 
765
765
  // src/schema/models.ts
766
766
  import { z as z9 } from "zod";
767
- var TranscriptionModelId = z9.enum(["tiny", "base", "small", "large-v3-turbo"]);
767
+ var ModelKey = z9.string().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*(\/[a-z0-9][a-z0-9._-]*)?$/);
768
+ var TranscriptionModelId = ModelKey;
768
769
  var MlRuntimeState = z9.enum(["not_installed", "installing", "installed", "failed"]);
769
770
  var MlInstallPhase = z9.enum(["packages", "model", "verifying"]);
770
771
  var MlInstallProgress = z9.strictObject({
@@ -824,18 +825,7 @@ var MlProgress = z9.strictObject({
824
825
  /** The segment just transcribed (transcribe only): text appears as it is recognised. */
825
826
  segment: TranscriptSegment.nullable()
826
827
  });
827
- var TextModelId = z9.enum([
828
- "smollm2-135m",
829
- "llama-3.2-3b",
830
- "phi-4-mini",
831
- "gemma-3-4b",
832
- "llama-3.1-8b",
833
- "qwen-2.5-7b",
834
- "mistral-small-3.1",
835
- "gpt-oss-20b",
836
- "qwen-2.5-coder-7b",
837
- "qwen-2.5-coder-14b"
838
- ]);
828
+ var TextModelId = ModelKey;
839
829
  var TextModelInfo = z9.strictObject({
840
830
  id: TextModelId,
841
831
  /** Download size of the weights. */
@@ -843,7 +833,14 @@ var TextModelInfo = z9.strictObject({
843
833
  installed: z9.boolean()
844
834
  });
845
835
  var LlmServerState = z9.enum(["stopped", "starting", "running", "failed"]);
846
- var LlmRunning = z9.strictObject({ id: TextModelId, port: z9.int().min(1024).max(65535) });
836
+ var LlmRunning = z9.strictObject({
837
+ id: TextModelId,
838
+ port: z9.int().min(1024).max(65535),
839
+ /** (1.48) What the service actually applied, echoed so the app can attest "read and applied". Optional until the service sends them. */
840
+ context_length: z9.int().min(512).max(131072).optional(),
841
+ gpu_layers: z9.int().min(-1).max(999).optional(),
842
+ threads: z9.int().min(1).max(512).optional()
843
+ });
847
844
  var ModelsLlmStatusParams = z9.strictObject({});
848
845
  var ModelsLlmStatusResult = z9.strictObject({
849
846
  state: LlmServerState,
@@ -861,12 +858,57 @@ var ModelsLlmInstallParams = z9.strictObject({ model: TextModelId });
861
858
  var ModelsLlmInstallResult = z9.strictObject({ model: TextModelId, elapsed_ms: nonNegInt });
862
859
  var ModelsLlmStartParams = z9.strictObject({
863
860
  model: TextModelId,
864
- /** Tokens of context; the service picks a size that fits this computer when omitted. */
865
- context_length: z9.int().min(512).max(131072).optional()
861
+ /** Tokens of context, from the knob desktop.models/context_length. Omitted today means the service's fixed 4096 (optional until callers send it). */
862
+ context_length: z9.int().min(512).max(131072).optional(),
863
+ /** (1.48) Layers offloaded to the GPU; -1 = all. From the knob desktop.models/gpu_layers. */
864
+ gpu_layers: z9.int().min(-1).max(999).optional(),
865
+ /** (1.48) CPU threads, computed by the app from the knobs. */
866
+ threads: z9.int().min(1).max(512).optional(),
867
+ /** (1.48) Seconds to wait for the model to load, computed by the app from the knobs. */
868
+ load_timeout_s: z9.int().min(10).max(3600).optional()
866
869
  });
867
870
  var ModelsLlmStartResult = z9.strictObject({ running: LlmRunning, elapsed_ms: nonNegInt });
868
871
  var ModelsLlmStopParams = z9.strictObject({});
869
872
  var ModelsLlmStopResult = z9.strictObject({ stopped: z9.boolean() });
873
+ var Sha256Hex = z9.string().regex(/^[0-9a-f]{64}$/);
874
+ var CatalogFile = z9.strictObject({
875
+ /** Path inside the model's folder (the artifact's path_in_repo). */
876
+ path: z9.string().min(1).max(512),
877
+ /** The pinned https URL it is downloaded from. */
878
+ url: z9.string().url().max(2048),
879
+ size_bytes: nonNegInt,
880
+ sha256: Sha256Hex,
881
+ /** weights, weights_shard, mmproj, config, tokenizer, … (ai.model_artifact.role). */
882
+ role: z9.string().max(32)
883
+ });
884
+ var CatalogModelEntry = z9.strictObject({
885
+ /** The key callers name this model by (the 1.48 id for a seeded model). */
886
+ key: ModelKey,
887
+ /** The selected variant's key (`q4_k_m`, `ct2`). */
888
+ variant: z9.string().min(1).max(64),
889
+ /** The upstream revision (or the variant id when there is none): a change re-downloads. */
890
+ revision: z9.string().min(1).max(64),
891
+ multilingual: z9.boolean(),
892
+ /** Exactly the files this computer fetches for this model: never more, never fewer. */
893
+ files: z9.array(CatalogFile).min(1).max(256)
894
+ });
895
+ var LlamaServerBuild = z9.strictObject({
896
+ version: z9.string().min(1).max(32),
897
+ url: z9.string().url().max(2048),
898
+ size_bytes: nonNegInt,
899
+ sha256: Sha256Hex
900
+ });
901
+ var MlCatalogSetParams = z9.strictObject({
902
+ text: z9.array(CatalogModelEntry).max(512),
903
+ transcription: z9.array(CatalogModelEntry).max(64),
904
+ /** Null where the catalog has no build for this os/arch (installs then say so). */
905
+ llama_server: LlamaServerBuild.nullable(),
906
+ /** The knob desktop.models/default_transcription_model. */
907
+ default_transcription: TranscriptionModelId,
908
+ /** When the catalog was last changed (catalog_updated_at), for the service's log. */
909
+ catalog_updated_at: z9.string().max(40)
910
+ });
911
+ var MlCatalogSetResult = z9.strictObject({ text: nonNegInt, transcription: nonNegInt });
870
912
  var DownloadKind = z9.enum(["speech_model", "text_model", "runtime"]);
871
913
  var DownloadRow = z9.strictObject({
872
914
  /** The job's key in the service: "model:base", "llm:smollm2-135m", "llm-server", "runtime". */