@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/index.cjs CHANGED
@@ -194,6 +194,8 @@ __export(src_exports, {
194
194
  CalendarListParams: () => CalendarListParams,
195
195
  CalendarListResult: () => CalendarListResult,
196
196
  CancelMsg: () => CancelMsg,
197
+ CatalogFile: () => CatalogFile,
198
+ CatalogModelEntry: () => CatalogModelEntry,
197
199
  ChatAppProject: () => ChatAppProject,
198
200
  ChatFamily: () => ChatFamily,
199
201
  ChatHidden: () => ChatHidden,
@@ -479,6 +481,7 @@ __export(src_exports, {
479
481
  LEGACY_ACTIONS: () => LEGACY_ACTIONS,
480
482
  LEGACY_DISPATCHERS: () => LEGACY_DISPATCHERS,
481
483
  Limits: () => Limits,
484
+ LlamaServerBuild: () => LlamaServerBuild,
482
485
  LlmRunning: () => LlmRunning,
483
486
  LlmServerState: () => LlmServerState,
484
487
  LocationGetParams: () => LocationGetParams,
@@ -500,6 +503,8 @@ __export(src_exports, {
500
503
  MessagesMessage: () => MessagesMessage,
501
504
  MessagesSendParams: () => MessagesSendParams,
502
505
  MessagesSendResult: () => MessagesSendResult,
506
+ MlCatalogSetParams: () => MlCatalogSetParams,
507
+ MlCatalogSetResult: () => MlCatalogSetResult,
503
508
  MlInstallPhase: () => MlInstallPhase,
504
509
  MlInstallProgress: () => MlInstallProgress,
505
510
  MlProgress: () => MlProgress,
@@ -508,6 +513,7 @@ __export(src_exports, {
508
513
  MlServiceStatus: () => MlServiceStatus,
509
514
  MlStatusParams: () => MlStatusParams,
510
515
  MlStatusResult: () => MlStatusResult,
516
+ ModelKey: () => ModelKey,
511
517
  ModelsDownloadsCancelParams: () => ModelsDownloadsCancelParams,
512
518
  ModelsDownloadsCancelResult: () => ModelsDownloadsCancelResult,
513
519
  ModelsDownloadsListParams: () => ModelsDownloadsListParams,
@@ -697,6 +703,7 @@ __export(src_exports, {
697
703
  SessionListResult: () => SessionListResult,
698
704
  SessionReleaseParams: () => SessionReleaseParams,
699
705
  SessionReleaseResult: () => SessionReleaseResult,
706
+ Sha256Hex: () => Sha256Hex,
700
707
  ShownSection: () => ShownSection,
701
708
  Signal: () => Signal,
702
709
  SpendAccount: () => SpendAccount,
@@ -876,7 +883,7 @@ module.exports = __toCommonJS(src_exports);
876
883
  var import_zod = require("zod");
877
884
  var import_uuid = require("@ai-matrx/kit/uuid");
878
885
  var PROTOCOL_MAJOR = 1;
879
- var PROTOCOL_MINOR = 47;
886
+ var PROTOCOL_MINOR = 49;
880
887
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
881
888
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
882
889
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -1689,7 +1696,8 @@ var RelayStatusResponse = RelayDeviceStatusEvent;
1689
1696
 
1690
1697
  // src/schema/models.ts
1691
1698
  var import_zod10 = require("zod");
1692
- var TranscriptionModelId = import_zod10.z.enum(["tiny", "base", "small", "large-v3-turbo"]);
1699
+ var ModelKey = import_zod10.z.string().min(1).max(128).regex(/^[a-z0-9][a-z0-9._-]*(\/[a-z0-9][a-z0-9._-]*)?$/);
1700
+ var TranscriptionModelId = ModelKey;
1693
1701
  var MlRuntimeState = import_zod10.z.enum(["not_installed", "installing", "installed", "failed"]);
1694
1702
  var MlInstallPhase = import_zod10.z.enum(["packages", "model", "verifying"]);
1695
1703
  var MlInstallProgress = import_zod10.z.strictObject({
@@ -1749,18 +1757,7 @@ var MlProgress = import_zod10.z.strictObject({
1749
1757
  /** The segment just transcribed (transcribe only): text appears as it is recognised. */
1750
1758
  segment: TranscriptSegment.nullable()
1751
1759
  });
1752
- var TextModelId = import_zod10.z.enum([
1753
- "smollm2-135m",
1754
- "llama-3.2-3b",
1755
- "phi-4-mini",
1756
- "gemma-3-4b",
1757
- "llama-3.1-8b",
1758
- "qwen-2.5-7b",
1759
- "mistral-small-3.1",
1760
- "gpt-oss-20b",
1761
- "qwen-2.5-coder-7b",
1762
- "qwen-2.5-coder-14b"
1763
- ]);
1760
+ var TextModelId = ModelKey;
1764
1761
  var TextModelInfo = import_zod10.z.strictObject({
1765
1762
  id: TextModelId,
1766
1763
  /** Download size of the weights. */
@@ -1768,7 +1765,14 @@ var TextModelInfo = import_zod10.z.strictObject({
1768
1765
  installed: import_zod10.z.boolean()
1769
1766
  });
1770
1767
  var LlmServerState = import_zod10.z.enum(["stopped", "starting", "running", "failed"]);
1771
- var LlmRunning = import_zod10.z.strictObject({ id: TextModelId, port: import_zod10.z.int().min(1024).max(65535) });
1768
+ var LlmRunning = import_zod10.z.strictObject({
1769
+ id: TextModelId,
1770
+ port: import_zod10.z.int().min(1024).max(65535),
1771
+ /** (1.48) What the service actually applied, echoed so the app can attest "read and applied". Optional until the service sends them. */
1772
+ context_length: import_zod10.z.int().min(512).max(131072).optional(),
1773
+ gpu_layers: import_zod10.z.int().min(-1).max(999).optional(),
1774
+ threads: import_zod10.z.int().min(1).max(512).optional()
1775
+ });
1772
1776
  var ModelsLlmStatusParams = import_zod10.z.strictObject({});
1773
1777
  var ModelsLlmStatusResult = import_zod10.z.strictObject({
1774
1778
  state: LlmServerState,
@@ -1786,12 +1790,57 @@ var ModelsLlmInstallParams = import_zod10.z.strictObject({ model: TextModelId })
1786
1790
  var ModelsLlmInstallResult = import_zod10.z.strictObject({ model: TextModelId, elapsed_ms: nonNegInt });
1787
1791
  var ModelsLlmStartParams = import_zod10.z.strictObject({
1788
1792
  model: TextModelId,
1789
- /** Tokens of context; the service picks a size that fits this computer when omitted. */
1790
- context_length: import_zod10.z.int().min(512).max(131072).optional()
1793
+ /** Tokens of context, from the knob desktop.models/context_length. Omitted today means the service's fixed 4096 (optional until callers send it). */
1794
+ context_length: import_zod10.z.int().min(512).max(131072).optional(),
1795
+ /** (1.48) Layers offloaded to the GPU; -1 = all. From the knob desktop.models/gpu_layers. */
1796
+ gpu_layers: import_zod10.z.int().min(-1).max(999).optional(),
1797
+ /** (1.48) CPU threads, computed by the app from the knobs. */
1798
+ threads: import_zod10.z.int().min(1).max(512).optional(),
1799
+ /** (1.48) Seconds to wait for the model to load, computed by the app from the knobs. */
1800
+ load_timeout_s: import_zod10.z.int().min(10).max(3600).optional()
1791
1801
  });
1792
1802
  var ModelsLlmStartResult = import_zod10.z.strictObject({ running: LlmRunning, elapsed_ms: nonNegInt });
1793
1803
  var ModelsLlmStopParams = import_zod10.z.strictObject({});
1794
1804
  var ModelsLlmStopResult = import_zod10.z.strictObject({ stopped: import_zod10.z.boolean() });
1805
+ var Sha256Hex = import_zod10.z.string().regex(/^[0-9a-f]{64}$/);
1806
+ var CatalogFile = import_zod10.z.strictObject({
1807
+ /** Path inside the model's folder (the artifact's path_in_repo). */
1808
+ path: import_zod10.z.string().min(1).max(512),
1809
+ /** The pinned https URL it is downloaded from. */
1810
+ url: import_zod10.z.string().url().max(2048),
1811
+ size_bytes: nonNegInt,
1812
+ sha256: Sha256Hex,
1813
+ /** weights, weights_shard, mmproj, config, tokenizer, … (ai.model_artifact.role). */
1814
+ role: import_zod10.z.string().max(32)
1815
+ });
1816
+ var CatalogModelEntry = import_zod10.z.strictObject({
1817
+ /** The key callers name this model by (the 1.48 id for a seeded model). */
1818
+ key: ModelKey,
1819
+ /** The selected variant's key (`q4_k_m`, `ct2`). */
1820
+ variant: import_zod10.z.string().min(1).max(64),
1821
+ /** The upstream revision (or the variant id when there is none): a change re-downloads. */
1822
+ revision: import_zod10.z.string().min(1).max(64),
1823
+ multilingual: import_zod10.z.boolean(),
1824
+ /** Exactly the files this computer fetches for this model: never more, never fewer. */
1825
+ files: import_zod10.z.array(CatalogFile).min(1).max(256)
1826
+ });
1827
+ var LlamaServerBuild = import_zod10.z.strictObject({
1828
+ version: import_zod10.z.string().min(1).max(32),
1829
+ url: import_zod10.z.string().url().max(2048),
1830
+ size_bytes: nonNegInt,
1831
+ sha256: Sha256Hex
1832
+ });
1833
+ var MlCatalogSetParams = import_zod10.z.strictObject({
1834
+ text: import_zod10.z.array(CatalogModelEntry).max(512),
1835
+ transcription: import_zod10.z.array(CatalogModelEntry).max(64),
1836
+ /** Null where the catalog has no build for this os/arch (installs then say so). */
1837
+ llama_server: LlamaServerBuild.nullable(),
1838
+ /** The knob desktop.models/default_transcription_model. */
1839
+ default_transcription: TranscriptionModelId,
1840
+ /** When the catalog was last changed (catalog_updated_at), for the service's log. */
1841
+ catalog_updated_at: import_zod10.z.string().max(40)
1842
+ });
1843
+ var MlCatalogSetResult = import_zod10.z.strictObject({ text: nonNegInt, transcription: nonNegInt });
1795
1844
  var DownloadKind = import_zod10.z.enum(["speech_model", "text_model", "runtime"]);
1796
1845
  var DownloadRow = import_zod10.z.strictObject({
1797
1846
  /** The job's key in the service: "model:base", "llm:smollm2-135m", "llm-server", "runtime". */
@@ -5463,7 +5512,8 @@ var SERVICES = {
5463
5512
  "ml.llm_start": { params: ModelsLlmStartParams, result: ModelsLlmStartResult },
5464
5513
  "ml.llm_stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult },
5465
5514
  "ml.downloads": { params: ModelsDownloadsListParams, result: ModelsDownloadsListResult },
5466
- "ml.download_cancel": { params: ModelsDownloadsCancelParams, result: ModelsDownloadsCancelResult }
5515
+ "ml.download_cancel": { params: ModelsDownloadsCancelParams, result: ModelsDownloadsCancelResult },
5516
+ "ml.catalog_set": { params: MlCatalogSetParams, result: MlCatalogSetResult }
5467
5517
  }
5468
5518
  },
5469
5519
  coding: {
@@ -5615,6 +5665,13 @@ var NAMED_SCHEMAS = {
5615
5665
  ModelsProgressEvent,
5616
5666
  TextModelId,
5617
5667
  TextModelInfo,
5668
+ ModelKey,
5669
+ Sha256Hex,
5670
+ CatalogFile,
5671
+ CatalogModelEntry,
5672
+ LlamaServerBuild,
5673
+ MlCatalogSetParams,
5674
+ MlCatalogSetResult,
5618
5675
  LlmServerState,
5619
5676
  LlmRunning,
5620
5677
  ModelsLlmStatusParams,
@@ -6262,6 +6319,8 @@ var NAMED_SCHEMAS = {
6262
6319
 
6263
6320
  // src/versioning.ts
6264
6321
  var FIELDS_SINCE = {
6322
+ LlmRunning: { context_length: "1.48", gpu_layers: "1.48", threads: "1.48" },
6323
+ ModelsLlmStartParams: { gpu_layers: "1.48", threads: "1.48", load_timeout_s: "1.48" },
6265
6324
  FsPatchResult: { edits_applied: "1.1", edits_failed: "1.1" },
6266
6325
  "ProtocolErrorBody.data": { edits_failed: "1.1" },
6267
6326
  "RelayCallResponse|0": { protocol_version: "1.1" },
@@ -6458,7 +6517,7 @@ function forPeer(op, part, value, version) {
6458
6517
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
6459
6518
 
6460
6519
  // src/contract.ts
6461
- var CONTRACT_SHA256 = "502c8718b1d2fd0fde43daed047da5a7b158f81ffa3846c7d73cda879777fe37";
6520
+ var CONTRACT_SHA256 = "783487638685c921a761d27c5c6dca3103d1d6d5ae0ec38ffd59086b68a2207a";
6462
6521
 
6463
6522
  // src/close-policy.ts
6464
6523
  var CLOSE_RULES = {