agent-console-server 4.0.0 → 4.1.1
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-DpaeSAoz.js → EphemeralAgentEventTypes-Spjnk48Y.js} +52 -21
- package/dist/{agentConsoleServerCommand-BVg1aa45.js → agentConsoleServerCommand-B7491RR7.js} +119 -12
- package/dist/cli.js +1 -1
- package/dist/{contracts-B39A83fK.d.ts → contracts-DPknvuKq.d.ts} +68 -9
- package/dist/contracts.d.ts +2 -2
- package/dist/contracts.js +1 -2
- package/dist/index.d.ts +37 -2
- package/dist/index.js +21 -3
- package/package.json +10 -9
|
@@ -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-BVg1aa45.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"
|
|
@@ -2330,7 +2348,7 @@ const SESSION_COMMAND_ENVIRONMENT_VARIABLE_PREFIX = `${SITE_NAME.toUpperCase()}_
|
|
|
2330
2348
|
const launchSessionWindow = ({ port, secret }) => {
|
|
2331
2349
|
const hostCommand = isSea() ? [process.execPath] : [process.execPath, process.argv[1] ?? ""];
|
|
2332
2350
|
const quotedHostCommand = hostCommand.map((_value, index) => `"%${SESSION_COMMAND_ENVIRONMENT_VARIABLE_PREFIX}${index}%"`).join(" ");
|
|
2333
|
-
spawn("cmd.exe", [
|
|
2351
|
+
spawn$1("cmd.exe", [
|
|
2334
2352
|
"/d",
|
|
2335
2353
|
"/s",
|
|
2336
2354
|
"/c",
|
|
@@ -2484,6 +2502,90 @@ const handleCommand = async (driver, command) => {
|
|
|
2484
2502
|
}
|
|
2485
2503
|
};
|
|
2486
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
|
|
2487
2589
|
//#region src/services/server/handleShellCommand.ts
|
|
2488
2590
|
const handleShellCommand = async (shellRegistry, command) => {
|
|
2489
2591
|
switch (command.type) {
|
|
@@ -2685,6 +2787,12 @@ const createAgentConsoleServer = async ({ createDriver, hostKey, hostname, origi
|
|
|
2685
2787
|
});
|
|
2686
2788
|
}, sendCommandError);
|
|
2687
2789
|
return;
|
|
2790
|
+
case "ListFiles":
|
|
2791
|
+
case "ReadFile":
|
|
2792
|
+
await getResultAsync(() => handleFileCommand(driver, command)).match((message) => {
|
|
2793
|
+
sendServerMessage(webSocket, message);
|
|
2794
|
+
}, sendCommandError);
|
|
2795
|
+
return;
|
|
2688
2796
|
default: await getResultAsync(() => handleCommand(driver, command)).match((sessionId) => {
|
|
2689
2797
|
if (sessionId) sendServerMessage(webSocket, {
|
|
2690
2798
|
commandId: command.id,
|
|
@@ -3076,12 +3184,12 @@ const sessionCommand = defineCommand({
|
|
|
3076
3184
|
//#endregion
|
|
3077
3185
|
//#region src/services/installer/uninstallHost.ts
|
|
3078
3186
|
const uninstallHost = () => {
|
|
3079
|
-
execFileSync("reg", [
|
|
3187
|
+
execFileSync$1("reg", [
|
|
3080
3188
|
"delete",
|
|
3081
3189
|
HOST_SCHEME_REGISTRY_KEY,
|
|
3082
3190
|
"/f"
|
|
3083
3191
|
], { stdio: "ignore" });
|
|
3084
|
-
spawn("powershell.exe", [
|
|
3192
|
+
spawn$1("powershell.exe", [
|
|
3085
3193
|
"-NoProfile",
|
|
3086
3194
|
"-Command",
|
|
3087
3195
|
`Start-Sleep -Seconds 2; Remove-Item -LiteralPath $env:${HOST_DIRECTORY_ENVIRONMENT_VARIABLE} -Recurse -Force`
|
|
@@ -3091,8 +3199,7 @@ const uninstallHost = () => {
|
|
|
3091
3199
|
...process.env,
|
|
3092
3200
|
[HOST_DIRECTORY_ENVIRONMENT_VARIABLE]: getHostInstallDirectory()
|
|
3093
3201
|
},
|
|
3094
|
-
stdio: "ignore"
|
|
3095
|
-
windowsHide: true
|
|
3202
|
+
stdio: "ignore"
|
|
3096
3203
|
}).unref();
|
|
3097
3204
|
};
|
|
3098
3205
|
//#endregion
|
|
@@ -3165,4 +3272,4 @@ const agentConsoleServerCommand = defineCommand({
|
|
|
3165
3272
|
}
|
|
3166
3273
|
});
|
|
3167
3274
|
//#endregion
|
|
3168
|
-
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";
|
|
@@ -1158,4 +1217,4 @@ declare const SCHEME_PAIRING_CODE_DURATION_MS: number;
|
|
|
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, 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, 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 };
|
|
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_MS, 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";
|
|
@@ -620,6 +620,18 @@ export declare const mapUserContent: (content: ContentBlock[] | string, context:
|
|
|
620
620
|
//#region src/services/drivers/claudeAgentSdk/parseMessageBody.d.ts
|
|
621
621
|
export declare const parseMessageBody: (value: unknown) => MessageBody | undefined;
|
|
622
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
|
|
623
635
|
//#region src/services/drivers/claudeAgentSdk/readSessionCwd.d.ts
|
|
624
636
|
export declare const readSessionCwd: (sessionId: string) => Promise<string>;
|
|
625
637
|
//#endregion
|
|
@@ -698,6 +710,26 @@ export declare const serveSessionChild: (connect: () => WebSocket, createDriver:
|
|
|
698
710
|
//#region src/services/drivers/window/takeChildReply.d.ts
|
|
699
711
|
export declare const takeChildReply: ({ pendingReplyMap }: SessionChild, commandId: string) => PromiseWithResolvers<string> | undefined;
|
|
700
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
|
|
701
733
|
//#region src/services/handshake/checkIsSignatureValid.d.ts
|
|
702
734
|
export declare const checkIsSignatureValid: (key: KeyObject, purpose: SignaturePurpose, port: number, nonce: string, signature: string) => boolean;
|
|
703
735
|
//#endregion
|
|
@@ -757,6 +789,9 @@ export declare const createPairingCodes: () => PairingCodes;
|
|
|
757
789
|
//#region src/services/server/handleCommand.d.ts
|
|
758
790
|
export declare const handleCommand: (driver: Driver, command: DriverCommand) => Promise<string>;
|
|
759
791
|
//#endregion
|
|
792
|
+
//#region src/services/server/handleFileCommand.d.ts
|
|
793
|
+
export declare const handleFileCommand: (driver: Driver, command: ListFilesCommand | ReadFileCommand) => Promise<ServerMessage>;
|
|
794
|
+
//#endregion
|
|
760
795
|
//#region src/services/server/handleShellCommand.d.ts
|
|
761
796
|
export declare const handleShellCommand: (shellRegistry: ShellRegistry, command: ShellCommand) => Promise<string>;
|
|
762
797
|
//#endregion
|
|
@@ -790,4 +825,4 @@ export declare const runConsoleListAgent: (shellPid: number) => void;
|
|
|
790
825
|
//#region src/services/shell/spawnPtyShell.d.ts
|
|
791
826
|
export declare const spawnPtyShell: ({ cols, cwd, rows }: ShellTerminalOptions) => Promise<ShellTerminal>;
|
|
792
827
|
//#endregion
|
|
793
|
-
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, 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, fileRewindEventSchema, forkCommandSchema, getSignedText, handOffMessageSchema, handshakeMessageSchema, handshakeMessageTypeSchema, hookEventSchema, hookPhaseSchema, hostErrorEventSchema, hostStoppingMessageSchema, interruptCommandSchema, launchSessionWindow$1 as launchSessionWindow, 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, writeLine$1 as writeLine };
|
|
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": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
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": "4.
|
|
59
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.296",
|
|
60
|
+
"@esposter/shared": "4.1.1",
|
|
61
61
|
"ws": "^8.22.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@arethetypeswrong/core": "^0.18.5",
|
|
65
|
-
"@esposter/configuration": "4.
|
|
66
|
-
"@
|
|
65
|
+
"@esposter/configuration": "4.1.1",
|
|
66
|
+
"@esposter/shared-node": "4.1.1",
|
|
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": "47b7795ab557d7731aa60588d0b9d1cdff243328"
|
|
83
84
|
}
|