@ai-matrx/desktop-protocol 0.21.50 → 0.21.52
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 +25 -1
- package/dist/client.cjs +99 -18
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +99 -18
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +146 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +375 -6
- package/dist/index.d.ts +375 -6
- package/dist/index.js +146 -27
- package/dist/index.js.map +1 -1
- package/dist/{models-CqgbnWpk.d.cts → models--9189VUC.d.cts} +522 -1
- package/dist/{models-CqgbnWpk.d.ts → models--9189VUC.d.ts} +522 -1
- package/dist/react.d.cts +214 -0
- package/dist/react.d.ts +214 -0
- package/generated/desktop-protocol.schema.json +456 -78
- package/package.json +2 -2
package/dist/client.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BackoffOptions } from '@ai-matrx/data/realtime';
|
|
2
2
|
export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/data/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
|
|
5
|
-
export { i as isDesktopProtocolError } from './models
|
|
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--9189VUC.cjs';
|
|
5
|
+
export { i as isDesktopProtocolError } from './models--9189VUC.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/data/realtime';
|
|
2
2
|
export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/data/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
|
|
5
|
-
export { i as isDesktopProtocolError } from './models
|
|
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--9189VUC.js';
|
|
5
|
+
export { i as isDesktopProtocolError } from './models--9189VUC.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 =
|
|
115
|
+
var PROTOCOL_MINOR = 57;
|
|
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_-]+$/);
|
|
@@ -2449,7 +2449,12 @@ var CodingSessionRecord = z28.strictObject({
|
|
|
2449
2449
|
lastRunStatus: CodingRunStatus.nullable(),
|
|
2450
2450
|
queued: z28.array(z28.string().max(1048576)).max(100),
|
|
2451
2451
|
agent: CodingSessionAgent.nullable(),
|
|
2452
|
-
agentRemovedDue: z28.boolean()
|
|
2452
|
+
agentRemovedDue: z28.boolean(),
|
|
2453
|
+
/**
|
|
2454
|
+
* (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
|
|
2455
|
+
* runs as, or whose config directory holds the chat. Absent: the default sign-in.
|
|
2456
|
+
*/
|
|
2457
|
+
accountId: z28.string().min(1).max(64).optional()
|
|
2453
2458
|
});
|
|
2454
2459
|
var CodingActiveElsewhere = z28.strictObject({
|
|
2455
2460
|
reason: z28.enum(["process", "recent-write", "open-tool-call", "open"]),
|
|
@@ -2471,7 +2476,12 @@ var CodingDiscoveredChat = z28.strictObject({
|
|
|
2471
2476
|
unavailable: ShortText.nullable(),
|
|
2472
2477
|
updatedAt: IsoTime,
|
|
2473
2478
|
source: z28.string().max(60).nullable(),
|
|
2474
|
-
activeElsewhere: CodingActiveElsewhere.nullable()
|
|
2479
|
+
activeElsewhere: CodingActiveElsewhere.nullable(),
|
|
2480
|
+
/**
|
|
2481
|
+
* (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
|
|
2482
|
+
* runs as, or whose config directory holds the chat. Absent: the default sign-in.
|
|
2483
|
+
*/
|
|
2484
|
+
accountId: z28.string().min(1).max(64).optional()
|
|
2475
2485
|
});
|
|
2476
2486
|
var CodingTranscriptItem = z28.discriminatedUnion("kind", [
|
|
2477
2487
|
z28.strictObject({ kind: z28.literal("user"), id: z28.string().max(200), text: z28.string(), at: IsoTime.nullable() }),
|
|
@@ -2511,6 +2521,31 @@ var CodingProviderProblem = z28.strictObject({
|
|
|
2511
2521
|
until: z28.string().max(120).nullable(),
|
|
2512
2522
|
at: IsoTime
|
|
2513
2523
|
});
|
|
2524
|
+
var CodingAccountUsage = z28.strictObject({
|
|
2525
|
+
windows: z28.array(CodingQuotaWindow).max(20),
|
|
2526
|
+
/** The provider's own status word ("allowed", "allowed_warning", "rejected"...), when it gives one. */
|
|
2527
|
+
status: z28.string().max(60).nullable(),
|
|
2528
|
+
/** When a rejected status lifts (ISO), when the provider says. */
|
|
2529
|
+
resetsAt: z28.string().max(80).nullable(),
|
|
2530
|
+
at: IsoTime
|
|
2531
|
+
});
|
|
2532
|
+
var CodingContinueTarget = z28.strictObject({
|
|
2533
|
+
accountId: z28.string().min(1).max(64).nullable(),
|
|
2534
|
+
label: z28.string().max(200)
|
|
2535
|
+
});
|
|
2536
|
+
var CodingProviderAccount = z28.strictObject({
|
|
2537
|
+
id: z28.string().min(1).max(64),
|
|
2538
|
+
label: z28.string().max(200),
|
|
2539
|
+
/** (1.57) No known usage limit or expired sign-in on this account. Absent: not read. */
|
|
2540
|
+
ready: z28.boolean().optional(),
|
|
2541
|
+
lastProblem: CodingProviderProblem.optional(),
|
|
2542
|
+
problem: ShortText.optional(),
|
|
2543
|
+
fix: ShortText.optional(),
|
|
2544
|
+
/** (1.57) Absent: never seen ("No usage data yet"). */
|
|
2545
|
+
usage: CodingAccountUsage.optional(),
|
|
2546
|
+
/** (1.57) This account is limited and that other one is not: "Continue on <label>". */
|
|
2547
|
+
continueOn: CodingContinueTarget.optional()
|
|
2548
|
+
});
|
|
2514
2549
|
var CodingProviderBinary = z28.strictObject({
|
|
2515
2550
|
path: LocalPath,
|
|
2516
2551
|
version: z28.string().max(80).nullable(),
|
|
@@ -2547,9 +2582,13 @@ var CodingProviderStatus = z28.strictObject({
|
|
|
2547
2582
|
* can use, as the computer's engine lists them; New session offers them beside the default sign-in.
|
|
2548
2583
|
* Absent: only the default sign-in (or a computer older than 1.53).
|
|
2549
2584
|
*/
|
|
2550
|
-
accounts: z28.array(
|
|
2585
|
+
accounts: z28.array(CodingProviderAccount).max(100).optional(),
|
|
2551
2586
|
/** (1.53) The computer tried to list `accounts` and could not: a short sentence the form shows with a retry. */
|
|
2552
|
-
accountsProblem: ShortText.optional()
|
|
2587
|
+
accountsProblem: ShortText.optional(),
|
|
2588
|
+
/** (1.57) The default sign-in's usage as last seen. Absent: never seen ("No usage data yet"). */
|
|
2589
|
+
usage: CodingAccountUsage.optional(),
|
|
2590
|
+
/** (1.57) The default sign-in is limited and this other account is not: "Continue on <label>". */
|
|
2591
|
+
continueOn: CodingContinueTarget.optional()
|
|
2553
2592
|
});
|
|
2554
2593
|
var CodingChatPreference = z28.strictObject({
|
|
2555
2594
|
title: z28.string().max(500).nullable(),
|
|
@@ -2576,7 +2615,12 @@ var CodingRecentRow = z28.strictObject({
|
|
|
2576
2615
|
state: z28.enum(["running", "needs_attention", "new_output", "elsewhere", "idle"]),
|
|
2577
2616
|
stateLabel: z28.string().max(120).nullable(),
|
|
2578
2617
|
pinned: z28.boolean(),
|
|
2579
|
-
startedBy: CodingStartedBy.nullable()
|
|
2618
|
+
startedBy: CodingStartedBy.nullable(),
|
|
2619
|
+
/**
|
|
2620
|
+
* (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
|
|
2621
|
+
* runs as, or whose config directory holds the chat. Absent: the default sign-in.
|
|
2622
|
+
*/
|
|
2623
|
+
accountId: z28.string().min(1).max(64).optional()
|
|
2580
2624
|
});
|
|
2581
2625
|
var CodingFolderCheck = z28.strictObject({
|
|
2582
2626
|
path: z28.string().max(4096),
|
|
@@ -2671,6 +2715,16 @@ var CodingOptionsSetParams = z28.strictObject({
|
|
|
2671
2715
|
effort: z28.string().max(40).optional()
|
|
2672
2716
|
});
|
|
2673
2717
|
var CodingOptionsSetResult = z28.strictObject({ session: CodingSessionRecord });
|
|
2718
|
+
var CodingAccountContinueParams = z28.strictObject({
|
|
2719
|
+
session_id: SessionKey,
|
|
2720
|
+
account_profile_id: z28.string().min(1).max(64).optional(),
|
|
2721
|
+
client_request_id: CodingClientRequestId
|
|
2722
|
+
});
|
|
2723
|
+
var CodingAccountContinueResult = z28.strictObject({
|
|
2724
|
+
session: CodingSessionRecord,
|
|
2725
|
+
run: CodingRunRecord.nullable(),
|
|
2726
|
+
how: z28.enum(["moved", "fresh"])
|
|
2727
|
+
});
|
|
2674
2728
|
var CodingAgentSetParams = z28.strictObject({ session_id: SessionKey, agent: CodingAgentSelectionParams.optional() });
|
|
2675
2729
|
var CodingAgentSetResult = z28.strictObject({ session: CodingSessionRecord });
|
|
2676
2730
|
var CodingAgentsAccessParams = z28.strictObject({});
|
|
@@ -2699,19 +2753,23 @@ var CodingSearchParams = z28.strictObject({
|
|
|
2699
2753
|
cursor: nonNegInt.optional(),
|
|
2700
2754
|
limit: z28.int().min(1).max(100).optional()
|
|
2701
2755
|
});
|
|
2756
|
+
var CodingSearchHit = z28.strictObject({
|
|
2757
|
+
provider: CodingProviderName,
|
|
2758
|
+
providerSessionId: SessionKey,
|
|
2759
|
+
title: z28.string().max(500),
|
|
2760
|
+
cwd: LocalPath.nullable(),
|
|
2761
|
+
updatedAt: IsoTime,
|
|
2762
|
+
where: z28.enum(["title", "content"]),
|
|
2763
|
+
snippet: z28.string().max(2e3).nullable(),
|
|
2764
|
+
/**
|
|
2765
|
+
* (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
|
|
2766
|
+
* runs as, or whose config directory holds the chat. Absent: the default sign-in.
|
|
2767
|
+
*/
|
|
2768
|
+
accountId: z28.string().min(1).max(64).optional()
|
|
2769
|
+
});
|
|
2702
2770
|
var CodingSearchResult = z28.strictObject({
|
|
2703
2771
|
query: z28.string().max(500),
|
|
2704
|
-
hits: z28.array(
|
|
2705
|
-
z28.strictObject({
|
|
2706
|
-
provider: CodingProviderName,
|
|
2707
|
-
providerSessionId: SessionKey,
|
|
2708
|
-
title: z28.string().max(500),
|
|
2709
|
-
cwd: LocalPath.nullable(),
|
|
2710
|
-
updatedAt: IsoTime,
|
|
2711
|
-
where: z28.enum(["title", "content"]),
|
|
2712
|
-
snippet: z28.string().max(2e3).nullable()
|
|
2713
|
-
})
|
|
2714
|
-
),
|
|
2772
|
+
hits: z28.array(CodingSearchHit),
|
|
2715
2773
|
scanned: nonNegInt,
|
|
2716
2774
|
total: nonNegInt,
|
|
2717
2775
|
nextCursor: nonNegInt.nullable()
|
|
@@ -3551,6 +3609,12 @@ var AppsAccountsListResult = z32.strictObject({
|
|
|
3551
3609
|
as_of_ms: epochMs.optional(),
|
|
3552
3610
|
refreshing: z32.boolean().optional()
|
|
3553
3611
|
});
|
|
3612
|
+
var AppsWindowsSetAccountParams = z32.strictObject({ app_key: AppKey, window: ChatPlace, email: z32.string().min(3).max(320) });
|
|
3613
|
+
var AppsWindowsForgetParams = z32.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
3614
|
+
var ProbeFact = z32.strictObject({ key: z32.string().max(200), value: z32.string().max(2e3) });
|
|
3615
|
+
var ProbeSource = z32.strictObject({ source: z32.string().max(120), instance: z32.string().max(64).nullable(), facts: z32.array(ProbeFact).max(500) });
|
|
3616
|
+
var AppsChatsProbeParams = z32.strictObject({ app_key: AppKey, chat_id: z32.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/) });
|
|
3617
|
+
var AppsChatsProbeResult = z32.strictObject({ app_key: AppKey, chat_id: z32.string().max(128), sources: z32.array(ProbeSource).max(200) });
|
|
3554
3618
|
|
|
3555
3619
|
// src/schema/browser.ts
|
|
3556
3620
|
import { z as z33 } from "zod";
|
|
@@ -4397,6 +4461,10 @@ var OPS = {
|
|
|
4397
4461
|
// 1.47: instances and accounts kept apart — an account's usage is the account's, every instance shows it by id.
|
|
4398
4462
|
"apps.instances.list": { params: AppsInstancesListParams, result: AppsInstancesListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
4399
4463
|
"apps.accounts.list": { params: AppsAccountsListParams, result: AppsAccountsListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
4464
|
+
// 1.56: an instance's kept-for account and forgetting it (the app's own tool writes both); every raw fact about one chat.
|
|
4465
|
+
"apps.windows.set_account": { params: AppsWindowsSetAccountParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
4466
|
+
"apps.windows.forget": { params: AppsWindowsForgetParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
4467
|
+
"apps.chats.probe": { params: AppsChatsProbeParams, result: AppsChatsProbeResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
4400
4468
|
"apps.projects.move": { params: AppsProjectsMoveParams, result: AppsProjectsMoveResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
4401
4469
|
"apps.projects.create": { params: AppsProjectsCreateParams, result: AppsProjectsCreateResult, kind: "unary", since: "1.10", errors: ["INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
4402
4470
|
"apps.projects.import_pins": { params: AppsProjectsImportPinsParams, result: AppsProjectsImportPinsResult, kind: "unary", since: "1.10", errors: ["CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
@@ -4487,6 +4555,8 @@ var OPS = {
|
|
|
4487
4555
|
"coding.stop": { params: CodingStopParams, result: CodingStopResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "INTERNAL"] },
|
|
4488
4556
|
"coding.stop_elsewhere": { params: CodingStopElsewhereParams, result: CodingStopElsewhereResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "CONFLICT", "PERMISSION_DENIED_OS", "INTERNAL"] },
|
|
4489
4557
|
"coding.options.set": { params: CodingOptionsSetParams, result: CodingOptionsSetResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "INTERNAL"] },
|
|
4558
|
+
// 1.56: "Continue on <account>" — the session moves to another account and its stopped turn is sent again, exactly once.
|
|
4559
|
+
"coding.account.continue": { params: CodingAccountContinueParams, result: CodingAccountContinueResult, kind: "unary", since: "1.56", errors: ["INVALID_PARAMS", "NOT_FOUND", "RESOURCE_BUSY", "AUTH_FORBIDDEN", "INTERNAL"] },
|
|
4490
4560
|
"coding.agent.set": { params: CodingAgentSetParams, result: CodingAgentSetResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "AUTH_FORBIDDEN", "INTERNAL"] },
|
|
4491
4561
|
"coding.agents.access": { params: CodingAgentsAccessParams, result: CodingAgentsAccessResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
|
|
4492
4562
|
"coding.titles.status": { params: CodingTitlesStatusParams, result: CodingTitlesStatusResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
|
|
@@ -4662,7 +4732,18 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
|
|
|
4662
4732
|
["apps.projects.to_window", [["group", "ProjectMoveGroup"]]],
|
|
4663
4733
|
["apps.windows.list", [["windows", "AppWindowInfo"]]],
|
|
4664
4734
|
["apps.windows.set_remote_control", [["remote_control", "WindowRemoteControl"]]],
|
|
4665
|
-
["coding.providers", [["providers", "CodingProviderStatus"]]]
|
|
4735
|
+
["coding.providers", [["providers", "CodingProviderStatus"]]],
|
|
4736
|
+
// 1.57: the account a coding record belongs to.
|
|
4737
|
+
["coding.sessions.list", [["sessions", "CodingSessionRecord"], ["recent", "CodingRecentRow"]]],
|
|
4738
|
+
["coding.recent.seen", [["recent", "CodingRecentRow"]]],
|
|
4739
|
+
["coding.discover", [["chats", "CodingDiscoveredChat"]]],
|
|
4740
|
+
["coding.search", [["hits", "CodingSearchHit"]]],
|
|
4741
|
+
["coding.start", [["session", "CodingSessionRecord"]]],
|
|
4742
|
+
["coding.send", [["session", "CodingSessionRecord"]]],
|
|
4743
|
+
["coding.takeover", [["session", "CodingSessionRecord"]]],
|
|
4744
|
+
["coding.options.set", [["session", "CodingSessionRecord"]]],
|
|
4745
|
+
["coding.agent.set", [["session", "CodingSessionRecord"]]],
|
|
4746
|
+
["coding.account.continue", [["session", "CodingSessionRecord"]]]
|
|
4666
4747
|
]);
|
|
4667
4748
|
var WINDOW_RESULTS = /* @__PURE__ */ new Map([
|
|
4668
4749
|
["window.list", "windows"],
|