qlogicagent 2.6.1 → 2.9.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/agent.js +19 -17
- package/dist/cli.js +634 -367
- package/dist/index.js +631 -364
- package/dist/orchestration.js +15 -15
- package/dist/protocol.js +1 -1
- package/dist/types/agent/agent.d.ts +4 -1
- package/dist/types/agent/tool-loop.d.ts +3 -1
- package/dist/types/agent/tunable-defaults.d.ts +22 -1
- package/dist/types/agent/types.d.ts +7 -9
- package/dist/types/cli/handlers/agents-handler.d.ts +19 -0
- package/dist/types/cli/handlers/config-handler.d.ts +17 -0
- package/dist/types/cli/handlers/dream-handler.d.ts +5 -0
- package/dist/types/cli/handlers/files-handler.d.ts +15 -0
- package/dist/types/cli/handlers/media-handler.d.ts +13 -0
- package/dist/types/cli/handlers/memory-handler.d.ts +11 -0
- package/dist/types/cli/handlers/pet-handler.d.ts +21 -0
- package/dist/types/cli/handlers/product-handler.d.ts +32 -0
- package/dist/types/cli/handlers/project-handler.d.ts +19 -0
- package/dist/types/cli/handlers/session-handler.d.ts +38 -0
- package/dist/types/cli/handlers/settings-handler.d.ts +24 -0
- package/dist/types/cli/handlers/skills-handler.d.ts +20 -0
- package/dist/types/cli/handlers/solo-handler.d.ts +15 -0
- package/dist/types/cli/handlers/turn-handler.d.ts +17 -0
- package/dist/types/cli/main.d.ts +2 -2
- package/dist/types/cli/stdio-server.d.ts +94 -100
- package/dist/types/cli/tool-bootstrap.d.ts +7 -8
- package/dist/types/config/config.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/llm/index.d.ts +1 -31
- package/dist/types/orchestration/dag-scheduler.d.ts +46 -0
- package/dist/types/orchestration/index.d.ts +1 -1
- package/dist/types/orchestration/product-planner.d.ts +146 -0
- package/dist/types/orchestration/skill-improvement.d.ts +39 -0
- package/dist/types/orchestration/solo-evaluator.d.ts +26 -6
- package/dist/types/orchestration/solo-persistence.d.ts +5 -0
- package/dist/types/orchestration/tool-cascade.d.ts +2 -2
- package/dist/types/protocol/methods.d.ts +189 -6
- package/dist/types/protocol/notifications.d.ts +1 -1
- package/dist/types/protocol/wire/acp-protocol.d.ts +7 -0
- package/dist/types/protocol/wire/agent-events.d.ts +2 -2
- package/dist/types/protocol/wire/agent-methods.d.ts +6 -4
- package/dist/types/protocol/wire/gateway-rpc.d.ts +77 -4
- package/dist/types/protocol/wire/index.d.ts +1 -1
- package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +3 -1
- package/dist/types/protocol/wire/notification-payloads.d.ts +124 -4
- package/dist/types/runtime/execution/dream-agent.d.ts +33 -6
- package/dist/types/runtime/execution/forked-agent.d.ts +1 -1
- package/dist/types/runtime/execution/memory-decay.d.ts +17 -5
- package/dist/types/runtime/hooks/context-compression.d.ts +1 -1
- package/dist/types/runtime/hooks/memory-hooks.d.ts +10 -1
- package/dist/types/runtime/infra/acp-types.d.ts +92 -0
- package/dist/types/runtime/infra/agent-paths.d.ts +22 -25
- package/dist/types/runtime/infra/agent-process.d.ts +1 -1
- package/dist/types/runtime/infra/builtin-providers.d.ts +36 -0
- package/dist/types/runtime/infra/checkpoint-backend.d.ts +1 -1
- package/dist/types/runtime/infra/index.d.ts +1 -2
- package/dist/types/runtime/infra/key-pool.d.ts +120 -0
- package/dist/types/runtime/infra/media-persistence.d.ts +26 -15
- package/dist/types/runtime/infra/model-registry.d.ts +187 -0
- package/dist/types/runtime/infra/project-instructions-store.d.ts +3 -3
- package/dist/types/runtime/infra/project-store.d.ts +3 -0
- package/dist/types/runtime/infra/token-budget.d.ts +2 -2
- package/dist/types/runtime/infra/worktree-backend.d.ts +1 -1
- package/dist/types/runtime/pet/index.d.ts +8 -0
- package/dist/types/runtime/pet/pet-context-injection.d.ts +8 -0
- package/dist/types/runtime/pet/pet-file-loader.d.ts +62 -0
- package/dist/types/runtime/pet/pet-growth-engine.d.ts +60 -0
- package/dist/types/runtime/pet/pet-reaction-service.d.ts +33 -0
- package/dist/types/runtime/pet/pet-soul-service.d.ts +71 -0
- package/dist/types/runtime/prompt/environment-context.d.ts +10 -0
- package/dist/types/runtime/prompt/index.d.ts +1 -1
- package/dist/types/runtime/session/group-session-split.d.ts +38 -0
- package/dist/types/runtime/session/index.d.ts +4 -2
- package/dist/types/runtime/session/session-locator.d.ts +24 -0
- package/dist/types/runtime/session/session-memory.d.ts +4 -4
- package/dist/types/runtime/session/session-persistence.d.ts +47 -46
- package/dist/types/runtime/session/session-state.d.ts +3 -5
- package/dist/types/skills/index.d.ts +8 -2
- package/dist/types/skills/memory/implicit-extraction.d.ts +58 -0
- package/dist/types/skills/memory/local-embedding.d.ts +176 -0
- package/dist/types/skills/memory/local-memory-provider.d.ts +197 -0
- package/dist/types/skills/memory/local-store.d.ts +255 -0
- package/dist/types/skills/memory/memdir.d.ts +13 -5
- package/dist/types/skills/memory/memory-provider-factory.d.ts +48 -0
- package/dist/types/skills/memory/memory-tool.d.ts +30 -2
- package/dist/types/skills/permissions/denial-audit-log.d.ts +52 -0
- package/dist/types/skills/permissions/hook-runner.d.ts +14 -4
- package/dist/types/skills/permissions/permission-classifier.d.ts +1 -1
- package/dist/types/skills/skill-system/skill-lifecycle.d.ts +81 -0
- package/dist/types/skills/skill-system/skill-validation.d.ts +29 -0
- package/dist/types/skills/tools/exec-tool.d.ts +1 -1
- package/dist/types/skills/tools/search-tool.d.ts +1 -1
- package/dist/types/skills/tools.d.ts +3 -3
- package/dist/types/transport/acp-event-emitter.d.ts +1 -1
- package/dist/types/transport/acp-server.d.ts +7 -2
- package/package.json +19 -5
- package/dist/types/llm/adapters/aliyun-oss-file-upload-adapter.d.ts +0 -44
- package/dist/types/llm/adapters/gemini-file-upload-adapter.d.ts +0 -26
- package/dist/types/llm/adapters/hub-oss-file-upload-adapter.d.ts +0 -29
- package/dist/types/llm/adapters/index.d.ts +0 -10
- package/dist/types/llm/adapters/openai-file-upload-adapter.d.ts +0 -38
- package/dist/types/llm/adapters/volcengine-file-upload-adapter.d.ts +0 -24
- package/dist/types/llm/builtin-providers.d.ts +0 -10
- package/dist/types/llm/debug-transport.d.ts +0 -12
- package/dist/types/llm/file-upload-service.d.ts +0 -68
- package/dist/types/llm/gemini-schema-utils.d.ts +0 -17
- package/dist/types/llm/llm-client.d.ts +0 -43
- package/dist/types/llm/media-client.d.ts +0 -42
- package/dist/types/llm/media-transport.d.ts +0 -176
- package/dist/types/llm/model-catalog.d.ts +0 -53
- package/dist/types/llm/model-detection.d.ts +0 -22
- package/dist/types/llm/provider-def.d.ts +0 -203
- package/dist/types/llm/provider-registry.d.ts +0 -59
- package/dist/types/llm/provider-tool-api.d.ts +0 -44
- package/dist/types/llm/retry.d.ts +0 -37
- package/dist/types/llm/transport.d.ts +0 -281
- package/dist/types/llm/transports/anthropic-messages.d.ts +0 -65
- package/dist/types/llm/transports/gemini-cache-api.d.ts +0 -86
- package/dist/types/llm/transports/gemini-file-api.d.ts +0 -90
- package/dist/types/llm/transports/gemini-generatecontent.d.ts +0 -56
- package/dist/types/llm/transports/gemini-lyria-realtime.d.ts +0 -117
- package/dist/types/llm/transports/gemini-media.d.ts +0 -53
- package/dist/types/llm/transports/media-resolve.d.ts +0 -50
- package/dist/types/llm/transports/minimax-media.d.ts +0 -55
- package/dist/types/llm/transports/openai-chat.d.ts +0 -81
- package/dist/types/llm/transports/openai-media.d.ts +0 -24
- package/dist/types/llm/transports/openai-responses.d.ts +0 -63
- package/dist/types/llm/transports/qwen-media.d.ts +0 -50
- package/dist/types/llm/transports/realtime-transport.d.ts +0 -183
- package/dist/types/llm/transports/volcengine-grounding.d.ts +0 -58
- package/dist/types/llm/transports/volcengine-media.d.ts +0 -93
- package/dist/types/llm/transports/volcengine-responses.d.ts +0 -64
- package/dist/types/llm/transports/zhipu-media.d.ts +0 -82
- package/dist/types/llm/transports/zhipu-tool-api.d.ts +0 -35
- package/dist/types/runtime/infra/project-plan-store.d.ts +0 -27
- package/dist/types/skills/memory/qmemory-adapter.d.ts +0 -55
- package/dist/types/skills/memory/qmemory-http-client.d.ts +0 -16
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LLMTransport 鈥?abstract interface for LLM inference calls.
|
|
3
|
-
*
|
|
4
|
-
* Aligned with Hermes `ProviderTransport` ABC:
|
|
5
|
-
* stream(request, apiKey, signal) 鈫?AsyncGenerator<LLMChunk>
|
|
6
|
-
*
|
|
7
|
-
* Two concrete implementations:
|
|
8
|
-
* - OpenAI Chat Completions (covers 95% of providers)
|
|
9
|
-
* - Anthropic Messages API
|
|
10
|
-
*/
|
|
11
|
-
import type { ChatMessage, ToolDefinition } from "../protocol/wire/index.js";
|
|
12
|
-
export type StructuredOutputConfig = {
|
|
13
|
-
mode: "json_object";
|
|
14
|
-
} | {
|
|
15
|
-
mode: "json_schema";
|
|
16
|
-
name: string;
|
|
17
|
-
schema: Record<string, unknown>;
|
|
18
|
-
strict?: boolean;
|
|
19
|
-
};
|
|
20
|
-
export interface CachingConfig {
|
|
21
|
-
type: "enabled" | "disabled";
|
|
22
|
-
/** Enable prefix caching mode (搂20.3). Requires store=true and stream=false. */
|
|
23
|
-
prefix?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export type ContextEdit = {
|
|
26
|
-
type: "clear_thinking";
|
|
27
|
-
keep?: "all" | {
|
|
28
|
-
type: "thinking_turns";
|
|
29
|
-
value: number;
|
|
30
|
-
};
|
|
31
|
-
} | {
|
|
32
|
-
type: "clear_tool_uses";
|
|
33
|
-
trigger?: {
|
|
34
|
-
type: "tool_uses";
|
|
35
|
-
value: number;
|
|
36
|
-
};
|
|
37
|
-
keep?: {
|
|
38
|
-
type: "tool_uses";
|
|
39
|
-
value: number;
|
|
40
|
-
};
|
|
41
|
-
excludeTools?: string[];
|
|
42
|
-
clearToolInput?: boolean;
|
|
43
|
-
};
|
|
44
|
-
export interface ContextManagementConfig {
|
|
45
|
-
edits: ContextEdit[];
|
|
46
|
-
}
|
|
47
|
-
export interface LLMRequest {
|
|
48
|
-
model: string;
|
|
49
|
-
messages: ChatMessage[];
|
|
50
|
-
tools?: ToolDefinition[];
|
|
51
|
-
toolChoice?: "auto" | "none" | "required" | {
|
|
52
|
-
type: "function";
|
|
53
|
-
name: string;
|
|
54
|
-
};
|
|
55
|
-
temperature?: number;
|
|
56
|
-
/** Nucleus sampling: controls diversity via cumulative probability cutoff. */
|
|
57
|
-
topP?: number;
|
|
58
|
-
maxTokens?: number;
|
|
59
|
-
reasoning?: {
|
|
60
|
-
effort: "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
61
|
-
/** Request encrypted original reasoning content (Volcengine 搂17.7). */
|
|
62
|
-
includeEncryptedReasoning?: boolean;
|
|
63
|
-
};
|
|
64
|
-
/** Volcengine: max builtin tool calls per turn (搂19.15). */
|
|
65
|
-
maxToolCalls?: number;
|
|
66
|
-
/**
|
|
67
|
-
* DeepSeek prefix completion: force model to continue from this prefix.
|
|
68
|
-
* Requires `/beta` endpoint; adds a trailing assistant message with `prefix: true`.
|
|
69
|
-
*/
|
|
70
|
-
prefixMessage?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Model requires streaming 鈥?disable non-streaming fallback in transports.
|
|
73
|
-
* When true, transports must NOT fall back to non-streaming requests on failure.
|
|
74
|
-
* Set for models like QwQ/Omni where the provider rejects non-streaming calls.
|
|
75
|
-
*/
|
|
76
|
-
streamRequired?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Disable injection of provider-native builtin tools (web_search, code_interpreter)
|
|
79
|
-
* for this specific request. Allows session-level control over GLM/Kimi builtin tools.
|
|
80
|
-
*/
|
|
81
|
-
disableBuiltinTools?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Volcengine builtin tools to inject (web_search, image_process, knowledge_search).
|
|
84
|
-
* Each entry specifies a tool type and optional config.
|
|
85
|
-
* These are platform-executed tools requiring beta headers.
|
|
86
|
-
*/
|
|
87
|
-
builtinTools?: Array<{
|
|
88
|
-
type: "builtin_web_search" | "builtin_image_process" | "builtin_knowledge_search" | "builtin_doubao_app";
|
|
89
|
-
config?: Record<string, unknown>;
|
|
90
|
-
}>;
|
|
91
|
-
/**
|
|
92
|
-
* Server-side context continuation via response chain (搂5).
|
|
93
|
-
* When set, the server automatically includes previous context,
|
|
94
|
-
* so messages[] only needs to contain the NEW user message.
|
|
95
|
-
*/
|
|
96
|
-
previousResponseId?: string;
|
|
97
|
-
/**
|
|
98
|
-
* Control server-side storage of this request's input/output (搂5.1).
|
|
99
|
-
* Default: true (server stores for 3 days).
|
|
100
|
-
*/
|
|
101
|
-
store?: boolean;
|
|
102
|
-
/** Expiration time for stored response (Unix seconds, max 7 days from now) */
|
|
103
|
-
storeExpireAt?: number;
|
|
104
|
-
/**
|
|
105
|
-
* Per-turn system instruction augmentation (搂8).
|
|
106
|
-
* Temporarily overlays persona or adds constraints for this turn only.
|
|
107
|
-
* NOTE: Incompatible with caching 鈥?do not use both together.
|
|
108
|
-
*/
|
|
109
|
-
instructions?: string;
|
|
110
|
-
/**
|
|
111
|
-
* Structured output format (搂16).
|
|
112
|
-
* Forces model to produce JSON conforming to the specified schema.
|
|
113
|
-
*/
|
|
114
|
-
structuredOutput?: StructuredOutputConfig;
|
|
115
|
-
/**
|
|
116
|
-
* Caching configuration (搂20).
|
|
117
|
-
* Controls prefix/session caching behavior.
|
|
118
|
-
* NOTE: Incompatible with instructions, json_schema, and builtin tools.
|
|
119
|
-
*/
|
|
120
|
-
caching?: CachingConfig;
|
|
121
|
-
/**
|
|
122
|
-
* Context management edits (搂21, beta).
|
|
123
|
-
* Server-side trimming of historical thinking chains and tool call traces.
|
|
124
|
-
*/
|
|
125
|
-
contextManagement?: ContextManagementConfig;
|
|
126
|
-
/**
|
|
127
|
-
* Gemini explicit cache reference (gemini-ProviderMax 搂8).
|
|
128
|
-
* Passes a pre-created cache name (e.g. "cachedContents/abc123") to
|
|
129
|
-
* generateContent so the server uses cached tokens instead of re-processing.
|
|
130
|
-
* Create caches via GeminiCacheAPI.createCache() first.
|
|
131
|
-
*/
|
|
132
|
-
cachedContent?: string;
|
|
133
|
-
/**
|
|
134
|
-
* Predicted output for speculative decoding (openai-ProviderMax 搂11).
|
|
135
|
-
* When editing code, pass the existing content so the model can diff efficiently.
|
|
136
|
-
* Reduces latency by 3-5x when prediction matches. Falls back when it doesn't.
|
|
137
|
-
* Works with OpenAI GPT-5.x models via Responses API and Chat Completions.
|
|
138
|
-
*/
|
|
139
|
-
prediction?: {
|
|
140
|
-
type: "content";
|
|
141
|
-
content: string;
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Prompt cache bucketing key (openai-ProviderMax 搂11).
|
|
145
|
-
* Replaces the deprecated `user` field. Helps OpenAI group similar requests
|
|
146
|
-
* for higher cache hit rates.
|
|
147
|
-
*/
|
|
148
|
-
promptCacheKey?: string;
|
|
149
|
-
/**
|
|
150
|
-
* Prompt cache retention policy (openai-ProviderMax 搂11).
|
|
151
|
-
* "in_memory" = default 5-10 min, "24h" = extended up to 24 hours.
|
|
152
|
-
*/
|
|
153
|
-
promptCacheRetention?: "in_memory" | "24h";
|
|
154
|
-
/**
|
|
155
|
-
* Service tier for request scheduling (openai-ProviderMax 搂14).
|
|
156
|
-
* "auto" = project default, "flex" = 50% cheaper / higher latency,
|
|
157
|
-
* "priority" = guaranteed low latency.
|
|
158
|
-
*/
|
|
159
|
-
serviceTier?: "auto" | "default" | "flex" | "priority";
|
|
160
|
-
/**
|
|
161
|
-
* OpenAI Responses API built-in tools (openai-ProviderMax 搂7).
|
|
162
|
-
* Platform-executed tools like web_search, file_search, code_interpreter, etc.
|
|
163
|
-
*/
|
|
164
|
-
openaiBuiltinTools?: Array<{
|
|
165
|
-
type: "web_search_preview" | "file_search" | "code_interpreter" | "computer_use_preview";
|
|
166
|
-
[key: string]: unknown;
|
|
167
|
-
}>;
|
|
168
|
-
/**
|
|
169
|
-
* OpenAI Responses API conversation ID (openai-ProviderMax 搂2.1).
|
|
170
|
-
* Alternative to previous_response_id 鈥?persistent server-side conversation.
|
|
171
|
-
* Cannot be used together with previousResponseId.
|
|
172
|
-
*/
|
|
173
|
-
conversationId?: string;
|
|
174
|
-
/**
|
|
175
|
-
* Disable parallel tool calling for this request.
|
|
176
|
-
* When false, the model must call tools sequentially.
|
|
177
|
-
*/
|
|
178
|
-
parallelToolCalls?: boolean;
|
|
179
|
-
/**
|
|
180
|
-
* Text output verbosity hint (openai-ProviderMax 搂5).
|
|
181
|
-
* Controls how detailed the model's textual output should be.
|
|
182
|
-
*/
|
|
183
|
-
textVerbosity?: "low" | "medium" | "high";
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* FIM completion request 鈥?DeepSeek Beta Completions API.
|
|
187
|
-
* POST /beta/v1/completions with prompt + suffix.
|
|
188
|
-
* Only works with non-thinking mode.
|
|
189
|
-
*/
|
|
190
|
-
export interface FIMRequest {
|
|
191
|
-
model: string;
|
|
192
|
-
/** Text before the cursor (prefix context) */
|
|
193
|
-
prompt: string;
|
|
194
|
-
/** Text after the cursor (suffix context) */
|
|
195
|
-
suffix?: string;
|
|
196
|
-
/** Max tokens to generate for the infill */
|
|
197
|
-
maxTokens?: number;
|
|
198
|
-
/** Sampling temperature */
|
|
199
|
-
temperature?: number;
|
|
200
|
-
/** Stop sequences */
|
|
201
|
-
stop?: string[];
|
|
202
|
-
}
|
|
203
|
-
export type FIMChunk = {
|
|
204
|
-
type: "delta";
|
|
205
|
-
text: string;
|
|
206
|
-
} | {
|
|
207
|
-
type: "done";
|
|
208
|
-
finishReason: string;
|
|
209
|
-
};
|
|
210
|
-
export type LLMChunk = {
|
|
211
|
-
type: "delta";
|
|
212
|
-
text: string;
|
|
213
|
-
} | {
|
|
214
|
-
type: "tool_call_delta";
|
|
215
|
-
index: number;
|
|
216
|
-
id?: string;
|
|
217
|
-
name?: string;
|
|
218
|
-
arguments: string;
|
|
219
|
-
} | {
|
|
220
|
-
type: "reasoning_delta";
|
|
221
|
-
text: string;
|
|
222
|
-
} | {
|
|
223
|
-
type: "reasoning_block_complete";
|
|
224
|
-
thinking: string;
|
|
225
|
-
signature: string;
|
|
226
|
-
} | {
|
|
227
|
-
type: "usage";
|
|
228
|
-
promptTokens: number;
|
|
229
|
-
completionTokens: number;
|
|
230
|
-
reasoningTokens?: number;
|
|
231
|
-
cacheReadTokens?: number;
|
|
232
|
-
cacheCreationTokens?: number;
|
|
233
|
-
} | {
|
|
234
|
-
type: "response_id";
|
|
235
|
-
id: string;
|
|
236
|
-
} | {
|
|
237
|
-
/** Informational status from platform-executed builtin tools (web_search, image_process). */
|
|
238
|
-
type: "builtin_tool_status";
|
|
239
|
-
toolType: string;
|
|
240
|
-
event: string;
|
|
241
|
-
data?: Record<string, unknown>;
|
|
242
|
-
} | {
|
|
243
|
-
/** Web search citation annotations from provider builtin tools (Volcengine web_search, Gemini grounding). */
|
|
244
|
-
type: "annotations";
|
|
245
|
-
annotations: Array<{
|
|
246
|
-
type: string;
|
|
247
|
-
url?: string;
|
|
248
|
-
title?: string;
|
|
249
|
-
[key: string]: unknown;
|
|
250
|
-
}>;
|
|
251
|
-
} | {
|
|
252
|
-
type: "error";
|
|
253
|
-
message: string;
|
|
254
|
-
} | {
|
|
255
|
-
type: "done";
|
|
256
|
-
finishReason: string;
|
|
257
|
-
};
|
|
258
|
-
export interface AccumulatedToolCall {
|
|
259
|
-
id: string;
|
|
260
|
-
name: string;
|
|
261
|
-
arguments: string;
|
|
262
|
-
}
|
|
263
|
-
export interface LLMTransport {
|
|
264
|
-
/**
|
|
265
|
-
* Stream an LLM inference request.
|
|
266
|
-
* apiKey is passed explicitly (from agent.turn.config, not env).
|
|
267
|
-
*/
|
|
268
|
-
stream(request: LLMRequest, apiKey: string, signal?: AbortSignal): AsyncGenerator<LLMChunk>;
|
|
269
|
-
/**
|
|
270
|
-
* FIM (Fill-In-Middle) completion 鈥?optional capability.
|
|
271
|
-
* Only implemented by providers that support it (DeepSeek /beta endpoint).
|
|
272
|
-
*/
|
|
273
|
-
complete?(request: FIMRequest, apiKey: string, signal?: AbortSignal): AsyncGenerator<FIMChunk>;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Accumulate tool_call_delta chunks into complete ToolCall objects.
|
|
277
|
-
* Modeled after admin-infer-proxy-client's Map<index, toolCall> accumulator.
|
|
278
|
-
*/
|
|
279
|
-
export declare function accumulateToolCalls(accumulator: Map<number, AccumulatedToolCall>, chunk: LLMChunk & {
|
|
280
|
-
type: "tool_call_delta";
|
|
281
|
-
}): void;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Anthropic Messages Transport 鈥?SSE streaming for Claude API.
|
|
3
|
-
*
|
|
4
|
-
* Aligned with CC (claude-code-haha) src/services/api/claude.ts:
|
|
5
|
-
* - cache_control ephemeral injection on system prompt blocks
|
|
6
|
-
* - ensureToolResultPairing() conversation repair before every request
|
|
7
|
-
* - Retry with exponential backoff on transient errors (429/529/overloaded)
|
|
8
|
-
* - Non-streaming fallback when stream errors out
|
|
9
|
-
* - 90s idle watchdog timeout for silently dropped connections
|
|
10
|
-
* - Adaptive/budget thinking with temperature omit
|
|
11
|
-
* - Cache token extraction with >0 guard (CC updateUsage parity)
|
|
12
|
-
* - signature_delta handling for thinking blocks
|
|
13
|
-
*/
|
|
14
|
-
import type { LLMChunk, LLMRequest, LLMTransport } from "../transport.js";
|
|
15
|
-
import type { ProviderQuirks } from "../provider-def.js";
|
|
16
|
-
import type { FileUploadAdapter } from "../file-upload-service.js";
|
|
17
|
-
export interface AnthropicTransportConfig {
|
|
18
|
-
baseUrl: string;
|
|
19
|
-
/** anthropic-version header (default "2023-06-01") */
|
|
20
|
-
apiVersion?: string;
|
|
21
|
-
/** Per-request timeout in ms (default 180_000) */
|
|
22
|
-
timeoutMs?: number;
|
|
23
|
-
/** Stream idle watchdog timeout in ms (default 90_000, CC parity) */
|
|
24
|
-
streamIdleTimeoutMs?: number;
|
|
25
|
-
/** Enable prompt caching via cache_control ephemeral (default true) */
|
|
26
|
-
enablePromptCaching?: boolean;
|
|
27
|
-
/** Max retry attempts on transient errors (default 3) */
|
|
28
|
-
maxRetries?: number;
|
|
29
|
-
/** Omit temperature when it equals 0 鈥?MiniMax rejects temperature=0 */
|
|
30
|
-
omitZeroTemperature?: boolean;
|
|
31
|
-
/** Provider-specific quirks for conditional logic (CC/altcode parity) */
|
|
32
|
-
quirks?: ProviderQuirks;
|
|
33
|
-
/** File upload adapter (Hub OSS relay for Anthropic). */
|
|
34
|
-
fileUploadAdapter?: FileUploadAdapter;
|
|
35
|
-
}
|
|
36
|
-
export declare class AnthropicMessagesTransport implements LLMTransport {
|
|
37
|
-
private baseUrl;
|
|
38
|
-
private apiVersion;
|
|
39
|
-
private timeoutMs;
|
|
40
|
-
private streamIdleTimeoutMs;
|
|
41
|
-
private enablePromptCaching;
|
|
42
|
-
private maxRetries;
|
|
43
|
-
private omitZeroTemperature;
|
|
44
|
-
private quirks;
|
|
45
|
-
private fileUploadAdapter?;
|
|
46
|
-
constructor(config: AnthropicTransportConfig);
|
|
47
|
-
stream(request: LLMRequest, apiKey: string, signal?: AbortSignal): AsyncGenerator<LLMChunk>;
|
|
48
|
-
/**
|
|
49
|
-
* Stream with idle watchdog timer (CC parity: 90s default).
|
|
50
|
-
* Throws if no chunks received for streamIdleTimeoutMs.
|
|
51
|
-
*/
|
|
52
|
-
private streamWithWatchdog;
|
|
53
|
-
/**
|
|
54
|
-
* Non-streaming fallback (CC executeNonStreamingRequest parity).
|
|
55
|
-
* Used when streaming fails after all retries.
|
|
56
|
-
* Caps max_tokens at 64K and adjusts thinking budget accordingly.
|
|
57
|
-
*/
|
|
58
|
-
private nonStreamingFallback;
|
|
59
|
-
/**
|
|
60
|
-
* Convert a non-streaming API response to LLMChunk sequence.
|
|
61
|
-
*/
|
|
62
|
-
private mapNonStreamingResponse;
|
|
63
|
-
private parseSSEStream;
|
|
64
|
-
private mapEvent;
|
|
65
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GeminiCacheAPI — Explicit Context Caching for Gemini generateContent.
|
|
3
|
-
*
|
|
4
|
-
* Manages named cached content resources that can be referenced in
|
|
5
|
-
* generateContent requests via the `cachedContent` field.
|
|
6
|
-
*
|
|
7
|
-
* REST endpoints:
|
|
8
|
-
* POST /v1beta/cachedContents — create cache
|
|
9
|
-
* GET /v1beta/cachedContents — list caches
|
|
10
|
-
* GET /v1beta/cachedContents/{name} — get cache metadata
|
|
11
|
-
* PATCH /v1beta/cachedContents/{name} — update TTL
|
|
12
|
-
* DELETE /v1beta/cachedContents/{name} — delete cache
|
|
13
|
-
*
|
|
14
|
-
* Minimum cacheable content: 1024 tokens (Flash) / 4096 tokens (Pro).
|
|
15
|
-
* TTL default: 1 hour. Storage: ~$1.00/hour/MTok (Flash series).
|
|
16
|
-
*
|
|
17
|
-
* Docs: https://ai.google.dev/gemini-api/docs/caching
|
|
18
|
-
*/
|
|
19
|
-
export interface GeminiCacheCreateOptions {
|
|
20
|
-
/** Model to use, e.g. "models/gemini-3-flash-preview" */
|
|
21
|
-
model: string;
|
|
22
|
-
/** Contents to cache (same format as generateContent contents) */
|
|
23
|
-
contents: Array<Record<string, unknown>>;
|
|
24
|
-
/** Optional system instruction to include in cache */
|
|
25
|
-
systemInstruction?: Record<string, unknown>;
|
|
26
|
-
/** Time-to-live, e.g. "300s" for 5 minutes. Default: "3600s" (1 hour) */
|
|
27
|
-
ttl?: string;
|
|
28
|
-
/** Human-readable name for identifying the cache */
|
|
29
|
-
displayName?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface GeminiCachedContent {
|
|
32
|
-
/** Resource name, e.g. "cachedContents/abc123" */
|
|
33
|
-
name: string;
|
|
34
|
-
/** Model this cache is bound to */
|
|
35
|
-
model: string;
|
|
36
|
-
/** Display name (if set) */
|
|
37
|
-
displayName?: string;
|
|
38
|
-
/** Token usage metadata */
|
|
39
|
-
usageMetadata?: {
|
|
40
|
-
totalTokenCount?: number;
|
|
41
|
-
};
|
|
42
|
-
/** Creation time (ISO 8601) */
|
|
43
|
-
createTime?: string;
|
|
44
|
-
/** Last update time (ISO 8601) */
|
|
45
|
-
updateTime?: string;
|
|
46
|
-
/** Expiration time (ISO 8601) */
|
|
47
|
-
expireTime?: string;
|
|
48
|
-
}
|
|
49
|
-
export declare class GeminiCacheAPI {
|
|
50
|
-
private baseUrl;
|
|
51
|
-
private timeoutMs;
|
|
52
|
-
constructor(config: {
|
|
53
|
-
baseUrl: string;
|
|
54
|
-
timeoutMs?: number;
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* Create a new cached content resource.
|
|
58
|
-
* The cache name returned can be passed as `cachedContent` in generateContent.
|
|
59
|
-
*/
|
|
60
|
-
createCache(options: GeminiCacheCreateOptions, apiKey: string, signal?: AbortSignal): Promise<GeminiCachedContent>;
|
|
61
|
-
/**
|
|
62
|
-
* Get metadata for a cached content resource.
|
|
63
|
-
*/
|
|
64
|
-
getCache(name: string, apiKey: string, signal?: AbortSignal): Promise<GeminiCachedContent>;
|
|
65
|
-
/**
|
|
66
|
-
* List all cached content resources.
|
|
67
|
-
*/
|
|
68
|
-
listCaches(apiKey: string, options?: {
|
|
69
|
-
pageSize?: number;
|
|
70
|
-
pageToken?: string;
|
|
71
|
-
}, signal?: AbortSignal): Promise<{
|
|
72
|
-
cachedContents: GeminiCachedContent[];
|
|
73
|
-
nextPageToken?: string;
|
|
74
|
-
}>;
|
|
75
|
-
/**
|
|
76
|
-
* Update a cache's TTL or expiration time.
|
|
77
|
-
*/
|
|
78
|
-
updateCache(name: string, update: {
|
|
79
|
-
ttl?: string;
|
|
80
|
-
expireTime?: string;
|
|
81
|
-
}, apiKey: string, signal?: AbortSignal): Promise<GeminiCachedContent>;
|
|
82
|
-
/**
|
|
83
|
-
* Delete a cached content resource.
|
|
84
|
-
*/
|
|
85
|
-
deleteCache(name: string, apiKey: string, signal?: AbortSignal): Promise<void>;
|
|
86
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GeminiFileAPI — Gemini File API for uploading and managing files.
|
|
3
|
-
*
|
|
4
|
-
* Files uploaded via this API can be referenced in generateContent requests
|
|
5
|
-
* using `file_data: { file_uri, mime_type }` parts.
|
|
6
|
-
*
|
|
7
|
-
* Upload uses the resumable upload protocol (2-step):
|
|
8
|
-
* 1. POST /upload/v1beta/files → get upload URL (response header)
|
|
9
|
-
* 2. PUT {upload_url} with file bytes → get file info
|
|
10
|
-
*
|
|
11
|
-
* Other operations:
|
|
12
|
-
* GET /v1beta/files — list files
|
|
13
|
-
* GET /v1beta/files/{name} — get file metadata
|
|
14
|
-
* DELETE /v1beta/files/{name} — delete file
|
|
15
|
-
*
|
|
16
|
-
* Files expire after 48 hours. Max 2GB per file, 20GB per project.
|
|
17
|
-
*
|
|
18
|
-
* Docs: https://ai.google.dev/gemini-api/docs/files
|
|
19
|
-
*/
|
|
20
|
-
export interface GeminiFileInfo {
|
|
21
|
-
/** Resource name, e.g. "files/abc123" */
|
|
22
|
-
name: string;
|
|
23
|
-
/** Display name (set during upload) */
|
|
24
|
-
displayName?: string;
|
|
25
|
-
/** MIME type */
|
|
26
|
-
mimeType: string;
|
|
27
|
-
/** File size in bytes */
|
|
28
|
-
sizeBytes?: string;
|
|
29
|
-
/** File URI for use in generateContent, e.g. "https://generativelanguage.googleapis.com/v1beta/files/abc123" */
|
|
30
|
-
uri: string;
|
|
31
|
-
/** Processing state: PROCESSING | ACTIVE | FAILED */
|
|
32
|
-
state: string;
|
|
33
|
-
/** Creation time (ISO 8601) */
|
|
34
|
-
createTime?: string;
|
|
35
|
-
/** Last update time (ISO 8601) */
|
|
36
|
-
updateTime?: string;
|
|
37
|
-
/** Expiration time (ISO 8601) */
|
|
38
|
-
expirationTime?: string;
|
|
39
|
-
/** Error info if state is FAILED */
|
|
40
|
-
error?: {
|
|
41
|
-
code: number;
|
|
42
|
-
message: string;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export declare class GeminiFileAPI {
|
|
46
|
-
private baseUrl;
|
|
47
|
-
private timeoutMs;
|
|
48
|
-
constructor(config: {
|
|
49
|
-
baseUrl: string;
|
|
50
|
-
timeoutMs?: number;
|
|
51
|
-
});
|
|
52
|
-
/**
|
|
53
|
-
* Upload a file using the resumable upload protocol.
|
|
54
|
-
*
|
|
55
|
-
* Step 1: Initiate upload → get upload URL from response header
|
|
56
|
-
* Step 2: Upload bytes to that URL → get file metadata
|
|
57
|
-
*
|
|
58
|
-
* @returns GeminiFileInfo with .uri for use in generateContent
|
|
59
|
-
*/
|
|
60
|
-
uploadFile(file: Blob | Buffer, apiKey: string, options?: {
|
|
61
|
-
mimeType?: string;
|
|
62
|
-
displayName?: string;
|
|
63
|
-
}, signal?: AbortSignal): Promise<GeminiFileInfo>;
|
|
64
|
-
/**
|
|
65
|
-
* Wait for a file to finish processing (state → ACTIVE).
|
|
66
|
-
* Some file types (video, audio) require server-side processing.
|
|
67
|
-
*/
|
|
68
|
-
waitForProcessing(name: string, apiKey: string, options?: {
|
|
69
|
-
pollIntervalMs?: number;
|
|
70
|
-
maxWaitMs?: number;
|
|
71
|
-
}): Promise<GeminiFileInfo>;
|
|
72
|
-
/**
|
|
73
|
-
* Get metadata for an uploaded file.
|
|
74
|
-
*/
|
|
75
|
-
getFile(name: string, apiKey: string, signal?: AbortSignal): Promise<GeminiFileInfo>;
|
|
76
|
-
/**
|
|
77
|
-
* List uploaded files.
|
|
78
|
-
*/
|
|
79
|
-
listFiles(apiKey: string, options?: {
|
|
80
|
-
pageSize?: number;
|
|
81
|
-
pageToken?: string;
|
|
82
|
-
}, signal?: AbortSignal): Promise<{
|
|
83
|
-
files: GeminiFileInfo[];
|
|
84
|
-
nextPageToken?: string;
|
|
85
|
-
}>;
|
|
86
|
-
/**
|
|
87
|
-
* Delete an uploaded file.
|
|
88
|
-
*/
|
|
89
|
-
deleteFile(name: string, apiKey: string, signal?: AbortSignal): Promise<void>;
|
|
90
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini generateContent Transport 鈥?Native Gemini API streaming implementation.
|
|
3
|
-
*
|
|
4
|
-
* Targets Gemini 3 series exclusively (3.1 Pro, 3 Flash, 3.1 Flash-Lite).
|
|
5
|
-
* Uses the native Gemini REST API instead of the OpenAI compatibility layer,
|
|
6
|
-
* unlocking Gemini-exclusive features unavailable via the compat endpoint:
|
|
7
|
-
* - thinkingConfig (thinkingLevel 鈥?G3 native control)
|
|
8
|
-
* - Google Search / Maps Grounding
|
|
9
|
-
* - Code Execution
|
|
10
|
-
* - Safety Settings fine-grained control
|
|
11
|
-
* - Thought Signatures for multi-turn reasoning continuity
|
|
12
|
-
* - URL Context / File Search
|
|
13
|
-
* - systemInstruction top-level field
|
|
14
|
-
*
|
|
15
|
-
* Streaming endpoint: POST .../models/{model}:streamGenerateContent?alt=sse
|
|
16
|
-
* Non-streaming: POST .../models/{model}:generateContent
|
|
17
|
-
* Auth: x-goog-api-key header
|
|
18
|
-
*
|
|
19
|
-
* Protocol reference: https://ai.google.dev/gemini-api/docs
|
|
20
|
-
* Aligned with gemini-ProviderMax.md native protocol strategy.
|
|
21
|
-
*/
|
|
22
|
-
import type { LLMChunk, LLMRequest, LLMTransport } from "../transport.js";
|
|
23
|
-
import type { ProviderQuirks } from "../provider-def.js";
|
|
24
|
-
import type { FileUploadAdapter } from "../file-upload-service.js";
|
|
25
|
-
export interface GeminiGenerateContentTransportConfig {
|
|
26
|
-
/** Base URL, e.g. "https://generativelanguage.googleapis.com/v1beta" */
|
|
27
|
-
baseUrl: string;
|
|
28
|
-
/** Per-request timeout in ms (default 180_000) */
|
|
29
|
-
timeoutMs?: number;
|
|
30
|
-
/** Provider-specific quirks */
|
|
31
|
-
quirks?: ProviderQuirks;
|
|
32
|
-
/** File upload adapter for resolving local media URLs via upload instead of base64. */
|
|
33
|
-
fileUploadAdapter?: FileUploadAdapter;
|
|
34
|
-
}
|
|
35
|
-
export declare class GeminiGenerateContentTransport implements LLMTransport {
|
|
36
|
-
private baseUrl;
|
|
37
|
-
private timeoutMs;
|
|
38
|
-
private quirks;
|
|
39
|
-
private fileUploadAdapter?;
|
|
40
|
-
constructor(config: GeminiGenerateContentTransportConfig);
|
|
41
|
-
stream(request: LLMRequest, apiKey: string, signal?: AbortSignal): AsyncGenerator<LLMChunk>;
|
|
42
|
-
private buildRequestBody;
|
|
43
|
-
private buildTools;
|
|
44
|
-
private buildToolConfig;
|
|
45
|
-
private buildGenerationConfig;
|
|
46
|
-
private fetchAndStream;
|
|
47
|
-
/**
|
|
48
|
-
* Parse SSE stream with 90s idle watchdog (CC parity).
|
|
49
|
-
*/
|
|
50
|
-
private parseSSEStreamWithWatchdog;
|
|
51
|
-
/**
|
|
52
|
-
* Process a single Gemini response chunk, yielding LLMChunk events.
|
|
53
|
-
*/
|
|
54
|
-
private processResponse;
|
|
55
|
-
private nonStreamingFallback;
|
|
56
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GeminiLyriaRealtimeSession — WebSocket-based real-time streaming music generation.
|
|
3
|
-
*
|
|
4
|
-
* Uses Lyria RealTime (`lyria-realtime-exp`) via the Gemini Live API WebSocket.
|
|
5
|
-
* Provides both a full interactive session API and a one-shot convenience method.
|
|
6
|
-
*
|
|
7
|
-
* Protocol:
|
|
8
|
-
* - WebSocket URL: wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent
|
|
9
|
-
* - Auth: API key as query parameter
|
|
10
|
-
* - Client → Server: setup, musicInput (weightedPrompts, musicGenerationConfig, playbackControl)
|
|
11
|
-
* - Server → Client: serverContent.audioChunks (base64 PCM s16le, 48kHz, stereo)
|
|
12
|
-
*
|
|
13
|
-
* Docs: https://ai.google.dev/gemini-api/docs/realtime-music-generation
|
|
14
|
-
*/
|
|
15
|
-
export interface WeightedPrompt {
|
|
16
|
-
text: string;
|
|
17
|
-
weight: number;
|
|
18
|
-
}
|
|
19
|
-
export type MusicScale = "C_MAJOR_A_MINOR" | "D_FLAT_MAJOR_B_FLAT_MINOR" | "D_MAJOR_B_MINOR" | "E_FLAT_MAJOR_C_MINOR" | "E_MAJOR_D_FLAT_MINOR" | "F_MAJOR_D_MINOR" | "G_FLAT_MAJOR_E_FLAT_MINOR" | "G_MAJOR_E_MINOR" | "A_FLAT_MAJOR_F_MINOR" | "A_MAJOR_G_FLAT_MINOR" | "B_FLAT_MAJOR_G_MINOR" | "B_MAJOR_A_FLAT_MINOR" | "SCALE_UNSPECIFIED";
|
|
20
|
-
export type MusicGenerationMode = "QUALITY" | "DIVERSITY" | "VOCALIZATION";
|
|
21
|
-
export interface MusicGenerationConfig {
|
|
22
|
-
bpm?: number;
|
|
23
|
-
density?: number;
|
|
24
|
-
brightness?: number;
|
|
25
|
-
guidance?: number;
|
|
26
|
-
scale?: MusicScale;
|
|
27
|
-
temperature?: number;
|
|
28
|
-
topK?: number;
|
|
29
|
-
seed?: number;
|
|
30
|
-
muteBass?: boolean;
|
|
31
|
-
muteDrums?: boolean;
|
|
32
|
-
onlyBassAndDrums?: boolean;
|
|
33
|
-
musicGenerationMode?: MusicGenerationMode;
|
|
34
|
-
audioFormat?: string;
|
|
35
|
-
sampleRateHz?: number;
|
|
36
|
-
}
|
|
37
|
-
export interface LyriaRealtimeConfig {
|
|
38
|
-
/** Base URL (REST), e.g. "https://generativelanguage.googleapis.com/v1beta" */
|
|
39
|
-
baseUrl: string;
|
|
40
|
-
}
|
|
41
|
-
export interface LyriaRealtimeSessionOptions {
|
|
42
|
-
model?: string;
|
|
43
|
-
prompts: WeightedPrompt[];
|
|
44
|
-
config?: MusicGenerationConfig;
|
|
45
|
-
}
|
|
46
|
-
/** Audio chunk received from the server. */
|
|
47
|
-
export interface AudioChunk {
|
|
48
|
-
/** Raw PCM s16le data (48kHz, stereo) */
|
|
49
|
-
data: Buffer;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Interactive Lyria RealTime session over WebSocket.
|
|
53
|
-
*
|
|
54
|
-
* Usage:
|
|
55
|
-
* const session = new GeminiLyriaRealtimeSession({ baseUrl: "..." });
|
|
56
|
-
* await session.connect(apiKey, { prompts: [{ text: "jazz", weight: 1 }] });
|
|
57
|
-
* session.onAudioChunk = (chunk) => { ... };
|
|
58
|
-
* await session.play();
|
|
59
|
-
* // ... later
|
|
60
|
-
* await session.stop();
|
|
61
|
-
* session.close();
|
|
62
|
-
*/
|
|
63
|
-
export declare class GeminiLyriaRealtimeSession {
|
|
64
|
-
private ws;
|
|
65
|
-
private wsUrl;
|
|
66
|
-
private model;
|
|
67
|
-
/** Called for each audio chunk received from the server. */
|
|
68
|
-
onAudioChunk: ((chunk: AudioChunk) => void) | null;
|
|
69
|
-
/** Called when the server reports a filtered prompt. */
|
|
70
|
-
onFilteredPrompt: ((reason: string) => void) | null;
|
|
71
|
-
/** Called on WebSocket error. */
|
|
72
|
-
onError: ((error: Error) => void) | null;
|
|
73
|
-
/** Called when the WebSocket connection closes. */
|
|
74
|
-
onClose: (() => void) | null;
|
|
75
|
-
constructor(config: LyriaRealtimeConfig);
|
|
76
|
-
/**
|
|
77
|
-
* Connect to the Lyria RealTime WebSocket and send setup + initial config.
|
|
78
|
-
*/
|
|
79
|
-
connect(apiKey: string, options: LyriaRealtimeSessionOptions): Promise<void>;
|
|
80
|
-
/** Set or update weighted prompts (smooth transition). */
|
|
81
|
-
setWeightedPrompts(prompts: WeightedPrompt[]): Promise<void>;
|
|
82
|
-
/** Set or update music generation config. */
|
|
83
|
-
setMusicGenerationConfig(config: MusicGenerationConfig): Promise<void>;
|
|
84
|
-
/** Start streaming music. */
|
|
85
|
-
play(): Promise<void>;
|
|
86
|
-
/** Pause music streaming (can resume with play). */
|
|
87
|
-
pause(): Promise<void>;
|
|
88
|
-
/** Stop music streaming (terminates the current piece). */
|
|
89
|
-
stop(): Promise<void>;
|
|
90
|
-
/** Reset model context (for BPM/scale changes). */
|
|
91
|
-
resetContext(): Promise<void>;
|
|
92
|
-
/** Close the WebSocket connection. */
|
|
93
|
-
close(): void;
|
|
94
|
-
/** Whether the session is connected. */
|
|
95
|
-
get connected(): boolean;
|
|
96
|
-
private send;
|
|
97
|
-
private handleMessage;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Generate a fixed-duration music clip using Lyria RealTime.
|
|
101
|
-
*
|
|
102
|
-
* Connects, plays for the specified duration (default 30s), collects all
|
|
103
|
-
* audio chunks, assembles into a WAV file, and returns the file path.
|
|
104
|
-
*
|
|
105
|
-
* Output: 48kHz, stereo, 16-bit PCM wrapped in WAV.
|
|
106
|
-
*/
|
|
107
|
-
export declare function generateRealtimeMusic(apiKey: string, config: LyriaRealtimeConfig, options: {
|
|
108
|
-
prompts: WeightedPrompt[];
|
|
109
|
-
durationSeconds?: number;
|
|
110
|
-
musicConfig?: MusicGenerationConfig;
|
|
111
|
-
model?: string;
|
|
112
|
-
signal?: AbortSignal;
|
|
113
|
-
onProgress?: (percent: number, status: string) => void;
|
|
114
|
-
}): Promise<{
|
|
115
|
-
filePath: string;
|
|
116
|
-
durationMs: number;
|
|
117
|
-
}>;
|