MCPcopy Create free account
hub / github.com/code-with-antonio/nightcode / truncate

Function truncate

packages/cli/src/lib/local-tools.ts:23–27  ·  view source on GitHub ↗
(value: string, limit: number)

Source from the content-addressed store, hash-verified

21}
22
23function truncate(value: string, limit: number) {
24 return value.length > limit
25 ? `${value.slice(0, limit)}\n... (truncated, ${value.length} total chars)`
26 : value;
27}
28
29export async function executeLocalTool(toolName: string, input: unknown, mode: ModeType) {
30 if (mode === Mode.PLAN && !["readFile", "listDirectory", "glob", "grep"].includes(toolName)) {

Callers 1

executeLocalToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected