feat: add session slug generator

This commit is contained in:
Peter Steinberger
2026-01-17 06:23:21 +00:00
parent bd32cc40e6
commit 5ebfc0738f
5 changed files with 171 additions and 3 deletions

View File

@@ -1,5 +1,4 @@
import { spawn, type ChildProcessWithoutNullStreams } from "node:child_process";
import { randomUUID } from "node:crypto";
import type { AgentTool, AgentToolResult } from "@mariozechner/pi-agent-core";
import { Type } from "@sinclair/typebox";
@@ -11,6 +10,7 @@ import {
type SessionStdin,
addSession,
appendOutput,
createSessionSlug,
markBackgrounded,
markExited,
tail,
@@ -189,7 +189,7 @@ export function createExecTool(
const maxOutput = DEFAULT_MAX_OUTPUT;
const startedAt = Date.now();
const sessionId = randomUUID();
const sessionId = createSessionSlug();
const warnings: string[] = [];
const backgroundRequested = params.background === true;
const yieldRequested = typeof params.yieldMs === "number";