Open History to see the last commit
1import * as Effect from "effect/Effect";
2import { Argument, Command } from "effect/cli";
3
4/**
5 * The npm bundle runs it as a sibling `claudeHistoryWorker.mjs` under the host
6 * Node; the single-executable has no Node to run a script with, so the adapter
7 * invokes this hidden subcommand on its own executable instead.
8 */
9export const claudeHistoryCommand = Command.make("__claude-history", {
10 method: Argument.String("method"),
11 sessionId: Argument.String("session-id"),
12 options: Argument.String("options").pipe(Argument.optional),
13}).pipe(
14 Command.unlisted,
15 Command.withHandler(({ method, sessionId, options }) =>
16 Effect.promise(async () => {
17 const { runClaudeHistoryWorker } = await import("../claudeHistoryWorker.ts");
18 return runClaudeHistoryWorker(
19 method,
20 sessionId,
21 options._tag === "Some" ? options.value : undefined,
22 );
23 }),
24 ),
25);