@ai-matrx/desktop-protocol 0.21.72 → 0.21.74

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 = 71;
147
+ var PROTOCOL_MINOR = 73;
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_-]+$/);
@@ -3145,6 +3145,11 @@ var ChatRow = import_zod30.z.strictObject({
3145
3145
  prior_sessions: import_zod30.z.array(ChatId).max(50).optional(),
3146
3146
  /** 1.61: where the title shows (the title facet's sync state for this chat's app). */
3147
3147
  title_sync: ChatTitleSync.optional(),
3148
+ /**
3149
+ * 1.72: whether our star is the app's pin for this chat (the pin facet's sync state: `synced` only
3150
+ * where a test proved the app takes and keeps the pin Matrx writes; `not_synced` says why).
3151
+ */
3152
+ pin_sync: ChatTitleSync.optional(),
3148
3153
  /** 1.62: every Move and Copy of this chat between instances, newest first (absent = never moved or copied). */
3149
3154
  moved: import_zod30.z.array(ChatMove).max(50).optional(),
3150
3155
  /**
@@ -3311,7 +3316,9 @@ var AccountUsage = import_zod31.z.strictObject({
3311
3316
  * window's use (its usage history), so the real reset is at or before it. Absent when no 5-hour
3312
3317
  * window is running (no use in the last reading, or the reading is over 5 hours old).
3313
3318
  */
3314
- five_hour_resets_by_ms: epochMs.optional()
3319
+ five_hour_resets_by_ms: epochMs.optional(),
3320
+ /** 1.73: where the reading came from (absent = the app itself). */
3321
+ read_source: import_zod31.z.enum(["app", "claude_code"]).optional()
3315
3322
  });
