@ai-matrx/desktop-protocol 0.21.73 → 0.21.75

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.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 = 72;
147
+ var PROTOCOL_MINOR = 74;
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_-]+$/);
@@ -998,6 +998,36 @@ var ModelsDownloadsListParams = import_zod9.z.strictObject({});
998
998
  var ModelsDownloadsListResult = import_zod9.z.strictObject({ downloads: import_zod9.z.array(DownloadRow).max(64) });
999
999
  var ModelsDownloadsCancelParams = import_zod9.z.strictObject({ key: import_zod9.z.string().max(64) });
1000
1000
  var ModelsDownloadsCancelResult = import_zod9.z.strictObject({ cancelled: import_zod9.z.boolean() });
1001
+ var LocalModelKind = import_zod9.z.enum(["text", "speech"]);
1002
+ var LocalModelRow = import_zod9.z.strictObject({
1003
+ kind: LocalModelKind,
1004
+ model: ModelKey,
1005
+ /** Its folder in the service's store. */
1006
+ path: import_zod9.z.string().max(1024),
1007
+ /** Every file of the model, as installed. */
1008
+ size_bytes: nonNegInt,
1009
+ /** What Remove frees: the files only Matrx 2 holds. A file linked from the person's own folder frees nothing. */
1010
+ freed_bytes: nonNegInt,
1011
+ /** True when any file is a link to a file elsewhere (used in place): Remove then never deletes that file. */
1012
+ in_place: import_zod9.z.boolean(),
1013
+ /** The folder the person's files stay in (in place), when the service can tell; null otherwise. */
1014
+ source: import_zod9.z.string().max(1024).nullable(),
1015
+ /** The language model the server runs now (Remove stops it first). */
1016
+ running: import_zod9.z.boolean()
1017
+ });
1018
+ var ModelsLocalListParams = import_zod9.z.strictObject({});
1019
+ var ModelsLocalListResult = import_zod9.z.strictObject({ models: import_zod9.z.array(LocalModelRow).max(1024) });
1020
+ var ModelsLocalRemoveParams = import_zod9.z.strictObject({ kind: LocalModelKind, model: ModelKey });
1021
+ var ModelsLocalRemoveResult = import_zod9.z.strictObject({
1022
+ kind: LocalModelKind,
1023
+ model: ModelKey,
1024
+ /** Bytes of disk the removal gave back (0 for a model used in place). */
1025
+ freed_bytes: nonNegInt,
1026
+ /** True when it was the running model and the server was stopped first. */
1027
+ stopped: import_zod9.z.boolean(),
1028
+ /** Where the person's files stay (a model used in place); null when nothing was kept. */
1029
+ kept: import_zod9.z.string().max(1024).nullable()
1030
+ });
1001
1031
  var MlServiceState = import_zod9.z.enum(["starting", "ready", "restarting", "failed", "stopped"]);
1002
1032
  var MlServiceStatus = import_zod9.z.strictObject({
1003
1033
  state: MlServiceState,
@@ -3316,7 +3346,9 @@ var AccountUsage = import_zod31.z.strictObject({
3316
3346
  * window's use (its usage history), so the real reset is at or before it. Absent when no 5-hour
3317
3347
  * window is running (no use in the last reading, or the reading is over 5 hours old).
3318
3348
  */
3319
- five_hour_resets_by_ms: epochMs.optional()
3349
+ five_hour_resets_by_ms: epochMs.optional(),
3350
+ /** 1.73: where the reading came from (absent = the app itself). */
3351
+ read_source: import_zod31.z.enum(["app", "claude_code"]).optional()
3320
3352
  });
3321
3353
  var AccountReset = import_zod31.z.strictObject({
3322
3354
  window: ChatPlace,
@@ -3774,6 +3806,25 @@ var ElsewhereInstance = import_zod32.z.strictObject({
3774
3806
  });
3775
3807
  var AccountResetSource = import_zod32.z.enum(["app", "usage_history", "your_list"]);
3776
3808
  var AccountGap = import_zod32.z.enum(["email", "plan", "usage"]);
3809
+ var AccountReadSource = import_zod32.z.enum(["app", "claude_code"]);
3810
+ var AccountProfile = import_zod32.z.strictObject({
3811
+ /** The person's name on the account. */
3812
+ name: import_zod32.z.string().max(200).nullable(),
3813
+ /** The organization the sign-in is in, and the person's role there. */
3814
+ org_name: import_zod32.z.string().max(200).nullable(),
3815
+ org_role: import_zod32.z.string().max(80).nullable(),
3816
+ /** Claude: the seat tier of a team plan, the rate-limit tier, how it is billed, when a trial ends. */
3817
+ seat_tier: import_zod32.z.string().max(80).nullable(),
3818
+ rate_limit_tier: import_zod32.z.string().max(120).nullable(),
3819
+ billing: import_zod32.z.string().max(80).nullable(),
3820
+ trial_ends_ms: epochMs.nullable(),
3821
+ /** Cursor: whether the subscription is active ("active", "canceled", …) as Cursor records it. */
3822
+ subscription: import_zod32.z.string().max(80).nullable(),
3823
+ /** Where these facts were read (a short label: "Claude Code's sign-in"). */
3824
+ source: import_zod32.z.string().max(200),
3825
+ /** When the app last fetched them, when it says. */
3826
+ as_of_ms: epochMs.nullable()
3827
+ });
3777
3828
  var AppAccount = import_zod32.z.strictObject({
3778
3829
  app_key: AppKey,
3779
3830
  /** The provider's own account id (Claude's account uuid, ChatGPT's account id); `org:<uuid>` when only its organization is known. */
@@ -3803,7 +3854,13 @@ var AppAccount = import_zod32.z.strictObject({
3803
3854
  instances: import_zod32.z.array(ChatPlace).max(200),
3804
3855
  first_seen_ms: epochMs.nullable(),
3805
3856
  last_seen_ms: epochMs.nullable(),
3806
- missing: import_zod32.z.array(AccountGap).max(3)
3857
+ missing: import_zod32.z.array(AccountGap).max(3),
3858
+ /** 1.73: who the account is beyond its email (plan details, role, tiers), when the app records it. */
3859
+ profile: AccountProfile.optional(),
3860
+ /** 1.73: where the newest reading came from (absent = the app itself). */
3861
+ read_source: AccountReadSource.optional(),
3862
+ /** 1.73: Claude Code: the running session's cost as Claude Code estimates it (US dollars), with a Claude Code reading. */
3863
+ session_cost_usd: import_zod32.z.number().nonnegative().optional()
3807
3864
  });
3808
3865
  var AppsInstancesListParams = import_zod32.z.strictObject({ app_key: AppKey, fresh: import_zod32.z.boolean().optional() });
3809
3866
  var AppsInstancesListResult = import_zod32.z.strictObject({
@@ -3837,6 +3894,47 @@ var ProbeFact = import_zod32.z.strictObject({ key: import_zod32.z.string().max(2
3837
3894
  var ProbeSource = import_zod32.z.strictObject({ source: import_zod32.z.string().max(120), instance: import_zod32.z.string().max(64).nullable(), facts: import_zod32.z.array(ProbeFact).max(500) });
3838
3895
  var AppsChatsProbeParams = import_zod32.z.strictObject({ app_key: AppKey, chat_id: import_zod32.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/) });
3839
3896
  var AppsChatsProbeResult = import_zod32.z.strictObject({ app_key: AppKey, chat_id: import_zod32.z.string().max(128), sources: import_zod32.z.array(ProbeSource).max(200) });
3897
+ var McpTransport = import_zod32.z.enum(["stdio", "http", "sse", "unknown"]);
3898
+ var McpServerRow = import_zod32.z.strictObject({
3899
+ app_key: AppKey,
3900
+ /** The app's instance whose settings hold it ("main", a home's name). */
3901
+ instance: import_zod32.z.string().max(120),
3902
+ name: import_zod32.z.string().max(200),
3903
+ transport: McpTransport,
3904
+ /** The URL (scheme, host and path only) or the command and its arguments (secret-looking ones blanked). */
3905
+ target: import_zod32.z.string().max(400).nullable(),
3906
+ /** "user" (every folder), "desktop" (the desktop app), or the folder it is set up for. */
3907
+ scope: import_zod32.z.string().max(400),
3908
+ /** Turned on or off in the app, when it records it. */
3909
+ enabled: import_zod32.z.boolean().nullable(),
3910
+ /** The settings file it was read from. */
3911
+ where: import_zod32.z.string().max(400)
3912
+ });
3913
+ var SetupFact = import_zod32.z.strictObject({ name: import_zod32.z.string().max(80), value: import_zod32.z.string().max(300) });
3914
+ var SetupItemKind = import_zod32.z.enum(["extension", "plugin", "marketplace", "model"]);
3915
+ var SetupItem = import_zod32.z.strictObject({
3916
+ kind: SetupItemKind,
3917
+ name: import_zod32.z.string().max(200),
3918
+ version: import_zod32.z.string().max(80).nullable(),
3919
+ /** Turned on or off, when the app records it. */
3920
+ enabled: import_zod32.z.boolean().nullable()
3921
+ });
3922
+ var AppSetup = import_zod32.z.strictObject({
3923
+ app_key: AppKey,
3924
+ instance: import_zod32.z.string().max(120),
3925
+ /** The folder its settings were read from. */
3926
+ where: import_zod32.z.string().max(400),
3927
+ facts: import_zod32.z.array(SetupFact).max(60),
3928
+ items: import_zod32.z.array(SetupItem).max(2e3),
3929
+ /** What could not be read there (shown, never hidden). */
3930
+ problems: import_zod32.z.array(import_zod32.z.string().max(300)).max(20)
3931
+ });
3932
+ var AppsSetupListParams = import_zod32.z.strictObject({ app_key: AppKey.optional() });
3933
+ var AppsSetupListResult = import_zod32.z.strictObject({
3934
+ setups: import_zod32.z.array(AppSetup).max(200),
3935
+ mcp: import_zod32.z.array(McpServerRow).max(2e3),
3936
+ problem: import_zod32.z.string().max(400).optional()
3937
+ });
3840
3938
 
3841
3939
  // src/schema/browser.ts
3842
3940
  var import_zod33 = require("zod");
@@ -4712,6 +4810,8 @@ var OPS = {
4712
4810
  "models.llm.stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult, kind: "unary", since: "1.31", errors: ["INTERNAL"] },
4713
4811
  "models.downloads.list": { params: ModelsDownloadsListParams, result: ModelsDownloadsListResult, kind: "unary", since: "1.45", errors: ["INTERNAL"] },
4714
4812
  "models.downloads.cancel": { params: ModelsDownloadsCancelParams, result: ModelsDownloadsCancelResult, kind: "unary", since: "1.45", errors: ["NOT_FOUND", "INTERNAL"] },
4813
+ "models.local.list": { params: ModelsLocalListParams, result: ModelsLocalListResult, kind: "unary", since: "1.74", errors: ["INTERNAL"] },
4814
+ "models.local.remove": { params: ModelsLocalRemoveParams, result: ModelsLocalRemoveResult, kind: "unary", since: "1.74", errors: ["NOT_FOUND", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"] },
4715
4815
  // Desktop apps and their profiles (SPEC §6 apps); profiles are rows in users.desktop_app_profile.
4716
4816
  "apps.list": { params: AppsListParams, result: AppsListResult, kind: "unary", since: "1.2", errors: ["INTERNAL"] },
4717
4817
  "apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
@@ -4741,6 +4841,7 @@ var OPS = {
4741
4841
  // 1.47: instances and accounts kept apart — an account's usage is the account's, every instance shows it by id.
4742
4842
  "apps.instances.list": { params: AppsInstancesListParams, result: AppsInstancesListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4743
4843
  "apps.accounts.list": { params: AppsAccountsListParams, result: AppsAccountsListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4844
+ "apps.setup.list": { params: AppsSetupListParams, result: AppsSetupListResult, kind: "unary", since: "1.73", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4744
4845
  // 1.56: an instance's kept-for account and forgetting it (the app's own tool writes both); every raw fact about one chat.
4745
4846
  "apps.windows.set_account": { params: AppsWindowsSetAccountParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4746
4847
  "apps.windows.forget": { params: AppsWindowsForgetParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },