goatchain 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,3 +19,8 @@
19
19
  * }
20
20
  */
21
21
  import 'dotenv/config';
22
+ /**
23
+ * ACP Server entry point.
24
+ * Can be called directly or imported and invoked by the CLI.
25
+ */
26
+ export declare function runAcpServer(): Promise<void>;
@@ -1,4 +1,14 @@
1
1
  import type { Message } from '../types';
2
+ /**
3
+ * Token counter using tiktoken for accurate token counting.
4
+ *
5
+ * Supports both model-specific encoding (gpt-4o, gpt-4, etc.) and
6
+ * fallback to cl100k_base encoding.
7
+ */
8
+ /**
9
+ * NOTE: Some runtimes may fail to load `tiktoken`'s WASM backend.
10
+ * We fall back to an approximate counter when encoding fails.
11
+ */
2
12
  export type TiktokenModel = string;
3
13
  /**
4
14
  * Count tokens in a string using the specified model's encoding.
@@ -80,7 +80,10 @@ export interface AgentLoopState {
80
80
  */
81
81
  lastModelStopReason?: ModelStopReason;
82
82
  /**
83
- * Cumulative token usage across all iterations.
83
+ * Token usage statistics.
84
+ * - promptTokens: Current request's prompt tokens (not cumulative)
85
+ * - completionTokens: Current request's completion tokens (not cumulative)
86
+ * - totalTokens: Cumulative total tokens across all iterations
84
87
  */
85
88
  usage: Usage;
86
89
  /**
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export type { ParallelSubagentMiddlewareOptions } from './middleware/parallelSub
9
9
  export { injectSystemReminderToLastUserMessage } from './middleware/utils';
10
10
  export * from './subagent';
11
11
  export * from './acp-adapter';
12
+ export { runAcpServer } from './acp-server';
12
13
  export * from './model';
13
14
  export type { OpenAITool } from './model';
14
15
  export { BaseSession, BaseSessionManager, Session } from './session';