pipe-protocol
Version:
A protocol for large scale Interplanetary Intertool Agent Context
26 lines • 804 B
TypeScript
/**
* @file Token Counting Implementation
* @version 1.0.0
* @status STABLE - DO NOT MODIFY WITHOUT TESTS
* @lastModified 2024-02-04
*
* Core functionality for counting and limiting tokens in data structures
*
* IMPORTANT:
* - All modifications must maintain test coverage
* - Token counting must be accurate
*
* Functionality:
* - Token counting for various data types
* - Token limit enforcement
* - Circular reference handling
*/
/**
* Counts tokens in a value, handling different types appropriately
*/
export declare function countTokens(value: any, seen?: WeakSet<object>): number;
/**
* Enforces a token limit on a value while trying to preserve structure
*/
export declare function enforceTokenLimit(value: any, limit: number): any;
//# sourceMappingURL=tokenCounting.d.ts.map