@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
3 lines (2 loc) • 649 B
JavaScript
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url); { const __piWorkerThreads = require("node:worker_threads"); if (typeof __piWorkerThreads.markAsUncloneable !== "function") { __piWorkerThreads.markAsUncloneable = () => {}; } }
import{shortHash}from"./chunk-QD45L5SP.js";var TOOL_CALL_ID_MAX_LENGTH=64;function normalizeToolCallId(id){let sanitized=id.replace(/[^a-zA-Z0-9_-]/g,"_");if(sanitized.length<=TOOL_CALL_ID_MAX_LENGTH)return sanitized;let suffix=`_${shortHash(id)}`;return`${sanitized.slice(0,TOOL_CALL_ID_MAX_LENGTH-suffix.length)}${suffix}`}export{normalizeToolCallId};