qlogicagent 1.0.1 → 1.1.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 +6 -6
- package/dist/cli.js +181 -172
- package/dist/index.js +181 -172
- package/dist/orchestration.js +1 -1
- package/dist/types/agent/tool-loop.d.ts +2 -0
- package/dist/types/agent/types.d.ts +46 -1
- package/dist/types/cli/stdio-server.d.ts +10 -0
- package/dist/types/cli/tool-bootstrap.d.ts +13 -1
- package/dist/types/llm/index.d.ts +1 -1
- package/dist/types/llm/llm-client.d.ts +1 -1
- package/dist/types/llm/media-client.d.ts +3 -4
- package/dist/types/llm/media-transport.d.ts +75 -4
- package/dist/types/llm/provider-def.d.ts +124 -3
- package/dist/types/llm/provider-registry.d.ts +5 -0
- package/dist/types/llm/provider-tool-api.d.ts +44 -0
- package/dist/types/llm/retry.d.ts +37 -0
- package/dist/types/llm/transport.d.ts +157 -2
- package/dist/types/llm/transports/anthropic-messages.d.ts +7 -0
- package/dist/types/llm/transports/minimax-media.d.ts +5 -0
- package/dist/types/llm/transports/openai-chat.d.ts +44 -3
- package/dist/types/llm/transports/realtime-transport.d.ts +183 -0
- package/dist/types/llm/transports/volcengine-grounding.d.ts +58 -0
- package/dist/types/llm/transports/volcengine-media.d.ts +50 -0
- package/dist/types/llm/transports/volcengine-responses.d.ts +60 -0
- package/dist/types/llm/transports/zhipu-media.d.ts +60 -0
- package/dist/types/llm/transports/zhipu-tool-api.d.ts +35 -0
- package/dist/types/orchestration/tool-cascade.d.ts +40 -0
- package/dist/types/orchestration/tool-loop/tool-schema.d.ts +1 -1
- package/dist/types/protocol/methods.d.ts +19 -0
- package/dist/types/skills/memory/memory-extractor.d.ts +1 -1
- package/dist/types/skills/tools/file-management-tool.d.ts +90 -0
- package/dist/types/skills/tools/image-generate-tool.d.ts +13 -1
- package/dist/types/skills/tools/music-generate-tool.d.ts +25 -0
- package/dist/types/skills/tools/stt-tool.d.ts +33 -0
- package/dist/types/skills/tools/three-d-generate-tool.d.ts +45 -0
- package/dist/types/skills/tools/tts-tool.d.ts +12 -0
- package/dist/types/skills/tools/video-edit-tool.d.ts +5 -2
- package/dist/types/skills/tools/video-generate-tool.d.ts +102 -2
- package/dist/types/skills/tools/video-merge-tool.d.ts +1 -1
- package/dist/types/skills/tools/video-upscale-tool.d.ts +1 -1
- package/dist/types/skills/tools/voice-clone-tool.d.ts +40 -0
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zhipu (GLM) Media Transport — CogView (image), CogVideoX (video), TTS, STT, Embedding.
|
|
3
|
+
*
|
|
4
|
+
* API reference (docs.bigmodel.cn):
|
|
5
|
+
* Image sync: POST /images/generations (CogView-4, cogview-3-flash)
|
|
6
|
+
* Image async: POST /async/images/generations (glm-image)
|
|
7
|
+
* Video async: POST /videos/generations (CogVideoX)
|
|
8
|
+
* TTS sync: POST /audio/speech (glm-tts, returns audio bytes)
|
|
9
|
+
* STT sync: POST /audio/transcriptions (glm-asr, multipart/form-data)
|
|
10
|
+
* Embedding: POST /embeddings (embedding-3/2)
|
|
11
|
+
* Async poll: GET /async-result/{id} (unified poll for all async tasks)
|
|
12
|
+
*
|
|
13
|
+
* Base URL: https://open.bigmodel.cn/api/paas/v4
|
|
14
|
+
* Auth: Authorization: Bearer $ZHIPU_API_KEY
|
|
15
|
+
*/
|
|
16
|
+
import type { MediaTransport, MediaRequest, MediaResult, MediaType } from "../media-transport.js";
|
|
17
|
+
export interface ZhipuMediaConfig {
|
|
18
|
+
/** Base URL, e.g. "https://open.bigmodel.cn/api/paas/v4" */
|
|
19
|
+
baseUrl: string;
|
|
20
|
+
timeoutMs?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class ZhipuMediaTransport implements MediaTransport {
|
|
23
|
+
readonly supportedTypes: readonly MediaType[];
|
|
24
|
+
private baseUrl;
|
|
25
|
+
private timeoutMs;
|
|
26
|
+
constructor(config: ZhipuMediaConfig);
|
|
27
|
+
generate(request: MediaRequest, apiKey: string, signal?: AbortSignal): Promise<MediaResult>;
|
|
28
|
+
private generateImage;
|
|
29
|
+
/** CogView-4 / cogview-3-flash — sync, returns URL directly */
|
|
30
|
+
private generateImageSync;
|
|
31
|
+
/** glm-image — async submit + poll */
|
|
32
|
+
private generateImageAsync;
|
|
33
|
+
private generateVideo;
|
|
34
|
+
private generateTTS;
|
|
35
|
+
private generateSTT;
|
|
36
|
+
private generateEmbedding;
|
|
37
|
+
private generateVoiceClone;
|
|
38
|
+
private generateDocumentParsing;
|
|
39
|
+
private generateRerank;
|
|
40
|
+
private postJSON;
|
|
41
|
+
/**
|
|
42
|
+
* Unified async result polling — GET /async-result/{id}
|
|
43
|
+
* Returns the result object when task_status === "SUCCESS".
|
|
44
|
+
* Throws on "FAIL" or timeout.
|
|
45
|
+
*/
|
|
46
|
+
private pollAsyncResult;
|
|
47
|
+
/**
|
|
48
|
+
* List cloned voices — GET /voice/
|
|
49
|
+
* Returns all voice clones for the current user.
|
|
50
|
+
*/
|
|
51
|
+
listVoices(apiKey: string, signal?: AbortSignal): Promise<Array<{
|
|
52
|
+
voice_id: string;
|
|
53
|
+
voice_name: string;
|
|
54
|
+
status: string;
|
|
55
|
+
}>>;
|
|
56
|
+
/**
|
|
57
|
+
* Delete a cloned voice — DELETE /voice/{voice_id}
|
|
58
|
+
*/
|
|
59
|
+
deleteVoice(voiceId: string, apiKey: string, signal?: AbortSignal): Promise<void>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZhipuToolAPI — Zhipu-specific utility endpoints.
|
|
3
|
+
*
|
|
4
|
+
* Implements ProviderToolAPI for Zhipu GLM platform independent APIs:
|
|
5
|
+
* C1: Web Search — POST /tools/web-search
|
|
6
|
+
* C2: Reader — POST /tools/reader (extract web page content)
|
|
7
|
+
* C3: Tokenizer — POST /tokenizer
|
|
8
|
+
* C4: Moderations — POST /moderations
|
|
9
|
+
*
|
|
10
|
+
* Base URL: https://open.bigmodel.cn/api/paas/v4
|
|
11
|
+
* Auth: Authorization: Bearer $ZHIPU_API_KEY
|
|
12
|
+
*
|
|
13
|
+
* C5 (File Parser) is handled by document_parsing media handler.
|
|
14
|
+
* C6 (Realtime API) requires WebSocket — out of scope for this interface.
|
|
15
|
+
*/
|
|
16
|
+
import type { ProviderToolAPI, ProviderToolCapability, WebSearchResult, ReaderResult, TokenizerResult, ModerationResult } from "../provider-tool-api.js";
|
|
17
|
+
export interface ZhipuToolAPIConfig {
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
apiKey: string;
|
|
20
|
+
timeoutMs?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class ZhipuToolAPI implements ProviderToolAPI {
|
|
23
|
+
readonly capabilities: readonly ProviderToolCapability[];
|
|
24
|
+
private baseUrl;
|
|
25
|
+
private apiKey;
|
|
26
|
+
private timeoutMs;
|
|
27
|
+
constructor(config: ZhipuToolAPIConfig);
|
|
28
|
+
webSearch(query: string, options?: {
|
|
29
|
+
maxResults?: number;
|
|
30
|
+
}): Promise<WebSearchResult[]>;
|
|
31
|
+
reader(pageUrl: string): Promise<ReaderResult>;
|
|
32
|
+
tokenize(text: string, model: string): Promise<TokenizerResult>;
|
|
33
|
+
moderate(text: string): Promise<ModerationResult>;
|
|
34
|
+
private postJSON;
|
|
35
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Cascade — provider-native tool augmentation layer.
|
|
3
|
+
*
|
|
4
|
+
* When a provider (e.g. Zhipu GLM) offers native utility APIs (web search, reader,
|
|
5
|
+
* tokenizer, etc.), the tool cascade automatically routes through the provider API
|
|
6
|
+
* first, falling back to the host-provided implementation (e.g. SearXNG) on failure.
|
|
7
|
+
*
|
|
8
|
+
* ## Architecture
|
|
9
|
+
*
|
|
10
|
+
* Two levels of provider tool integration:
|
|
11
|
+
*
|
|
12
|
+
* 1. **D-level (builtin tools)**: Injected directly into chat completion request
|
|
13
|
+
* via `builtinWebSearch` / `builtinCodeInterpreter` quirks.
|
|
14
|
+
* The LLM decides to use these inline during generation — no agent intervention.
|
|
15
|
+
* → Handled by openai-chat.ts transport layer.
|
|
16
|
+
*
|
|
17
|
+
* 2. **C-level (independent APIs)**: Discrete API endpoints the agent calls explicitly
|
|
18
|
+
* as tool steps (web_search, reader, tokenizer, moderations).
|
|
19
|
+
* → Handled by this cascade layer — wraps host-provided tool deps with
|
|
20
|
+
* provider-native backends, falling back on error.
|
|
21
|
+
*
|
|
22
|
+
* ## Usage
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { cascadeWebSearch } from "./tool-cascade.js";
|
|
26
|
+
* import { ZhipuToolAPI } from "../llm/transports/zhipu-tool-api.js";
|
|
27
|
+
*
|
|
28
|
+
* const providerApi = new ZhipuToolAPI({ baseUrl, apiKey });
|
|
29
|
+
* const cascadedSearch = cascadeWebSearch(providerApi, fallbackSearchFn);
|
|
30
|
+
* const tool = createWebSearchTool({ search: cascadedSearch });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
import type { ProviderToolAPI } from "../llm/provider-tool-api.js";
|
|
34
|
+
import type { WebSearchToolDeps } from "../skills/tools/web-search-tool.js";
|
|
35
|
+
/**
|
|
36
|
+
* Cascade web search: provider-native search → host fallback.
|
|
37
|
+
* Returns a WebSearchToolDeps.search function that tries the provider's
|
|
38
|
+
* webSearch API first, falling back to the host's search on error.
|
|
39
|
+
*/
|
|
40
|
+
export declare function cascadeWebSearch(providerApi: ProviderToolAPI | undefined, fallbackSearch: WebSearchToolDeps["search"]): WebSearchToolDeps["search"];
|
|
@@ -32,7 +32,7 @@ export declare function parseOpenAiToolCallsFromChatResponse(responseBody: strin
|
|
|
32
32
|
export declare function buildAssistantToolCallMessage(toolCalls: OpenAiToolCall[], text?: string, thinkingBlocks?: Array<{
|
|
33
33
|
thinking: string;
|
|
34
34
|
signature: string;
|
|
35
|
-
}
|
|
35
|
+
}>, reasoningContent?: string): Record<string, unknown>;
|
|
36
36
|
export declare function buildToolResultMessage(callId: string, result: {
|
|
37
37
|
ok: boolean;
|
|
38
38
|
payload?: unknown;
|
|
@@ -190,6 +190,21 @@ export interface ToolsListResult {
|
|
|
190
190
|
parameters?: Record<string, unknown>;
|
|
191
191
|
}>;
|
|
192
192
|
}
|
|
193
|
+
export interface MediaListModelsParams {
|
|
194
|
+
/** Filter by media type (image/video/music/tts/3d/stt/embedding). Omit to list all. */
|
|
195
|
+
mediaType?: string;
|
|
196
|
+
}
|
|
197
|
+
export interface MediaListModelsResult {
|
|
198
|
+
models: Array<{
|
|
199
|
+
providerId: string;
|
|
200
|
+
providerName: string;
|
|
201
|
+
modelId: string;
|
|
202
|
+
modelName: string;
|
|
203
|
+
mediaType: string;
|
|
204
|
+
/** Fine-grained capability metadata (operations, formats, limits) */
|
|
205
|
+
capabilities?: Record<string, unknown>;
|
|
206
|
+
}>;
|
|
207
|
+
}
|
|
193
208
|
export interface ConfigGetParams {
|
|
194
209
|
keys?: string[];
|
|
195
210
|
}
|
|
@@ -339,6 +354,10 @@ export interface RpcMethodMap {
|
|
|
339
354
|
params: ToolsListParams;
|
|
340
355
|
result: ToolsListResult;
|
|
341
356
|
};
|
|
357
|
+
"media.listModels": {
|
|
358
|
+
params: MediaListModelsParams;
|
|
359
|
+
result: MediaListModelsResult;
|
|
360
|
+
};
|
|
342
361
|
"config.get": {
|
|
343
362
|
params: ConfigGetParams;
|
|
344
363
|
result: ConfigGetResult;
|
|
@@ -44,7 +44,7 @@ export type ExtractionCompleteFn = (params: {
|
|
|
44
44
|
}>;
|
|
45
45
|
}>;
|
|
46
46
|
export interface MemoryExtractorOptions {
|
|
47
|
-
/** Model to use for extraction (default: "deepseek-
|
|
47
|
+
/** Model to use for extraction (default: "deepseek-v4-flash"). */
|
|
48
48
|
model?: string;
|
|
49
49
|
/** Timeout in ms for the LLM call (default: 30_000). */
|
|
50
50
|
timeoutMs?: number;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const FILE_UPLOAD_TOOL_NAME: "file_upload";
|
|
3
|
+
export interface FileUploadToolParams {
|
|
4
|
+
file_path: string;
|
|
5
|
+
purpose?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const FILE_UPLOAD_TOOL_SCHEMA: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly file_path: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: string;
|
|
13
|
+
};
|
|
14
|
+
readonly purpose: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly required: readonly ["file_path"];
|
|
20
|
+
};
|
|
21
|
+
export interface FileUploadResult {
|
|
22
|
+
fileId: string;
|
|
23
|
+
url?: string;
|
|
24
|
+
filename: string;
|
|
25
|
+
bytes: number;
|
|
26
|
+
provider: string;
|
|
27
|
+
}
|
|
28
|
+
export interface FileUploadToolDeps {
|
|
29
|
+
uploadFile(params: {
|
|
30
|
+
filePath: string;
|
|
31
|
+
purpose?: string;
|
|
32
|
+
}): Promise<FileUploadResult>;
|
|
33
|
+
}
|
|
34
|
+
export declare function createFileUploadTool(deps: FileUploadToolDeps): PortableTool<FileUploadToolParams>;
|
|
35
|
+
export declare const FILE_QUERY_TOOL_NAME: "file_query";
|
|
36
|
+
export interface FileQueryToolParams {
|
|
37
|
+
file_id?: string;
|
|
38
|
+
limit?: number;
|
|
39
|
+
}
|
|
40
|
+
export declare const FILE_QUERY_TOOL_SCHEMA: {
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
readonly properties: {
|
|
43
|
+
readonly file_id: {
|
|
44
|
+
readonly type: "string";
|
|
45
|
+
readonly description: "Query a specific file by ID. If omitted, lists recent uploaded files.";
|
|
46
|
+
};
|
|
47
|
+
readonly limit: {
|
|
48
|
+
readonly type: "number";
|
|
49
|
+
readonly description: "Max number of files to list when file_id is omitted. Default: 10, max: 100.";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
readonly required: readonly [];
|
|
53
|
+
};
|
|
54
|
+
export interface FileInfo {
|
|
55
|
+
id: string;
|
|
56
|
+
filename: string;
|
|
57
|
+
bytes: number;
|
|
58
|
+
status: string;
|
|
59
|
+
createdAt?: string;
|
|
60
|
+
url?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface FileQueryToolDeps {
|
|
63
|
+
queryFile(params: {
|
|
64
|
+
fileId: string;
|
|
65
|
+
}): Promise<FileInfo>;
|
|
66
|
+
listFiles(params: {
|
|
67
|
+
limit?: number;
|
|
68
|
+
}): Promise<FileInfo[]>;
|
|
69
|
+
}
|
|
70
|
+
export declare function createFileQueryTool(deps: FileQueryToolDeps): PortableTool<FileQueryToolParams>;
|
|
71
|
+
export declare const FILE_DELETE_TOOL_NAME: "file_delete";
|
|
72
|
+
export interface FileDeleteToolParams {
|
|
73
|
+
file_id: string;
|
|
74
|
+
}
|
|
75
|
+
export declare const FILE_DELETE_TOOL_SCHEMA: {
|
|
76
|
+
readonly type: "object";
|
|
77
|
+
readonly properties: {
|
|
78
|
+
readonly file_id: {
|
|
79
|
+
readonly type: "string";
|
|
80
|
+
readonly description: "ID of the uploaded file to delete.";
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
readonly required: readonly ["file_id"];
|
|
84
|
+
};
|
|
85
|
+
export interface FileDeleteToolDeps {
|
|
86
|
+
deleteFile(params: {
|
|
87
|
+
fileId: string;
|
|
88
|
+
}): Promise<void>;
|
|
89
|
+
}
|
|
90
|
+
export declare function createFileDeleteTool(deps: FileDeleteToolDeps): PortableTool<FileDeleteToolParams>;
|
|
@@ -7,6 +7,8 @@ export interface ImageGenerateToolParams {
|
|
|
7
7
|
size?: string;
|
|
8
8
|
image_url?: string;
|
|
9
9
|
n?: number;
|
|
10
|
+
quality?: string;
|
|
11
|
+
seed?: number;
|
|
10
12
|
}
|
|
11
13
|
export declare const IMAGE_GENERATE_TOOL_SCHEMA: {
|
|
12
14
|
readonly type: "object";
|
|
@@ -29,12 +31,20 @@ export declare const IMAGE_GENERATE_TOOL_SCHEMA: {
|
|
|
29
31
|
};
|
|
30
32
|
readonly image_url: {
|
|
31
33
|
readonly type: "string";
|
|
32
|
-
readonly description:
|
|
34
|
+
readonly description: string;
|
|
33
35
|
};
|
|
34
36
|
readonly n: {
|
|
35
37
|
readonly type: "number";
|
|
36
38
|
readonly description: "Number of images to generate (1-4). Default: 1.";
|
|
37
39
|
};
|
|
40
|
+
readonly quality: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly description: "Image quality level: 'auto', 'high', 'low', 'hd'. Provider-specific.";
|
|
43
|
+
};
|
|
44
|
+
readonly seed: {
|
|
45
|
+
readonly type: "number";
|
|
46
|
+
readonly description: "Random seed for reproducible generation. Same seed + prompt = same result.";
|
|
47
|
+
};
|
|
38
48
|
};
|
|
39
49
|
readonly required: readonly ["prompt"];
|
|
40
50
|
};
|
|
@@ -57,6 +67,8 @@ export interface ImageGenerateToolDeps {
|
|
|
57
67
|
size?: string;
|
|
58
68
|
imageUrl?: string;
|
|
59
69
|
n?: number;
|
|
70
|
+
quality?: string;
|
|
71
|
+
seed?: number;
|
|
60
72
|
}): Promise<ImageGenerateResult>;
|
|
61
73
|
}
|
|
62
74
|
export declare function createImageGenerateTool(deps: ImageGenerateToolDeps): PortableTool<ImageGenerateToolParams>;
|
|
@@ -6,6 +6,9 @@ export interface MusicGenerateToolParams {
|
|
|
6
6
|
style?: string;
|
|
7
7
|
lyrics?: string;
|
|
8
8
|
duration?: number;
|
|
9
|
+
is_instrumental?: boolean;
|
|
10
|
+
cover_audio_url?: string;
|
|
11
|
+
audio_format?: string;
|
|
9
12
|
}
|
|
10
13
|
export declare const MUSIC_GENERATE_TOOL_SCHEMA: {
|
|
11
14
|
readonly type: "object";
|
|
@@ -30,6 +33,19 @@ export declare const MUSIC_GENERATE_TOOL_SCHEMA: {
|
|
|
30
33
|
readonly type: "number";
|
|
31
34
|
readonly description: "Duration in seconds (5-300). Infer from purpose: ringtone 15-30s, BGM 30-60s, full song 120-180s.";
|
|
32
35
|
};
|
|
36
|
+
readonly is_instrumental: {
|
|
37
|
+
readonly type: "boolean";
|
|
38
|
+
readonly description: "Set true for pure instrumental music without vocals. Defaults to true when no lyrics are provided.";
|
|
39
|
+
};
|
|
40
|
+
readonly cover_audio_url: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly description: string;
|
|
43
|
+
};
|
|
44
|
+
readonly audio_format: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly enum: readonly ["mp3", "wav", "flac"];
|
|
47
|
+
readonly description: "Output audio format. Defaults to mp3.";
|
|
48
|
+
};
|
|
33
49
|
};
|
|
34
50
|
readonly required: readonly ["prompt"];
|
|
35
51
|
};
|
|
@@ -50,6 +66,15 @@ export interface MusicGenerateToolDeps {
|
|
|
50
66
|
style?: string;
|
|
51
67
|
lyrics?: string;
|
|
52
68
|
duration?: number;
|
|
69
|
+
isInstrumental?: boolean;
|
|
70
|
+
audioUrl?: string;
|
|
71
|
+
audioFormat?: string;
|
|
53
72
|
}): Promise<MusicGenerateResult>;
|
|
73
|
+
/**
|
|
74
|
+
* Optional: auto-generate lyrics from a prompt (MiniMax Lyrics Generation API).
|
|
75
|
+
* When provided, the tool will auto-call this when no lyrics are supplied
|
|
76
|
+
* and the song is not marked as instrumental.
|
|
77
|
+
*/
|
|
78
|
+
generateLyrics?: (prompt: string) => Promise<string>;
|
|
54
79
|
}
|
|
55
80
|
export declare function createMusicGenerateTool(deps: MusicGenerateToolDeps): PortableTool<MusicGenerateToolParams>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const STT_TOOL_NAME: "stt";
|
|
3
|
+
export interface SttToolParams {
|
|
4
|
+
audio_url: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const STT_TOOL_SCHEMA: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly audio_url: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: string;
|
|
13
|
+
};
|
|
14
|
+
readonly language: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: "Language hint for transcription: 'zh' (Chinese), 'en' (English), or auto-detect if omitted.";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly required: readonly ["audio_url"];
|
|
20
|
+
};
|
|
21
|
+
export interface SttResult {
|
|
22
|
+
transcription: string;
|
|
23
|
+
model?: string;
|
|
24
|
+
durationMs?: number;
|
|
25
|
+
}
|
|
26
|
+
/** Deps injected by the host runtime for STT. */
|
|
27
|
+
export interface SttToolDeps {
|
|
28
|
+
speechToText(params: {
|
|
29
|
+
audioUrl: string;
|
|
30
|
+
language?: string;
|
|
31
|
+
}): Promise<SttResult>;
|
|
32
|
+
}
|
|
33
|
+
export declare function createSttTool(deps: SttToolDeps): PortableTool<SttToolParams>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
+
export declare const THREE_D_GENERATE_TOOL_NAME: "three_d_generate";
|
|
3
|
+
export interface ThreeDGenerateToolParams {
|
|
4
|
+
prompt: string;
|
|
5
|
+
image_url?: string;
|
|
6
|
+
output_format?: string;
|
|
7
|
+
seed?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const THREE_D_GENERATE_TOOL_SCHEMA: {
|
|
10
|
+
readonly type: "object";
|
|
11
|
+
readonly properties: {
|
|
12
|
+
readonly prompt: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: string;
|
|
15
|
+
};
|
|
16
|
+
readonly image_url: {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
readonly description: string;
|
|
19
|
+
};
|
|
20
|
+
readonly output_format: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly description: "3D model output format: 'glb' (default), 'obj', 'usd', 'usdz'.";
|
|
23
|
+
};
|
|
24
|
+
readonly seed: {
|
|
25
|
+
readonly type: "number";
|
|
26
|
+
readonly description: "Random seed for reproducible generation.";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly required: readonly ["prompt"];
|
|
30
|
+
};
|
|
31
|
+
export interface ThreeDGenerateResult {
|
|
32
|
+
mediaUrls: string[];
|
|
33
|
+
model?: string;
|
|
34
|
+
durationMs?: number;
|
|
35
|
+
}
|
|
36
|
+
/** Deps injected by the host runtime for 3D generation. */
|
|
37
|
+
export interface ThreeDGenerateToolDeps {
|
|
38
|
+
generate3D(params: {
|
|
39
|
+
prompt: string;
|
|
40
|
+
imageUrl?: string;
|
|
41
|
+
outputFormat?: string;
|
|
42
|
+
seed?: number;
|
|
43
|
+
}): Promise<ThreeDGenerateResult>;
|
|
44
|
+
}
|
|
45
|
+
export declare function createThreeDGenerateTool(deps: ThreeDGenerateToolDeps): PortableTool<ThreeDGenerateToolParams>;
|
|
@@ -3,6 +3,8 @@ export declare const TTS_TOOL_NAME: "tts";
|
|
|
3
3
|
export interface TtsToolParams {
|
|
4
4
|
text: string;
|
|
5
5
|
channel?: string;
|
|
6
|
+
voice?: string;
|
|
7
|
+
speed?: number;
|
|
6
8
|
}
|
|
7
9
|
export declare const TTS_TOOL_SCHEMA: {
|
|
8
10
|
readonly type: "object";
|
|
@@ -15,6 +17,14 @@ export declare const TTS_TOOL_SCHEMA: {
|
|
|
15
17
|
readonly type: "string";
|
|
16
18
|
readonly description: "Optional channel id to pick output format (e.g. telegram).";
|
|
17
19
|
};
|
|
20
|
+
readonly voice: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly description: string;
|
|
23
|
+
};
|
|
24
|
+
readonly speed: {
|
|
25
|
+
readonly type: "number";
|
|
26
|
+
readonly description: "Speech speed multiplier (0.25-4.0). Default is 1.0.";
|
|
27
|
+
};
|
|
18
28
|
};
|
|
19
29
|
readonly required: readonly ["text"];
|
|
20
30
|
};
|
|
@@ -33,6 +43,8 @@ export interface TtsToolDeps {
|
|
|
33
43
|
textToSpeech(params: {
|
|
34
44
|
text: string;
|
|
35
45
|
channel?: string;
|
|
46
|
+
voice?: string;
|
|
47
|
+
speed?: number;
|
|
36
48
|
}): Promise<TtsResult>;
|
|
37
49
|
}
|
|
38
50
|
export declare function createTtsTool(deps: TtsToolDeps): PortableTool<TtsToolParams>;
|
|
@@ -22,17 +22,20 @@ export declare const VIDEO_EDIT_TOOL_SCHEMA: {
|
|
|
22
22
|
};
|
|
23
23
|
readonly minItems: 1;
|
|
24
24
|
readonly maxItems: 3;
|
|
25
|
-
readonly description:
|
|
25
|
+
readonly description: string;
|
|
26
26
|
};
|
|
27
27
|
readonly reference_images: {
|
|
28
28
|
readonly type: "array";
|
|
29
29
|
readonly items: {
|
|
30
30
|
readonly type: "string";
|
|
31
31
|
};
|
|
32
|
-
readonly
|
|
32
|
+
readonly maxItems: 9;
|
|
33
|
+
readonly description: string;
|
|
33
34
|
};
|
|
34
35
|
readonly duration: {
|
|
35
36
|
readonly type: "number";
|
|
37
|
+
readonly minimum: 4;
|
|
38
|
+
readonly maximum: 15;
|
|
36
39
|
readonly description: "Output duration in seconds (4-15s). Default: same as source.";
|
|
37
40
|
};
|
|
38
41
|
readonly aspect_ratio: {
|
|
@@ -5,8 +5,22 @@ export interface VideoGenerateToolParams {
|
|
|
5
5
|
purpose?: string;
|
|
6
6
|
style?: string;
|
|
7
7
|
image_url?: string;
|
|
8
|
+
reference_videos?: string[];
|
|
9
|
+
reference_audios?: string[];
|
|
10
|
+
generate_audio?: boolean;
|
|
8
11
|
aspect_ratio?: string;
|
|
9
12
|
duration?: number;
|
|
13
|
+
resolution?: string;
|
|
14
|
+
fps?: number;
|
|
15
|
+
seed?: number;
|
|
16
|
+
camera_fixed?: boolean;
|
|
17
|
+
return_last_frame?: boolean;
|
|
18
|
+
draft?: boolean;
|
|
19
|
+
service_tier?: "default" | "flex";
|
|
20
|
+
callback_url?: string;
|
|
21
|
+
safety_identifier?: string;
|
|
22
|
+
execution_expires_after?: number;
|
|
23
|
+
video_tools?: string[];
|
|
10
24
|
}
|
|
11
25
|
export declare const VIDEO_GENERATE_TOOL_SCHEMA: {
|
|
12
26
|
readonly type: "object";
|
|
@@ -25,7 +39,27 @@ export declare const VIDEO_GENERATE_TOOL_SCHEMA: {
|
|
|
25
39
|
};
|
|
26
40
|
readonly image_url: {
|
|
27
41
|
readonly type: "string";
|
|
28
|
-
readonly description:
|
|
42
|
+
readonly description: string;
|
|
43
|
+
};
|
|
44
|
+
readonly reference_videos: {
|
|
45
|
+
readonly type: "array";
|
|
46
|
+
readonly items: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
};
|
|
49
|
+
readonly maxItems: 3;
|
|
50
|
+
readonly description: string;
|
|
51
|
+
};
|
|
52
|
+
readonly reference_audios: {
|
|
53
|
+
readonly type: "array";
|
|
54
|
+
readonly items: {
|
|
55
|
+
readonly type: "string";
|
|
56
|
+
};
|
|
57
|
+
readonly maxItems: 3;
|
|
58
|
+
readonly description: string;
|
|
59
|
+
};
|
|
60
|
+
readonly generate_audio: {
|
|
61
|
+
readonly type: "boolean";
|
|
62
|
+
readonly description: string;
|
|
29
63
|
};
|
|
30
64
|
readonly aspect_ratio: {
|
|
31
65
|
readonly type: "string";
|
|
@@ -33,7 +67,57 @@ export declare const VIDEO_GENERATE_TOOL_SCHEMA: {
|
|
|
33
67
|
};
|
|
34
68
|
readonly duration: {
|
|
35
69
|
readonly type: "number";
|
|
36
|
-
readonly
|
|
70
|
+
readonly minimum: 3;
|
|
71
|
+
readonly maximum: 15;
|
|
72
|
+
readonly description: string;
|
|
73
|
+
};
|
|
74
|
+
readonly resolution: {
|
|
75
|
+
readonly type: "string";
|
|
76
|
+
readonly description: "Output resolution: '480p', '720p', '1080p'. Default: '720p'.";
|
|
77
|
+
};
|
|
78
|
+
readonly fps: {
|
|
79
|
+
readonly type: "number";
|
|
80
|
+
readonly description: "Frame rate: 24 or 30 fps. Default: provider-specific.";
|
|
81
|
+
};
|
|
82
|
+
readonly seed: {
|
|
83
|
+
readonly type: "number";
|
|
84
|
+
readonly description: "Random seed for reproducible generation.";
|
|
85
|
+
};
|
|
86
|
+
readonly camera_fixed: {
|
|
87
|
+
readonly type: "boolean";
|
|
88
|
+
readonly description: "Lock camera position (Seedance 1.0/1.5 only, not supported for img2video).";
|
|
89
|
+
};
|
|
90
|
+
readonly return_last_frame: {
|
|
91
|
+
readonly type: "boolean";
|
|
92
|
+
readonly description: "Return last frame URL for chaining continuous video segments.";
|
|
93
|
+
};
|
|
94
|
+
readonly draft: {
|
|
95
|
+
readonly type: "boolean";
|
|
96
|
+
readonly description: "Draft mode: low-cost preview (Seedance 1.5 pro only).";
|
|
97
|
+
};
|
|
98
|
+
readonly service_tier: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
readonly enum: readonly ["default", "flex"];
|
|
101
|
+
readonly description: "'default' (online, fast) or 'flex' (offline, ~50% cost). Not all models support flex.";
|
|
102
|
+
};
|
|
103
|
+
readonly callback_url: {
|
|
104
|
+
readonly type: "string";
|
|
105
|
+
readonly description: "Webhook URL for async task completion notification.";
|
|
106
|
+
};
|
|
107
|
+
readonly safety_identifier: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly description: "End-user safety identifier for content moderation tracking.";
|
|
110
|
+
};
|
|
111
|
+
readonly execution_expires_after: {
|
|
112
|
+
readonly type: "number";
|
|
113
|
+
readonly description: "Task expiration in seconds (for offline/flex scheduling).";
|
|
114
|
+
};
|
|
115
|
+
readonly video_tools: {
|
|
116
|
+
readonly type: "array";
|
|
117
|
+
readonly items: {
|
|
118
|
+
readonly type: "string";
|
|
119
|
+
};
|
|
120
|
+
readonly description: "Video-level builtin tools, e.g. ['web_search'] (Seedance 2.0 online search).";
|
|
37
121
|
};
|
|
38
122
|
};
|
|
39
123
|
readonly required: readonly ["prompt"];
|
|
@@ -42,6 +126,8 @@ export interface VideoGenerateResult {
|
|
|
42
126
|
mediaUrls: string[];
|
|
43
127
|
model?: string;
|
|
44
128
|
durationMs?: number;
|
|
129
|
+
lastFrameUrl?: string;
|
|
130
|
+
taskId?: string;
|
|
45
131
|
}
|
|
46
132
|
/** Deps injected by the host runtime for video generation. */
|
|
47
133
|
export interface VideoGenerateToolDeps {
|
|
@@ -55,8 +141,22 @@ export interface VideoGenerateToolDeps {
|
|
|
55
141
|
purpose?: string;
|
|
56
142
|
style?: string;
|
|
57
143
|
imageUrl?: string;
|
|
144
|
+
referenceVideos?: string[];
|
|
145
|
+
referenceAudios?: string[];
|
|
146
|
+
generateAudio?: boolean;
|
|
58
147
|
aspectRatio?: string;
|
|
59
148
|
duration?: number;
|
|
149
|
+
resolution?: string;
|
|
150
|
+
fps?: number;
|
|
151
|
+
seed?: number;
|
|
152
|
+
cameraFixed?: boolean;
|
|
153
|
+
returnLastFrame?: boolean;
|
|
154
|
+
draft?: boolean;
|
|
155
|
+
serviceTier?: "default" | "flex";
|
|
156
|
+
callbackUrl?: string;
|
|
157
|
+
safetyIdentifier?: string;
|
|
158
|
+
executionExpiresAfterSeconds?: number;
|
|
159
|
+
videoTools?: string[];
|
|
60
160
|
}): Promise<VideoGenerateResult>;
|
|
61
161
|
}
|
|
62
162
|
export declare function createVideoGenerateTool(deps: VideoGenerateToolDeps): PortableTool<VideoGenerateToolParams>;
|
|
@@ -26,7 +26,7 @@ export declare const VIDEO_MERGE_TOOL_SCHEMA: {
|
|
|
26
26
|
readonly properties: {
|
|
27
27
|
readonly video: {
|
|
28
28
|
readonly type: "string";
|
|
29
|
-
readonly description: "Video file path.";
|
|
29
|
+
readonly description: "Video URL or file path. MUST be publicly accessible HTTP/HTTPS URL. Use file_upload tool first if local file.";
|
|
30
30
|
};
|
|
31
31
|
readonly audio: {
|
|
32
32
|
readonly type: "string";
|
|
@@ -10,7 +10,7 @@ export declare const VIDEO_UPSCALE_TOOL_SCHEMA: {
|
|
|
10
10
|
readonly properties: {
|
|
11
11
|
readonly video: {
|
|
12
12
|
readonly type: "string";
|
|
13
|
-
readonly description:
|
|
13
|
+
readonly description: string;
|
|
14
14
|
};
|
|
15
15
|
readonly targetResolution: {
|
|
16
16
|
readonly type: "string";
|