agent-console-server 3.9.0 → 4.1.0
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/{EphemeralAgentEventTypes-Ctmqlyvj.js → EphemeralAgentEventTypes-Spjnk48Y.js} +53 -22
- package/dist/{agentConsoleServerCommand-D-Uv3ME1.js → agentConsoleServerCommand-B7491RR7.js} +139 -30
- package/dist/cli.js +1 -1
- package/dist/{contracts-CDeSer-r.d.ts → contracts-DPknvuKq.d.ts} +69 -10
- package/dist/contracts.d.ts +2 -2
- package/dist/contracts.js +1 -2
- package/dist/index.d.ts +50 -13
- package/dist/index.js +21 -3
- package/package.json +10 -9
|
@@ -8,7 +8,7 @@ const HOST_SCHEME = `${SITE_NAME.toLowerCase()}-host`;
|
|
|
8
8
|
const PAIRING_CODE_PARAMETER = "code";
|
|
9
9
|
const PAIRING_HASH_PARAMETER = "host";
|
|
10
10
|
const SHELL_OUTPUT_LENGTH = 1e5;
|
|
11
|
-
const
|
|
11
|
+
const SCHEME_PAIRING_CODE_DURATION_MS = Temporal.Duration.from({ minutes: 1 }).total("milliseconds");
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/models/handshake/HandshakeMessageType.ts
|
|
14
14
|
let HandshakeMessageType = /* @__PURE__ */ function(HandshakeMessageType) {
|
|
@@ -37,6 +37,8 @@ let ServerMessageType = /* @__PURE__ */ function(ServerMessageType) {
|
|
|
37
37
|
ServerMessageType["Authenticated"] = "Authenticated";
|
|
38
38
|
ServerMessageType["CommandError"] = "CommandError";
|
|
39
39
|
ServerMessageType["Events"] = "Events";
|
|
40
|
+
ServerMessageType["FileContent"] = "FileContent";
|
|
41
|
+
ServerMessageType["Files"] = "Files";
|
|
40
42
|
ServerMessageType["HostStopping"] = "HostStopping";
|
|
41
43
|
ServerMessageType["Paired"] = "Paired";
|
|
42
44
|
ServerMessageType["Proof"] = "Proof";
|
|
@@ -104,14 +106,16 @@ const messageUuidSchema = z.object({ messageUuid: z.string() });
|
|
|
104
106
|
//#region src/models/event/ParentToolUseId.ts
|
|
105
107
|
const parentToolUseIdSchema = z.object({ parentToolUseId: z.string() });
|
|
106
108
|
//#endregion
|
|
107
|
-
//#region src/models/event/
|
|
108
|
-
const
|
|
109
|
-
...createBaseAgentEventSchema(
|
|
109
|
+
//#region src/models/event/BaseMessageAgentEvent.ts
|
|
110
|
+
const createBaseMessageAgentEventSchema = (typeSchema) => z.object({
|
|
111
|
+
...createBaseAgentEventSchema(typeSchema).shape,
|
|
110
112
|
...messageUuidSchema.shape,
|
|
111
|
-
...parentToolUseIdSchema.shape
|
|
112
|
-
text: z.string()
|
|
113
|
+
...parentToolUseIdSchema.shape
|
|
113
114
|
});
|
|
114
115
|
//#endregion
|
|
116
|
+
//#region src/models/event/AssistantMessageEvent.ts
|
|
117
|
+
const assistantMessageEventSchema = createBaseMessageAgentEventSchema(z.literal("AssistantMessage")).extend({ text: z.string() });
|
|
118
|
+
//#endregion
|
|
115
119
|
//#region src/models/event/Model.ts
|
|
116
120
|
const modelSchema = z.object({
|
|
117
121
|
description: z.string(),
|
|
@@ -334,12 +338,7 @@ const subagentEventSchema = z.object({
|
|
|
334
338
|
});
|
|
335
339
|
//#endregion
|
|
336
340
|
//#region src/models/event/ThinkingEvent.ts
|
|
337
|
-
const thinkingEventSchema = z.
|
|
338
|
-
...createBaseAgentEventSchema(z.literal("Thinking")).shape,
|
|
339
|
-
...messageUuidSchema.shape,
|
|
340
|
-
...parentToolUseIdSchema.shape,
|
|
341
|
-
thinking: z.string()
|
|
342
|
-
});
|
|
341
|
+
const thinkingEventSchema = createBaseMessageAgentEventSchema(z.literal("Thinking")).extend({ thinking: z.string() });
|
|
343
342
|
//#endregion
|
|
344
343
|
//#region src/models/event/TodoStatus.ts
|
|
345
344
|
let TodoStatus = /* @__PURE__ */ function(TodoStatus) {
|
|
@@ -383,10 +382,7 @@ const toolResultEventSchema = z.object({
|
|
|
383
382
|
});
|
|
384
383
|
//#endregion
|
|
385
384
|
//#region src/models/event/ToolUseEvent.ts
|
|
386
|
-
const toolUseEventSchema = z.
|
|
387
|
-
...createBaseAgentEventSchema(z.literal("ToolUse")).shape,
|
|
388
|
-
...messageUuidSchema.shape,
|
|
389
|
-
...parentToolUseIdSchema.shape,
|
|
385
|
+
const toolUseEventSchema = createBaseMessageAgentEventSchema(z.literal("ToolUse")).extend({
|
|
390
386
|
input: z.record(z.string(), z.unknown()),
|
|
391
387
|
name: z.string().min(1),
|
|
392
388
|
toolUseId: z.string().min(1)
|
|
@@ -428,10 +424,7 @@ const unknownEventSchema = z.object({
|
|
|
428
424
|
});
|
|
429
425
|
//#endregion
|
|
430
426
|
//#region src/models/event/UserMessageEvent.ts
|
|
431
|
-
const userMessageEventSchema = z.
|
|
432
|
-
...createBaseAgentEventSchema(z.literal("UserMessage")).shape,
|
|
433
|
-
...messageUuidSchema.shape,
|
|
434
|
-
...parentToolUseIdSchema.shape,
|
|
427
|
+
const userMessageEventSchema = createBaseMessageAgentEventSchema(z.literal("UserMessage")).extend({
|
|
435
428
|
attachmentCount: z.int().nonnegative(),
|
|
436
429
|
text: z.string()
|
|
437
430
|
});
|
|
@@ -472,6 +465,22 @@ const eventsMessageSchema = z.object({
|
|
|
472
465
|
sessionId: z.string().min(1)
|
|
473
466
|
});
|
|
474
467
|
//#endregion
|
|
468
|
+
//#region src/models/server/FileContentMessage.ts
|
|
469
|
+
const fileContentMessageSchema = z.object({
|
|
470
|
+
...createBaseServerMessageSchema(z.literal("FileContent")).shape,
|
|
471
|
+
commandId: z.string().min(1),
|
|
472
|
+
content: z.string(),
|
|
473
|
+
notice: z.string(),
|
|
474
|
+
path: z.string().min(1)
|
|
475
|
+
});
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/models/server/FilesMessage.ts
|
|
478
|
+
const filesMessageSchema = z.object({
|
|
479
|
+
...createBaseServerMessageSchema(z.literal("Files")).shape,
|
|
480
|
+
commandId: z.string().min(1),
|
|
481
|
+
files: z.array(z.string())
|
|
482
|
+
});
|
|
483
|
+
//#endregion
|
|
475
484
|
//#region src/models/server/HostStoppingMessage.ts
|
|
476
485
|
const hostStoppingMessageSchema = z.object({ ...createBaseServerMessageSchema(z.literal("HostStopping")).shape });
|
|
477
486
|
//#endregion
|
|
@@ -548,6 +557,8 @@ const serverMessageSchema = z.discriminatedUnion("type", [
|
|
|
548
557
|
authenticatedMessageSchema,
|
|
549
558
|
commandErrorMessageSchema,
|
|
550
559
|
eventsMessageSchema,
|
|
560
|
+
fileContentMessageSchema,
|
|
561
|
+
filesMessageSchema,
|
|
551
562
|
hostStoppingMessageSchema,
|
|
552
563
|
pairedMessageSchema,
|
|
553
564
|
proofMessageSchema,
|
|
@@ -582,10 +593,12 @@ let CommandType = /* @__PURE__ */ function(CommandType) {
|
|
|
582
593
|
CommandType["CreateSession"] = "CreateSession";
|
|
583
594
|
CommandType["Fork"] = "Fork";
|
|
584
595
|
CommandType["Interrupt"] = "Interrupt";
|
|
596
|
+
CommandType["ListFiles"] = "ListFiles";
|
|
585
597
|
CommandType["ListSessions"] = "ListSessions";
|
|
586
598
|
CommandType["OpenShell"] = "OpenShell";
|
|
587
599
|
CommandType["PermissionVerdict"] = "PermissionVerdict";
|
|
588
600
|
CommandType["Prompt"] = "Prompt";
|
|
601
|
+
CommandType["ReadFile"] = "ReadFile";
|
|
589
602
|
CommandType["Resume"] = "Resume";
|
|
590
603
|
CommandType["ResumeAt"] = "ResumeAt";
|
|
591
604
|
CommandType["RewindFiles"] = "RewindFiles";
|
|
@@ -734,6 +747,19 @@ const driverCommandSchema = z.discriminatedUnion("type", [
|
|
|
734
747
|
stopTaskCommandSchema
|
|
735
748
|
]);
|
|
736
749
|
//#endregion
|
|
750
|
+
//#region src/models/command/ListFilesCommand.ts
|
|
751
|
+
const listFilesCommandSchema = z.object({
|
|
752
|
+
...createBaseCommandSchema(z.literal("ListFiles")).shape,
|
|
753
|
+
...sessionIdSchema.shape
|
|
754
|
+
});
|
|
755
|
+
//#endregion
|
|
756
|
+
//#region src/models/command/ReadFileCommand.ts
|
|
757
|
+
const readFileCommandSchema = z.object({
|
|
758
|
+
...createBaseCommandSchema(z.literal("ReadFile")).shape,
|
|
759
|
+
...sessionIdSchema.shape,
|
|
760
|
+
path: z.string().min(1)
|
|
761
|
+
});
|
|
762
|
+
//#endregion
|
|
737
763
|
//#region src/models/command/CloseShellCommand.ts
|
|
738
764
|
const closeShellCommandSchema = z.object({
|
|
739
765
|
...createBaseCommandSchema(z.literal("CloseShell")).shape,
|
|
@@ -777,7 +803,12 @@ const shellCommandSchema = z.discriminatedUnion("type", [
|
|
|
777
803
|
]);
|
|
778
804
|
//#endregion
|
|
779
805
|
//#region src/models/command/Command.ts
|
|
780
|
-
const commandSchema = z.discriminatedUnion("type", [
|
|
806
|
+
const commandSchema = z.discriminatedUnion("type", [
|
|
807
|
+
...driverCommandSchema.options,
|
|
808
|
+
...shellCommandSchema.options,
|
|
809
|
+
listFilesCommandSchema,
|
|
810
|
+
readFileCommandSchema
|
|
811
|
+
]);
|
|
781
812
|
//#endregion
|
|
782
813
|
//#region src/models/handshake/BaseHandshakeMessage.ts
|
|
783
814
|
const createBaseHandshakeMessageSchema = (typeSchema) => z.object({ type: typeSchema });
|
|
@@ -835,4 +866,4 @@ let HostCloseCode = /* @__PURE__ */ function(HostCloseCode) {
|
|
|
835
866
|
//#region src/models/event/EphemeralAgentEventTypes.ts
|
|
836
867
|
const EphemeralAgentEventTypes = ["StreamDelta", "TurnUsage"];
|
|
837
868
|
//#endregion
|
|
838
|
-
export {
|
|
869
|
+
export { pairedMessageSchema as $, AgentEventType as $t, listSessionsCommandSchema as A, rateLimitEventSchema as At, AttachmentMediaType as B, contextUsageEventSchema as Bt, setModelCommandSchema as C, SessionState as Ct, promptCommandSchema as D, PermissionMode as Dt, resumeAtCommandSchema as E, sessionInitEventSchema as Et, backgroundTasksCommandSchema as F, hostErrorEventSchema as Ft, shellOpenedMessageSchema as G, capabilitiesEventSchema as Gt, getSignedText as H, CompactionTrigger as Ht, sessionIdSchema as I, hookEventSchema as It, sessionsMessageSchema as J, assistantMessageEventSchema as Jt, shellClosedMessageSchema as K, slashCommandSchema as Kt, createBaseCommandSchema as L, HookPhase as Lt, forkCommandSchema as M, PermissionBehavior as Mt, createSessionCommandSchema as N, permissionBehaviorSchema as Nt, attachmentSchema as O, permissionModeSchema as Ot, closeSessionCommandSchema as P, permissionRequestEventSchema as Pt, proofMessageSchema as Q, createBaseAgentEventSchema as Qt, CommandType as R, hookPhaseSchema as Rt, setPermissionModeCommandSchema as S, sessionStateEventSchema as St, resumeCommandSchema as T, sessionSettingsEventSchema as Tt, serverMessageSchema as U, compactionTriggerSchema as Ut, attachmentMediaTypeSchema as V, compactionEventSchema as Vt, shellOutputMessageSchema as W, commandOutputEventSchema as Wt, sessionResetMessageSchema as X, parentToolUseIdSchema as Xt, sessionSummarySchema as Y, createBaseMessageAgentEventSchema as Yt, sessionOpenedMessageSchema as Z, messageUuidSchema as Zt, readFileCommandSchema as _, SHELL_OUTPUT_LENGTH as _n, thinkingEventSchema as _t, pairMessageSchema as a, createBaseServerMessageSchema as an, userMessageEventSchema as at, stopTaskCommandSchema as b, subagentStatusSchema as bt, authenticateMessageSchema as c, HandshakeMessageType as cn, turnResultEventSchema as ct, shellCommandSchema as d, DEFAULT_HOSTNAME as dn, toolResultEventSchema as dt, agentEventTypeSchema as en, hostStoppingMessageSchema as et, shellResizeCommandSchema as f, DEFAULT_PORT as fn, toolProgressEventSchema as ft, closeShellCommandSchema as g, SCHEME_PAIRING_CODE_DURATION_MS as gn, todoStatusSchema as gt, terminalSizeSchema as h, PAIRING_HASH_PARAMETER as hn, TodoStatus as ht, revokeMessageSchema as i, serverMessageTypeSchema as in, agentEventSchema as it, interruptCommandSchema as j, permissionResolutionEventSchema as jt, permissionVerdictCommandSchema as k, mcpServerSchema as kt, createBaseHandshakeMessageSchema as l, handshakeMessageTypeSchema as ln, tokenUsageSchema as lt, openShellCommandSchema as m, PAIRING_CODE_PARAMETER as mn, todoSchema as mt, HostCloseCode as n, authenticatedMessageSchema as nn, fileContentMessageSchema as nt, handOffMessageSchema as o, SignaturePurpose as on, unknownEventSchema as ot, shellInputCommandSchema as p, HOST_SCHEME as pn, todoUpdateEventSchema as pt, shellIdSchema as q, modelSchema as qt, handshakeMessageSchema as r, ServerMessageType as rn, eventsMessageSchema as rt, challengeMessageSchema as s, signaturePurposeSchema as sn, turnUsageEventSchema as st, EphemeralAgentEventTypes as t, commandErrorMessageSchema as tn, filesMessageSchema as tt, commandSchema as u, DEFAULT_APP_ORIGIN as un, toolUseEventSchema as ut, listFilesCommandSchema as v, subagentEventSchema as vt, rewindFilesCommandSchema as w, sessionStateSchema as wt, slashCommandCommandSchema as x, streamDeltaEventSchema as xt, driverCommandSchema as y, SubagentStatus as yt, commandTypeSchema as z, fileRewindEventSchema as zt };
|
package/dist/{agentConsoleServerCommand-D-Uv3ME1.js → agentConsoleServerCommand-B7491RR7.js}
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as getSignedText, Ot as permissionModeSchema, U as serverMessageSchema, _n as SHELL_OUTPUT_LENGTH, dn as DEFAULT_HOSTNAME, fn as DEFAULT_PORT, gn as SCHEME_PAIRING_CODE_DURATION_MS, gt as todoStatusSchema, hn as PAIRING_HASH_PARAMETER, it as agentEventSchema, mn as PAIRING_CODE_PARAMETER, pn as HOST_SCHEME, r as handshakeMessageSchema, t as EphemeralAgentEventTypes, u as commandSchema, un as DEFAULT_APP_ORIGIN, y as driverCommandSchema } from "./EphemeralAgentEventTypes-Spjnk48Y.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { homedir, hostname } from "node:os";
|
|
4
4
|
import { ID_SEPARATOR, InvalidOperationError, Operation, RoutePath, SITE_NAME, createUniqueArraySchema, exhaustiveGuard, getOrCreate, getResult, getResultAsync, noop, withFinalizerAsync } from "@esposter/shared";
|
|
5
|
-
import { basename, delimiter, dirname, join, relative, win32 } from "node:path";
|
|
6
|
-
import { execFileSync, spawn } from "node:child_process";
|
|
5
|
+
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep, win32 } from "node:path";
|
|
6
|
+
import { execFile, execFileSync, spawn } from "node:child_process";
|
|
7
|
+
import { parseArgs, promisify } from "node:util";
|
|
7
8
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
8
9
|
import { getAssetKeys, getRawAsset, isSea } from "node:sea";
|
|
9
10
|
import { createHash, createPrivateKey, createPublicKey, generateKeyPairSync, randomBytes, sign, timingSafeEqual, verify } from "node:crypto";
|
|
10
11
|
import { z } from "zod";
|
|
11
12
|
import { once } from "node:events";
|
|
12
13
|
import { WebSocket, WebSocketServer } from "ws";
|
|
13
|
-
import { parseArgs } from "node:util";
|
|
14
14
|
import { getSessionInfo, getSessionMessages, listSessions, query } from "@anthropic-ai/claude-agent-sdk";
|
|
15
|
-
import { readFile, readdir } from "node:fs/promises";
|
|
15
|
+
import { readFile, readdir, realpath, stat } from "node:fs/promises";
|
|
16
16
|
import { createServer } from "node:http";
|
|
17
17
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
18
18
|
//#region src/services/cli/getReachableHostname.ts
|
|
@@ -51,6 +51,24 @@ const getHostInstallDirectory = () => join(process.env.LOCALAPPDATA ?? join(home
|
|
|
51
51
|
//#region src/services/installer/checkIsHostInstalled.ts
|
|
52
52
|
const checkIsHostInstalled = () => relative(getHostInstallDirectory(), dirname(process.execPath)) === "";
|
|
53
53
|
//#endregion
|
|
54
|
+
//#region ../shared-node/dist/execSync-CtM99iYq.js
|
|
55
|
+
const withHiddenWindow = (parameters) => {
|
|
56
|
+
const optionsIndex = Array.isArray(parameters[0]) || parameters[0] === void 0 && parameters.length > 1 ? 1 : 0;
|
|
57
|
+
const options = parameters[optionsIndex];
|
|
58
|
+
if (typeof options === "object" && options !== null) return parameters.toSpliced(optionsIndex, 1, {
|
|
59
|
+
...options,
|
|
60
|
+
windowsHide: true
|
|
61
|
+
});
|
|
62
|
+
const isPlaceholder = options === void 0 && optionsIndex < parameters.length;
|
|
63
|
+
return parameters.toSpliced(optionsIndex, Number(isPlaceholder), { windowsHide: true });
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region ../shared-node/dist/child-process.js
|
|
67
|
+
const execFile$1 = ((file, ...parameters) => execFile(file, ...withHiddenWindow(parameters)));
|
|
68
|
+
Object.defineProperty(execFile$1, promisify.custom, { value: (file, ...parameters) => promisify(execFile)(file, ...withHiddenWindow(parameters)) });
|
|
69
|
+
const execFileSync$1 = ((file, ...parameters) => execFileSync(file, ...withHiddenWindow(parameters)));
|
|
70
|
+
const spawn$1 = ((file, ...parameters) => spawn(file, ...withHiddenWindow(parameters)));
|
|
71
|
+
//#endregion
|
|
54
72
|
//#region src/services/installer/installHost.ts
|
|
55
73
|
const installHost = () => {
|
|
56
74
|
const installDirectory = getHostInstallDirectory();
|
|
@@ -83,7 +101,7 @@ const installHost = () => {
|
|
|
83
101
|
"/d",
|
|
84
102
|
`"${executablePath}" "%1"`
|
|
85
103
|
]
|
|
86
|
-
]) execFileSync("reg", [
|
|
104
|
+
]) execFileSync$1("reg", [
|
|
87
105
|
"add",
|
|
88
106
|
...registryArguments,
|
|
89
107
|
"/f"
|
|
@@ -112,7 +130,7 @@ const STATE_DIRECTORY_NAME = ".agent-console-server";
|
|
|
112
130
|
const DEVICES_FILENAME = "devices.json";
|
|
113
131
|
const HOST_KEY_FILENAME = "host-key.pem";
|
|
114
132
|
const SECRET_BYTE_LENGTH = 32;
|
|
115
|
-
const
|
|
133
|
+
const PRINTED_PAIRING_CODE_DURATION_MS = Temporal.Duration.from({ minutes: 10 }).total("milliseconds");
|
|
116
134
|
//#endregion
|
|
117
135
|
//#region src/services/device/getStateDirectory.ts
|
|
118
136
|
const getStateDirectory = () => join(homedir(), STATE_DIRECTORY_NAME);
|
|
@@ -160,8 +178,8 @@ const deviceSchema = z.object({
|
|
|
160
178
|
//#region src/services/device/readDevices.ts
|
|
161
179
|
const readDevices = (stateDirectory) => {
|
|
162
180
|
const devicesPath = join(stateDirectory, DEVICES_FILENAME);
|
|
163
|
-
if (
|
|
164
|
-
return
|
|
181
|
+
if (existsSync(devicesPath)) return z.array(deviceSchema).parse(JSON.parse(readFileSync(devicesPath, "utf8")));
|
|
182
|
+
else return [];
|
|
165
183
|
};
|
|
166
184
|
//#endregion
|
|
167
185
|
//#region src/services/device/writeDevices.ts
|
|
@@ -1926,11 +1944,13 @@ const childEventsMessageSchema = z.object({
|
|
|
1926
1944
|
sessionId: z.string().min(1)
|
|
1927
1945
|
});
|
|
1928
1946
|
//#endregion
|
|
1929
|
-
//#region src/models/window/
|
|
1947
|
+
//#region src/models/window/RejoiningSession.ts
|
|
1930
1948
|
const rejoiningSessionSchema = z.object({
|
|
1931
1949
|
events: createUniqueArraySchema(agentEventSchema, "id"),
|
|
1932
1950
|
sessionId: z.string().min(1)
|
|
1933
1951
|
});
|
|
1952
|
+
//#endregion
|
|
1953
|
+
//#region src/models/window/ChildRejoinMessage.ts
|
|
1934
1954
|
const childRejoinMessageSchema = z.object({
|
|
1935
1955
|
...createBaseChildMessageSchema(z.literal("Rejoin")).shape,
|
|
1936
1956
|
sessions: createUniqueArraySchema(rejoiningSessionSchema, "sessionId")
|
|
@@ -1968,10 +1988,10 @@ const hashCredential = (credential) => createHash("sha256").update(credential).d
|
|
|
1968
1988
|
const SESSION_SUBCOMMAND = "session";
|
|
1969
1989
|
const SESSION_SECRET_ENVIRONMENT_VARIABLE = `${SITE_NAME.toUpperCase()}_SESSION_SECRET`;
|
|
1970
1990
|
const SESSION_SECRET_BYTE_LENGTH = 32;
|
|
1971
|
-
const
|
|
1991
|
+
const SESSION_WINDOW_CONNECT_TIMEOUT_MS = Temporal.Duration.from({ seconds: 30 }).total("milliseconds");
|
|
1972
1992
|
const SESSION_WINDOWS_FILENAME = "session-windows.json";
|
|
1973
|
-
const
|
|
1974
|
-
const
|
|
1993
|
+
const SESSION_WINDOW_REJOIN_DURATION_MS = Temporal.Duration.from({ minutes: 1 }).total("milliseconds");
|
|
1994
|
+
const SESSION_WINDOW_RECONNECT_DELAY_MS = Temporal.Duration.from({ seconds: 1 }).total("milliseconds");
|
|
1975
1995
|
//#endregion
|
|
1976
1996
|
//#region src/models/window/SessionWindows.ts
|
|
1977
1997
|
const sessionWindowsSchema = z.object({
|
|
@@ -2033,7 +2053,7 @@ const createWindowDriver = ({ onEvents, onSessionOpen, onSessionsChange }, { lau
|
|
|
2033
2053
|
const rejoinTimeout = setTimeout(() => {
|
|
2034
2054
|
rejoinSecretHashSet.clear();
|
|
2035
2055
|
saveSessionWindows();
|
|
2036
|
-
},
|
|
2056
|
+
}, SESSION_WINDOW_REJOIN_DURATION_MS);
|
|
2037
2057
|
const getWindowSession = (sessionId) => {
|
|
2038
2058
|
const windowSession = windowSessionMap.get(sessionId);
|
|
2039
2059
|
if (!windowSession) throw new InvalidOperationError(Operation.Read, sessionId, "the session is not open on this host");
|
|
@@ -2168,7 +2188,7 @@ const createWindowDriver = ({ onEvents, onSessionOpen, onSessionsChange }, { lau
|
|
|
2168
2188
|
const timeout = setTimeout(() => {
|
|
2169
2189
|
pendingLaunchMap.delete(secret);
|
|
2170
2190
|
connection.reject(new InvalidOperationError(Operation.Create, cwd, "the session's window did not start"));
|
|
2171
|
-
},
|
|
2191
|
+
}, SESSION_WINDOW_CONNECT_TIMEOUT_MS);
|
|
2172
2192
|
pendingLaunchMap.set(secret, {
|
|
2173
2193
|
connection,
|
|
2174
2194
|
timeout
|
|
@@ -2327,8 +2347,8 @@ const createWindowDriver = ({ onEvents, onSessionOpen, onSessionsChange }, { lau
|
|
|
2327
2347
|
const SESSION_COMMAND_ENVIRONMENT_VARIABLE_PREFIX = `${SITE_NAME.toUpperCase()}_SESSION_COMMAND_`;
|
|
2328
2348
|
const launchSessionWindow = ({ port, secret }) => {
|
|
2329
2349
|
const hostCommand = isSea() ? [process.execPath] : [process.execPath, process.argv[1] ?? ""];
|
|
2330
|
-
const quotedHostCommand = hostCommand.map((
|
|
2331
|
-
spawn("cmd.exe", [
|
|
2350
|
+
const quotedHostCommand = hostCommand.map((_value, index) => `"%${SESSION_COMMAND_ENVIRONMENT_VARIABLE_PREFIX}${index}%"`).join(" ");
|
|
2351
|
+
spawn$1("cmd.exe", [
|
|
2332
2352
|
"/d",
|
|
2333
2353
|
"/s",
|
|
2334
2354
|
"/c",
|
|
@@ -2420,11 +2440,11 @@ const createEventLog = () => {
|
|
|
2420
2440
|
const createPairingCodes = () => {
|
|
2421
2441
|
const codeTimeoutMap = /* @__PURE__ */ new Map();
|
|
2422
2442
|
return {
|
|
2423
|
-
add: (code,
|
|
2443
|
+
add: (code, durationMs) => {
|
|
2424
2444
|
clearTimeout(codeTimeoutMap.get(code));
|
|
2425
2445
|
codeTimeoutMap.set(code, setTimeout(() => {
|
|
2426
2446
|
codeTimeoutMap.delete(code);
|
|
2427
|
-
},
|
|
2447
|
+
}, durationMs));
|
|
2428
2448
|
},
|
|
2429
2449
|
clear: () => {
|
|
2430
2450
|
for (const timeout of codeTimeoutMap.values()) clearTimeout(timeout);
|
|
@@ -2482,6 +2502,90 @@ const handleCommand = async (driver, command) => {
|
|
|
2482
2502
|
}
|
|
2483
2503
|
};
|
|
2484
2504
|
//#endregion
|
|
2505
|
+
//#region src/services/files/getSessionCwd.ts
|
|
2506
|
+
const getSessionCwd = async (driver, sessionId) => {
|
|
2507
|
+
const session = (await driver.listSessions()).find(({ id }) => id === sessionId);
|
|
2508
|
+
if (!session) throw new InvalidOperationError(Operation.Read, sessionId, "the session is not open on this host");
|
|
2509
|
+
return session.cwd;
|
|
2510
|
+
};
|
|
2511
|
+
//#endregion
|
|
2512
|
+
//#region src/services/files/constants.ts
|
|
2513
|
+
const REPOSITORY_FILE_MAX_BYTE_LENGTH = 524288;
|
|
2514
|
+
const REPOSITORY_WALK_IGNORED_NAMES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
2515
|
+
//#endregion
|
|
2516
|
+
//#region src/services/files/listRepositoryFiles.ts
|
|
2517
|
+
const execFileAsync = promisify(execFile$1);
|
|
2518
|
+
const listGitFiles = async (cwd) => {
|
|
2519
|
+
const { stdout } = await execFileAsync("git", [
|
|
2520
|
+
"ls-files",
|
|
2521
|
+
"-co",
|
|
2522
|
+
"--exclude-standard",
|
|
2523
|
+
"-z"
|
|
2524
|
+
], { cwd });
|
|
2525
|
+
return stdout.split("\0").filter(Boolean);
|
|
2526
|
+
};
|
|
2527
|
+
const walkFiles = async (root, directory) => {
|
|
2528
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
2529
|
+
const files = entries.filter((entry) => entry.isFile()).map((entry) => relative(root, join(directory, entry.name)));
|
|
2530
|
+
const subdirectories = entries.filter((entry) => entry.isDirectory() && !REPOSITORY_WALK_IGNORED_NAMES.has(entry.name));
|
|
2531
|
+
const nested = await Promise.all(subdirectories.map((entry) => walkFiles(root, join(directory, entry.name))));
|
|
2532
|
+
return [...files, ...nested.flat()];
|
|
2533
|
+
};
|
|
2534
|
+
const listRepositoryFiles = async (cwd) => {
|
|
2535
|
+
return (await getResultAsync(() => listGitFiles(cwd)).unwrapOr(void 0) ?? await walkFiles(cwd, cwd)).map((file) => file.split(sep).join("/")).toSorted();
|
|
2536
|
+
};
|
|
2537
|
+
//#endregion
|
|
2538
|
+
//#region src/services/files/resolveRepositoryPath.ts
|
|
2539
|
+
const resolveRepositoryPath = async (cwd, path) => {
|
|
2540
|
+
const root = await realpath(cwd);
|
|
2541
|
+
const target = await realpath(resolve(root, path));
|
|
2542
|
+
const relation = relative(root, target);
|
|
2543
|
+
if (relation === ".." || relation.startsWith(`..${sep}`) || isAbsolute(relation)) throw new InvalidOperationError(Operation.Read, path, "the file is outside the session's working directory");
|
|
2544
|
+
return target;
|
|
2545
|
+
};
|
|
2546
|
+
//#endregion
|
|
2547
|
+
//#region src/services/files/readRepositoryFile.ts
|
|
2548
|
+
const readRepositoryFile = async (cwd, path) => {
|
|
2549
|
+
const target = await resolveRepositoryPath(cwd, path);
|
|
2550
|
+
const { size } = await stat(target);
|
|
2551
|
+
if (size > 524288) return {
|
|
2552
|
+
content: "",
|
|
2553
|
+
notice: "The file is too large to show."
|
|
2554
|
+
};
|
|
2555
|
+
const buffer = await readFile(target);
|
|
2556
|
+
if (buffer.includes(0)) return {
|
|
2557
|
+
content: "",
|
|
2558
|
+
notice: "The file is not text, so it cannot be shown."
|
|
2559
|
+
};
|
|
2560
|
+
return {
|
|
2561
|
+
content: buffer.toString("utf8"),
|
|
2562
|
+
notice: ""
|
|
2563
|
+
};
|
|
2564
|
+
};
|
|
2565
|
+
//#endregion
|
|
2566
|
+
//#region src/services/server/handleFileCommand.ts
|
|
2567
|
+
const handleFileCommand = async (driver, command) => {
|
|
2568
|
+
const cwd = await getSessionCwd(driver, command.sessionId);
|
|
2569
|
+
switch (command.type) {
|
|
2570
|
+
case "ListFiles": return {
|
|
2571
|
+
commandId: command.id,
|
|
2572
|
+
files: await listRepositoryFiles(cwd),
|
|
2573
|
+
type: "Files"
|
|
2574
|
+
};
|
|
2575
|
+
case "ReadFile": {
|
|
2576
|
+
const file = await readRepositoryFile(cwd, command.path);
|
|
2577
|
+
return {
|
|
2578
|
+
commandId: command.id,
|
|
2579
|
+
content: file.content,
|
|
2580
|
+
notice: file.notice,
|
|
2581
|
+
path: command.path,
|
|
2582
|
+
type: "FileContent"
|
|
2583
|
+
};
|
|
2584
|
+
}
|
|
2585
|
+
default: return exhaustiveGuard(command);
|
|
2586
|
+
}
|
|
2587
|
+
};
|
|
2588
|
+
//#endregion
|
|
2485
2589
|
//#region src/services/server/handleShellCommand.ts
|
|
2486
2590
|
const handleShellCommand = async (shellRegistry, command) => {
|
|
2487
2591
|
switch (command.type) {
|
|
@@ -2683,6 +2787,12 @@ const createAgentConsoleServer = async ({ createDriver, hostKey, hostname, origi
|
|
|
2683
2787
|
});
|
|
2684
2788
|
}, sendCommandError);
|
|
2685
2789
|
return;
|
|
2790
|
+
case "ListFiles":
|
|
2791
|
+
case "ReadFile":
|
|
2792
|
+
await getResultAsync(() => handleFileCommand(driver, command)).match((message) => {
|
|
2793
|
+
sendServerMessage(webSocket, message);
|
|
2794
|
+
}, sendCommandError);
|
|
2795
|
+
return;
|
|
2686
2796
|
default: await getResultAsync(() => handleCommand(driver, command)).match((sessionId) => {
|
|
2687
2797
|
if (sessionId) sendServerMessage(webSocket, {
|
|
2688
2798
|
commandId: command.id,
|
|
@@ -2765,7 +2875,7 @@ const createAgentConsoleServer = async ({ createDriver, hostKey, hostname, origi
|
|
|
2765
2875
|
webSocket.close(4404);
|
|
2766
2876
|
return;
|
|
2767
2877
|
}
|
|
2768
|
-
if (handshakeMessage.type === "HandOff") pairingCodes.add(handshakeMessage.code,
|
|
2878
|
+
if (handshakeMessage.type === "HandOff") pairingCodes.add(handshakeMessage.code, SCHEME_PAIRING_CODE_DURATION_MS);
|
|
2769
2879
|
else {
|
|
2770
2880
|
writeDevices(stateDirectory, readDevices(stateDirectory).filter(({ id }) => id !== handshakeMessage.deviceId));
|
|
2771
2881
|
for (const [deviceWebSocket, deviceId] of socketDeviceIdMap) if (deviceId === handshakeMessage.deviceId) deviceWebSocket.close(4401);
|
|
@@ -2898,11 +3008,11 @@ const serveHost = async ({ hostname, origin, port, schemeLaunch }) => {
|
|
|
2898
3008
|
process.exit(1);
|
|
2899
3009
|
});
|
|
2900
3010
|
if (schemeLaunch) {
|
|
2901
|
-
if (schemeLaunch.code) server.addPairingCode(schemeLaunch.code,
|
|
3011
|
+
if (schemeLaunch.code) server.addPairingCode(schemeLaunch.code, SCHEME_PAIRING_CODE_DURATION_MS);
|
|
2902
3012
|
process.stdout.write("The host is running. Keep this window open.\n\nTo stop, close this window.\n");
|
|
2903
3013
|
} else {
|
|
2904
3014
|
const code = randomBytes(32).toString("base64url");
|
|
2905
|
-
server.addPairingCode(code,
|
|
3015
|
+
server.addPairingCode(code, PRINTED_PAIRING_CODE_DURATION_MS);
|
|
2906
3016
|
const hostAddress = `ws://${reachableHostname}:${server.port}`;
|
|
2907
3017
|
const pairingUrl = `${origin}${RoutePath.Genshin}#${new URLSearchParams({
|
|
2908
3018
|
[PAIRING_CODE_PARAMETER]: code,
|
|
@@ -3027,7 +3137,7 @@ const serveSessionChild = async (connect, createDriver, writeLine, signal) => {
|
|
|
3027
3137
|
if (signal.aborted || isRefused || code === 4e3 || sessionEventMap.size === 0) break;
|
|
3028
3138
|
if (!isRejoining) writeLine("The host went away. This session keeps running, and comes back when the host is started again.");
|
|
3029
3139
|
isRejoining = true;
|
|
3030
|
-
await setTimeout$1(
|
|
3140
|
+
await setTimeout$1(SESSION_WINDOW_RECONNECT_DELAY_MS);
|
|
3031
3141
|
}
|
|
3032
3142
|
await driver.close();
|
|
3033
3143
|
await taskRegistry.drain();
|
|
@@ -3074,12 +3184,12 @@ const sessionCommand = defineCommand({
|
|
|
3074
3184
|
//#endregion
|
|
3075
3185
|
//#region src/services/installer/uninstallHost.ts
|
|
3076
3186
|
const uninstallHost = () => {
|
|
3077
|
-
execFileSync("reg", [
|
|
3187
|
+
execFileSync$1("reg", [
|
|
3078
3188
|
"delete",
|
|
3079
3189
|
HOST_SCHEME_REGISTRY_KEY,
|
|
3080
3190
|
"/f"
|
|
3081
3191
|
], { stdio: "ignore" });
|
|
3082
|
-
spawn("powershell.exe", [
|
|
3192
|
+
spawn$1("powershell.exe", [
|
|
3083
3193
|
"-NoProfile",
|
|
3084
3194
|
"-Command",
|
|
3085
3195
|
`Start-Sleep -Seconds 2; Remove-Item -LiteralPath $env:${HOST_DIRECTORY_ENVIRONMENT_VARIABLE} -Recurse -Force`
|
|
@@ -3089,8 +3199,7 @@ const uninstallHost = () => {
|
|
|
3089
3199
|
...process.env,
|
|
3090
3200
|
[HOST_DIRECTORY_ENVIRONMENT_VARIABLE]: getHostInstallDirectory()
|
|
3091
3201
|
},
|
|
3092
|
-
stdio: "ignore"
|
|
3093
|
-
windowsHide: true
|
|
3202
|
+
stdio: "ignore"
|
|
3094
3203
|
}).unref();
|
|
3095
3204
|
};
|
|
3096
3205
|
//#endregion
|
|
@@ -3114,8 +3223,8 @@ const checkIsSchemeLaunchTampered = (commandLineArguments) => commandLineArgumen
|
|
|
3114
3223
|
const getSchemeLaunch = (argument) => {
|
|
3115
3224
|
if (!URL.canParse(argument)) return void 0;
|
|
3116
3225
|
const url = new URL(argument);
|
|
3117
|
-
if (url.protocol
|
|
3118
|
-
return
|
|
3226
|
+
if (url.protocol === `${HOST_SCHEME}:`) return { code: url.searchParams.get("code") ?? "" };
|
|
3227
|
+
else return void 0;
|
|
3119
3228
|
};
|
|
3120
3229
|
//#endregion
|
|
3121
3230
|
//#region src/services/shell/constants.ts
|
|
@@ -3163,4 +3272,4 @@ const agentConsoleServerCommand = defineCommand({
|
|
|
3163
3272
|
}
|
|
3164
3273
|
});
|
|
3165
3274
|
//#endregion
|
|
3166
|
-
export {
|
|
3275
|
+
export { childSessionOpenMessageSchema as $, signNonce as $t, createEventLog as A, mapAssistantContent as At, readSessionWindows as B, DEFAULT_DENY_MESSAGE as Bt, resolveRepositoryPath as C, hostArgs as Cn, toSessionInitEvent as Ct, getSessionCwd as D, mapSystemMessage as Dt, REPOSITORY_WALK_IGNORED_NAMES as E, toToolResultText as Et, launchSessionWindow as F, createFileOriginTracker as Ft, SESSION_WINDOWS_FILENAME as G, toSessionClosedEvents as Gt, SESSION_SECRET_BYTE_LENGTH as H, SESSION_LIST_LIMIT as Ht, createWindowDriver as I, createPermissionBridge as It, SESSION_WINDOW_REJOIN_DURATION_MS as J, runMain as Jt, SESSION_WINDOW_CONNECT_TIMEOUT_MS as K, getEventId as Kt, checkIsTokenValid as L, toPermissionResult as Lt, getPublicKeyText as M, createTodoTracker as Mt, getDeviceName as N, TodoToolName as Nt, handleCommand as O, mapTaskMessage as Ot, findDevice as P, createStreamTracker as Pt, childSessionsChangeMessageSchema as Q, HOST_PROBE_TIMEOUT_MS as Qt, takeChildReply as R, toPermissionRequestEvent as Rt, readRepositoryFile as S, NODE_PTY_DIRECTORY_NAME as Sn, toTurnResultEvents as St, REPOSITORY_FILE_MAX_BYTE_LENGTH as T, mapUserContent as Tt, SESSION_SECRET_ENVIRONMENT_VARIABLE as U, SETTING_SOURCES as Ut, sessionWindowsSchema as V, IGNORED_SDK_MESSAGE_TYPES as Vt, SESSION_SUBCOMMAND as W, closeOpenSession as Wt, SessionWindowCloseCode as X, sendToRunningHost as Xt, hashCredential as Y, runDevicesCommand as Yt, childMessageSchema as Z, readMessageText as Zt, createAgentConsoleServer as _, CLAUDE_CODE_EXECUTABLE_FILENAME as _n, toCapabilitiesEvent as _t, checkIsSchemeLaunchTampered as a, writeStateFile as an, ChildMessageType as at, handleShellCommand as b, HOST_INSTALL_DIRECTORY_SEGMENTS as bn, readSessionHistory as bt, sessionCommand as c, HOST_KEY_FILENAME as cn, createClaudeAgentSdkDriver as ct, formatSessionLogLine as d, STATE_DIRECTORY_NAME as dn, readSessionCwd as dt, checkIsSignatureValid as en, childRejoinMessageSchema as et, serveCommand as f, writeLine as fn, listSessionSummaries as ft, getShellFile as g, getHostInstallDirectory as gn, toContextUsageEvent as gt, loadNodePty as h, checkIsHostInstalled as hn, watchSession as ht, getSchemeLaunch as i, readHostKey as in, childCommandErrorMessageSchema as it, answerHttpRequest as j, toUnknownEvent as jt, createPairingCodes as k, mapHookMessage as kt, runSessionChild as l, PRINTED_PAIRING_CODE_DURATION_MS as ln, createTaskRegistry as lt, spawnPtyShell as m, installHost as mn, getClaudeCodeExecutablePath as mt, runConsoleListAgent as n, readDevices as nn, childEventsMessageSchema as nt, uninstallCommand as o, getStateDirectory as on, childMessageTypeSchema as ot, serveHost as p, installDownloadedHost as pn, createSessionOpener as pt, SESSION_WINDOW_RECONNECT_DELAY_MS as q, devicesCommand as qt, CONSOLE_LIST_AGENT_NAME as r, deviceSchema as rn, childCommandResultMessageSchema as rt, uninstallHost as s, DEVICES_FILENAME as sn, createBaseChildMessageSchema as st, agentConsoleServerCommand as t, writeDevices as tn, rejoiningSessionSchema as tt, serveSessionChild as u, SECRET_BYTE_LENGTH as un, toContentBlockParam as ut, createShellRegistry as v, HOST_DIRECTORY_ENVIRONMENT_VARIABLE as vn, getSessionTitle as vt, listRepositoryFiles as w, getReachableHostname as wn, parseMessageBody as wt, handleFileCommand as x, HOST_SCHEME_REGISTRY_KEY as xn, createSdkMessageMapper as xt, sendServerMessage as y, HOST_EXECUTABLE_FILENAME as yn, readToolUseResultMap as yt, sendChildCommand as z, createInputQueue as zt };
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Jt as runMain, t as agentConsoleServerCommand } from "./agentConsoleServerCommand-B7491RR7.js";
|
|
2
2
|
//#region src/cli.ts
|
|
3
3
|
await runMain(agentConsoleServerCommand);
|
|
4
4
|
//#endregion
|
|
@@ -31,10 +31,12 @@ declare enum CommandType {
|
|
|
31
31
|
CreateSession = "CreateSession",
|
|
32
32
|
Fork = "Fork",
|
|
33
33
|
Interrupt = "Interrupt",
|
|
34
|
+
ListFiles = "ListFiles",
|
|
34
35
|
ListSessions = "ListSessions",
|
|
35
36
|
OpenShell = "OpenShell",
|
|
36
37
|
PermissionVerdict = "PermissionVerdict",
|
|
37
38
|
Prompt = "Prompt",
|
|
39
|
+
ReadFile = "ReadFile",
|
|
38
40
|
Resume = "Resume",
|
|
39
41
|
ResumeAt = "ResumeAt",
|
|
40
42
|
RewindFiles = "RewindFiles",
|
|
@@ -259,6 +261,25 @@ declare const stopTaskCommandSchema: z.ZodObject<{
|
|
|
259
261
|
type DriverCommand = BackgroundTasksCommand | CloseSessionCommand | CreateSessionCommand | ForkCommand | InterruptCommand | ListSessionsCommand | PermissionVerdictCommand | PromptCommand | ResumeAtCommand | ResumeCommand | RewindFilesCommand | SetModelCommand | SetPermissionModeCommand | SlashCommandCommand | StopTaskCommand;
|
|
260
262
|
declare const driverCommandSchema: z.ZodDiscriminatedUnion<[typeof backgroundTasksCommandSchema, typeof closeSessionCommandSchema, typeof createSessionCommandSchema, typeof forkCommandSchema, typeof interruptCommandSchema, typeof listSessionsCommandSchema, typeof permissionVerdictCommandSchema, typeof promptCommandSchema, typeof resumeAtCommandSchema, typeof resumeCommandSchema, typeof rewindFilesCommandSchema, typeof setModelCommandSchema, typeof setPermissionModeCommandSchema, typeof slashCommandCommandSchema, typeof stopTaskCommandSchema], "type">;
|
|
261
263
|
//#endregion
|
|
264
|
+
//#region src/models/command/ListFilesCommand.d.ts
|
|
265
|
+
interface ListFilesCommand extends BaseCommand<CommandType.ListFiles>, SessionId {}
|
|
266
|
+
declare const listFilesCommandSchema: z.ZodObject<{
|
|
267
|
+
id: z.ZodString;
|
|
268
|
+
sessionId: z.ZodString;
|
|
269
|
+
type: z.ZodLiteral<CommandType.ListFiles>;
|
|
270
|
+
}>;
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region src/models/command/ReadFileCommand.d.ts
|
|
273
|
+
interface ReadFileCommand extends BaseCommand<CommandType.ReadFile>, SessionId {
|
|
274
|
+
path: string;
|
|
275
|
+
}
|
|
276
|
+
declare const readFileCommandSchema: z.ZodObject<{
|
|
277
|
+
id: z.ZodString;
|
|
278
|
+
path: z.ZodString;
|
|
279
|
+
sessionId: z.ZodString;
|
|
280
|
+
type: z.ZodLiteral<CommandType.ReadFile>;
|
|
281
|
+
}>;
|
|
282
|
+
//#endregion
|
|
262
283
|
//#region src/models/command/TerminalSize.d.ts
|
|
263
284
|
interface TerminalSize {
|
|
264
285
|
cols: number;
|
|
@@ -308,8 +329,8 @@ type ShellCommand = CloseShellCommand | OpenShellCommand | ShellInputCommand | S
|
|
|
308
329
|
declare const shellCommandSchema: z.ZodDiscriminatedUnion<[typeof closeShellCommandSchema, typeof openShellCommandSchema, typeof shellInputCommandSchema, typeof shellResizeCommandSchema], "type">;
|
|
309
330
|
//#endregion
|
|
310
331
|
//#region src/models/command/Command.d.ts
|
|
311
|
-
type Command = DriverCommand | ShellCommand;
|
|
312
|
-
declare const commandSchema: z.ZodDiscriminatedUnion<[...(typeof driverCommandSchema)["options"], ...(typeof shellCommandSchema)["options"]], "type">;
|
|
332
|
+
type Command = DriverCommand | ListFilesCommand | ReadFileCommand | ShellCommand;
|
|
333
|
+
declare const commandSchema: z.ZodDiscriminatedUnion<[...(typeof driverCommandSchema)["options"], ...(typeof shellCommandSchema)["options"], typeof listFilesCommandSchema, typeof readFileCommandSchema], "type">;
|
|
313
334
|
//#endregion
|
|
314
335
|
//#region src/models/event/AgentEventType.d.ts
|
|
315
336
|
declare enum AgentEventType {
|
|
@@ -368,8 +389,18 @@ declare const parentToolUseIdSchema: z.ZodObject<{
|
|
|
368
389
|
parentToolUseId: z.ZodString;
|
|
369
390
|
}>;
|
|
370
391
|
//#endregion
|
|
392
|
+
//#region src/models/event/BaseMessageAgentEvent.d.ts
|
|
393
|
+
interface BaseMessageAgentEvent<T extends AgentEventType> extends BaseAgentEvent<T>, MessageUuid, ParentToolUseId {}
|
|
394
|
+
declare const createBaseMessageAgentEventSchema: <T extends z.ZodType<AgentEventType>>(typeSchema: T) => z.ZodObject<{
|
|
395
|
+
createdAt: z.ZodCoercedDate;
|
|
396
|
+
id: z.ZodString;
|
|
397
|
+
messageUuid: z.ZodString;
|
|
398
|
+
parentToolUseId: z.ZodString;
|
|
399
|
+
type: T;
|
|
400
|
+
}>;
|
|
401
|
+
//#endregion
|
|
371
402
|
//#region src/models/event/AssistantMessageEvent.d.ts
|
|
372
|
-
interface AssistantMessageEvent extends
|
|
403
|
+
interface AssistantMessageEvent extends BaseMessageAgentEvent<AgentEventType.AssistantMessage> {
|
|
373
404
|
text: string;
|
|
374
405
|
}
|
|
375
406
|
declare const assistantMessageEventSchema: z.ZodObject<{
|
|
@@ -717,7 +748,7 @@ declare const subagentEventSchema: z.ZodObject<{
|
|
|
717
748
|
}>;
|
|
718
749
|
//#endregion
|
|
719
750
|
//#region src/models/event/ThinkingEvent.d.ts
|
|
720
|
-
interface ThinkingEvent extends
|
|
751
|
+
interface ThinkingEvent extends BaseMessageAgentEvent<AgentEventType.Thinking> {
|
|
721
752
|
thinking: string;
|
|
722
753
|
}
|
|
723
754
|
declare const thinkingEventSchema: z.ZodObject<{
|
|
@@ -795,7 +826,7 @@ declare const toolResultEventSchema: z.ZodObject<{
|
|
|
795
826
|
}>;
|
|
796
827
|
//#endregion
|
|
797
828
|
//#region src/models/event/ToolUseEvent.d.ts
|
|
798
|
-
interface ToolUseEvent extends
|
|
829
|
+
interface ToolUseEvent extends BaseMessageAgentEvent<AgentEventType.ToolUse> {
|
|
799
830
|
input: Record<string, unknown>;
|
|
800
831
|
name: string;
|
|
801
832
|
toolUseId: string;
|
|
@@ -877,7 +908,7 @@ declare const unknownEventSchema: z.ZodObject<{
|
|
|
877
908
|
}>;
|
|
878
909
|
//#endregion
|
|
879
910
|
//#region src/models/event/UserMessageEvent.d.ts
|
|
880
|
-
interface UserMessageEvent extends
|
|
911
|
+
interface UserMessageEvent extends BaseMessageAgentEvent<AgentEventType.UserMessage> {
|
|
881
912
|
attachmentCount: number;
|
|
882
913
|
text: string;
|
|
883
914
|
}
|
|
@@ -979,6 +1010,8 @@ declare enum ServerMessageType {
|
|
|
979
1010
|
Authenticated = "Authenticated",
|
|
980
1011
|
CommandError = "CommandError",
|
|
981
1012
|
Events = "Events",
|
|
1013
|
+
FileContent = "FileContent",
|
|
1014
|
+
Files = "Files",
|
|
982
1015
|
HostStopping = "HostStopping",
|
|
983
1016
|
Paired = "Paired",
|
|
984
1017
|
Proof = "Proof",
|
|
@@ -1025,6 +1058,32 @@ declare const eventsMessageSchema: z.ZodObject<{
|
|
|
1025
1058
|
type: z.ZodLiteral<ServerMessageType.Events>;
|
|
1026
1059
|
}>;
|
|
1027
1060
|
//#endregion
|
|
1061
|
+
//#region src/models/server/FileContentMessage.d.ts
|
|
1062
|
+
interface FileContentMessage extends BaseServerMessage<ServerMessageType.FileContent> {
|
|
1063
|
+
commandId: string;
|
|
1064
|
+
content: string;
|
|
1065
|
+
notice: string;
|
|
1066
|
+
path: string;
|
|
1067
|
+
}
|
|
1068
|
+
declare const fileContentMessageSchema: z.ZodObject<{
|
|
1069
|
+
commandId: z.ZodString;
|
|
1070
|
+
content: z.ZodString;
|
|
1071
|
+
notice: z.ZodString;
|
|
1072
|
+
path: z.ZodString;
|
|
1073
|
+
type: z.ZodLiteral<ServerMessageType.FileContent>;
|
|
1074
|
+
}>;
|
|
1075
|
+
//#endregion
|
|
1076
|
+
//#region src/models/server/FilesMessage.d.ts
|
|
1077
|
+
interface FilesMessage extends BaseServerMessage<ServerMessageType.Files> {
|
|
1078
|
+
commandId: string;
|
|
1079
|
+
files: string[];
|
|
1080
|
+
}
|
|
1081
|
+
declare const filesMessageSchema: z.ZodObject<{
|
|
1082
|
+
commandId: z.ZodString;
|
|
1083
|
+
files: z.ZodArray<z.ZodString>;
|
|
1084
|
+
type: z.ZodLiteral<ServerMessageType.Files>;
|
|
1085
|
+
}>;
|
|
1086
|
+
//#endregion
|
|
1028
1087
|
//#region src/models/server/HostCloseCode.d.ts
|
|
1029
1088
|
declare enum HostCloseCode {
|
|
1030
1089
|
HandshakeRefused = 4400,
|
|
@@ -1142,8 +1201,8 @@ declare const shellOutputMessageSchema: z.ZodObject<{
|
|
|
1142
1201
|
}>;
|
|
1143
1202
|
//#endregion
|
|
1144
1203
|
//#region src/models/server/ServerMessage.d.ts
|
|
1145
|
-
type ServerMessage = AuthenticatedMessage | CommandErrorMessage | EventsMessage | HostStoppingMessage | PairedMessage | ProofMessage | SessionOpenedMessage | SessionResetMessage | SessionsMessage | ShellClosedMessage | ShellOpenedMessage | ShellOutputMessage;
|
|
1146
|
-
declare const serverMessageSchema: z.ZodDiscriminatedUnion<[typeof authenticatedMessageSchema, typeof commandErrorMessageSchema, typeof eventsMessageSchema, typeof hostStoppingMessageSchema, typeof pairedMessageSchema, typeof proofMessageSchema, typeof sessionOpenedMessageSchema, typeof sessionResetMessageSchema, typeof sessionsMessageSchema, typeof shellClosedMessageSchema, typeof shellOpenedMessageSchema, typeof shellOutputMessageSchema], "type">;
|
|
1204
|
+
type ServerMessage = AuthenticatedMessage | CommandErrorMessage | EventsMessage | FileContentMessage | FilesMessage | HostStoppingMessage | PairedMessage | ProofMessage | SessionOpenedMessage | SessionResetMessage | SessionsMessage | ShellClosedMessage | ShellOpenedMessage | ShellOutputMessage;
|
|
1205
|
+
declare const serverMessageSchema: z.ZodDiscriminatedUnion<[typeof authenticatedMessageSchema, typeof commandErrorMessageSchema, typeof eventsMessageSchema, typeof fileContentMessageSchema, typeof filesMessageSchema, typeof hostStoppingMessageSchema, typeof pairedMessageSchema, typeof proofMessageSchema, typeof sessionOpenedMessageSchema, typeof sessionResetMessageSchema, typeof sessionsMessageSchema, typeof shellClosedMessageSchema, typeof shellOpenedMessageSchema, typeof shellOutputMessageSchema], "type">;
|
|
1147
1206
|
//#endregion
|
|
1148
1207
|
//#region src/services/constants.d.ts
|
|
1149
1208
|
declare const DEFAULT_APP_ORIGIN = "https://esposter.com";
|
|
@@ -1153,9 +1212,9 @@ declare const HOST_SCHEME: string;
|
|
|
1153
1212
|
declare const PAIRING_CODE_PARAMETER = "code";
|
|
1154
1213
|
declare const PAIRING_HASH_PARAMETER = "host";
|
|
1155
1214
|
declare const SHELL_OUTPUT_LENGTH = 1e5;
|
|
1156
|
-
declare const
|
|
1215
|
+
declare const SCHEME_PAIRING_CODE_DURATION_MS: number;
|
|
1157
1216
|
//#endregion
|
|
1158
1217
|
//#region src/services/handshake/getSignedText.d.ts
|
|
1159
1218
|
declare const getSignedText: (purpose: SignaturePurpose, port: number, nonce: string) => string;
|
|
1160
1219
|
//#endregion
|
|
1161
|
-
export {
|
|
1220
|
+
export { PairMessage as $, readFileCommandSchema as $n, mcpServerSchema as $t, HostStoppingMessage as A, BaseMessageAgentEvent as An, ForkCommand as Ar, TodoUpdateEvent as At, commandErrorMessageSchema as B, Command as Bn, BackgroundTasksCommand as Br, SubagentStatus as Bt, sessionResetMessageSchema as C, capabilitiesEventSchema as Cn, permissionVerdictCommandSchema as Cr, tokenUsageSchema as Ct, proofMessageSchema as D, modelSchema as Dn, listSessionsCommandSchema as Dr, toolResultEventSchema as Dt, ProofMessage as E, Model as En, ListSessionsCommand as Er, ToolResultEvent as Et, FileContentMessage as F, messageUuidSchema as Fn, closeShellCommandSchema as Fr, todoStatusSchema as Ft, ServerMessageType as G, shellResizeCommandSchema as Gn, createBaseCommandSchema as Gr, sessionStateEventSchema as Gt, authenticatedMessageSchema as H, ShellCommand as Hn, SessionId as Hr, StreamDeltaEvent as Ht, fileContentMessageSchema as I, BaseAgentEvent as In, ShellId as Ir, ThinkingEvent as It, signaturePurposeSchema as J, OpenShellCommand as Jn, Attachment as Jr, SessionSettingsEvent as Jt, serverMessageTypeSchema as K, ShellInputCommand as Kn, CommandType as Kr, SessionState as Kt, EventsMessage as L, createBaseAgentEventSchema as Ln, shellIdSchema as Lr, thinkingEventSchema as Lt, HostCloseCode as M, ParentToolUseId as Mn, CreateSessionCommand as Mr, Todo as Mt, FilesMessage as N, parentToolUseIdSchema as Nn, createSessionCommandSchema as Nr, todoSchema as Nt, PairedMessage as O, AssistantMessageEvent as On, InterruptCommand as Or, ToolProgressEvent as Ot, filesMessageSchema as P, MessageUuid as Pn, CloseShellCommand as Pr, TodoStatus as Pt, revokeMessageSchema as Q, ReadFileCommand as Qn, McpServer as Qt, eventsMessageSchema as R, AgentEventType as Rn, CloseSessionCommand as Rr, SubagentEvent as Rt, SessionResetMessage as S, CapabilitiesEvent as Sn, PermissionVerdictCommand as Sr, TokenUsage as St, sessionOpenedMessageSchema as T, slashCommandSchema as Tn, permissionBehaviorSchema as Tr, toolUseEventSchema as Tt, BaseServerMessage as U, shellCommandSchema as Un, sessionIdSchema as Ur, streamDeltaEventSchema as Ut, AuthenticatedMessage as V, commandSchema as Vn, backgroundTasksCommandSchema as Vr, subagentStatusSchema as Vt, createBaseServerMessageSchema as W, ShellResizeCommand as Wn, BaseCommand as Wr, SessionStateEvent as Wt, handshakeMessageSchema as X, TerminalSize as Xn, AttachmentMediaType as Xr, SessionInitEvent as Xt, HandshakeMessage as Y, openShellCommandSchema as Yn, attachmentSchema as Yr, sessionSettingsEventSchema as Yt, RevokeMessage as Z, terminalSizeSchema as Zn, attachmentMediaTypeSchema as Zr, sessionInitEventSchema as Zt, shellClosedMessageSchema as _, compactionEventSchema as _n, resumeCommandSchema as _r, unknownEventSchema as _t, HOST_SCHEME as a, permissionRequestEventSchema as an, stopTaskCommandSchema as ar, AuthenticateMessage as at, SessionSummary as b, CommandOutputEvent as bn, PromptCommand as br, TurnResultEvent as bt, SCHEME_PAIRING_CODE_DURATION_MS as c, HookEvent as cn, SetPermissionModeCommand as cr, createBaseHandshakeMessageSchema as ct, serverMessageSchema as d, hookPhaseSchema as dn, permissionModeSchema as dr, EphemeralAgentEventTypes as dt, RateLimitEvent as en, ListFilesCommand as er, pairMessageSchema as et, ShellOutputMessage as f, FileRewindEvent as fn, SetModelCommand as fr, AgentEvent as ft, ShellClosedMessage as g, CompactionEvent as gn, ResumeCommand as gr, UnknownEvent as gt, shellOpenedMessageSchema as h, contextUsageEventSchema as hn, rewindFilesCommandSchema as hr, userMessageEventSchema as ht, DEFAULT_PORT as i, PermissionRequestEvent as in, StopTaskCommand as ir, challengeMessageSchema as it, hostStoppingMessageSchema as j, createBaseMessageAgentEventSchema as jn, forkCommandSchema as jr, todoUpdateEventSchema as jt, pairedMessageSchema as k, assistantMessageEventSchema as kn, interruptCommandSchema as kr, toolProgressEventSchema as kt, SHELL_OUTPUT_LENGTH as l, hookEventSchema as ln, setPermissionModeCommandSchema as lr, HandshakeMessageType as lt, ShellOpenedMessage as m, ContextUsageEvent as mn, RewindFilesCommand as mr, UserMessageEvent as mt, DEFAULT_APP_ORIGIN as n, PermissionResolutionEvent as nn, DriverCommand as nr, handOffMessageSchema as nt, PAIRING_CODE_PARAMETER as o, HostErrorEvent as on, SlashCommandCommand as or, authenticateMessageSchema as ot, shellOutputMessageSchema as p, fileRewindEventSchema as pn, setModelCommandSchema as pr, agentEventSchema as pt, SignaturePurpose as q, shellInputCommandSchema as qn, commandTypeSchema as qr, sessionStateSchema as qt, DEFAULT_HOSTNAME as r, permissionResolutionEventSchema as rn, driverCommandSchema as rr, ChallengeMessage as rt, PAIRING_HASH_PARAMETER as s, hostErrorEventSchema as sn, slashCommandCommandSchema as sr, BaseHandshakeMessage as st, getSignedText as t, rateLimitEventSchema as tn, listFilesCommandSchema as tr, HandOffMessage as tt, ServerMessage as u, HookPhase as un, PermissionMode as ur, handshakeMessageTypeSchema as ut, SessionsMessage as v, CompactionTrigger as vn, ResumeAtCommand as vr, TurnUsageEvent as vt, SessionOpenedMessage as w, SlashCommand as wn, PermissionBehavior as wr, ToolUseEvent as wt, sessionSummarySchema as x, commandOutputEventSchema as xn, promptCommandSchema as xr, turnResultEventSchema as xt, sessionsMessageSchema as y, compactionTriggerSchema as yn, resumeAtCommandSchema as yr, turnUsageEventSchema as yt, CommandErrorMessage as z, agentEventTypeSchema as zn, closeSessionCommandSchema as zr, subagentEventSchema as zt };
|
package/dist/contracts.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { AgentEvent, AgentEventType, AssistantMessageEvent, Attachment, AttachmentMediaType, AuthenticateMessage, AuthenticatedMessage, BackgroundTasksCommand, BaseAgentEvent, BaseCommand, BaseHandshakeMessage, BaseServerMessage, CapabilitiesEvent, ChallengeMessage, CloseSessionCommand, CloseShellCommand, Command, CommandErrorMessage, CommandOutputEvent, CommandType, CompactionEvent, CompactionTrigger, ContextUsageEvent, CreateSessionCommand, DEFAULT_APP_ORIGIN, DEFAULT_HOSTNAME, DEFAULT_PORT, DriverCommand, EphemeralAgentEventTypes, EventsMessage, FileRewindEvent, ForkCommand, HOST_SCHEME, HandOffMessage, HandshakeMessage, HandshakeMessageType, HookEvent, HookPhase, HostCloseCode, HostErrorEvent, HostStoppingMessage, InterruptCommand, ListSessionsCommand, McpServer, MessageUuid, Model, OpenShellCommand, PAIRING_CODE_PARAMETER, PAIRING_HASH_PARAMETER, PairMessage, PairedMessage, ParentToolUseId, PermissionBehavior, PermissionMode, PermissionRequestEvent, PermissionResolutionEvent, PermissionVerdictCommand, PromptCommand, ProofMessage, RateLimitEvent, ResumeAtCommand, ResumeCommand, RevokeMessage, RewindFilesCommand,
|
|
1
|
+
import { $ as PairMessage, $n as readFileCommandSchema, $t as mcpServerSchema, A as HostStoppingMessage, Ar as ForkCommand, At as TodoUpdateEvent, B as commandErrorMessageSchema, Bn as Command, Br as BackgroundTasksCommand, Bt as SubagentStatus, C as sessionResetMessageSchema, Cn as capabilitiesEventSchema, Cr as permissionVerdictCommandSchema, Ct as tokenUsageSchema, D as proofMessageSchema, Dn as modelSchema, Dr as listSessionsCommandSchema, Dt as toolResultEventSchema, E as ProofMessage, En as Model, Er as ListSessionsCommand, Et as ToolResultEvent, F as FileContentMessage, Fn as messageUuidSchema, Fr as closeShellCommandSchema, Ft as todoStatusSchema, G as ServerMessageType, Gn as shellResizeCommandSchema, Gr as createBaseCommandSchema, Gt as sessionStateEventSchema, H as authenticatedMessageSchema, Hn as ShellCommand, Hr as SessionId, Ht as StreamDeltaEvent, I as fileContentMessageSchema, In as BaseAgentEvent, Ir as ShellId, It as ThinkingEvent, J as signaturePurposeSchema, Jn as OpenShellCommand, Jr as Attachment, Jt as SessionSettingsEvent, K as serverMessageTypeSchema, Kn as ShellInputCommand, Kr as CommandType, Kt as SessionState, L as EventsMessage, Ln as createBaseAgentEventSchema, Lr as shellIdSchema, Lt as thinkingEventSchema, M as HostCloseCode, Mn as ParentToolUseId, Mr as CreateSessionCommand, Mt as Todo, N as FilesMessage, Nn as parentToolUseIdSchema, Nr as createSessionCommandSchema, Nt as todoSchema, O as PairedMessage, On as AssistantMessageEvent, Or as InterruptCommand, Ot as ToolProgressEvent, P as filesMessageSchema, Pn as MessageUuid, Pr as CloseShellCommand, Pt as TodoStatus, Q as revokeMessageSchema, Qn as ReadFileCommand, Qt as McpServer, R as eventsMessageSchema, Rn as AgentEventType, Rr as CloseSessionCommand, Rt as SubagentEvent, S as SessionResetMessage, Sn as CapabilitiesEvent, Sr as PermissionVerdictCommand, St as TokenUsage, T as sessionOpenedMessageSchema, Tn as slashCommandSchema, Tr as permissionBehaviorSchema, Tt as toolUseEventSchema, U as BaseServerMessage, Un as shellCommandSchema, Ur as sessionIdSchema, Ut as streamDeltaEventSchema, V as AuthenticatedMessage, Vn as commandSchema, Vr as backgroundTasksCommandSchema, Vt as subagentStatusSchema, W as createBaseServerMessageSchema, Wn as ShellResizeCommand, Wr as BaseCommand, Wt as SessionStateEvent, X as handshakeMessageSchema, Xn as TerminalSize, Xr as AttachmentMediaType, Xt as SessionInitEvent, Y as HandshakeMessage, Yn as openShellCommandSchema, Yr as attachmentSchema, Yt as sessionSettingsEventSchema, Z as RevokeMessage, Zn as terminalSizeSchema, Zr as attachmentMediaTypeSchema, Zt as sessionInitEventSchema, _ as shellClosedMessageSchema, _n as compactionEventSchema, _r as resumeCommandSchema, _t as unknownEventSchema, a as HOST_SCHEME, an as permissionRequestEventSchema, ar as stopTaskCommandSchema, at as AuthenticateMessage, b as SessionSummary, bn as CommandOutputEvent, br as PromptCommand, bt as TurnResultEvent, c as SCHEME_PAIRING_CODE_DURATION_MS, cn as HookEvent, cr as SetPermissionModeCommand, ct as createBaseHandshakeMessageSchema, d as serverMessageSchema, dn as hookPhaseSchema, dr as permissionModeSchema, dt as EphemeralAgentEventTypes, en as RateLimitEvent, er as ListFilesCommand, et as pairMessageSchema, f as ShellOutputMessage, fn as FileRewindEvent, fr as SetModelCommand, ft as AgentEvent, g as ShellClosedMessage, gn as CompactionEvent, gr as ResumeCommand, gt as UnknownEvent, h as shellOpenedMessageSchema, hn as contextUsageEventSchema, hr as rewindFilesCommandSchema, ht as userMessageEventSchema, i as DEFAULT_PORT, in as PermissionRequestEvent, ir as StopTaskCommand, it as challengeMessageSchema, j as hostStoppingMessageSchema, jr as forkCommandSchema, jt as todoUpdateEventSchema, k as pairedMessageSchema, kn as assistantMessageEventSchema, kr as interruptCommandSchema, kt as toolProgressEventSchema, l as SHELL_OUTPUT_LENGTH, ln as hookEventSchema, lr as setPermissionModeCommandSchema, lt as HandshakeMessageType, m as ShellOpenedMessage, mn as ContextUsageEvent, mr as RewindFilesCommand, mt as UserMessageEvent, n as DEFAULT_APP_ORIGIN, nn as PermissionResolutionEvent, nr as DriverCommand, nt as handOffMessageSchema, o as PAIRING_CODE_PARAMETER, on as HostErrorEvent, or as SlashCommandCommand, ot as authenticateMessageSchema, p as shellOutputMessageSchema, pn as fileRewindEventSchema, pr as setModelCommandSchema, pt as agentEventSchema, q as SignaturePurpose, qn as shellInputCommandSchema, qr as commandTypeSchema, qt as sessionStateSchema, r as DEFAULT_HOSTNAME, rn as permissionResolutionEventSchema, rr as driverCommandSchema, rt as ChallengeMessage, s as PAIRING_HASH_PARAMETER, sn as hostErrorEventSchema, sr as slashCommandCommandSchema, st as BaseHandshakeMessage, t as getSignedText, tn as rateLimitEventSchema, tr as listFilesCommandSchema, tt as HandOffMessage, u as ServerMessage, un as HookPhase, ur as PermissionMode, ut as handshakeMessageTypeSchema, v as SessionsMessage, vn as CompactionTrigger, vr as ResumeAtCommand, vt as TurnUsageEvent, w as SessionOpenedMessage, wn as SlashCommand, wr as PermissionBehavior, wt as ToolUseEvent, x as sessionSummarySchema, xn as commandOutputEventSchema, xr as promptCommandSchema, xt as turnResultEventSchema, y as sessionsMessageSchema, yn as compactionTriggerSchema, yr as resumeAtCommandSchema, yt as turnUsageEventSchema, z as CommandErrorMessage, zn as agentEventTypeSchema, zr as closeSessionCommandSchema, zt as subagentEventSchema } from "./contracts-DPknvuKq.js";
|
|
2
|
+
export { AgentEvent, AgentEventType, AssistantMessageEvent, Attachment, AttachmentMediaType, AuthenticateMessage, AuthenticatedMessage, BackgroundTasksCommand, BaseAgentEvent, BaseCommand, BaseHandshakeMessage, BaseServerMessage, CapabilitiesEvent, ChallengeMessage, CloseSessionCommand, CloseShellCommand, Command, CommandErrorMessage, CommandOutputEvent, CommandType, CompactionEvent, CompactionTrigger, ContextUsageEvent, CreateSessionCommand, DEFAULT_APP_ORIGIN, DEFAULT_HOSTNAME, DEFAULT_PORT, DriverCommand, EphemeralAgentEventTypes, EventsMessage, FileContentMessage, FileRewindEvent, FilesMessage, ForkCommand, HOST_SCHEME, HandOffMessage, HandshakeMessage, HandshakeMessageType, HookEvent, HookPhase, HostCloseCode, HostErrorEvent, HostStoppingMessage, InterruptCommand, ListFilesCommand, ListSessionsCommand, McpServer, MessageUuid, Model, OpenShellCommand, PAIRING_CODE_PARAMETER, PAIRING_HASH_PARAMETER, PairMessage, PairedMessage, ParentToolUseId, PermissionBehavior, PermissionMode, PermissionRequestEvent, PermissionResolutionEvent, PermissionVerdictCommand, PromptCommand, ProofMessage, RateLimitEvent, ReadFileCommand, ResumeAtCommand, ResumeCommand, RevokeMessage, RewindFilesCommand, SCHEME_PAIRING_CODE_DURATION_MS, SHELL_OUTPUT_LENGTH, ServerMessage, ServerMessageType, SessionId, SessionInitEvent, SessionOpenedMessage, SessionResetMessage, SessionSettingsEvent, SessionState, SessionStateEvent, SessionSummary, SessionsMessage, SetModelCommand, SetPermissionModeCommand, ShellClosedMessage, ShellCommand, ShellId, ShellInputCommand, ShellOpenedMessage, ShellOutputMessage, ShellResizeCommand, SignaturePurpose, SlashCommand, SlashCommandCommand, StopTaskCommand, StreamDeltaEvent, SubagentEvent, SubagentStatus, TerminalSize, ThinkingEvent, Todo, TodoStatus, TodoUpdateEvent, TokenUsage, ToolProgressEvent, ToolResultEvent, ToolUseEvent, TurnResultEvent, TurnUsageEvent, UnknownEvent, UserMessageEvent, agentEventSchema, agentEventTypeSchema, assistantMessageEventSchema, attachmentMediaTypeSchema, attachmentSchema, authenticateMessageSchema, authenticatedMessageSchema, backgroundTasksCommandSchema, capabilitiesEventSchema, challengeMessageSchema, closeSessionCommandSchema, closeShellCommandSchema, commandErrorMessageSchema, commandOutputEventSchema, commandSchema, commandTypeSchema, compactionEventSchema, compactionTriggerSchema, contextUsageEventSchema, createBaseAgentEventSchema, createBaseCommandSchema, createBaseHandshakeMessageSchema, createBaseServerMessageSchema, createSessionCommandSchema, driverCommandSchema, eventsMessageSchema, fileContentMessageSchema, fileRewindEventSchema, filesMessageSchema, forkCommandSchema, getSignedText, handOffMessageSchema, handshakeMessageSchema, handshakeMessageTypeSchema, hookEventSchema, hookPhaseSchema, hostErrorEventSchema, hostStoppingMessageSchema, interruptCommandSchema, listFilesCommandSchema, listSessionsCommandSchema, mcpServerSchema, messageUuidSchema, modelSchema, openShellCommandSchema, pairMessageSchema, pairedMessageSchema, parentToolUseIdSchema, permissionBehaviorSchema, permissionModeSchema, permissionRequestEventSchema, permissionResolutionEventSchema, permissionVerdictCommandSchema, promptCommandSchema, proofMessageSchema, rateLimitEventSchema, readFileCommandSchema, resumeAtCommandSchema, resumeCommandSchema, revokeMessageSchema, rewindFilesCommandSchema, serverMessageSchema, serverMessageTypeSchema, sessionIdSchema, sessionInitEventSchema, sessionOpenedMessageSchema, sessionResetMessageSchema, sessionSettingsEventSchema, sessionStateEventSchema, sessionStateSchema, sessionSummarySchema, sessionsMessageSchema, setModelCommandSchema, setPermissionModeCommandSchema, shellClosedMessageSchema, shellCommandSchema, shellIdSchema, shellInputCommandSchema, shellOpenedMessageSchema, shellOutputMessageSchema, shellResizeCommandSchema, signaturePurposeSchema, slashCommandCommandSchema, slashCommandSchema, stopTaskCommandSchema, streamDeltaEventSchema, subagentEventSchema, subagentStatusSchema, terminalSizeSchema, thinkingEventSchema, todoSchema, todoStatusSchema, todoUpdateEventSchema, tokenUsageSchema, toolProgressEventSchema, toolResultEventSchema, toolUseEventSchema, turnResultEventSchema, turnUsageEventSchema, unknownEventSchema, userMessageEventSchema };
|
package/dist/contracts.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export { $t as AgentEventType, B as AttachmentMediaType, R as CommandType, Ht as CompactionTrigger, un as DEFAULT_APP_ORIGIN, dn as DEFAULT_HOSTNAME, fn as DEFAULT_PORT, t as EphemeralAgentEventTypes, pn as HOST_SCHEME, cn as HandshakeMessageType, Lt as HookPhase, n as HostCloseCode, mn as PAIRING_CODE_PARAMETER, hn as PAIRING_HASH_PARAMETER, Mt as PermissionBehavior, Dt as PermissionMode, gn as SCHEME_PAIRING_CODE_DURATION_MS, _n as SHELL_OUTPUT_LENGTH, rn as ServerMessageType, Ct as SessionState, on as SignaturePurpose, yt as SubagentStatus, ht as TodoStatus, it as agentEventSchema, en as agentEventTypeSchema, Jt as assistantMessageEventSchema, V as attachmentMediaTypeSchema, O as attachmentSchema, c as authenticateMessageSchema, nn as authenticatedMessageSchema, F as backgroundTasksCommandSchema, Gt as capabilitiesEventSchema, s as challengeMessageSchema, P as closeSessionCommandSchema, g as closeShellCommandSchema, tn as commandErrorMessageSchema, Wt as commandOutputEventSchema, u as commandSchema, z as commandTypeSchema, Vt as compactionEventSchema, Ut as compactionTriggerSchema, Bt as contextUsageEventSchema, Qt as createBaseAgentEventSchema, L as createBaseCommandSchema, l as createBaseHandshakeMessageSchema, an as createBaseServerMessageSchema, N as createSessionCommandSchema, y as driverCommandSchema, rt as eventsMessageSchema, nt as fileContentMessageSchema, zt as fileRewindEventSchema, tt as filesMessageSchema, M as forkCommandSchema, H as getSignedText, o as handOffMessageSchema, r as handshakeMessageSchema, ln as handshakeMessageTypeSchema, It as hookEventSchema, Rt as hookPhaseSchema, Ft as hostErrorEventSchema, et as hostStoppingMessageSchema, j as interruptCommandSchema, v as listFilesCommandSchema, A as listSessionsCommandSchema, kt as mcpServerSchema, Zt as messageUuidSchema, qt as modelSchema, m as openShellCommandSchema, a as pairMessageSchema, $ as pairedMessageSchema, Xt as parentToolUseIdSchema, Nt as permissionBehaviorSchema, Ot as permissionModeSchema, Pt as permissionRequestEventSchema, jt as permissionResolutionEventSchema, k as permissionVerdictCommandSchema, D as promptCommandSchema, Q as proofMessageSchema, At as rateLimitEventSchema, _ as readFileCommandSchema, E as resumeAtCommandSchema, T as resumeCommandSchema, i as revokeMessageSchema, w as rewindFilesCommandSchema, U as serverMessageSchema, in as serverMessageTypeSchema, I as sessionIdSchema, Et as sessionInitEventSchema, Z as sessionOpenedMessageSchema, X as sessionResetMessageSchema, Tt as sessionSettingsEventSchema, St as sessionStateEventSchema, wt as sessionStateSchema, Y as sessionSummarySchema, J as sessionsMessageSchema, C as setModelCommandSchema, S as setPermissionModeCommandSchema, K as shellClosedMessageSchema, d as shellCommandSchema, q as shellIdSchema, p as shellInputCommandSchema, G as shellOpenedMessageSchema, W as shellOutputMessageSchema, f as shellResizeCommandSchema, sn as signaturePurposeSchema, x as slashCommandCommandSchema, Kt as slashCommandSchema, b as stopTaskCommandSchema, xt as streamDeltaEventSchema, vt as subagentEventSchema, bt as subagentStatusSchema, h as terminalSizeSchema, _t as thinkingEventSchema, mt as todoSchema, gt as todoStatusSchema, pt as todoUpdateEventSchema, lt as tokenUsageSchema, ft as toolProgressEventSchema, dt as toolResultEventSchema, ut as toolUseEventSchema, ct as turnResultEventSchema, st as turnUsageEventSchema, ot as unknownEventSchema, at as userMessageEventSchema } from "./EphemeralAgentEventTypes-Spjnk48Y.js";
|
|
2
2
|
import "./contracts-la_KkjCS.js";
|
|
3
|
-
export { AgentEventType, AttachmentMediaType, CommandType, CompactionTrigger, DEFAULT_APP_ORIGIN, DEFAULT_HOSTNAME, DEFAULT_PORT, EphemeralAgentEventTypes, HOST_SCHEME, HandshakeMessageType, HookPhase, HostCloseCode, PAIRING_CODE_PARAMETER, PAIRING_HASH_PARAMETER, PermissionBehavior, PermissionMode, SCHEME_PAIRING_CODE_DURATION, SHELL_OUTPUT_LENGTH, ServerMessageType, SessionState, SignaturePurpose, SubagentStatus, TodoStatus, agentEventSchema, agentEventTypeSchema, assistantMessageEventSchema, attachmentMediaTypeSchema, attachmentSchema, authenticateMessageSchema, authenticatedMessageSchema, backgroundTasksCommandSchema, capabilitiesEventSchema, challengeMessageSchema, closeSessionCommandSchema, closeShellCommandSchema, commandErrorMessageSchema, commandOutputEventSchema, commandSchema, commandTypeSchema, compactionEventSchema, compactionTriggerSchema, contextUsageEventSchema, createBaseAgentEventSchema, createBaseCommandSchema, createBaseHandshakeMessageSchema, createBaseServerMessageSchema, createSessionCommandSchema, driverCommandSchema, eventsMessageSchema, fileRewindEventSchema, forkCommandSchema, getSignedText, handOffMessageSchema, handshakeMessageSchema, handshakeMessageTypeSchema, hookEventSchema, hookPhaseSchema, hostErrorEventSchema, hostStoppingMessageSchema, interruptCommandSchema, listSessionsCommandSchema, mcpServerSchema, messageUuidSchema, modelSchema, openShellCommandSchema, pairMessageSchema, pairedMessageSchema, parentToolUseIdSchema, permissionBehaviorSchema, permissionModeSchema, permissionRequestEventSchema, permissionResolutionEventSchema, permissionVerdictCommandSchema, promptCommandSchema, proofMessageSchema, rateLimitEventSchema, resumeAtCommandSchema, resumeCommandSchema, revokeMessageSchema, rewindFilesCommandSchema, serverMessageSchema, serverMessageTypeSchema, sessionIdSchema, sessionInitEventSchema, sessionOpenedMessageSchema, sessionResetMessageSchema, sessionSettingsEventSchema, sessionStateEventSchema, sessionStateSchema, sessionSummarySchema, sessionsMessageSchema, setModelCommandSchema, setPermissionModeCommandSchema, shellClosedMessageSchema, shellCommandSchema, shellIdSchema, shellInputCommandSchema, shellOpenedMessageSchema, shellOutputMessageSchema, shellResizeCommandSchema, signaturePurposeSchema, slashCommandCommandSchema, slashCommandSchema, stopTaskCommandSchema, streamDeltaEventSchema, subagentEventSchema, subagentStatusSchema, terminalSizeSchema, thinkingEventSchema, todoSchema, todoStatusSchema, todoUpdateEventSchema, tokenUsageSchema, toolProgressEventSchema, toolResultEventSchema, toolUseEventSchema, turnResultEventSchema, turnUsageEventSchema, unknownEventSchema, userMessageEventSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as PairMessage, $n as readFileCommandSchema, $t as mcpServerSchema, A as HostStoppingMessage, An as BaseMessageAgentEvent, Ar as ForkCommand, At as TodoUpdateEvent, B as commandErrorMessageSchema, Bn as Command, Br as BackgroundTasksCommand, Bt as SubagentStatus, C as sessionResetMessageSchema, Cn as capabilitiesEventSchema, Cr as permissionVerdictCommandSchema, Ct as tokenUsageSchema, D as proofMessageSchema, Dn as modelSchema, Dr as listSessionsCommandSchema, Dt as toolResultEventSchema, E as ProofMessage, En as Model, Er as ListSessionsCommand, Et as ToolResultEvent, F as FileContentMessage, Fn as messageUuidSchema, Fr as closeShellCommandSchema, Ft as todoStatusSchema, G as ServerMessageType, Gn as shellResizeCommandSchema, Gr as createBaseCommandSchema, Gt as sessionStateEventSchema, H as authenticatedMessageSchema, Hn as ShellCommand, Hr as SessionId, Ht as StreamDeltaEvent, I as fileContentMessageSchema, In as BaseAgentEvent, Ir as ShellId, It as ThinkingEvent, J as signaturePurposeSchema, Jn as OpenShellCommand, Jr as Attachment, Jt as SessionSettingsEvent, K as serverMessageTypeSchema, Kn as ShellInputCommand, Kr as CommandType, Kt as SessionState, L as EventsMessage, Ln as createBaseAgentEventSchema, Lr as shellIdSchema, Lt as thinkingEventSchema, M as HostCloseCode, Mn as ParentToolUseId, Mr as CreateSessionCommand, Mt as Todo, N as FilesMessage, Nn as parentToolUseIdSchema, Nr as createSessionCommandSchema, Nt as todoSchema, O as PairedMessage, On as AssistantMessageEvent, Or as InterruptCommand, Ot as ToolProgressEvent, P as filesMessageSchema, Pn as MessageUuid, Pr as CloseShellCommand, Pt as TodoStatus, Q as revokeMessageSchema, Qn as ReadFileCommand, Qt as McpServer, R as eventsMessageSchema, Rn as AgentEventType, Rr as CloseSessionCommand, Rt as SubagentEvent, S as SessionResetMessage, Sn as CapabilitiesEvent, Sr as PermissionVerdictCommand, St as TokenUsage, T as sessionOpenedMessageSchema, Tn as slashCommandSchema, Tr as permissionBehaviorSchema, Tt as toolUseEventSchema, U as BaseServerMessage, Un as shellCommandSchema, Ur as sessionIdSchema, Ut as streamDeltaEventSchema, V as AuthenticatedMessage, Vn as commandSchema, Vr as backgroundTasksCommandSchema, Vt as subagentStatusSchema, W as createBaseServerMessageSchema, Wn as ShellResizeCommand, Wr as BaseCommand, Wt as SessionStateEvent, X as handshakeMessageSchema, Xn as TerminalSize, Xr as AttachmentMediaType, Xt as SessionInitEvent, Y as HandshakeMessage, Yn as openShellCommandSchema, Yr as attachmentSchema, Yt as sessionSettingsEventSchema, Z as RevokeMessage, Zn as terminalSizeSchema, Zr as attachmentMediaTypeSchema, Zt as sessionInitEventSchema, _ as shellClosedMessageSchema, _n as compactionEventSchema, _r as resumeCommandSchema, _t as unknownEventSchema, a as HOST_SCHEME, an as permissionRequestEventSchema, ar as stopTaskCommandSchema, at as AuthenticateMessage, b as SessionSummary, bn as CommandOutputEvent, br as PromptCommand, bt as TurnResultEvent, c as SCHEME_PAIRING_CODE_DURATION_MS, cn as HookEvent, cr as SetPermissionModeCommand, ct as createBaseHandshakeMessageSchema, d as serverMessageSchema, dn as hookPhaseSchema, dr as permissionModeSchema, dt as EphemeralAgentEventTypes, en as RateLimitEvent, er as ListFilesCommand, et as pairMessageSchema, f as ShellOutputMessage, fn as FileRewindEvent, fr as SetModelCommand, ft as AgentEvent, g as ShellClosedMessage, gn as CompactionEvent, gr as ResumeCommand, gt as UnknownEvent, h as shellOpenedMessageSchema, hn as contextUsageEventSchema, hr as rewindFilesCommandSchema, ht as userMessageEventSchema, i as DEFAULT_PORT, in as PermissionRequestEvent, ir as StopTaskCommand, it as challengeMessageSchema, j as hostStoppingMessageSchema, jn as createBaseMessageAgentEventSchema, jr as forkCommandSchema, jt as todoUpdateEventSchema, k as pairedMessageSchema, kn as assistantMessageEventSchema, kr as interruptCommandSchema, kt as toolProgressEventSchema, l as SHELL_OUTPUT_LENGTH, ln as hookEventSchema, lr as setPermissionModeCommandSchema, lt as HandshakeMessageType, m as ShellOpenedMessage, mn as ContextUsageEvent, mr as RewindFilesCommand, mt as UserMessageEvent, n as DEFAULT_APP_ORIGIN, nn as PermissionResolutionEvent, nr as DriverCommand, nt as handOffMessageSchema, o as PAIRING_CODE_PARAMETER, on as HostErrorEvent, or as SlashCommandCommand, ot as authenticateMessageSchema, p as shellOutputMessageSchema, pn as fileRewindEventSchema, pr as setModelCommandSchema, pt as agentEventSchema, q as SignaturePurpose, qn as shellInputCommandSchema, qr as commandTypeSchema, qt as sessionStateSchema, r as DEFAULT_HOSTNAME, rn as permissionResolutionEventSchema, rr as driverCommandSchema, rt as ChallengeMessage, s as PAIRING_HASH_PARAMETER, sn as hostErrorEventSchema, sr as slashCommandCommandSchema, st as BaseHandshakeMessage, t as getSignedText, tn as rateLimitEventSchema, tr as listFilesCommandSchema, tt as HandOffMessage, u as ServerMessage, un as HookPhase, ur as PermissionMode, ut as handshakeMessageTypeSchema, v as SessionsMessage, vn as CompactionTrigger, vr as ResumeAtCommand, vt as TurnUsageEvent, w as SessionOpenedMessage, wn as SlashCommand, wr as PermissionBehavior, wt as ToolUseEvent, x as sessionSummarySchema, xn as commandOutputEventSchema, xr as promptCommandSchema, xt as turnResultEventSchema, y as sessionsMessageSchema, yn as compactionTriggerSchema, yr as resumeAtCommandSchema, yt as turnUsageEventSchema, z as CommandErrorMessage, zn as agentEventTypeSchema, zr as closeSessionCommandSchema, zt as subagentEventSchema } from "./contracts-DPknvuKq.js";
|
|
2
2
|
import { ItemEntityType } from "@esposter/shared";
|
|
3
3
|
import { KeyObject } from "node:crypto";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -214,7 +214,7 @@ export interface Driver {
|
|
|
214
214
|
//#endregion
|
|
215
215
|
//#region src/models/server/AgentConsoleServer.d.ts
|
|
216
216
|
export interface AgentConsoleServer {
|
|
217
|
-
addPairingCode: (code: string,
|
|
217
|
+
addPairingCode: (code: string, durationMs: number) => void;
|
|
218
218
|
close: () => Promise<void>;
|
|
219
219
|
port: number;
|
|
220
220
|
}
|
|
@@ -254,7 +254,7 @@ export interface EventLog {
|
|
|
254
254
|
//#endregion
|
|
255
255
|
//#region src/models/server/PairingCodes.d.ts
|
|
256
256
|
export interface PairingCodes {
|
|
257
|
-
add: (code: string,
|
|
257
|
+
add: (code: string, durationMs: number) => void;
|
|
258
258
|
clear: () => void;
|
|
259
259
|
take: (code: string) => boolean;
|
|
260
260
|
}
|
|
@@ -335,18 +335,20 @@ export declare const childEventsMessageSchema: z.ZodObject<{
|
|
|
335
335
|
type: z.ZodLiteral<ChildMessageType.Events>;
|
|
336
336
|
}>;
|
|
337
337
|
//#endregion
|
|
338
|
-
//#region src/models/window/
|
|
339
|
-
export interface ChildRejoinMessage extends BaseChildMessage<ChildMessageType.Rejoin> {
|
|
340
|
-
sessions: RejoiningSession[];
|
|
341
|
-
}
|
|
338
|
+
//#region src/models/window/RejoiningSession.d.ts
|
|
342
339
|
export interface RejoiningSession {
|
|
343
340
|
events: AgentEvent[];
|
|
344
341
|
sessionId: string;
|
|
345
342
|
}
|
|
346
|
-
declare const rejoiningSessionSchema: z.ZodObject<{
|
|
343
|
+
export declare const rejoiningSessionSchema: z.ZodObject<{
|
|
347
344
|
events: z.ZodArray<typeof agentEventSchema>;
|
|
348
345
|
sessionId: z.ZodString;
|
|
349
346
|
}>;
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region src/models/window/ChildRejoinMessage.d.ts
|
|
349
|
+
export interface ChildRejoinMessage extends BaseChildMessage<ChildMessageType.Rejoin> {
|
|
350
|
+
sessions: RejoiningSession[];
|
|
351
|
+
}
|
|
350
352
|
export declare const childRejoinMessageSchema: z.ZodObject<{
|
|
351
353
|
sessions: z.ZodArray<typeof rejoiningSessionSchema>;
|
|
352
354
|
type: z.ZodLiteral<ChildMessageType.Rejoin>;
|
|
@@ -527,7 +529,7 @@ export declare const STATE_DIRECTORY_NAME = ".agent-console-server";
|
|
|
527
529
|
export declare const DEVICES_FILENAME = "devices.json";
|
|
528
530
|
export declare const HOST_KEY_FILENAME = "host-key.pem";
|
|
529
531
|
export declare const SECRET_BYTE_LENGTH = 32;
|
|
530
|
-
export declare const
|
|
532
|
+
export declare const PRINTED_PAIRING_CODE_DURATION_MS: number;
|
|
531
533
|
//#endregion
|
|
532
534
|
//#region src/services/device/findDevice.d.ts
|
|
533
535
|
export declare const findDevice: (devices: Device[], credential: string) => Device | undefined;
|
|
@@ -618,6 +620,18 @@ export declare const mapUserContent: (content: ContentBlock[] | string, context:
|
|
|
618
620
|
//#region src/services/drivers/claudeAgentSdk/parseMessageBody.d.ts
|
|
619
621
|
export declare const parseMessageBody: (value: unknown) => MessageBody | undefined;
|
|
620
622
|
//#endregion
|
|
623
|
+
//#region src/services/drivers/claudeAgentSdk/readMcpAppResource.d.ts
|
|
624
|
+
export interface McpAppResource {
|
|
625
|
+
html: string;
|
|
626
|
+
meta: Record<string, unknown>;
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* One MCP Apps widget, read from the server the session's CLI dialed. The contents are untrusted third-party HTML,
|
|
630
|
+
* so only a ui:// resource of an HTML type is accepted, and its own _meta (the csp and permissions the app declares)
|
|
631
|
+
* travels with it for the host to enforce
|
|
632
|
+
*/
|
|
633
|
+
export declare const readMcpAppResource: (query: Pick<Query, "readMcpResource">, serverName: string, uri: string) => Promise<McpAppResource>;
|
|
634
|
+
//#endregion
|
|
621
635
|
//#region src/services/drivers/claudeAgentSdk/readSessionCwd.d.ts
|
|
622
636
|
export declare const readSessionCwd: (sessionId: string) => Promise<string>;
|
|
623
637
|
//#endregion
|
|
@@ -667,10 +681,10 @@ export declare const watchSession: (sessionId: string, openSession: OpenSession,
|
|
|
667
681
|
export declare const SESSION_SUBCOMMAND = "session";
|
|
668
682
|
export declare const SESSION_SECRET_ENVIRONMENT_VARIABLE: string;
|
|
669
683
|
export declare const SESSION_SECRET_BYTE_LENGTH = 32;
|
|
670
|
-
export declare const
|
|
684
|
+
export declare const SESSION_WINDOW_CONNECT_TIMEOUT_MS: number;
|
|
671
685
|
export declare const SESSION_WINDOWS_FILENAME = "session-windows.json";
|
|
672
|
-
export declare const
|
|
673
|
-
export declare const
|
|
686
|
+
export declare const SESSION_WINDOW_REJOIN_DURATION_MS: number;
|
|
687
|
+
export declare const SESSION_WINDOW_RECONNECT_DELAY_MS: number;
|
|
674
688
|
//#endregion
|
|
675
689
|
//#region src/services/drivers/window/createWindowDriver.d.ts
|
|
676
690
|
export declare const createWindowDriver: ({ onEvents, onSessionOpen, onSessionsChange }: DriverCallbacks, { launchSessionWindow, stateDirectory, writeLine }: WindowDriverOptions) => Driver;
|
|
@@ -696,6 +710,26 @@ export declare const serveSessionChild: (connect: () => WebSocket, createDriver:
|
|
|
696
710
|
//#region src/services/drivers/window/takeChildReply.d.ts
|
|
697
711
|
export declare const takeChildReply: ({ pendingReplyMap }: SessionChild, commandId: string) => PromiseWithResolvers<string> | undefined;
|
|
698
712
|
//#endregion
|
|
713
|
+
//#region src/services/files/constants.d.ts
|
|
714
|
+
export declare const REPOSITORY_FILE_MAX_BYTE_LENGTH: number;
|
|
715
|
+
export declare const REPOSITORY_WALK_IGNORED_NAMES: ReadonlySet<string>;
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/services/files/getSessionCwd.d.ts
|
|
718
|
+
export declare const getSessionCwd: (driver: Driver, sessionId: string) => Promise<string>;
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region src/services/files/listRepositoryFiles.d.ts
|
|
721
|
+
export declare const listRepositoryFiles: (cwd: string) => Promise<string[]>;
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region src/services/files/readRepositoryFile.d.ts
|
|
724
|
+
export interface RepositoryFile {
|
|
725
|
+
content: string;
|
|
726
|
+
notice: string;
|
|
727
|
+
}
|
|
728
|
+
export declare const readRepositoryFile: (cwd: string, path: string) => Promise<RepositoryFile>;
|
|
729
|
+
//#endregion
|
|
730
|
+
//#region src/services/files/resolveRepositoryPath.d.ts
|
|
731
|
+
export declare const resolveRepositoryPath: (cwd: string, path: string) => Promise<string>;
|
|
732
|
+
//#endregion
|
|
699
733
|
//#region src/services/handshake/checkIsSignatureValid.d.ts
|
|
700
734
|
export declare const checkIsSignatureValid: (key: KeyObject, purpose: SignaturePurpose, port: number, nonce: string, signature: string) => boolean;
|
|
701
735
|
//#endregion
|
|
@@ -755,6 +789,9 @@ export declare const createPairingCodes: () => PairingCodes;
|
|
|
755
789
|
//#region src/services/server/handleCommand.d.ts
|
|
756
790
|
export declare const handleCommand: (driver: Driver, command: DriverCommand) => Promise<string>;
|
|
757
791
|
//#endregion
|
|
792
|
+
//#region src/services/server/handleFileCommand.d.ts
|
|
793
|
+
export declare const handleFileCommand: (driver: Driver, command: ListFilesCommand | ReadFileCommand) => Promise<ServerMessage>;
|
|
794
|
+
//#endregion
|
|
758
795
|
//#region src/services/server/handleShellCommand.d.ts
|
|
759
796
|
export declare const handleShellCommand: (shellRegistry: ShellRegistry, command: ShellCommand) => Promise<string>;
|
|
760
797
|
//#endregion
|
|
@@ -788,4 +825,4 @@ export declare const runConsoleListAgent: (shellPid: number) => void;
|
|
|
788
825
|
//#region src/services/shell/spawnPtyShell.d.ts
|
|
789
826
|
export declare const spawnPtyShell: ({ cols, cwd, rows }: ShellTerminalOptions) => Promise<ShellTerminal>;
|
|
790
827
|
//#endregion
|
|
791
|
-
export { AgentEvent, AgentEventType, AssistantMessageEvent, Attachment, AttachmentMediaType, AuthenticateMessage, AuthenticatedMessage, BackgroundTasksCommand, BaseAgentEvent, BaseCommand, BaseHandshakeMessage, BaseServerMessage, CapabilitiesEvent, ChallengeMessage, CloseSessionCommand, CloseShellCommand, Command, CommandErrorMessage, CommandOutputEvent, CommandType, CompactionEvent, CompactionTrigger, ContextUsageEvent, CreateSessionCommand, DEFAULT_APP_ORIGIN, DEFAULT_HOSTNAME, DEFAULT_PORT, DriverCommand, EphemeralAgentEventTypes, EventsMessage, FileRewindEvent, ForkCommand, HOST_SCHEME, HandOffMessage, HandshakeMessage, HandshakeMessageType, HookEvent, HookPhase, HostCloseCode, HostErrorEvent, HostStoppingMessage, InterruptCommand, ListSessionsCommand, McpServer, MessageUuid, Model, OpenShellCommand, PAIRING_CODE_PARAMETER, PAIRING_HASH_PARAMETER, PairMessage, PairedMessage, ParentToolUseId, PermissionBehavior, PermissionMode, PermissionRequestEvent, PermissionResolutionEvent, PermissionVerdictCommand, PromptCommand, ProofMessage, RateLimitEvent, ResumeAtCommand, ResumeCommand, RevokeMessage, RewindFilesCommand,
|
|
828
|
+
export { AgentEvent, AgentEventType, AssistantMessageEvent, Attachment, AttachmentMediaType, AuthenticateMessage, AuthenticatedMessage, BackgroundTasksCommand, BaseAgentEvent, BaseCommand, BaseHandshakeMessage, BaseMessageAgentEvent, BaseServerMessage, CapabilitiesEvent, ChallengeMessage, CloseSessionCommand, CloseShellCommand, Command, CommandErrorMessage, CommandOutputEvent, CommandType, CompactionEvent, CompactionTrigger, ContextUsageEvent, CreateSessionCommand, DEFAULT_APP_ORIGIN, DEFAULT_HOSTNAME, DEFAULT_PORT, DriverCommand, EphemeralAgentEventTypes, EventsMessage, FileContentMessage, FileRewindEvent, FilesMessage, ForkCommand, HOST_SCHEME, HandOffMessage, HandshakeMessage, HandshakeMessageType, HookEvent, HookPhase, HostCloseCode, HostErrorEvent, HostStoppingMessage, InterruptCommand, ListFilesCommand, ListSessionsCommand, McpServer, MessageUuid, Model, OpenShellCommand, PAIRING_CODE_PARAMETER, PAIRING_HASH_PARAMETER, PairMessage, PairedMessage, ParentToolUseId, PermissionBehavior, PermissionMode, PermissionRequestEvent, PermissionResolutionEvent, PermissionVerdictCommand, PromptCommand, ProofMessage, RateLimitEvent, ReadFileCommand, ResumeAtCommand, ResumeCommand, RevokeMessage, RewindFilesCommand, SCHEME_PAIRING_CODE_DURATION_MS, SHELL_OUTPUT_LENGTH, ServerMessage, ServerMessageType, SessionId, SessionInitEvent, SessionOpenedMessage, SessionResetMessage, SessionSettingsEvent, SessionState, SessionStateEvent, SessionSummary, SessionsMessage, SetModelCommand, SetPermissionModeCommand, ShellClosedMessage, ShellCommand, ShellId, ShellInputCommand, ShellOpenedMessage, ShellOutputMessage, ShellResizeCommand, SignaturePurpose, SlashCommand, SlashCommandCommand, StopTaskCommand, StreamDeltaEvent, SubagentEvent, SubagentStatus, TerminalSize, ThinkingEvent, Todo, TodoStatus, TodoUpdateEvent, TokenUsage, ToolProgressEvent, ToolResultEvent, ToolUseEvent, TurnResultEvent, TurnUsageEvent, UnknownEvent, UserMessageEvent, agentEventSchema, agentEventTypeSchema, assistantMessageEventSchema, attachmentMediaTypeSchema, attachmentSchema, authenticateMessageSchema, authenticatedMessageSchema, backgroundTasksCommandSchema, capabilitiesEventSchema, challengeMessageSchema, closeSessionCommandSchema, closeShellCommandSchema, commandErrorMessageSchema, commandOutputEventSchema, commandSchema, commandTypeSchema, compactionEventSchema, compactionTriggerSchema, contextUsageEventSchema, createBaseAgentEventSchema, createBaseCommandSchema, createBaseHandshakeMessageSchema, createBaseMessageAgentEventSchema, createBaseServerMessageSchema, createSessionCommandSchema, driverCommandSchema, eventsMessageSchema, fileContentMessageSchema, fileRewindEventSchema, filesMessageSchema, forkCommandSchema, getSignedText, handOffMessageSchema, handshakeMessageSchema, handshakeMessageTypeSchema, hookEventSchema, hookPhaseSchema, hostErrorEventSchema, hostStoppingMessageSchema, interruptCommandSchema, launchSessionWindow$1 as launchSessionWindow, listFilesCommandSchema, listSessionsCommandSchema, mcpServerSchema, messageUuidSchema, modelSchema, openShellCommandSchema, pairMessageSchema, pairedMessageSchema, parentToolUseIdSchema, permissionBehaviorSchema, permissionModeSchema, permissionRequestEventSchema, permissionResolutionEventSchema, permissionVerdictCommandSchema, promptCommandSchema, proofMessageSchema, rateLimitEventSchema, readFileCommandSchema, resumeAtCommandSchema, resumeCommandSchema, revokeMessageSchema, rewindFilesCommandSchema, serverMessageSchema, serverMessageTypeSchema, sessionIdSchema, sessionInitEventSchema, sessionOpenedMessageSchema, sessionResetMessageSchema, sessionSettingsEventSchema, sessionStateEventSchema, sessionStateSchema, sessionSummarySchema, sessionsMessageSchema, setModelCommandSchema, setPermissionModeCommandSchema, shellClosedMessageSchema, shellCommandSchema, shellIdSchema, shellInputCommandSchema, shellOpenedMessageSchema, shellOutputMessageSchema, shellResizeCommandSchema, signaturePurposeSchema, slashCommandCommandSchema, slashCommandSchema, stopTaskCommandSchema, streamDeltaEventSchema, subagentEventSchema, subagentStatusSchema, terminalSizeSchema, thinkingEventSchema, todoSchema, todoStatusSchema, todoUpdateEventSchema, tokenUsageSchema, toolProgressEventSchema, toolResultEventSchema, toolUseEventSchema, turnResultEventSchema, turnUsageEventSchema, unknownEventSchema, userMessageEventSchema, writeLine$1 as writeLine };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as
|
|
3
|
-
|
|
1
|
+
import { $ as childSessionOpenMessageSchema, $t as signNonce, A as createEventLog, At as mapAssistantContent, B as readSessionWindows, Bt as DEFAULT_DENY_MESSAGE, C as resolveRepositoryPath, Cn as hostArgs, Ct as toSessionInitEvent, D as getSessionCwd, Dt as mapSystemMessage, E as REPOSITORY_WALK_IGNORED_NAMES, Et as toToolResultText, F as launchSessionWindow, Ft as createFileOriginTracker, G as SESSION_WINDOWS_FILENAME, Gt as toSessionClosedEvents, H as SESSION_SECRET_BYTE_LENGTH, Ht as SESSION_LIST_LIMIT, I as createWindowDriver, It as createPermissionBridge, J as SESSION_WINDOW_REJOIN_DURATION_MS, K as SESSION_WINDOW_CONNECT_TIMEOUT_MS, Kt as getEventId, L as checkIsTokenValid, Lt as toPermissionResult, M as getPublicKeyText, Mt as createTodoTracker, N as getDeviceName, Nt as TodoToolName, O as handleCommand, Ot as mapTaskMessage, P as findDevice, Pt as createStreamTracker, Q as childSessionsChangeMessageSchema, Qt as HOST_PROBE_TIMEOUT_MS, R as takeChildReply, Rt as toPermissionRequestEvent, S as readRepositoryFile, Sn as NODE_PTY_DIRECTORY_NAME, St as toTurnResultEvents, T as REPOSITORY_FILE_MAX_BYTE_LENGTH, Tt as mapUserContent, U as SESSION_SECRET_ENVIRONMENT_VARIABLE, Ut as SETTING_SOURCES, V as sessionWindowsSchema, Vt as IGNORED_SDK_MESSAGE_TYPES, W as SESSION_SUBCOMMAND, Wt as closeOpenSession, X as SessionWindowCloseCode, Xt as sendToRunningHost, Y as hashCredential, Yt as runDevicesCommand, Z as childMessageSchema, Zt as readMessageText, _ as createAgentConsoleServer, _n as CLAUDE_CODE_EXECUTABLE_FILENAME, _t as toCapabilitiesEvent, a as checkIsSchemeLaunchTampered, an as writeStateFile, at as ChildMessageType, b as handleShellCommand, bn as HOST_INSTALL_DIRECTORY_SEGMENTS, bt as readSessionHistory, c as sessionCommand, cn as HOST_KEY_FILENAME, ct as createClaudeAgentSdkDriver, d as formatSessionLogLine, dn as STATE_DIRECTORY_NAME, dt as readSessionCwd, en as checkIsSignatureValid, et as childRejoinMessageSchema, f as serveCommand, fn as writeLine, ft as listSessionSummaries, g as getShellFile, gn as getHostInstallDirectory, gt as toContextUsageEvent, h as loadNodePty, hn as checkIsHostInstalled, ht as watchSession, i as getSchemeLaunch, in as readHostKey, it as childCommandErrorMessageSchema, j as answerHttpRequest, jt as toUnknownEvent, k as createPairingCodes, kt as mapHookMessage, l as runSessionChild, ln as PRINTED_PAIRING_CODE_DURATION_MS, lt as createTaskRegistry, m as spawnPtyShell, mn as installHost, mt as getClaudeCodeExecutablePath, n as runConsoleListAgent, nn as readDevices, nt as childEventsMessageSchema, o as uninstallCommand, on as getStateDirectory, ot as childMessageTypeSchema, p as serveHost, pn as installDownloadedHost, pt as createSessionOpener, q as SESSION_WINDOW_RECONNECT_DELAY_MS, qt as devicesCommand, r as CONSOLE_LIST_AGENT_NAME, rn as deviceSchema, rt as childCommandResultMessageSchema, s as uninstallHost, sn as DEVICES_FILENAME, st as createBaseChildMessageSchema, t as agentConsoleServerCommand, tn as writeDevices, tt as rejoiningSessionSchema, u as serveSessionChild, un as SECRET_BYTE_LENGTH, ut as toContentBlockParam, v as createShellRegistry, vn as HOST_DIRECTORY_ENVIRONMENT_VARIABLE, vt as getSessionTitle, w as listRepositoryFiles, wn as getReachableHostname, wt as parseMessageBody, x as handleFileCommand, xn as HOST_SCHEME_REGISTRY_KEY, xt as createSdkMessageMapper, y as sendServerMessage, yn as HOST_EXECUTABLE_FILENAME, yt as readToolUseResultMap, z as sendChildCommand, zt as createInputQueue } from "./agentConsoleServerCommand-B7491RR7.js";
|
|
2
|
+
import { $ as pairedMessageSchema, $t as AgentEventType, A as listSessionsCommandSchema, At as rateLimitEventSchema, B as AttachmentMediaType, Bt as contextUsageEventSchema, C as setModelCommandSchema, Ct as SessionState, D as promptCommandSchema, Dt as PermissionMode, E as resumeAtCommandSchema, Et as sessionInitEventSchema, F as backgroundTasksCommandSchema, Ft as hostErrorEventSchema, G as shellOpenedMessageSchema, Gt as capabilitiesEventSchema, H as getSignedText, Ht as CompactionTrigger, I as sessionIdSchema, It as hookEventSchema, J as sessionsMessageSchema, Jt as assistantMessageEventSchema, K as shellClosedMessageSchema, Kt as slashCommandSchema, L as createBaseCommandSchema, Lt as HookPhase, M as forkCommandSchema, Mt as PermissionBehavior, N as createSessionCommandSchema, Nt as permissionBehaviorSchema, O as attachmentSchema, Ot as permissionModeSchema, P as closeSessionCommandSchema, Pt as permissionRequestEventSchema, Q as proofMessageSchema, Qt as createBaseAgentEventSchema, R as CommandType, Rt as hookPhaseSchema, S as setPermissionModeCommandSchema, St as sessionStateEventSchema, T as resumeCommandSchema, Tt as sessionSettingsEventSchema, U as serverMessageSchema, Ut as compactionTriggerSchema, V as attachmentMediaTypeSchema, Vt as compactionEventSchema, W as shellOutputMessageSchema, Wt as commandOutputEventSchema, X as sessionResetMessageSchema, Xt as parentToolUseIdSchema, Y as sessionSummarySchema, Yt as createBaseMessageAgentEventSchema, Z as sessionOpenedMessageSchema, Zt as messageUuidSchema, _ as readFileCommandSchema, _n as SHELL_OUTPUT_LENGTH, _t as thinkingEventSchema, a as pairMessageSchema, an as createBaseServerMessageSchema, at as userMessageEventSchema, b as stopTaskCommandSchema, bt as subagentStatusSchema, c as authenticateMessageSchema, cn as HandshakeMessageType, ct as turnResultEventSchema, d as shellCommandSchema, dn as DEFAULT_HOSTNAME, dt as toolResultEventSchema, en as agentEventTypeSchema, et as hostStoppingMessageSchema, f as shellResizeCommandSchema, fn as DEFAULT_PORT, ft as toolProgressEventSchema, g as closeShellCommandSchema, gn as SCHEME_PAIRING_CODE_DURATION_MS, gt as todoStatusSchema, h as terminalSizeSchema, hn as PAIRING_HASH_PARAMETER, ht as TodoStatus, i as revokeMessageSchema, in as serverMessageTypeSchema, it as agentEventSchema, j as interruptCommandSchema, jt as permissionResolutionEventSchema, k as permissionVerdictCommandSchema, kt as mcpServerSchema, l as createBaseHandshakeMessageSchema, ln as handshakeMessageTypeSchema, lt as tokenUsageSchema, m as openShellCommandSchema, mn as PAIRING_CODE_PARAMETER, mt as todoSchema, n as HostCloseCode, nn as authenticatedMessageSchema, nt as fileContentMessageSchema, o as handOffMessageSchema, on as SignaturePurpose, ot as unknownEventSchema, p as shellInputCommandSchema, pn as HOST_SCHEME, pt as todoUpdateEventSchema, q as shellIdSchema, qt as modelSchema, r as handshakeMessageSchema, rn as ServerMessageType, rt as eventsMessageSchema, s as challengeMessageSchema, sn as signaturePurposeSchema, st as turnUsageEventSchema, t as EphemeralAgentEventTypes, tn as commandErrorMessageSchema, tt as filesMessageSchema, u as commandSchema, un as DEFAULT_APP_ORIGIN, ut as toolUseEventSchema, v as listFilesCommandSchema, vt as subagentEventSchema, w as rewindFilesCommandSchema, wt as sessionStateSchema, x as slashCommandCommandSchema, xt as streamDeltaEventSchema, y as driverCommandSchema, yt as SubagentStatus, z as commandTypeSchema, zt as fileRewindEventSchema } from "./EphemeralAgentEventTypes-Spjnk48Y.js";
|
|
3
|
+
import { InvalidOperationError, Operation } from "@esposter/shared";
|
|
4
|
+
//#region src/services/drivers/claudeAgentSdk/readMcpAppResource.ts
|
|
5
|
+
/**
|
|
6
|
+
* One MCP Apps widget, read from the server the session's CLI dialed. The contents are untrusted third-party HTML,
|
|
7
|
+
* so only a ui:// resource of an HTML type is accepted, and its own _meta (the csp and permissions the app declares)
|
|
8
|
+
* travels with it for the host to enforce
|
|
9
|
+
*/
|
|
10
|
+
const readMcpAppResource = async (query, serverName, uri) => {
|
|
11
|
+
if (!uri.startsWith("ui://")) throw new InvalidOperationError(Operation.Read, uri, "an MCP app is read from a ui:// resource only");
|
|
12
|
+
const { contents } = await query.readMcpResource(serverName, uri);
|
|
13
|
+
const [content] = contents;
|
|
14
|
+
if (content?.text === void 0 || !content.mimeType?.startsWith("text/html")) throw new InvalidOperationError(Operation.Read, uri, "the server returned no HTML for the app");
|
|
15
|
+
return {
|
|
16
|
+
html: content.text,
|
|
17
|
+
meta: content._meta ?? {}
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { AgentEventType, AttachmentMediaType, CLAUDE_CODE_EXECUTABLE_FILENAME, CONSOLE_LIST_AGENT_NAME, ChildMessageType, CommandType, CompactionTrigger, DEFAULT_APP_ORIGIN, DEFAULT_DENY_MESSAGE, DEFAULT_HOSTNAME, DEFAULT_PORT, DEVICES_FILENAME, EphemeralAgentEventTypes, HOST_DIRECTORY_ENVIRONMENT_VARIABLE, HOST_EXECUTABLE_FILENAME, HOST_INSTALL_DIRECTORY_SEGMENTS, HOST_KEY_FILENAME, HOST_PROBE_TIMEOUT_MS, HOST_SCHEME, HOST_SCHEME_REGISTRY_KEY, HandshakeMessageType, HookPhase, HostCloseCode, IGNORED_SDK_MESSAGE_TYPES, NODE_PTY_DIRECTORY_NAME, PAIRING_CODE_PARAMETER, PAIRING_HASH_PARAMETER, PRINTED_PAIRING_CODE_DURATION_MS, PermissionBehavior, PermissionMode, REPOSITORY_FILE_MAX_BYTE_LENGTH, REPOSITORY_WALK_IGNORED_NAMES, SCHEME_PAIRING_CODE_DURATION_MS, SECRET_BYTE_LENGTH, SESSION_LIST_LIMIT, SESSION_SECRET_BYTE_LENGTH, SESSION_SECRET_ENVIRONMENT_VARIABLE, SESSION_SUBCOMMAND, SESSION_WINDOWS_FILENAME, SESSION_WINDOW_CONNECT_TIMEOUT_MS, SESSION_WINDOW_RECONNECT_DELAY_MS, SESSION_WINDOW_REJOIN_DURATION_MS, SETTING_SOURCES, SHELL_OUTPUT_LENGTH, STATE_DIRECTORY_NAME, ServerMessageType, SessionState, SessionWindowCloseCode, SignaturePurpose, SubagentStatus, TodoStatus, TodoToolName, agentConsoleServerCommand, agentEventSchema, agentEventTypeSchema, answerHttpRequest, assistantMessageEventSchema, attachmentMediaTypeSchema, attachmentSchema, authenticateMessageSchema, authenticatedMessageSchema, backgroundTasksCommandSchema, capabilitiesEventSchema, challengeMessageSchema, checkIsHostInstalled, checkIsSchemeLaunchTampered, checkIsSignatureValid, checkIsTokenValid, childCommandErrorMessageSchema, childCommandResultMessageSchema, childEventsMessageSchema, childMessageSchema, childMessageTypeSchema, childRejoinMessageSchema, childSessionOpenMessageSchema, childSessionsChangeMessageSchema, closeOpenSession, closeSessionCommandSchema, closeShellCommandSchema, commandErrorMessageSchema, commandOutputEventSchema, commandSchema, commandTypeSchema, compactionEventSchema, compactionTriggerSchema, contextUsageEventSchema, createAgentConsoleServer, createBaseAgentEventSchema, createBaseChildMessageSchema, createBaseCommandSchema, createBaseHandshakeMessageSchema, createBaseMessageAgentEventSchema, createBaseServerMessageSchema, createClaudeAgentSdkDriver, createEventLog, createFileOriginTracker, createInputQueue, createPairingCodes, createPermissionBridge, createSdkMessageMapper, createSessionCommandSchema, createSessionOpener, createShellRegistry, createStreamTracker, createTaskRegistry, createTodoTracker, createWindowDriver, deviceSchema, devicesCommand, driverCommandSchema, eventsMessageSchema, fileContentMessageSchema, fileRewindEventSchema, filesMessageSchema, findDevice, forkCommandSchema, formatSessionLogLine, getClaudeCodeExecutablePath, getDeviceName, getEventId, getHostInstallDirectory, getPublicKeyText, getReachableHostname, getSchemeLaunch, getSessionCwd, getSessionTitle, getShellFile, getSignedText, getStateDirectory, handOffMessageSchema, handleCommand, handleFileCommand, handleShellCommand, handshakeMessageSchema, handshakeMessageTypeSchema, hashCredential, hookEventSchema, hookPhaseSchema, hostArgs, hostErrorEventSchema, hostStoppingMessageSchema, installDownloadedHost, installHost, interruptCommandSchema, launchSessionWindow, listFilesCommandSchema, listRepositoryFiles, listSessionSummaries, listSessionsCommandSchema, loadNodePty, mapAssistantContent, mapHookMessage, mapSystemMessage, mapTaskMessage, mapUserContent, mcpServerSchema, messageUuidSchema, modelSchema, openShellCommandSchema, pairMessageSchema, pairedMessageSchema, parentToolUseIdSchema, parseMessageBody, permissionBehaviorSchema, permissionModeSchema, permissionRequestEventSchema, permissionResolutionEventSchema, permissionVerdictCommandSchema, promptCommandSchema, proofMessageSchema, rateLimitEventSchema, readDevices, readFileCommandSchema, readHostKey, readMcpAppResource, readMessageText, readRepositoryFile, readSessionCwd, readSessionHistory, readSessionWindows, readToolUseResultMap, rejoiningSessionSchema, resolveRepositoryPath, resumeAtCommandSchema, resumeCommandSchema, revokeMessageSchema, rewindFilesCommandSchema, runConsoleListAgent, runDevicesCommand, runSessionChild, sendChildCommand, sendServerMessage, sendToRunningHost, serveCommand, serveHost, serveSessionChild, serverMessageSchema, serverMessageTypeSchema, sessionCommand, sessionIdSchema, sessionInitEventSchema, sessionOpenedMessageSchema, sessionResetMessageSchema, sessionSettingsEventSchema, sessionStateEventSchema, sessionStateSchema, sessionSummarySchema, sessionWindowsSchema, sessionsMessageSchema, setModelCommandSchema, setPermissionModeCommandSchema, shellClosedMessageSchema, shellCommandSchema, shellIdSchema, shellInputCommandSchema, shellOpenedMessageSchema, shellOutputMessageSchema, shellResizeCommandSchema, signNonce, signaturePurposeSchema, slashCommandCommandSchema, slashCommandSchema, spawnPtyShell, stopTaskCommandSchema, streamDeltaEventSchema, subagentEventSchema, subagentStatusSchema, takeChildReply, terminalSizeSchema, thinkingEventSchema, toCapabilitiesEvent, toContentBlockParam, toContextUsageEvent, toPermissionRequestEvent, toPermissionResult, toSessionClosedEvents, toSessionInitEvent, toToolResultText, toTurnResultEvents, toUnknownEvent, todoSchema, todoStatusSchema, todoUpdateEventSchema, tokenUsageSchema, toolProgressEventSchema, toolResultEventSchema, toolUseEventSchema, turnResultEventSchema, turnUsageEventSchema, uninstallCommand, uninstallHost, unknownEventSchema, userMessageEventSchema, watchSession, writeDevices, writeLine, writeStateFile };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-console-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "The host behind the Esposter agent console — a loopback WebSocket that runs Claude Code sessions through the Claude Agent SDK and speaks a typed wire to the page.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -56,22 +56,23 @@
|
|
|
56
56
|
"typecheck": "tsc"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@anthropic-ai/claude-agent-sdk": "^0.3.
|
|
60
|
-
"@esposter/shared": "
|
|
59
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.296",
|
|
60
|
+
"@esposter/shared": "4.1.0",
|
|
61
61
|
"ws": "^8.22.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@arethetypeswrong/core": "^0.18.5",
|
|
65
|
-
"@esposter/configuration": "
|
|
66
|
-
"@
|
|
65
|
+
"@esposter/configuration": "4.1.0",
|
|
66
|
+
"@esposter/shared-node": "4.1.0",
|
|
67
|
+
"@types/node": "^26.6.5",
|
|
67
68
|
"@types/ws": "^8.18.2",
|
|
68
69
|
"citty": "^0.2.2",
|
|
69
70
|
"publint": "^0.3.25",
|
|
70
|
-
"tsdown": "^0.23.
|
|
71
|
-
"vitest": "^5.0.
|
|
71
|
+
"tsdown": "^0.23.1",
|
|
72
|
+
"vitest": "^5.0.4"
|
|
72
73
|
},
|
|
73
74
|
"peerDependencies": {
|
|
74
|
-
"zod": "^4.6.
|
|
75
|
+
"zod": "^4.6.7"
|
|
75
76
|
},
|
|
76
77
|
"optionalDependencies": {
|
|
77
78
|
"node-pty": "^1.1.0"
|
|
@@ -79,5 +80,5 @@
|
|
|
79
80
|
"inlinedDependencies": {
|
|
80
81
|
"citty": "0.2.2"
|
|
81
82
|
},
|
|
82
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "68de4c22fa7591bf6f6cc0fab2c9a906d8c4d71a"
|
|
83
84
|
}
|