@kenkaiiii/gg-agent 5.92.0 → 5.94.0

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.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Message, StreamOptions, Tool, ToolResultContent, ServerToolDefinition, Usage, StopReason, AssistantMessage } from '@kenkaiiii/gg-ai';
1
+ import { Message, StreamOptions, Tool, ToolResultContent, ServerToolDefinition, Usage, StopReason, AssistantMessage, ToolResult } from '@kenkaiiii/gg-ai';
2
2
  import { z } from 'zod';
3
3
 
4
4
  /**
@@ -365,8 +365,6 @@ interface AgentOptions {
365
365
  onContextPrepared?: StreamOptions["onContextPrepared"];
366
366
  /** Stable per-session cache routing key for providers that support it. */
367
367
  promptCacheKey?: StreamOptions["promptCacheKey"];
368
- /** Override the User-Agent sent with OAuth-authenticated Anthropic requests. */
369
- userAgent?: StreamOptions["userAgent"];
370
368
  /** Extra HTTP headers attached to every model request (e.g. Kimi For Coding
371
369
  * client-identity headers). Merged into the underlying SDK default headers. */
372
370
  defaultHeaders?: StreamOptions["defaultHeaders"];
@@ -579,6 +577,7 @@ declare function cancelledBeforeStartText(name: string): string;
579
577
  * something never ran when it did.
580
578
  */
581
579
  declare function indeterminateOutcomeText(name: string): string;
580
+ declare function capToolResults(toolResults: ToolResult[], maxToolResultChars: number | undefined): void;
582
581
  declare function repairToolPairingAdjacent(messages: Message[]): void;
583
582
 
584
583
  /**
@@ -590,4 +589,14 @@ declare function repairToolPairingAdjacent(messages: Message[]): void;
590
589
  */
591
590
  declare function isLocalBackendUrl(baseUrl?: string): boolean;
592
591
 
593
- export { Agent, type AgentDoneEvent, type AgentErrorEvent, type AgentEvent, type AgentFollowUpMessageEvent, type AgentOptions, type AgentResult, type AgentRetryEvent, type AgentServerToolCallEvent, type AgentServerToolResultEvent, type AgentSteeringMessageEvent, AgentStream, type AgentStreamRuleTriggeredEvent, type AgentTextDeltaEvent, type AgentThinkingDeltaEvent, type AgentTool, type AgentToolCallDeltaEvent, type AgentToolCallEndEvent, type AgentToolCallStartEvent, type AgentToolCallUpdateEvent, type AgentTurnEndEvent, type AgentTurnTiming, DEFAULT_STREAM_RULE_MAX_RETRIES, DEFAULT_STREAM_RULE_WINDOW_CHARS, JsonEscapeDecoder, type StreamDiagnosticFn, type StreamRule, type StreamRuleMatch, StreamRuleMonitor, type StreamRuleScope, type StreamRuleSource, type StreamRulesConfig, type StructuredToolResult, type ToolContext, type ToolExecuteResult, type ToolExecutionMode, type TransformContextOptions, agentLoop, buildStreamRuleReminder, cancelledBeforeStartText, indeterminateOutcomeText, isAbortError, isBillingError, isContextOverflow, isLocalBackendUrl, isUsageLimitError, repairToolPairingAdjacent, setStreamDiagnostic };
592
+ /** Result text for a call naming a tool that is not registered. */
593
+ declare function unknownToolMessage(name: string, available: readonly string[]): string;
594
+ /**
595
+ * Repair hints appended to an invalid-arguments error: the expected shape
596
+ * (`{ file_path: string, limit?: number }`) and, for each unrecognised key the
597
+ * model sent, the field it most likely meant. Empty when the schema has no
598
+ * object shape to describe.
599
+ */
600
+ declare function argumentHints(tool: AgentTool, args: unknown): string;
601
+
602
+ export { Agent, type AgentDoneEvent, type AgentErrorEvent, type AgentEvent, type AgentFollowUpMessageEvent, type AgentOptions, type AgentResult, type AgentRetryEvent, type AgentServerToolCallEvent, type AgentServerToolResultEvent, type AgentSteeringMessageEvent, AgentStream, type AgentStreamRuleTriggeredEvent, type AgentTextDeltaEvent, type AgentThinkingDeltaEvent, type AgentTool, type AgentToolCallDeltaEvent, type AgentToolCallEndEvent, type AgentToolCallStartEvent, type AgentToolCallUpdateEvent, type AgentTurnEndEvent, type AgentTurnTiming, DEFAULT_STREAM_RULE_MAX_RETRIES, DEFAULT_STREAM_RULE_WINDOW_CHARS, JsonEscapeDecoder, type StreamDiagnosticFn, type StreamRule, type StreamRuleMatch, StreamRuleMonitor, type StreamRuleScope, type StreamRuleSource, type StreamRulesConfig, type StructuredToolResult, type ToolContext, type ToolExecuteResult, type ToolExecutionMode, type TransformContextOptions, agentLoop, argumentHints, buildStreamRuleReminder, cancelledBeforeStartText, capToolResults, indeterminateOutcomeText, isAbortError, isBillingError, isContextOverflow, isLocalBackendUrl, isUsageLimitError, repairToolPairingAdjacent, setStreamDiagnostic, unknownToolMessage };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Message, StreamOptions, Tool, ToolResultContent, ServerToolDefinition, Usage, StopReason, AssistantMessage } from '@kenkaiiii/gg-ai';
1
+ import { Message, StreamOptions, Tool, ToolResultContent, ServerToolDefinition, Usage, StopReason, AssistantMessage, ToolResult } from '@kenkaiiii/gg-ai';
2
2
  import { z } from 'zod';
