@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/CHANGELOG.md CHANGED
@@ -1,9 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.44
4
+ ### Unreleased
5
+
6
+ - **Protocol 1.49 — local models come from the platform catalog.** `TextModelId` and
7
+ `TranscriptionModelId` become `ModelKey` (a string key, `<model>` or `<model>/<variant>`); every 1.48 id
8
+ is still valid. New service op `ml.catalog_set` (`MlCatalogSetParams`: per model the selected variant's
9
+ files with URL, size and SHA-256; the llama-server build; the default transcription model knob) — the
10
+ `ml` service no longer holds a model list. Consumer action: a Python service built from this contract
11
+ must serve `ml.catalog_set`; code that switched over the old enums must handle any key.
12
+
13
+ - **Protocol 1.48 — model start carries the app's knobs, and the service echoes what it applied.**
14
+ `ModelsLlmStartParams` gains optional `gpu_layers` (-1..999), `threads` (1..512), `load_timeout_s` (10..3600)
15
+ beside `context_length`; `LlmRunning` gains optional `context_length`, `gpu_layers`, `threads` (what was
16
+ actually applied, for config attestation). All optional and listed in `FIELDS_SINCE` "1.48"; Matrx 2 makes
17
+ them required when the Python service and every caller send them. The false "the service picks a size"
18
+ comment on `context_length` is corrected (the service uses a fixed 4096 when it is omitted).
19
+
3
20
  ## 0.21.42
4
21
 
