mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 19:05:11 +00:00
Export truncation utilities for custom tools, add truncated-tool example
- Export truncateHead, truncateTail, truncateLine, formatSize, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES from package - Add examples/extensions/truncated-tool.ts showing proper output truncation with custom rendering - Document output truncation best practices in docs/extensions.md
This commit is contained in:
parent
f87fb0a38a
commit
7c99ea54bf
5 changed files with 266 additions and 1 deletions
|
|
@ -4,7 +4,16 @@ export { createFindTool, type FindToolDetails, findTool } from "./find.js";
|
|||
export { createGrepTool, type GrepToolDetails, grepTool } from "./grep.js";
|
||||
export { createLsTool, type LsToolDetails, lsTool } from "./ls.js";
|
||||
export { createReadTool, type ReadToolDetails, type ReadToolOptions, readTool } from "./read.js";
|
||||
export type { TruncationResult } from "./truncate.js";
|
||||
export {
|
||||
DEFAULT_MAX_BYTES,
|
||||
DEFAULT_MAX_LINES,
|
||||
formatSize,
|
||||
type TruncationOptions,
|
||||
type TruncationResult,
|
||||
truncateHead,
|
||||
truncateLine,
|
||||
truncateTail,
|
||||
} from "./truncate.js";
|
||||
export { createWriteTool, writeTool } from "./write.js";
|
||||
|
||||
import type { AgentTool } from "@mariozechner/pi-agent-core";
|
||||
|
|
|
|||
|
|
@ -171,9 +171,12 @@ export {
|
|||
type BashToolDetails,
|
||||
bashTool,
|
||||
codingTools,
|
||||
DEFAULT_MAX_BYTES,
|
||||
DEFAULT_MAX_LINES,
|
||||
editTool,
|
||||
type FindToolDetails,
|
||||
findTool,
|
||||
formatSize,
|
||||
type GrepToolDetails,
|
||||
grepTool,
|
||||
type LsToolDetails,
|
||||
|
|
@ -182,7 +185,11 @@ export {
|
|||
type ReadToolOptions,
|
||||
readTool,
|
||||
type ToolsOptions,
|
||||
type TruncationOptions,
|
||||
type TruncationResult,
|
||||
truncateHead,
|
||||
truncateLine,
|
||||
truncateTail,
|
||||
writeTool,
|
||||
} from "./core/tools/index.js";
|
||||
// Main entry point
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue