Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions packages/types/src/global-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,47 @@ export const globalSettingsSchema = z.object({
* Tools in this list will be excluded from prompt generation and rejected at execution time.
*/
disabledTools: z.array(toolNamesSchema).optional(),

/**
* Settings for the ToolResultProcessor (tool output compression).
* Controls thresholds for when compression kicks in.
*/
toolResultProcessorSettings: z
.object({
/** Master switch — false disables all compression */
enabled: z.boolean().optional(),
/** Compress read_file results above this many characters (default: 1500) */
readFileCharsAbove: z.number().optional(),
/** Compress search_files results above this many matches (default: 20) */
searchMatchesAbove: z.number().optional(),
/** Compress list_files results above this many paths (default: 100) */
listFilesCountAbove: z.number().optional(),
/** Compress execute_command results above this many characters (default: 1500) */
executeCommandCharsAbove: z.number().optional(),
})
.optional(),
Comment thread
coderabbitai[bot] marked this conversation as resolved.

/**
* Zoo Code API key for subscription features (smart compression).
* Stored in VS Code SecretStorage — never in global state.
* Generate at https://zoocode.dev/dashboard/api-tokens
*/
zooCodeApiKey: z.string().optional(),

/**
* Zoo Code API base URL for subscription features (smart compression).
* Defaults to "https://zoocode.dev". Override for dev/staging.
*/
zooCodeBaseUrl: z.string().optional(),
})

export type GlobalSettings = z.infer<typeof globalSettingsSchema>

/**
* Settings for the ToolResultProcessor, extracted from GlobalSettings for convenience.
*/
export type ToolResultProcessorSettings = NonNullable<GlobalSettings["toolResultProcessorSettings"]>

export const GLOBAL_SETTINGS_KEYS = globalSettingsSchema.keyof().options

/**
Expand Down Expand Up @@ -285,6 +322,7 @@ export const SECRET_STATE_KEYS = [
// Global secrets that are part of GlobalSettings (not ProviderSettings)
export const GLOBAL_SECRET_KEYS = [
"openRouterImageApiKey", // For image generation
"zooCodeApiKey", // Zoo Code subscription API key
] as const

// Type for the actual secret storage keys
Expand Down
9 changes: 8 additions & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ export interface ApiHandlerCreateMessageMetadata {
* Task ID used for tracking and provider-specific features:
* - Roo: Sent as X-Roo-Task-ID header
* - Requesty: Sent as trace_id
* Optional — not required for internal compression calls (ZooGatewayApiHandler).
*/
taskId: string
taskId?: string
/**
* Current mode slug for provider-specific tracking:
* - Requesty: Sent in extra metadata
Expand Down Expand Up @@ -87,6 +88,12 @@ export interface ApiHandlerCreateMessageMetadata {
* Only applies to providers that support function calling restrictions (e.g., Gemini).
*/
allowedFunctionNames?: string[]
/**
* Name of the tool that produced the result being compressed.
* Used by ZooGatewayApiHandler to pass the originating tool name
* to the compression endpoint for logging and prompt tuning.
*/
toolName?: string
}

export interface ApiHandler {
Expand Down
Loading
Loading