5
- UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
- Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/desktop-protocol/src`.
22
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
23
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
24
+ Diff: `git diff bdadfd428f a5da075c1d -- apps/shared/desktop-protocol/src`
25
+
26
+ Changed shipped source files (1):
27
+ - `apps/shared/desktop-protocol/src/schema/apps-instances.ts`
7
28
 
8
29
  ## 0.21.39
9
30
 
package/dist/client.cjs CHANGED
@@ -144,7 +144,7 @@ var import_zod2 = require("zod");
144
144
  var import_zod = require("zod");
145
145
  var import_uuid = require("@ai-matrx/kit/uuid");
146
146
  var PROTOCOL_MAJOR = 1;
147
- var PROTOCOL_MINOR = 47;
147
+ var PROTOCOL_MINOR = 49;
148
148
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
149
149
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
150
150
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -796,7 +796,8 @@ var SessionControlChangedEvent = import_zod8.z.strictObject({ controller_client_
796
796
 
797
797
  // src/schema/models.ts
798
798
  var import_zod9 = require("zod");
799
- var TranscriptionModelId = import_zod9.z.enum(["tiny", "base", "small", "large-v3-turbo"]);
799
+ var ModelKey = import_zod9.z.string().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*(\/[a-z0-9][a-z0-9._-]*)?$/);
800
+ var TranscriptionModelId = ModelKey;
800
801
  var MlRuntimeState = import_zod9.z.enum(["not_installed", "installing", "installed", "failed"]);
801
802
  var MlInstallPhase = import_zod9.z.enum(["packages", "model", "verifying"]);
802
803
  var MlInstallProgress = import_zod9.z.strictObject({
@@ -856,18 +857,7 @@ var MlProgress = import_zod9.z.strictObject({
856
857
  /** The segment just transcribed (transcribe only): text appears as it is recognised. */
857
858
  segment: TranscriptSegment.nullable()
858
859
  });
859
- var TextModelId = import_zod9.z.enum([
860
- "smollm2-135m",
861
- "llama-3.2-3b",
862
- "phi-4-mini",
863
- "gemma-3-4b",
864
- "llama-3.1-8b",
865
- "qwen-2.5-7b",
866
- "mistral-small-3.1",
867
- "gpt-oss-20b",
868
- "qwen-2.5-coder-7b",
869
- "qwen-2.5-coder-14b"
870
- ]);
860
+ var TextModelId = ModelKey;
871
861
  var TextModelInfo = import_zod9.z.strictObject({
872
862
  id: TextModelId,
873
863
  /** Download size of the weights. */
@@ -875,7 +865,14 @@ var TextModelInfo = import_zod9.z.strictObject({
875
865
  installed: import_zod9.z.boolean()
876
866
  });
877
867
  var LlmServerState = import_zod9.z.enum(["stopped", "starting", "running", "failed"]);
878
- var LlmRunning = import_zod9.z.strictObject({ id: TextModelId, port: import_zod9.z.int().min(1024).max(65535) });
868
+ var LlmRunning = import_zod9.z.strictObject({
869
+ id: TextModelId,
870
+ port: import_zod9.z.int().min(1024).max(65535),
871
+ /** (1.48) What the service actually applied, echoed so the app can attest "read and applied". Optional until the service sends them. */
872
+ context_length: import_zod9.z.int().min(512).max(131072).optional(),
873
+ gpu_layers: import_zod9.z.int().min(-1).max(999).optional(),
874
+ threads: import_zod9.z.int().min(1).max(512).optional()
875
+ });
879
876
  var ModelsLlmStatusParams = import_zod9.z.strictObject({});
880
877
  var ModelsLlmStatusResult = import_zod9.z.strictObject({
881
878
  state: LlmServerState,
@@ -893,12 +890,57 @@ var ModelsLlmInstallParams = import_zod9.z.strictObject({ model: TextModelId });
893
890
  var ModelsLlmInstallResult = import_zod9.z.strictObject({ model: TextModelId, elapsed_ms: nonNegInt });
894
891
  var ModelsLlmStartParams = import_zod9.z.strictObject({
895
892
  model: TextModelId,
896
- /** Tokens of context; the service picks a size that fits this computer when omitted. */
897
- context_length: import_zod9.z.int().min(512).max(131072).optional()
893
+ /** Tokens of context, from the knob desktop.models/context_length. Omitted today means the service's fixed 4096 (optional until callers send it). */
894
+ context_length: import_zod9.z.int().min(512).max(131072).optional(),
895
+ /** (1.48) Layers offloaded to the GPU; -1 = all. From the knob desktop.models/gpu_layers. */
896
+ gpu_layers: import_zod9.z.int().min(-1).max(999).optional(),
897
+ /** (1.48) CPU threads, computed by the app from the knobs. */
898
+ threads: import_zod9.z.int().min(1).max(512).optional(),
899
+ /** (1.48) Seconds to wait for the model to load, computed by the app from the knobs. */
900
+ load_timeout_s: import_zod9.z.int().min(10).max(3600).optional()
898
901
  });
899
902
  var ModelsLlmStartResult = import_zod9.z.strictObject({ running: LlmRunning, elapsed_ms: nonNegInt });
900
903
  var ModelsLlmStopParams = import_zod9.z.strictObject({});
901
904
  var ModelsLlmStopResult = import_zod9.z.strictObject({ stopped: import_zod9.z.boolean() });
905
+ var Sha256Hex = import_zod9.z.string().regex(/^[0-9a-f]{64}$/);
906
+ var CatalogFile = import_zod9.z.strictObject({
907
+ /** Path inside the model's folder (the artifact's path_in_repo). */
908
+ path: import_zod9.z.string().min(1).max(512),
909
+ /** The pinned https URL it is downloaded from. */
910
+ url: import_zod9.z.string().url().max(2048),
911
+ size_bytes: nonNegInt,
912
+ sha256: Sha256Hex,
913
+ /** weights, weights_shard, mmproj, config, tokenizer, … (ai.model_artifact.role). */
914
+ role: import_zod9.z.string().max(32)
915
+ });
916
+ var CatalogModelEntry = import_zod9.z.strictObject({
917
+ /** The key callers name this model by (the 1.48 id for a seeded model). */
918
+ key: ModelKey,
919
+ /** The selected variant's key (`q4_k_m`, `ct2`). */
920
+ variant: import_zod9.z.string().min(1).max(64),
921
+ /** The upstream revision (or the variant id when there is none): a change re-downloads. */
922
+ revision: import_zod9.z.string().min(1).max(64),
923
+ multilingual: import_zod9.z.boolean(),
924
+ /** Exactly the files this computer fetches for this model: never more, never fewer. */
925
+ files: import_zod9.z.array(CatalogFile).min(1).max(256)
926
+ });
927
+ var LlamaServerBuild = import_zod9.z.strictObject({
928
+ version: import_zod9.z.string().min(1).max(32),
929
+ url: import_zod9.z.string().url().max(2048),
930
+ size_bytes: nonNegInt,
931
+ sha256: Sha256Hex
932
+ });
933
+ var MlCatalogSetParams = import_zod9.z.strictObject({
934
+ text: import_zod9.z.array(CatalogModelEntry).max(512),
935
+ transcription: import_zod9.z.array(CatalogModelEntry).max(64),
936
+ /** Null where the catalog has no build for this os/arch (installs then say so). */
937
+ llama_server: LlamaServerBuild.nullable(),
938
+ /** The knob desktop.models/default_transcription_model. */
939
+ default_transcription: TranscriptionModelId,
940
+ /** When the catalog was last changed (catalog_updated_at), for the service's log. */
941
+ catalog_updated_at: import_zod9.z.string().max(40)
942
+ });
943
+ var MlCatalogSetResult = import_zod9.z.strictObject({ text: nonNegInt, transcription: nonNegInt });
902
944
  var DownloadKind = import_zod9.z.enum(["speech_model", "text_model", "runtime"]);
903
945
  var DownloadRow = import_zod9.z.strictObject({
904
946
  /** The job's key in the service: "model:base", "llm:smollm2-135m", "llm-server", "runtime". */