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