@linkshell/wire 0.2.29 → 0.2.31
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.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/live-activity.d.ts +59 -2
- package/dist/live-activity.js +26 -0
- package/dist/live-activity.js.map +1 -1
- package/dist/lsa.d.ts +308 -0
- package/dist/lsa.js +144 -0
- package/dist/lsa.js.map +1 -0
- package/dist/model.d.ts +66 -0
- package/dist/model.js +19 -0
- package/dist/model.js.map +1 -1
- package/dist/relay.d.ts +1 -1
- package/dist/rpc.d.ts +242 -7
- package/dist/rpc.js +97 -5
- package/dist/rpc.js.map +1 -1
- package/dist/updates.d.ts +3 -3
- package/dist/usage.d.ts +32 -0
- package/dist/usage.js +93 -5
- package/dist/usage.js.map +1 -1
- package/dist/watch.d.ts +7 -7
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/live-activity.ts +35 -0
- package/src/lsa.ts +159 -0
- package/src/model.ts +25 -0
- package/src/relay.ts +1 -1
- package/src/rpc.ts +108 -4
- package/src/usage.ts +117 -5
package/dist/rpc.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { mcpMethods } from "./rpc-mcp.js";
|
|
3
|
+
import { lsaMethods } from "./lsa.js";
|
|
3
4
|
export declare const rpcIdSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
4
5
|
export type RpcId = z.infer<typeof rpcIdSchema>;
|
|
5
6
|
export declare const rpcErrorSchema: z.ZodObject<{
|
|
@@ -44,8 +45,70 @@ export declare const RPC_APP_ERROR = -32000;
|
|
|
44
45
|
* 1: side conversations (`sessions.side`), `machine.info.protocol` itself.
|
|
45
46
|
* 2: session terminals (`terminals.create` `sessionId`, `TerminalInfo.sessionId`).
|
|
46
47
|
* 3: whole-computer CPU and physical memory sampling (`machine.metrics`).
|
|
48
|
+
* 4: smart keep-awake & battery telemetry (`machine.keepAwake`), real git working-tree
|
|
49
|
+
* diff/revert (`git.diff`, `git.revertFile`), fast `@file` search (`fs.projectFiles`),
|
|
50
|
+
* clipboard & screen privacy (`clipboard.*`, `screen.privacy`), push-to-start wakeup
|
|
51
|
+
* (`liveActivities.registerPushToStart`), and LSA Phase 1 steward RPCs (`lsa.*`).
|
|
47
52
|
*/
|
|
48
|
-
export declare const HOST_PROTOCOL =
|
|
53
|
+
export declare const HOST_PROTOCOL = 4;
|
|
54
|
+
export declare const gitDiffFileStatusSchema: z.ZodEnum<{
|
|
55
|
+
modified: "modified";
|
|
56
|
+
added: "added";
|
|
57
|
+
deleted: "deleted";
|
|
58
|
+
renamed: "renamed";
|
|
59
|
+
untracked: "untracked";
|
|
60
|
+
}>;
|
|
61
|
+
export type GitDiffFileStatus = z.infer<typeof gitDiffFileStatusSchema>;
|
|
62
|
+
export declare const gitDiffFileSchema: z.ZodObject<{
|
|
63
|
+
path: z.ZodString;
|
|
64
|
+
oldPath: z.ZodOptional<z.ZodString>;
|
|
65
|
+
status: z.ZodEnum<{
|
|
66
|
+
modified: "modified";
|
|
67
|
+
added: "added";
|
|
68
|
+
deleted: "deleted";
|
|
69
|
+
renamed: "renamed";
|
|
70
|
+
untracked: "untracked";
|
|
71
|
+
}>;
|
|
72
|
+
oldText: z.ZodString;
|
|
73
|
+
newText: z.ZodString;
|
|
74
|
+
additions: z.ZodNumber;
|
|
75
|
+
deletions: z.ZodNumber;
|
|
76
|
+
binary: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export type GitDiffFile = z.infer<typeof gitDiffFileSchema>;
|
|
79
|
+
export declare const gitDiffResultSchema: z.ZodObject<{
|
|
80
|
+
files: z.ZodArray<z.ZodObject<{
|
|
81
|
+
path: z.ZodString;
|
|
82
|
+
oldPath: z.ZodOptional<z.ZodString>;
|
|
83
|
+
status: z.ZodEnum<{
|
|
84
|
+
modified: "modified";
|
|
85
|
+
added: "added";
|
|
86
|
+
deleted: "deleted";
|
|
87
|
+
renamed: "renamed";
|
|
88
|
+
untracked: "untracked";
|
|
89
|
+
}>;
|
|
90
|
+
oldText: z.ZodString;
|
|
91
|
+
newText: z.ZodString;
|
|
92
|
+
additions: z.ZodNumber;
|
|
93
|
+
deletions: z.ZodNumber;
|
|
94
|
+
binary: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
truncated: z.ZodBoolean;
|
|
97
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export type GitDiffResult = z.infer<typeof gitDiffResultSchema>;
|
|
100
|
+
export declare const projectFileEntrySchema: z.ZodObject<{
|
|
101
|
+
path: z.ZodString;
|
|
102
|
+
relativePath: z.ZodString;
|
|
103
|
+
isDir: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export type ProjectFileEntry = z.infer<typeof projectFileEntrySchema>;
|
|
106
|
+
export declare const screenPrivacyStateSchema: z.ZodObject<{
|
|
107
|
+
curtain: z.ZodBoolean;
|
|
108
|
+
lockOnDisconnect: z.ZodBoolean;
|
|
109
|
+
supported: z.ZodBoolean;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export type ScreenPrivacyState = z.infer<typeof screenPrivacyStateSchema>;
|
|
49
112
|
export declare const directoryEntrySchema: z.ZodObject<{
|
|
50
113
|
name: z.ZodString;
|
|
51
114
|
path: z.ZodString;
|
|
@@ -878,6 +941,7 @@ declare const coreMethods: {
|
|
|
878
941
|
cacheReadTokens: z.ZodNumber;
|
|
879
942
|
cacheWriteTokens: z.ZodNumber;
|
|
880
943
|
totalTokens: z.ZodNumber;
|
|
944
|
+
estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
881
945
|
}, z.core.$strip>;
|
|
882
946
|
daily: z.ZodArray<z.ZodObject<{
|
|
883
947
|
records: z.ZodNumber;
|
|
@@ -887,6 +951,7 @@ declare const coreMethods: {
|
|
|
887
951
|
cacheReadTokens: z.ZodNumber;
|
|
888
952
|
cacheWriteTokens: z.ZodNumber;
|
|
889
953
|
totalTokens: z.ZodNumber;
|
|
954
|
+
estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
890
955
|
date: z.ZodString;
|
|
891
956
|
}, z.core.$strip>>;
|
|
892
957
|
models: z.ZodArray<z.ZodObject<{
|
|
@@ -897,6 +962,7 @@ declare const coreMethods: {
|
|
|
897
962
|
cacheReadTokens: z.ZodNumber;
|
|
898
963
|
cacheWriteTokens: z.ZodNumber;
|
|
899
964
|
totalTokens: z.ZodNumber;
|
|
965
|
+
estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
900
966
|
agent: z.ZodString;
|
|
901
967
|
model: z.ZodString;
|
|
902
968
|
}, z.core.$strip>>;
|
|
@@ -914,7 +980,13 @@ declare const coreMethods: {
|
|
|
914
980
|
records: z.ZodNumber;
|
|
915
981
|
totalTokens: z.ZodNumber;
|
|
916
982
|
note: z.ZodString;
|
|
983
|
+
estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
917
984
|
}, z.core.$strip>>>;
|
|
985
|
+
estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
986
|
+
remoteStats: z.ZodOptional<z.ZodObject<{
|
|
987
|
+
remoteTurns: z.ZodNumber;
|
|
988
|
+
remoteApprovals: z.ZodNumber;
|
|
989
|
+
}, z.core.$strip>>;
|
|
918
990
|
warnings: z.ZodArray<z.ZodString>;
|
|
919
991
|
}, z.core.$strip>;
|
|
920
992
|
};
|
|
@@ -934,6 +1006,23 @@ declare const coreMethods: {
|
|
|
934
1006
|
}, z.core.$strip>;
|
|
935
1007
|
readonly result: z.ZodObject<{}, z.core.$strip>;
|
|
936
1008
|
};
|
|
1009
|
+
readonly "liveActivities.registerPushToStart": {
|
|
1010
|
+
readonly params: z.ZodObject<{
|
|
1011
|
+
deviceId: z.ZodString;
|
|
1012
|
+
pushToStartToken: z.ZodString;
|
|
1013
|
+
platform: z.ZodEnum<{
|
|
1014
|
+
ios: "ios";
|
|
1015
|
+
android: "android";
|
|
1016
|
+
}>;
|
|
1017
|
+
serviceUrl: z.ZodURL;
|
|
1018
|
+
grant: z.ZodString;
|
|
1019
|
+
expiresAt: z.ZodNumber;
|
|
1020
|
+
computerKey: z.ZodString;
|
|
1021
|
+
}, z.core.$strip>;
|
|
1022
|
+
readonly result: z.ZodObject<{
|
|
1023
|
+
ok: z.ZodOptional<z.ZodBoolean>;
|
|
1024
|
+
}, z.core.$loose>;
|
|
1025
|
+
};
|
|
937
1026
|
readonly "machine.info": {
|
|
938
1027
|
readonly params: z.ZodObject<{}, z.core.$loose>;
|
|
939
1028
|
readonly result: z.ZodObject<{
|
|
@@ -1012,6 +1101,20 @@ declare const coreMethods: {
|
|
|
1012
1101
|
usedBytes: z.ZodNumber;
|
|
1013
1102
|
availableBytes: z.ZodNumber;
|
|
1014
1103
|
}, z.core.$strip>>;
|
|
1104
|
+
power: z.ZodOptional<z.ZodObject<{
|
|
1105
|
+
onBattery: z.ZodBoolean;
|
|
1106
|
+
percent: z.ZodNullable<z.ZodNumber>;
|
|
1107
|
+
charging: z.ZodOptional<z.ZodBoolean>;
|
|
1108
|
+
}, z.core.$strip>>;
|
|
1109
|
+
keepAwake: z.ZodOptional<z.ZodObject<{
|
|
1110
|
+
mode: z.ZodEnum<{
|
|
1111
|
+
smart: "smart";
|
|
1112
|
+
always: "always";
|
|
1113
|
+
off: "off";
|
|
1114
|
+
}>;
|
|
1115
|
+
active: z.ZodBoolean;
|
|
1116
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1117
|
+
}, z.core.$strip>>;
|
|
1015
1118
|
history: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1016
1119
|
sampledAt: z.ZodNumber;
|
|
1017
1120
|
sampleIntervalMs: z.ZodNumber;
|
|
@@ -1032,9 +1135,41 @@ declare const coreMethods: {
|
|
|
1032
1135
|
usedBytes: z.ZodNumber;
|
|
1033
1136
|
availableBytes: z.ZodNumber;
|
|
1034
1137
|
}, z.core.$strip>>;
|
|
1138
|
+
power: z.ZodOptional<z.ZodObject<{
|
|
1139
|
+
onBattery: z.ZodBoolean;
|
|
1140
|
+
percent: z.ZodNullable<z.ZodNumber>;
|
|
1141
|
+
charging: z.ZodOptional<z.ZodBoolean>;
|
|
1142
|
+
}, z.core.$strip>>;
|
|
1143
|
+
keepAwake: z.ZodOptional<z.ZodObject<{
|
|
1144
|
+
mode: z.ZodEnum<{
|
|
1145
|
+
smart: "smart";
|
|
1146
|
+
always: "always";
|
|
1147
|
+
off: "off";
|
|
1148
|
+
}>;
|
|
1149
|
+
active: z.ZodBoolean;
|
|
1150
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1151
|
+
}, z.core.$strip>>;
|
|
1035
1152
|
}, z.core.$strip>>>;
|
|
1036
1153
|
}, z.core.$strip>;
|
|
1037
1154
|
};
|
|
1155
|
+
readonly "machine.keepAwake": {
|
|
1156
|
+
readonly params: z.ZodObject<{
|
|
1157
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
1158
|
+
smart: "smart";
|
|
1159
|
+
always: "always";
|
|
1160
|
+
off: "off";
|
|
1161
|
+
}>>;
|
|
1162
|
+
}, z.core.$strip>;
|
|
1163
|
+
readonly result: z.ZodObject<{
|
|
1164
|
+
mode: z.ZodEnum<{
|
|
1165
|
+
smart: "smart";
|
|
1166
|
+
always: "always";
|
|
1167
|
+
off: "off";
|
|
1168
|
+
}>;
|
|
1169
|
+
active: z.ZodBoolean;
|
|
1170
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1171
|
+
}, z.core.$strip>;
|
|
1172
|
+
};
|
|
1038
1173
|
readonly "machine.rename": {
|
|
1039
1174
|
/** Empty restores the configured default; names never change peer identities. */
|
|
1040
1175
|
readonly params: z.ZodObject<{
|
|
@@ -1460,8 +1595,8 @@ declare const coreMethods: {
|
|
|
1460
1595
|
category: z.ZodDefault<z.ZodEnum<{
|
|
1461
1596
|
model: "model";
|
|
1462
1597
|
other: "other";
|
|
1463
|
-
model_config: "model_config";
|
|
1464
1598
|
mode: "mode";
|
|
1599
|
+
model_config: "model_config";
|
|
1465
1600
|
effort: "effort";
|
|
1466
1601
|
}>>;
|
|
1467
1602
|
current: z.ZodString;
|
|
@@ -3838,8 +3973,8 @@ declare const coreMethods: {
|
|
|
3838
3973
|
category: z.ZodDefault<z.ZodEnum<{
|
|
3839
3974
|
model: "model";
|
|
3840
3975
|
other: "other";
|
|
3841
|
-
model_config: "model_config";
|
|
3842
3976
|
mode: "mode";
|
|
3977
|
+
model_config: "model_config";
|
|
3843
3978
|
effort: "effort";
|
|
3844
3979
|
}>>;
|
|
3845
3980
|
current: z.ZodString;
|
|
@@ -5529,8 +5664,8 @@ declare const coreMethods: {
|
|
|
5529
5664
|
category: z.ZodDefault<z.ZodEnum<{
|
|
5530
5665
|
model: "model";
|
|
5531
5666
|
other: "other";
|
|
5532
|
-
model_config: "model_config";
|
|
5533
5667
|
mode: "mode";
|
|
5668
|
+
model_config: "model_config";
|
|
5534
5669
|
effort: "effort";
|
|
5535
5670
|
}>>;
|
|
5536
5671
|
current: z.ZodString;
|
|
@@ -6173,8 +6308,8 @@ declare const coreMethods: {
|
|
|
6173
6308
|
readonly result: z.ZodObject<{
|
|
6174
6309
|
delivery: z.ZodEnum<{
|
|
6175
6310
|
started: "started";
|
|
6176
|
-
steered: "steered";
|
|
6177
6311
|
queued: "queued";
|
|
6312
|
+
steered: "steered";
|
|
6178
6313
|
duplicate: "duplicate";
|
|
6179
6314
|
}>;
|
|
6180
6315
|
}, z.core.$strip>;
|
|
@@ -7059,6 +7194,11 @@ declare const coreMethods: {
|
|
|
7059
7194
|
}, z.core.$strip>>;
|
|
7060
7195
|
}, z.core.$strip>;
|
|
7061
7196
|
};
|
|
7197
|
+
/** Explicitly end this computer's gateway account binding (local only). */
|
|
7198
|
+
readonly "gateway.account.leave": {
|
|
7199
|
+
readonly params: z.ZodObject<{}, z.core.$loose>;
|
|
7200
|
+
readonly result: z.ZodObject<{}, z.core.$loose>;
|
|
7201
|
+
};
|
|
7062
7202
|
/**
|
|
7063
7203
|
* Opens a pairing window (local only). `link` is what the QR encodes; the
|
|
7064
7204
|
* code can be typed instead. `pairing.done` follows when a device pairs.
|
|
@@ -7120,9 +7260,50 @@ declare const coreMethods: {
|
|
|
7120
7260
|
branch: z.ZodOptional<z.ZodString>;
|
|
7121
7261
|
head: z.ZodOptional<z.ZodString>;
|
|
7122
7262
|
dirty: z.ZodBoolean;
|
|
7263
|
+
remote: z.ZodOptional<z.ZodString>;
|
|
7264
|
+
rootCommit: z.ZodOptional<z.ZodString>;
|
|
7123
7265
|
}, z.core.$strip>>;
|
|
7124
7266
|
}, z.core.$strip>;
|
|
7125
7267
|
};
|
|
7268
|
+
/** Real git working-tree diff (or against `base`), bounded by `maxBytes` and including untracked text files by default. */
|
|
7269
|
+
readonly "git.diff": {
|
|
7270
|
+
readonly params: z.ZodObject<{
|
|
7271
|
+
cwd: z.ZodString;
|
|
7272
|
+
base: z.ZodOptional<z.ZodString>;
|
|
7273
|
+
includeUntracked: z.ZodOptional<z.ZodBoolean>;
|
|
7274
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
7275
|
+
}, z.core.$strip>;
|
|
7276
|
+
readonly result: z.ZodObject<{
|
|
7277
|
+
files: z.ZodArray<z.ZodObject<{
|
|
7278
|
+
path: z.ZodString;
|
|
7279
|
+
oldPath: z.ZodOptional<z.ZodString>;
|
|
7280
|
+
status: z.ZodEnum<{
|
|
7281
|
+
modified: "modified";
|
|
7282
|
+
added: "added";
|
|
7283
|
+
deleted: "deleted";
|
|
7284
|
+
renamed: "renamed";
|
|
7285
|
+
untracked: "untracked";
|
|
7286
|
+
}>;
|
|
7287
|
+
oldText: z.ZodString;
|
|
7288
|
+
newText: z.ZodString;
|
|
7289
|
+
additions: z.ZodNumber;
|
|
7290
|
+
deletions: z.ZodNumber;
|
|
7291
|
+
binary: z.ZodOptional<z.ZodBoolean>;
|
|
7292
|
+
}, z.core.$strip>>;
|
|
7293
|
+
truncated: z.ZodBoolean;
|
|
7294
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
7295
|
+
}, z.core.$strip>;
|
|
7296
|
+
};
|
|
7297
|
+
/** Restores a tracked file or removes an untracked file strictly inside the repository root. */
|
|
7298
|
+
readonly "git.revertFile": {
|
|
7299
|
+
readonly params: z.ZodObject<{
|
|
7300
|
+
cwd: z.ZodString;
|
|
7301
|
+
path: z.ZodString;
|
|
7302
|
+
}, z.core.$strip>;
|
|
7303
|
+
readonly result: z.ZodObject<{
|
|
7304
|
+
ok: z.ZodBoolean;
|
|
7305
|
+
}, z.core.$strip>;
|
|
7306
|
+
};
|
|
7126
7307
|
/** The worktrees LinkShell made, newest first. */
|
|
7127
7308
|
readonly "worktrees.list": {
|
|
7128
7309
|
readonly params: z.ZodObject<{}, z.core.$loose>;
|
|
@@ -7254,6 +7435,36 @@ declare const coreMethods: {
|
|
|
7254
7435
|
truncated: z.ZodBoolean;
|
|
7255
7436
|
}, z.core.$strip>;
|
|
7256
7437
|
};
|
|
7438
|
+
/** Fast project file listing under `cwd` (`git ls-files` with directory walk fallback) for `@file` autocomplete. */
|
|
7439
|
+
readonly "fs.projectFiles": {
|
|
7440
|
+
readonly params: z.ZodObject<{
|
|
7441
|
+
cwd: z.ZodString;
|
|
7442
|
+
query: z.ZodOptional<z.ZodString>;
|
|
7443
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
7444
|
+
}, z.core.$strip>;
|
|
7445
|
+
readonly result: z.ZodObject<{
|
|
7446
|
+
files: z.ZodArray<z.ZodObject<{
|
|
7447
|
+
path: z.ZodString;
|
|
7448
|
+
relativePath: z.ZodString;
|
|
7449
|
+
isDir: z.ZodOptional<z.ZodBoolean>;
|
|
7450
|
+
}, z.core.$strip>>;
|
|
7451
|
+
truncated: z.ZodBoolean;
|
|
7452
|
+
}, z.core.$strip>;
|
|
7453
|
+
};
|
|
7454
|
+
readonly "clipboard.read": {
|
|
7455
|
+
readonly params: z.ZodObject<{}, z.core.$loose>;
|
|
7456
|
+
readonly result: z.ZodObject<{
|
|
7457
|
+
text: z.ZodString;
|
|
7458
|
+
}, z.core.$strip>;
|
|
7459
|
+
};
|
|
7460
|
+
readonly "clipboard.write": {
|
|
7461
|
+
readonly params: z.ZodObject<{
|
|
7462
|
+
text: z.ZodString;
|
|
7463
|
+
}, z.core.$strip>;
|
|
7464
|
+
readonly result: z.ZodObject<{
|
|
7465
|
+
ok: z.ZodBoolean;
|
|
7466
|
+
}, z.core.$strip>;
|
|
7467
|
+
};
|
|
7257
7468
|
readonly "terminals.list": {
|
|
7258
7469
|
readonly params: z.ZodObject<{}, z.core.$loose>;
|
|
7259
7470
|
readonly result: z.ZodObject<{
|
|
@@ -7474,6 +7685,18 @@ declare const coreMethods: {
|
|
|
7474
7685
|
problem: z.ZodOptional<z.ZodString>;
|
|
7475
7686
|
}, z.core.$strip>;
|
|
7476
7687
|
};
|
|
7688
|
+
/** Privacy curtain (dim/blank physical screen while viewing remotely) and auto-lock on disconnect. */
|
|
7689
|
+
readonly "screen.privacy": {
|
|
7690
|
+
readonly params: z.ZodObject<{
|
|
7691
|
+
curtain: z.ZodOptional<z.ZodBoolean>;
|
|
7692
|
+
lockOnDisconnect: z.ZodOptional<z.ZodBoolean>;
|
|
7693
|
+
}, z.core.$strip>;
|
|
7694
|
+
readonly result: z.ZodObject<{
|
|
7695
|
+
curtain: z.ZodBoolean;
|
|
7696
|
+
lockOnDisconnect: z.ZodBoolean;
|
|
7697
|
+
supported: z.ZodBoolean;
|
|
7698
|
+
}, z.core.$strip>;
|
|
7699
|
+
};
|
|
7477
7700
|
/** Bytes to the host's end of a stream (base64). */
|
|
7478
7701
|
readonly "proxy.write": {
|
|
7479
7702
|
readonly params: z.ZodObject<{
|
|
@@ -7489,7 +7712,7 @@ declare const coreMethods: {
|
|
|
7489
7712
|
readonly result: z.ZodObject<{}, z.core.$loose>;
|
|
7490
7713
|
};
|
|
7491
7714
|
};
|
|
7492
|
-
export declare const methods: typeof coreMethods & typeof acpMethods & typeof mcpMethods;
|
|
7715
|
+
export declare const methods: typeof coreMethods & typeof acpMethods & typeof mcpMethods & typeof lsaMethods;
|
|
7493
7716
|
export type MethodName = keyof typeof methods;
|
|
7494
7717
|
export type MethodParams<M extends MethodName> = z.input<(typeof methods)[M]["params"]>;
|
|
7495
7718
|
export type MethodResult<M extends MethodName> = z.infer<(typeof methods)[M]["result"]>;
|
|
@@ -9096,8 +9319,8 @@ export declare const notifications: {
|
|
|
9096
9319
|
category: z.ZodDefault<z.ZodEnum<{
|
|
9097
9320
|
model: "model";
|
|
9098
9321
|
other: "other";
|
|
9099
|
-
model_config: "model_config";
|
|
9100
9322
|
mode: "mode";
|
|
9323
|
+
model_config: "model_config";
|
|
9101
9324
|
effort: "effort";
|
|
9102
9325
|
}>>;
|
|
9103
9326
|
current: z.ZodString;
|
|
@@ -9849,6 +10072,18 @@ export declare const notifications: {
|
|
|
9849
10072
|
streamId: z.ZodString;
|
|
9850
10073
|
error: z.ZodOptional<z.ZodString>;
|
|
9851
10074
|
}, z.core.$strip>;
|
|
10075
|
+
/** Zero-plaintext transition wakeup metadata. */
|
|
10076
|
+
readonly "liveActivities.wakeup": z.ZodObject<{
|
|
10077
|
+
machineId: z.ZodString;
|
|
10078
|
+
sessionId: z.ZodString;
|
|
10079
|
+
eventType: z.ZodEnum<{
|
|
10080
|
+
error: "error";
|
|
10081
|
+
completed: "completed";
|
|
10082
|
+
question: "question";
|
|
10083
|
+
approval: "approval";
|
|
10084
|
+
}>;
|
|
10085
|
+
createdAt: z.ZodNumber;
|
|
10086
|
+
}, z.core.$strip>;
|
|
9852
10087
|
};
|
|
9853
10088
|
export type NotificationName = keyof typeof notifications;
|
|
9854
10089
|
export type NotificationParams<N extends NotificationName> = z.infer<(typeof notifications)[N]>;
|
package/dist/rpc.js
CHANGED
|
@@ -3,11 +3,12 @@ import { usageQuerySchema, usageReportSchema } from "./usage.js";
|
|
|
3
3
|
import { goalChangeSchema, sessionGoalSchema } from "./goal.js";
|
|
4
4
|
import { acpAgentSettingsSchema, acpFeaturesSchema, acpRemoteAgentSchema, acpProviderSchema } from "./acp.js";
|
|
5
5
|
import { editorRequestSchema, editorResultSchema } from "./editor.js";
|
|
6
|
-
import { liveActivityIdSchema, liveActivitySubscriptionSchema } from "./live-activity.js";
|
|
7
|
-
import { backgroundTaskSchema, agentInfoSchema, gatewayStatusSchema, machineInfoSchema, machineMetricsSnapshotSchema, portInfoSchema, projectSummarySchema, terminalInfoSchema, sessionDriverSchema, sessionSummarySchema, subagentInfoSchema, gitInfoSchema, worktreeEntrySchema, questionAnswerSchema, pendingPermissionSchema, } from "./model.js";
|
|
6
|
+
import { liveActivityIdSchema, liveActivityPushToStartSchema, liveActivitySubscriptionSchema, wakeupNoticeSchema } from "./live-activity.js";
|
|
7
|
+
import { backgroundTaskSchema, agentInfoSchema, gatewayStatusSchema, keepAwakeModeSchema, machineInfoSchema, machineKeepAwakeSchema, machineMetricsSnapshotSchema, portInfoSchema, projectSummarySchema, terminalInfoSchema, sessionDriverSchema, sessionSummarySchema, subagentInfoSchema, gitInfoSchema, worktreeEntrySchema, questionAnswerSchema, pendingPermissionSchema, } from "./model.js";
|
|
8
8
|
import { contentBlockSchema, sessionConfigOptionSchema, sessionEventSchema, sessionNoticeSchema } from "./updates.js";
|
|
9
9
|
import { sideChatSchema } from "./side.js";
|
|
10
10
|
import { mcpMethods } from "./rpc-mcp.js";
|
|
11
|
+
import { lsaMethods } from "./lsa.js";
|
|
11
12
|
// ── JSON-RPC 2.0 framing ─────────────────────────────────────────────
|
|
12
13
|
export const rpcIdSchema = z.union([z.string(), z.number()]);
|
|
13
14
|
export const rpcErrorSchema = z.object({
|
|
@@ -49,9 +50,39 @@ export const RPC_APP_ERROR = -32000;
|
|
|
49
50
|
* 1: side conversations (`sessions.side`), `machine.info.protocol` itself.
|
|
50
51
|
* 2: session terminals (`terminals.create` `sessionId`, `TerminalInfo.sessionId`).
|
|
51
52
|
* 3: whole-computer CPU and physical memory sampling (`machine.metrics`).
|
|
53
|
+
* 4: smart keep-awake & battery telemetry (`machine.keepAwake`), real git working-tree
|
|
54
|
+
* diff/revert (`git.diff`, `git.revertFile`), fast `@file` search (`fs.projectFiles`),
|
|
55
|
+
* clipboard & screen privacy (`clipboard.*`, `screen.privacy`), push-to-start wakeup
|
|
56
|
+
* (`liveActivities.registerPushToStart`), and LSA Phase 1 steward RPCs (`lsa.*`).
|
|
52
57
|
*/
|
|
53
|
-
export const HOST_PROTOCOL =
|
|
58
|
+
export const HOST_PROTOCOL = 4;
|
|
54
59
|
const empty = z.looseObject({});
|
|
60
|
+
export const gitDiffFileStatusSchema = z.enum(["modified", "added", "deleted", "renamed", "untracked"]);
|
|
61
|
+
export const gitDiffFileSchema = z.object({
|
|
62
|
+
path: z.string(),
|
|
63
|
+
oldPath: z.string().optional(),
|
|
64
|
+
status: gitDiffFileStatusSchema,
|
|
65
|
+
oldText: z.string(),
|
|
66
|
+
newText: z.string(),
|
|
67
|
+
additions: z.number().int().nonnegative(),
|
|
68
|
+
deletions: z.number().int().nonnegative(),
|
|
69
|
+
binary: z.boolean().optional(),
|
|
70
|
+
});
|
|
71
|
+
export const gitDiffResultSchema = z.object({
|
|
72
|
+
files: z.array(gitDiffFileSchema),
|
|
73
|
+
truncated: z.boolean(),
|
|
74
|
+
branch: z.string().optional(),
|
|
75
|
+
});
|
|
76
|
+
export const projectFileEntrySchema = z.object({
|
|
77
|
+
path: z.string(),
|
|
78
|
+
relativePath: z.string(),
|
|
79
|
+
isDir: z.boolean().optional(),
|
|
80
|
+
});
|
|
81
|
+
export const screenPrivacyStateSchema = z.object({
|
|
82
|
+
curtain: z.boolean(),
|
|
83
|
+
lockOnDisconnect: z.boolean(),
|
|
84
|
+
supported: z.boolean(),
|
|
85
|
+
});
|
|
55
86
|
export const directoryEntrySchema = z.object({
|
|
56
87
|
name: z.string(),
|
|
57
88
|
path: z.string(),
|
|
@@ -100,11 +131,19 @@ const coreMethods = {
|
|
|
100
131
|
params: z.object({ activityId: liveActivityIdSchema }),
|
|
101
132
|
result: z.object({}),
|
|
102
133
|
},
|
|
134
|
+
"liveActivities.registerPushToStart": {
|
|
135
|
+
params: liveActivityPushToStartSchema,
|
|
136
|
+
result: z.looseObject({ ok: z.boolean().optional() }),
|
|
137
|
+
},
|
|
103
138
|
"machine.info": {
|
|
104
139
|
params: empty,
|
|
105
140
|
result: machineInfoSchema,
|
|
106
141
|
},
|
|
107
142
|
"machine.metrics": { params: empty, result: machineMetricsSnapshotSchema },
|
|
143
|
+
"machine.keepAwake": {
|
|
144
|
+
params: z.object({ mode: keepAwakeModeSchema.optional() }),
|
|
145
|
+
result: machineKeepAwakeSchema,
|
|
146
|
+
},
|
|
108
147
|
"machine.rename": {
|
|
109
148
|
/** Empty restores the configured default; names never change peer identities. */
|
|
110
149
|
params: z.object({ name: z.string().trim().max(40) }),
|
|
@@ -447,6 +486,8 @@ const coreMethods = {
|
|
|
447
486
|
* host connects, moves or disconnects without a restart.
|
|
448
487
|
*/
|
|
449
488
|
"gateway.refresh": { params: empty, result: gatewayStatusSchema },
|
|
489
|
+
/** Explicitly end this computer's gateway account binding (local only). */
|
|
490
|
+
"gateway.account.leave": { params: empty, result: empty },
|
|
450
491
|
/**
|
|
451
492
|
* Opens a pairing window (local only). `link` is what the QR encodes; the
|
|
452
493
|
* code can be typed instead. `pairing.done` follows when a device pairs.
|
|
@@ -473,9 +514,24 @@ const coreMethods = {
|
|
|
473
514
|
params: z.object({ password: z.string().min(4).max(128).optional() }),
|
|
474
515
|
result: z.object({ password: z.boolean() }),
|
|
475
516
|
},
|
|
476
|
-
// ── Git: sessions in worktrees ──
|
|
517
|
+
// ── Git: sessions in worktrees & working-tree diffs ──
|
|
477
518
|
/** What git says about `path`; no `git` when it isn't in a repository. */
|
|
478
519
|
"git.info": { params: z.object({ path: z.string().min(1) }), result: z.object({ git: gitInfoSchema.optional() }) },
|
|
520
|
+
/** Real git working-tree diff (or against `base`), bounded by `maxBytes` and including untracked text files by default. */
|
|
521
|
+
"git.diff": {
|
|
522
|
+
params: z.object({
|
|
523
|
+
cwd: z.string().min(1),
|
|
524
|
+
base: z.string().optional(),
|
|
525
|
+
includeUntracked: z.boolean().optional(),
|
|
526
|
+
maxBytes: z.number().int().positive().max(10_000_000).optional(),
|
|
527
|
+
}),
|
|
528
|
+
result: gitDiffResultSchema,
|
|
529
|
+
},
|
|
530
|
+
/** Restores a tracked file or removes an untracked file strictly inside the repository root. */
|
|
531
|
+
"git.revertFile": {
|
|
532
|
+
params: z.object({ cwd: z.string().min(1), path: z.string().min(1) }),
|
|
533
|
+
result: z.object({ ok: z.boolean() }),
|
|
534
|
+
},
|
|
479
535
|
/** The worktrees LinkShell made, newest first. */
|
|
480
536
|
"worktrees.list": { params: empty, result: z.object({ worktrees: z.array(worktreeEntrySchema) }) },
|
|
481
537
|
/** Removes a worktree and its branch. Refused (`busy`) while a session uses it, or (`dirty`) when work in it would be lost, unless `force`. */
|
|
@@ -565,6 +621,27 @@ const coreMethods = {
|
|
|
565
621
|
params: z.object({ query: z.string().min(1).max(200), limit: z.number().int().min(1).max(200).default(60) }),
|
|
566
622
|
result: z.object({ entries: z.array(directoryEntrySchema), truncated: z.boolean() }),
|
|
567
623
|
},
|
|
624
|
+
/** Fast project file listing under `cwd` (`git ls-files` with directory walk fallback) for `@file` autocomplete. */
|
|
625
|
+
"fs.projectFiles": {
|
|
626
|
+
params: z.object({
|
|
627
|
+
cwd: z.string().min(1),
|
|
628
|
+
query: z.string().max(200).optional(),
|
|
629
|
+
limit: z.number().int().min(1).max(2000).optional(),
|
|
630
|
+
}),
|
|
631
|
+
result: z.object({
|
|
632
|
+
files: z.array(projectFileEntrySchema),
|
|
633
|
+
truncated: z.boolean(),
|
|
634
|
+
}),
|
|
635
|
+
},
|
|
636
|
+
// ── Clipboard: encrypted host clipboard access ──
|
|
637
|
+
"clipboard.read": {
|
|
638
|
+
params: empty,
|
|
639
|
+
result: z.object({ text: z.string() }),
|
|
640
|
+
},
|
|
641
|
+
"clipboard.write": {
|
|
642
|
+
params: z.object({ text: z.string().max(2_000_000) }),
|
|
643
|
+
result: z.object({ ok: z.boolean() }),
|
|
644
|
+
},
|
|
568
645
|
// ── Terminals: plain shells on the host, any command, like SSH ──
|
|
569
646
|
"terminals.list": {
|
|
570
647
|
params: empty,
|
|
@@ -698,6 +775,14 @@ const coreMethods = {
|
|
|
698
775
|
problem: z.string().optional(),
|
|
699
776
|
}),
|
|
700
777
|
},
|
|
778
|
+
/** Privacy curtain (dim/blank physical screen while viewing remotely) and auto-lock on disconnect. */
|
|
779
|
+
"screen.privacy": {
|
|
780
|
+
params: z.object({
|
|
781
|
+
curtain: z.boolean().optional(),
|
|
782
|
+
lockOnDisconnect: z.boolean().optional(),
|
|
783
|
+
}),
|
|
784
|
+
result: screenPrivacyStateSchema,
|
|
785
|
+
},
|
|
701
786
|
/** Bytes to the host's end of a stream (base64). */
|
|
702
787
|
"proxy.write": {
|
|
703
788
|
params: z.object({ streamId: z.string().min(1), data: z.string().max(2_000_000) }),
|
|
@@ -708,7 +793,12 @@ const coreMethods = {
|
|
|
708
793
|
result: empty,
|
|
709
794
|
},
|
|
710
795
|
};
|
|
711
|
-
export const methods = {
|
|
796
|
+
export const methods = {
|
|
797
|
+
...coreMethods,
|
|
798
|
+
...acpMethods,
|
|
799
|
+
...mcpMethods,
|
|
800
|
+
...lsaMethods,
|
|
801
|
+
};
|
|
712
802
|
export function isMethodName(name) {
|
|
713
803
|
return Object.prototype.hasOwnProperty.call(methods, name);
|
|
714
804
|
}
|
|
@@ -746,5 +836,7 @@ export const notifications = {
|
|
|
746
836
|
"proxy.data": z.object({ streamId: z.string(), data: z.string() }),
|
|
747
837
|
/** The host's end of a stream closed (the server hung up, or refused). */
|
|
748
838
|
"proxy.closed": z.object({ streamId: z.string(), error: z.string().optional() }),
|
|
839
|
+
/** Zero-plaintext transition wakeup metadata. */
|
|
840
|
+
"liveActivities.wakeup": wakeupNoticeSchema,
|
|
749
841
|
};
|
|
750
842
|
//# sourceMappingURL=rpc.js.map
|