3
3
 
4
4
  /**
@@ -365,8 +365,6 @@ interface AgentOptions {
365
365
  onContextPrepared?: StreamOptions["onContextPrepared"];
366
366
  /** Stable per-session cache routing key for providers that support it. */
367
367
  promptCacheKey?: StreamOptions["promptCacheKey"];
368
- /** Override the User-Agent sent with OAuth-authenticated Anthropic requests. */
369
- userAgent?: StreamOptions["userAgent"];
370
368
  /** Extra HTTP headers attached to every model request (e.g. Kimi For Coding
371
369
  * client-identity headers). Merged into the underlying SDK default headers. */
372
370
  defaultHeaders?: StreamOptions["defaultHeaders"];
@@ -579,6 +577,7 @@ declare function cancelledBeforeStartText(name: string): string;
579
577
  * something never ran when it did.
580
578
  */
581
579
  declare function indeterminateOutcomeText(name: string): string;
580
+ declare function capToolResults(toolResults: ToolResult[], maxToolResultChars: number | undefined): void;
582
581
  declare function repairToolPairingAdjacent(messages: Message[]): void;
583
582
 
584
583
  /**
@@ -590,4 +589,14 @@ declare function repairToolPairingAdjacent(messages: Message[]): void;
590
589
  */
591
590
  declare function isLocalBackendUrl(baseUrl?: string): boolean;
592
591
 