3316
3323
  var AccountReset = import_zod31.z.strictObject({
3317
3324
  window: ChatPlace,
@@ -3461,6 +3468,30 @@ var AppsProjectsToWindowResult = import_zod31.z.strictObject({
3461
3468
  chats: import_zod31.z.array(ProjectMoveOutcome).max(5e3).optional(),
3462
3469
  message: import_zod31.z.string().max(400)
3463
3470
  });
3471
+ var AppsChatsBringBackParams = import_zod31.z.strictObject({ app_key: AppKey, chat_id: ChatId, dry_run: import_zod31.z.boolean().optional() });
3472
+ var AppsChatsBringBackResult = AppsProjectsToWindowResult.extend({ project_id: ChatProjectId.nullable() });
3473
+ var TidyUpFacet = import_zod31.z.strictObject({
3474
+ app_key: AppKey,
3475
+ facet: import_zod31.z.enum(["title", "pin"]),
3476
+ state: import_zod31.z.enum(["synced", "not_synced", "unsupported"]),
3477
+ note: import_zod31.z.string().max(400),
3478
+ to_push: nonNegInt,
3479
+ pushed: nonNegInt,
3480
+ already: nonNegInt,
3481
+ waiting: nonNegInt,
3482
+ failed: nonNegInt
3483
+ });
3484
+ var TidyUpRestart = import_zod31.z.strictObject({ window: ChatPlace, why: import_zod31.z.string().max(400) });
3485
+ var AppsChatsTidyUpParams = import_zod31.z.strictObject({ dry_run: import_zod31.z.boolean(), restart_windows: import_zod31.z.array(ChatPlace).max(64).optional() });
3486
+ var AppsChatsTidyUpResult = import_zod31.z.strictObject({
3487
+ dry_run: import_zod31.z.boolean(),
3488
+ facets: import_zod31.z.array(TidyUpFacet).max(32),
3489
+ /** Claude windows that would keep an old name until they reopen (the plan lists them; nothing is quit unasked). */
3490
+ restart: import_zod31.z.array(TidyUpRestart).max(64),
3491
+ /** The windows this run quit and reopened. */
3492
+ restarted: import_zod31.z.array(ChatPlace).max(64),
3493
+ message: import_zod31.z.string().max(600)
3494
+ });
3464
3495
  var ColdChat = import_zod31.z.strictObject({
3465
3496
  id: ChatId,
3466
3497
  title: import_zod31.z.string().max(1e3),
@@ -3745,6 +3776,25 @@ var ElsewhereInstance = import_zod32.z.strictObject({
3745
3776
  });
3746
3777
  var AccountResetSource = import_zod32.z.enum(["app", "usage_history", "your_list"]);
3747
3778
  var AccountGap = import_zod32.z.enum(["email", "plan", "usage"]);
3779
+ var AccountReadSource = import_zod32.z.enum(["app", "claude_code"]);
3780
+ var AccountProfile = import_zod32.z.strictObject({
3781
+ /** The person's name on the account. */
3782
+ name: import_zod32.z.string().max(200).nullable(),
3783
+ /** The organization the sign-in is in, and the person's role there. */
3784
+ org_name: import_zod32.z.string().max(200).nullable(),
3785
+ org_role: import_zod32.z.string().max(80).nullable(),
3786
+ /** Claude: the seat tier of a team plan, the rate-limit tier, how it is billed, when a trial ends. */
3787
+ seat_tier: import_zod32.z.string().max(80).nullable(),
3788
+ rate_limit_tier: import_zod32.z.string().max(120).nullable(),
3789
+ billing: import_zod32.z.string().max(80).nullable(),
3790
+ trial_ends_ms: epochMs.nullable(),
3791
+ /** Cursor: whether the subscription is active ("active", "canceled", …) as Cursor records it. */
3792
+ subscription: import_zod32.z.string().max(80).nullable(),
3793
+ /** Where these facts were read (a short label: "Claude Code's sign-in"). */
3794
+ source: import_zod32.z.string().max(200),
3795
+ /** When the app last fetched them, when it says. */
3796
+ as_of_ms: epochMs.nullable()
3797
+ });
3748
3798
  var AppAccount = import_zod32.z.strictObject({
3749
3799
  app_key: AppKey,
3750
3800
  /** The provider's own account id (Claude's account uuid, ChatGPT's account id); `org:<uuid>` when only its organization is known. */
@@ -3774,7 +3824,13 @@ var AppAccount = import_zod32.z.strictObject({
3774
3824
  instances: import_zod32.z.array(ChatPlace).max(200),
3775
3825
  first_seen_ms: epochMs.nullable(),
3776
3826
  last_seen_ms: epochMs.nullable(),
3777
- missing: import_zod32.z.array(AccountGap).max(3)
3827
+ missing: import_zod32.z.array(AccountGap).max(3),
3828
+ /** 1.73: who the account is beyond its email (plan details, role, tiers), when the app records it. */
3829
+ profile: AccountProfile.optional(),
3830
+ /** 1.73: where the newest reading came from (absent = the app itself). */
3831
+ read_source: AccountReadSource.optional(),
3832
+ /** 1.73: Claude Code: the running session's cost as Claude Code estimates it (US dollars), with a Claude Code reading. */
3833
+ session_cost_usd: import_zod32.z.number().nonnegative().optional()
3778
3834
  });
3779
3835
  var AppsInstancesListParams = import_zod32.z.strictObject({ app_key: AppKey, fresh: import_zod32.z.boolean().optional() });
3780
3836
  var AppsInstancesListResult = import_zod32.z.strictObject({
@@ -3808,6 +3864,47 @@ var ProbeFact = import_zod32.z.strictObject({ key: import_zod32.z.string().max(2
3808
3864
  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) });
3809
3865
  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}$/) });
3810
3866
  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) });
3867
+ var McpTransport = import_zod32.z.enum(["stdio", "http", "sse", "unknown"]);
3868
+ var McpServerRow = import_zod32.z.strictObject({
3869
+ app_key: AppKey,
3870
+ /** The app's instance whose settings hold it ("main", a home's name). */
3871
+ instance: import_zod32.z.string().max(120),
3872
+ name: import_zod32.z.string().max(200),
3873
+ transport: McpTransport,
3874
+ /** The URL (scheme, host and path only) or the command and its arguments (secret-looking ones blanked). */
3875
+ target: import_zod32.z.string().max(400).nullable(),
3876
+ /** "user" (every folder), "desktop" (the desktop app), or the folder it is set up for. */
3877
+ scope: import_zod32.z.string().max(400),
3878
+ /** Turned on or off in the app, when it records it. */
3879
+ enabled: import_zod32.z.boolean().nullable(),
3880
+ /** The settings file it was read from. */
3881
+ where: import_zod32.z.string().max(400)
3882
+ });
3883
+ var SetupFact = import_zod32.z.strictObject({ name: import_zod32.z.string().max(80), value: import_zod32.z.string().max(300) });
3884
+ var SetupItemKind = import_zod32.z.enum(["extension", "plugin", "marketplace", "model"]);
3885
+ var SetupItem = import_zod32.z.strictObject({
3886
+ kind: SetupItemKind,
3887
+ name: import_zod32.z.string().max(200),
3888
+ version: import_zod32.z.string().max(80).nullable(),
3889
+ /** Turned on or off, when the app records it. */
3890
+ enabled: import_zod32.z.boolean().nullable()
3891
+ });
3892
+ var AppSetup = import_zod32.z.strictObject({
3893
+ app_key: AppKey,
3894
+ instance: import_zod32.z.string().max(120),
3895
+ /** The folder its settings were read from. */
3896
+ where: import_zod32.z.string().max(400),
3897
+ facts: import_zod32.z.array(SetupFact).max(60),
3898
+ items: import_zod32.z.array(SetupItem).max(2e3),
3899
+ /** What could not be read there (shown, never hidden). */
3900
+ problems: import_zod32.z.array(import_zod32.z.string().max(300)).max(20)
3901
+ });
3902
+ var AppsSetupListParams = import_zod32.z.strictObject({ app_key: AppKey.optional() });
3903
+ var AppsSetupListResult = import_zod32.z.strictObject({
3904
+ setups: import_zod32.z.array(AppSetup).max(200),
3905
+ mcp: import_zod32.z.array(McpServerRow).max(2e3),
3906
+ problem: import_zod32.z.string().max(400).optional()
3907
+ });
3811
3908
 
3812
3909
  // src/schema/browser.ts
3813
3910
  var import_zod33 = require("zod");
@@ -4712,6 +4809,7 @@ var OPS = {
4712
4809
  // 1.47: instances and accounts kept apart — an account's usage is the account's, every instance shows it by id.
4713
4810
  "apps.instances.list": { params: AppsInstancesListParams, result: AppsInstancesListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4714
4811
  "apps.accounts.list": { params: AppsAccountsListParams, result: AppsAccountsListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4812
+ "apps.setup.list": { params: AppsSetupListParams, result: AppsSetupListResult, kind: "unary", since: "1.73", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4715
4813
  // 1.56: an instance's kept-for account and forgetting it (the app's own tool writes both); every raw fact about one chat.
4716
4814
  "apps.windows.set_account": { params: AppsWindowsSetAccountParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4717
4815
  "apps.windows.forget": { params: AppsWindowsForgetParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -4727,6 +4825,8 @@ var OPS = {
4727
4825
  "apps.chats.open": { params: AppsChatsOpenParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4728
4826
  "apps.chats.titles_check": { params: AppsChatsTitlesCheckParams, result: AppsChatsTitlesCheckResult, kind: "unary", since: "1.29", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4729
4827
  "apps.chats.titles_push": { params: AppsChatsTitlesPushParams, result: AppsChatsTitlesPushResult, kind: "unary", since: "1.29", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4828
+ "apps.chats.bring_back": { params: AppsChatsBringBackParams, result: AppsChatsBringBackResult, kind: "unary", since: "1.72", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4829
+ "apps.chats.tidy_up": { params: AppsChatsTidyUpParams, result: AppsChatsTidyUpResult, kind: "unary", since: "1.72", errors: ["INVALID_PARAMS", "NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4730
4830
  "apps.spend": { params: AppsSpendParams, result: AppsSpendResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4731
4831
  "apps.sync.status": { params: AppsSyncStatusParams, result: AppsSyncStatusResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4732
4832
  "apps.sync.run": { params: AppsSyncRunParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },