@linkshell/wire 0.2.31 → 0.2.32
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/direct.d.ts +2 -0
- package/dist/direct.js +3 -1
- package/dist/direct.js.map +1 -1
- package/dist/peer.d.ts +3 -1
- package/dist/peer.js +60 -22
- package/dist/peer.js.map +1 -1
- package/dist/relay-client.d.ts +7 -1
- package/dist/relay-client.js +83 -6
- package/dist/relay-client.js.map +1 -1
- package/dist/relay.d.ts +1 -0
- package/dist/relay.js +1 -1
- package/dist/relay.js.map +1 -1
- package/dist/rpc.d.ts +356 -1
- package/dist/rpc.js +37 -3
- package/dist/rpc.js.map +1 -1
- package/dist/updates.d.ts +4 -0
- package/dist/updates.js +4 -0
- package/dist/updates.js.map +1 -1
- package/package.json +1 -1
- package/src/direct.ts +4 -1
- package/src/peer.ts +56 -18
- package/src/relay-client.ts +84 -8
- package/src/relay.ts +1 -1
- package/src/rpc.ts +37 -3
- package/src/updates.ts +4 -0
package/src/relay.ts
CHANGED
|
@@ -81,7 +81,7 @@ export const serverFrameSchema = z.discriminatedUnion("t", [
|
|
|
81
81
|
/** An encrypted frame from a peer, with the keys the gateway verified it holds. */
|
|
82
82
|
z.object({ t: z.literal("from"), from: publicIdentitySchema, via: z.enum(["paired", "account"]), d: z.string() }),
|
|
83
83
|
/** A frame couldn't be delivered: the peer is offline or not reachable. */
|
|
84
|
-
z.object({ t: z.literal("undeliverable"), to: z.string(), reason: z.string() }),
|
|
84
|
+
z.object({ t: z.literal("undeliverable"), to: z.string(), reason: z.string(), channel: z.string().optional() }),
|
|
85
85
|
z.object({ t: z.literal("pong") }),
|
|
86
86
|
z.object({ t: z.literal("error"), code: z.string(), message: z.string() }),
|
|
87
87
|
]);
|
package/src/rpc.ts
CHANGED
|
@@ -167,6 +167,14 @@ const acpMethods = {
|
|
|
167
167
|
|
|
168
168
|
const coreMethods = {
|
|
169
169
|
"desktop.shutdown": { params: z.object({ pid: z.number().int().positive() }), result: empty },
|
|
170
|
+
/** Opens a local path in the chosen desktop editor, file manager, or terminal (local only). */
|
|
171
|
+
"desktop.openPath": {
|
|
172
|
+
params: z.object({
|
|
173
|
+
path: z.string().min(1),
|
|
174
|
+
app: z.enum(["default", "reveal", "cursor", "vscode", "zed", "terminal"]).optional(),
|
|
175
|
+
}),
|
|
176
|
+
result: z.object({ ok: z.boolean() }),
|
|
177
|
+
},
|
|
170
178
|
"usage.summary": { params: usageQuerySchema, result: usageReportSchema },
|
|
171
179
|
"liveActivities.subscribe": {
|
|
172
180
|
params: liveActivitySubscriptionSchema,
|
|
@@ -203,13 +211,20 @@ const coreMethods = {
|
|
|
203
211
|
limit: z.number().int().positive().max(200).optional(),
|
|
204
212
|
/** Only sessions updated strictly before this timestamp (pagination). */
|
|
205
213
|
before: z.number().optional(),
|
|
214
|
+
/** Tie-breaker session id when multiple sessions share the `before` timestamp. */
|
|
215
|
+
beforeId: z.string().optional(),
|
|
206
216
|
includeArchived: z.boolean().optional(),
|
|
207
217
|
}),
|
|
208
218
|
result: z.object({
|
|
209
219
|
sessions: z.array(sessionSummarySchema),
|
|
210
220
|
nextBefore: z.number().optional(),
|
|
221
|
+
nextBeforeId: z.string().optional(),
|
|
211
222
|
}),
|
|
212
223
|
},
|
|
224
|
+
"sessions.get": {
|
|
225
|
+
params: z.object({ sessionId: z.string().min(1) }),
|
|
226
|
+
result: z.object({ session: sessionSummarySchema.optional() }),
|
|
227
|
+
},
|
|
213
228
|
/**
|
|
214
229
|
* The models a new session of `agent` can start on, for choosing one before
|
|
215
230
|
* there is a session (whose own list comes later, in its `ls_config`).
|
|
@@ -243,6 +258,8 @@ const coreMethods = {
|
|
|
243
258
|
cwd: z.string().min(1),
|
|
244
259
|
prompt: z.array(contentBlockSchema).optional(),
|
|
245
260
|
clientMessageId: z.string().optional(),
|
|
261
|
+
/** Client-generated idempotency key so a retried create does not spawn a duplicate session. */
|
|
262
|
+
requestId: z.string().max(128).optional(),
|
|
246
263
|
/** One of `agents.models`' values; absent: the agent's own default. */
|
|
247
264
|
model: z.string().optional(),
|
|
248
265
|
/** Explicit choices from agents.models.config, applied before the first prompt. */
|
|
@@ -577,6 +594,20 @@ const coreMethods = {
|
|
|
577
594
|
params: z.object({ cwd: z.string().min(1), path: z.string().min(1) }),
|
|
578
595
|
result: z.object({ ok: z.boolean() }),
|
|
579
596
|
},
|
|
597
|
+
/** Commits staged or specified paths inside `cwd`'s repository. */
|
|
598
|
+
"git.commit": {
|
|
599
|
+
params: z.object({
|
|
600
|
+
cwd: z.string().min(1),
|
|
601
|
+
message: z.string().min(1).max(4000),
|
|
602
|
+
stageAll: z.boolean().optional(),
|
|
603
|
+
paths: z.array(z.string().min(1)).max(500).optional(),
|
|
604
|
+
}),
|
|
605
|
+
result: z.object({
|
|
606
|
+
sha: z.string(),
|
|
607
|
+
branch: z.string().optional(),
|
|
608
|
+
summary: z.string(),
|
|
609
|
+
}),
|
|
610
|
+
},
|
|
580
611
|
/** The worktrees LinkShell made, newest first. */
|
|
581
612
|
"worktrees.list": { params: empty, result: z.object({ worktrees: z.array(worktreeEntrySchema) }) },
|
|
582
613
|
/** Removes a worktree and its branch. Refused (`busy`) while a session uses it, or (`dirty`) when work in it would be lost, unless `force`. */
|
|
@@ -645,14 +676,17 @@ const coreMethods = {
|
|
|
645
676
|
},
|
|
646
677
|
/**
|
|
647
678
|
* Saves a file from the device into `dir`. A name that's taken gets a
|
|
648
|
-
* numbered suffix ("photo 2.jpg") rather than overwriting
|
|
679
|
+
* numbered suffix ("photo 2.jpg") rather than overwriting; subsequent chunks
|
|
680
|
+
* pass `appendPath` and `offset` so each chunk stays below the relay frame cap.
|
|
649
681
|
*/
|
|
650
682
|
"fs.upload": {
|
|
651
683
|
params: z.object({
|
|
652
684
|
dir: z.string().min(1),
|
|
653
685
|
name: z.string().min(1).max(255),
|
|
654
|
-
/** base64; up to ~
|
|
655
|
-
data: z.string().max(
|
|
686
|
+
/** base64; up to ~20 MB single-shot upload (smaller when chunked via `offset`/`appendPath`). */
|
|
687
|
+
data: z.string().max(30_000_000),
|
|
688
|
+
offset: z.number().int().nonnegative().optional(),
|
|
689
|
+
appendPath: z.string().optional(),
|
|
656
690
|
}),
|
|
657
691
|
result: z.object({ path: z.string(), size: z.number().int() }),
|
|
658
692
|
},
|
package/src/updates.ts
CHANGED
|
@@ -105,12 +105,16 @@ export const sessionUpdateSchema = z.discriminatedUnion("sessionUpdate", [
|
|
|
105
105
|
parentToolCallId: z.string().optional(),
|
|
106
106
|
messageId: z.string(),
|
|
107
107
|
content: contentBlockSchema,
|
|
108
|
+
/** Replaces any buffered partial text for `messageId` (e.g. compacted turn chunks). */
|
|
109
|
+
replace: z.boolean().optional(),
|
|
108
110
|
}),
|
|
109
111
|
z.object({
|
|
110
112
|
sessionUpdate: z.literal("agent_thought_chunk"),
|
|
111
113
|
parentToolCallId: z.string().optional(),
|
|
112
114
|
messageId: z.string(),
|
|
113
115
|
content: contentBlockSchema,
|
|
116
|
+
/** Replaces any buffered partial thought for `messageId` (e.g. compacted turn chunks). */
|
|
117
|
+
replace: z.boolean().optional(),
|
|
114
118
|
}),
|
|
115
119
|
z.object({
|
|
116
120
|
sessionUpdate: z.literal("tool_call"),
|