593
- export { Agent, type AgentDoneEvent, type AgentErrorEvent, type AgentEvent, type AgentFollowUpMessageEvent, type AgentOptions, type AgentResult, type AgentRetryEvent, type AgentServerToolCallEvent, type AgentServerToolResultEvent, type AgentSteeringMessageEvent, AgentStream, type AgentStreamRuleTriggeredEvent, type AgentTextDeltaEvent, type AgentThinkingDeltaEvent, type AgentTool, type AgentToolCallDeltaEvent, type AgentToolCallEndEvent, type AgentToolCallStartEvent, type AgentToolCallUpdateEvent, type AgentTurnEndEvent, type AgentTurnTiming, DEFAULT_STREAM_RULE_MAX_RETRIES, DEFAULT_STREAM_RULE_WINDOW_CHARS, JsonEscapeDecoder, type StreamDiagnosticFn, type StreamRule, type StreamRuleMatch, StreamRuleMonitor, type StreamRuleScope, type StreamRuleSource, type StreamRulesConfig, type StructuredToolResult, type ToolContext, type ToolExecuteResult, type ToolExecutionMode, type TransformContextOptions, agentLoop, buildStreamRuleReminder, cancelledBeforeStartText, indeterminateOutcomeText, isAbortError, isBillingError, isContextOverflow, isLocalBackendUrl, isUsageLimitError, repairToolPairingAdjacent, setStreamDiagnostic };
592
+ /** Result text for a call naming a tool that is not registered. */
593
+ declare function unknownToolMessage(name: string, available: readonly string[]): string;
594
+ /**
595
+ * Repair hints appended to an invalid-arguments error: the expected shape
596
+ * (`{ file_path: string, limit?: number }`) and, for each unrecognised key the
597
+ * model sent, the field it most likely meant. Empty when the schema has no
598
+ * object shape to describe.
599
+ */
600
+ declare function argumentHints(tool: AgentTool, args: unknown): string;
601
+
602
+ export { Agent, type AgentDoneEvent, type AgentErrorEvent, type AgentEvent, type AgentFollowUpMessageEvent, type AgentOptions, type AgentResult, type AgentRetryEvent, type AgentServerToolCallEvent, type AgentServerToolResultEvent, type AgentSteeringMessageEvent, AgentStream, type AgentStreamRuleTriggeredEvent, type AgentTextDeltaEvent, type AgentThinkingDeltaEvent, type AgentTool, type AgentToolCallDeltaEvent, type AgentToolCallEndEvent, type AgentToolCallStartEvent, type AgentToolCallUpdateEvent, type AgentTurnEndEvent, type AgentTurnTiming, DEFAULT_STREAM_RULE_MAX_RETRIES, DEFAULT_STREAM_RULE_WINDOW_CHARS, JsonEscapeDecoder, type StreamDiagnosticFn, type StreamRule, type StreamRuleMatch, StreamRuleMonitor, type StreamRuleScope, type StreamRuleSource, type StreamRulesConfig, type StructuredToolResult, type ToolContext, type ToolExecuteResult, type ToolExecutionMode, type TransformContextOptions, agentLoop, argumentHints, buildStreamRuleReminder, cancelledBeforeStartText, capToolResults, indeterminateOutcomeText, isAbortError, isBillingError, isContextOverflow, isLocalBackendUrl, isUsageLimitError, repairToolPairingAdjacent, setStreamDiagnostic, unknownToolMessage };
package/dist/index.js CHANGED
@@ -977,7 +977,6 @@ async function* agentLoop(messages, options) {
977
977
  supportsVideo: options.supportsVideo,
978
978
  compaction: options.compaction,
979
979
  clearToolUses: options.clearToolUses,
980
- userAgent: options.userAgent,
981
980
  defaultHeaders: options.defaultHeaders,
982
981
  providerOptions: options.providerOptions,
983
982
  fetch: options.fetch,
@@ -2542,8 +2541,10 @@ export {
2542
2541
  JsonEscapeDecoder,
2543
2542
  StreamRuleMonitor,
2544
2543
  agentLoop,
2544
+ argumentHints,
2545
2545
  buildStreamRuleReminder,
2546
2546
  cancelledBeforeStartText,
2547
+ capToolResults,
2547
2548
  indeterminateOutcomeText,
2548
2549
  isAbortError,
2549
2550
  isBillingError,
@@ -2551,6 +2552,7 @@ export {
2551
2552
  isLocalBackendUrl,
2552
2553
  isUsageLimitError,
2553
2554
  repairToolPairingAdjacent,
2554
- setStreamDiagnostic
2555
+ setStreamDiagnostic,
2556
+ unknownToolMessage
2555
2557
  };
2556
2558
  //# sourceMappingURL=index.js.map