llm-cli-gateway 2.11.1 → 2.12.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.ts CHANGED
@@ -5,7 +5,6 @@ import { ISessionManager, type CliType, type ProviderType } from "./session-mana
5
5
  import { ResourceProvider } from "./resources.js";
6
6
  import { PerformanceMetrics } from "./metrics.js";
7
7
  import { type PersistenceConfig, type CacheAwarenessConfig, type ProvidersConfig, type ApiProviderRuntime, type AcpConfig } from "./config.js";
8
- import { type XaiReasoningEffort } from "./xai-api-provider.js";
9
8
  import { DatabaseConnection } from "./db.js";
10
9
  import { AsyncJobManager } from "./async-job-manager.js";
11
10
  import { ApprovalManager, ApprovalRecord } from "./approval-manager.js";
@@ -63,6 +62,7 @@ export declare const WORKTREE_SCHEMA: z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
63
62
  export declare const WORKSPACE_ALIAS_SCHEMA: z.ZodString;
64
63
  export declare const SESSION_PROVIDER_VALUES: readonly ["claude", "codex", "gemini", "grok", "mistral", "devin", "grok-api"];
65
64
  export declare const SESSION_PROVIDER_ENUM: z.ZodEnum<["claude", "codex", "gemini", "grok", "mistral", "devin", "grok-api"]>;
65
+ export declare function sessionProviderValuesFor(providers: ProvidersConfig): string[];
66
66
  export type SessionProvider = ProviderType;
67
67
  export interface GatewayServerDeps {
68
68
  sessionManager?: ISessionManager;
@@ -120,6 +120,25 @@ export declare function resolveWorktreeForRequest(worktreeOpt: boolean | {
120
120
  workspaceRoot?: string;
121
121
  }): Promise<ResolvedWorktree>;
122
122
  export declare function formatWorktreePrefix(worktreePath?: string): string;
123
+ export declare function createErrorResponse(cli: string, code: number, stderr: string, correlationId?: string, error?: Error, apiError?: {
124
+ httpStatus?: number | null;
125
+ responseBody?: string;
126
+ }): {
127
+ content: {
128
+ type: "text";
129
+ text: string;
130
+ }[];
131
+ isError: boolean;
132
+ structuredContent: {
133
+ httpStatus?: number | undefined;
134
+ responseBody?: string | undefined;
135
+ response: string;
136
+ correlationId: string | null;
137
+ cli: string;
138
+ exitCode: number;
139
+ errorCategory: string;
140
+ };
141
+ };
123
142
  export declare function extractUsageAndCost(cli: "claude" | "codex" | "gemini" | "grok" | "mistral" | "devin", output: string, outputFormat?: string, ctx?: {
124
143
  sessionId?: string;
125
144
  home?: string;
@@ -232,6 +251,8 @@ export declare function prepareGeminiRequest(params: {
232
251
  attachments?: string[];
233
252
  skipTrust?: boolean;
234
253
  yolo?: boolean;
254
+ project?: string;
255
+ newProject?: boolean;
235
256
  }, runtime?: GatewayServerRuntime): CliRequestPrep | ExtendedToolResponse;
236
257
  export declare function prepareGrokRequest(params: {
237
258
  prompt?: string;
@@ -278,6 +299,9 @@ export declare function prepareGrokRequest(params: {
278
299
  restoreCode?: boolean;
279
300
  leaderSocket?: string;
280
301
  nativeWorktree?: boolean | string;
302
+ worktreeRef?: string;
303
+ forkSession?: boolean;
304
+ jsonSchema?: string | Record<string, unknown>;
281
305
  }, runtime?: GatewayServerRuntime): CliRequestPrep | ExtendedToolResponse;
282
306
  export declare function prepareMistralRequest(params: {
283
307
  prompt?: string;
@@ -309,6 +333,7 @@ export declare function buildMistralRetryPrep(params: Pick<MistralRequestParams,
309
333
  env: Record<string, string>;
310
334
  ignoredDisallowedTools: boolean;
311
335
  };
336
+ export declare function buildCliResponse(cli: "claude" | "codex" | "gemini" | "grok" | "mistral" | "devin", stdout: string, optimizeResponse: boolean, corrId: string, sessionId: string | undefined, prep: CliRequestPrep, durationMs: number, resumable?: boolean, outputFormat?: string, warnings?: WarningEntry[]): ExtendedToolResponse;
312
337
  export interface GrokApiRequestParams {
313
338
  prompt?: string;
314
339
  promptParts?: PromptParts;
@@ -321,12 +346,13 @@ export interface GrokApiRequestParams {
321
346
  maxOutputTokens?: number;
322
347
  temperature?: number;
323
348
  topP?: number;
324
- reasoningEffort?: XaiReasoningEffort;
349
+ reasoningEffort?: "none" | "low" | "medium" | "high";
325
350
  timeoutMs?: number;
326
351
  }
327
352
  export declare function handleGrokApiRequest(deps: HandlerDeps, params: GrokApiRequestParams): Promise<ExtendedToolResponse>;
328
353
  interface ApiProviderToolParams {
329
354
  prompt?: string;
355
+ promptParts?: PromptParts;
330
356
  system?: string;
331
357
  model?: string;
332
358
  correlationId?: string;
@@ -335,6 +361,11 @@ interface ApiProviderToolParams {
335
361
  topP?: number;
336
362
  reasoningEffort?: "none" | "low" | "medium" | "high";
337
363
  timeoutMs?: number;
364
+ optimizePrompt?: boolean;
365
+ optimizeResponse?: boolean;
366
+ forceRefresh?: boolean;
367
+ sessionId?: string;
368
+ createNewSession?: boolean;
338
369
  }
339
370
  export declare function handleApiProviderRequest(runtimeArg: GatewayServerRuntime, providerRuntime: ApiProviderRuntime, params: ApiProviderToolParams): Promise<ExtendedToolResponse>;
340
371
  export declare function handleApiProviderRequestAsync(runtimeArg: GatewayServerRuntime, providerRuntime: ApiProviderRuntime, params: ApiProviderToolParams): ExtendedToolResponse;
@@ -364,6 +395,8 @@ export interface GeminiRequestParams {
364
395
  attachments?: string[];
365
396
  skipTrust?: boolean;
366
397
  yolo?: boolean;
398
+ project?: string;
399
+ newProject?: boolean;
367
400
  workspace?: string;
368
401
  worktree?: boolean | {
369
402
  name?: string;
@@ -437,6 +470,9 @@ export interface GrokRequestParams {
437
470
  restoreCode?: boolean;
438
471
  leaderSocket?: string;
439
472
  nativeWorktree?: boolean | string;
473
+ worktreeRef?: string;
474
+ forkSession?: boolean;
475
+ jsonSchema?: string | Record<string, unknown>;
440
476
  workspace?: string;
441
477
  worktree?: boolean | {
442
478
  name?: string;