Skip to content

armgit / pibot

Public Imported from GitHub
0

Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.

382 B
Raw Blame
import { z } from "zod";

/** POSIX, drive-letter or UNC absolute path without control line breaks; both ACP sides use it. */
export const absolutePath = z
  .string()
  .min(1)
  .max(32768)
  .refine(
    (path) =>
      !/[\0\r\n]/.test(path) &&
      (path.startsWith("/") || /^[A-Za-z]:[\\/]/.test(path) || /^\\\\[^\\]+\\[^\\]+/.test(path)),
    "Absolute path required",
  );