qlogicagent 0.2.1 → 0.4.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/README.md +45 -45
- package/package.json +56 -42
- package/dist/agent/agent.d.ts +0 -43
- package/dist/agent/agent.js +0 -113
- package/dist/agent/tool-loop.d.ts +0 -64
- package/dist/agent/tool-loop.js +0 -575
- package/dist/agent/types.d.ts +0 -175
- package/dist/agent/types.js +0 -14
- package/dist/cli/main.d.ts +0 -11
- package/dist/cli/main.js +0 -23
- package/dist/cli/stdio-server.d.ts +0 -45
- package/dist/cli/stdio-server.js +0 -463
- package/dist/config/config.d.ts +0 -17
- package/dist/config/config.js +0 -21
- package/dist/contracts/hooks.d.ts +0 -120
- package/dist/contracts/hooks.js +0 -7
- package/dist/contracts/index.d.ts +0 -10
- package/dist/contracts/index.js +0 -10
- package/dist/contracts/planner.d.ts +0 -35
- package/dist/contracts/planner.js +0 -2
- package/dist/contracts/skill-candidate.d.ts +0 -63
- package/dist/contracts/skill-candidate.js +0 -195
- package/dist/contracts/todo.d.ts +0 -14
- package/dist/contracts/todo.js +0 -9
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -15
- package/dist/llm/builtin-providers.d.ts +0 -10
- package/dist/llm/builtin-providers.js +0 -531
- package/dist/llm/index.d.ts +0 -15
- package/dist/llm/index.js +0 -14
- package/dist/llm/llm-client.d.ts +0 -43
- package/dist/llm/llm-client.js +0 -67
- package/dist/llm/model-catalog.d.ts +0 -53
- package/dist/llm/model-catalog.js +0 -191
- package/dist/llm/provider-def.d.ts +0 -59
- package/dist/llm/provider-def.js +0 -12
- package/dist/llm/provider-registry.d.ts +0 -54
- package/dist/llm/provider-registry.js +0 -147
- package/dist/llm/transport.d.ts +0 -62
- package/dist/llm/transport.js +0 -27
- package/dist/llm/transports/anthropic-messages.d.ts +0 -31
- package/dist/llm/transports/anthropic-messages.js +0 -293
- package/dist/llm/transports/openai-chat.d.ts +0 -36
- package/dist/llm/transports/openai-chat.js +0 -165
- package/dist/orchestration/agent-registry.d.ts +0 -41
- package/dist/orchestration/agent-registry.js +0 -116
- package/dist/orchestration/approval-aware-tool-plan.d.ts +0 -32
- package/dist/orchestration/approval-aware-tool-plan.js +0 -87
- package/dist/orchestration/context-compression.d.ts +0 -220
- package/dist/orchestration/context-compression.js +0 -583
- package/dist/orchestration/conversation-repair.d.ts +0 -61
- package/dist/orchestration/conversation-repair.js +0 -429
- package/dist/orchestration/curator-scheduler.d.ts +0 -119
- package/dist/orchestration/curator-scheduler.js +0 -135
- package/dist/orchestration/embedded-failover-policy.d.ts +0 -110
- package/dist/orchestration/embedded-failover-policy.js +0 -168
- package/dist/orchestration/error-classification.d.ts +0 -12
- package/dist/orchestration/error-classification.js +0 -77
- package/dist/orchestration/failover-classification.d.ts +0 -8
- package/dist/orchestration/failover-classification.js +0 -381
- package/dist/orchestration/failover-error.d.ts +0 -33
- package/dist/orchestration/failover-error.js +0 -198
- package/dist/orchestration/fork-subagent.d.ts +0 -100
- package/dist/orchestration/fork-subagent.js +0 -98
- package/dist/orchestration/index.d.ts +0 -120
- package/dist/orchestration/index.js +0 -267
- package/dist/orchestration/memory-flush-policy.d.ts +0 -57
- package/dist/orchestration/memory-flush-policy.js +0 -85
- package/dist/orchestration/memory-provider.d.ts +0 -14
- package/dist/orchestration/memory-provider.js +0 -2
- package/dist/orchestration/parallel-tool-calls.d.ts +0 -41
- package/dist/orchestration/parallel-tool-calls.js +0 -59
- package/dist/orchestration/prompt-cache-strategy.d.ts +0 -126
- package/dist/orchestration/prompt-cache-strategy.js +0 -228
- package/dist/orchestration/reactive-compact.d.ts +0 -73
- package/dist/orchestration/reactive-compact.js +0 -78
- package/dist/orchestration/retry-loop.d.ts +0 -22
- package/dist/orchestration/retry-loop.js +0 -24
- package/dist/orchestration/skill-candidate.d.ts +0 -52
- package/dist/orchestration/skill-candidate.js +0 -141
- package/dist/orchestration/skill-consolidation.d.ts +0 -123
- package/dist/orchestration/skill-consolidation.js +0 -220
- package/dist/orchestration/skill-improvement.d.ts +0 -59
- package/dist/orchestration/skill-improvement.js +0 -66
- package/dist/orchestration/skill-similarity.d.ts +0 -98
- package/dist/orchestration/skill-similarity.js +0 -131
- package/dist/orchestration/streaming-tool-executor.d.ts +0 -73
- package/dist/orchestration/streaming-tool-executor.js +0 -96
- package/dist/orchestration/team-orchestration.d.ts +0 -195
- package/dist/orchestration/team-orchestration.js +0 -369
- package/dist/orchestration/team-tool-loop-wiring.d.ts +0 -92
- package/dist/orchestration/team-tool-loop-wiring.js +0 -147
- package/dist/orchestration/tool-choice-policy.d.ts +0 -54
- package/dist/orchestration/tool-choice-policy.js +0 -164
- package/dist/orchestration/tool-loop-state.d.ts +0 -50
- package/dist/orchestration/tool-loop-state.js +0 -133
- package/dist/orchestration/tool-schema.d.ts +0 -39
- package/dist/orchestration/tool-schema.js +0 -297
- package/dist/orchestration/transcript-repair.d.ts +0 -42
- package/dist/orchestration/transcript-repair.js +0 -426
- package/dist/orchestration/turn-loop-guard.d.ts +0 -86
- package/dist/orchestration/turn-loop-guard.js +0 -92
- package/dist/orchestration/web-browser-policy.d.ts +0 -17
- package/dist/orchestration/web-browser-policy.js +0 -39
- package/dist/runtime/context-compression.d.ts +0 -61
- package/dist/runtime/context-compression.js +0 -274
- package/dist/runtime/hook-registry.d.ts +0 -12
- package/dist/runtime/hook-registry.js +0 -53
- package/dist/runtime/memory-hooks.d.ts +0 -23
- package/dist/runtime/memory-hooks.js +0 -65
- package/dist/runtime/tool-eligibility.d.ts +0 -59
- package/dist/runtime/tool-eligibility.js +0 -111
- package/dist/skills/index.d.ts +0 -108
- package/dist/skills/index.js +0 -82
- package/dist/skills/memory-extractor.d.ts +0 -64
- package/dist/skills/memory-extractor.js +0 -173
- package/dist/skills/memory-query-tool.d.ts +0 -43
- package/dist/skills/memory-query-tool.js +0 -127
- package/dist/skills/memory-store.d.ts +0 -66
- package/dist/skills/memory-store.js +0 -228
- package/dist/skills/memory-tool.d.ts +0 -67
- package/dist/skills/memory-tool.js +0 -192
- package/dist/skills/portable-tool.d.ts +0 -71
- package/dist/skills/portable-tool.js +0 -14
- package/dist/skills/qmemory-adapter.d.ts +0 -52
- package/dist/skills/qmemory-adapter.js +0 -165
- package/dist/skills/skill-frontmatter.d.ts +0 -19
- package/dist/skills/skill-frontmatter.js +0 -344
- package/dist/skills/skill-guard.d.ts +0 -23
- package/dist/skills/skill-guard.js +0 -229
- package/dist/skills/skill-loader.d.ts +0 -16
- package/dist/skills/skill-loader.js +0 -303
- package/dist/skills/skill-source.d.ts +0 -119
- package/dist/skills/skill-source.js +0 -126
- package/dist/skills/skill-types.d.ts +0 -199
- package/dist/skills/skill-types.js +0 -6
- package/dist/skills/think-tool.d.ts +0 -16
- package/dist/skills/think-tool.js +0 -59
- package/dist/skills/todo-tool.d.ts +0 -63
- package/dist/skills/todo-tool.js +0 -114
- package/dist/skills/tools/agent-tool.d.ts +0 -91
- package/dist/skills/tools/agent-tool.js +0 -142
- package/dist/skills/tools/apply-patch-tool.d.ts +0 -29
- package/dist/skills/tools/apply-patch-tool.js +0 -184
- package/dist/skills/tools/ask-user-tool.d.ts +0 -80
- package/dist/skills/tools/ask-user-tool.js +0 -121
- package/dist/skills/tools/brief-tool.d.ts +0 -74
- package/dist/skills/tools/brief-tool.js +0 -95
- package/dist/skills/tools/browser-tool.d.ts +0 -114
- package/dist/skills/tools/browser-tool.js +0 -155
- package/dist/skills/tools/checkpoint-tool.d.ts +0 -66
- package/dist/skills/tools/checkpoint-tool.js +0 -102
- package/dist/skills/tools/config-tool.d.ts +0 -63
- package/dist/skills/tools/config-tool.js +0 -143
- package/dist/skills/tools/cron-tool.d.ts +0 -116
- package/dist/skills/tools/cron-tool.js +0 -175
- package/dist/skills/tools/edit-tool.d.ts +0 -43
- package/dist/skills/tools/edit-tool.js +0 -70
- package/dist/skills/tools/exec-tool.d.ts +0 -102
- package/dist/skills/tools/exec-tool.js +0 -133
- package/dist/skills/tools/image-generate-tool.d.ts +0 -62
- package/dist/skills/tools/image-generate-tool.js +0 -67
- package/dist/skills/tools/instructions-tool.d.ts +0 -103
- package/dist/skills/tools/instructions-tool.js +0 -187
- package/dist/skills/tools/lsp-tool.d.ts +0 -153
- package/dist/skills/tools/lsp-tool.js +0 -227
- package/dist/skills/tools/mcp-client-types.d.ts +0 -269
- package/dist/skills/tools/mcp-client-types.js +0 -53
- package/dist/skills/tools/mcp-tool.d.ts +0 -249
- package/dist/skills/tools/mcp-tool.js +0 -503
- package/dist/skills/tools/memory-tool.d.ts +0 -74
- package/dist/skills/tools/memory-tool.js +0 -88
- package/dist/skills/tools/monitor-tool.d.ts +0 -113
- package/dist/skills/tools/monitor-tool.js +0 -131
- package/dist/skills/tools/music-generate-tool.d.ts +0 -55
- package/dist/skills/tools/music-generate-tool.js +0 -62
- package/dist/skills/tools/notify-tool.d.ts +0 -53
- package/dist/skills/tools/notify-tool.js +0 -62
- package/dist/skills/tools/patch-tool.d.ts +0 -45
- package/dist/skills/tools/patch-tool.js +0 -505
- package/dist/skills/tools/pdf-tool.d.ts +0 -66
- package/dist/skills/tools/pdf-tool.js +0 -88
- package/dist/skills/tools/plan-mode-tool.d.ts +0 -59
- package/dist/skills/tools/plan-mode-tool.js +0 -122
- package/dist/skills/tools/read-tool.d.ts +0 -51
- package/dist/skills/tools/read-tool.js +0 -84
- package/dist/skills/tools/repl-tool.d.ts +0 -70
- package/dist/skills/tools/repl-tool.js +0 -69
- package/dist/skills/tools/search-tool.d.ts +0 -112
- package/dist/skills/tools/search-tool.js +0 -225
- package/dist/skills/tools/send-message-tool.d.ts +0 -51
- package/dist/skills/tools/send-message-tool.js +0 -76
- package/dist/skills/tools/skill-list-tool.d.ts +0 -33
- package/dist/skills/tools/skill-list-tool.js +0 -54
- package/dist/skills/tools/skill-manage-tool.d.ts +0 -73
- package/dist/skills/tools/skill-manage-tool.js +0 -153
- package/dist/skills/tools/skill-view-tool.d.ts +0 -37
- package/dist/skills/tools/skill-view-tool.js +0 -72
- package/dist/skills/tools/sleep-tool.d.ts +0 -49
- package/dist/skills/tools/sleep-tool.js +0 -81
- package/dist/skills/tools/structured-output-tool.d.ts +0 -116
- package/dist/skills/tools/structured-output-tool.js +0 -176
- package/dist/skills/tools/task-tool.d.ts +0 -104
- package/dist/skills/tools/task-tool.js +0 -161
- package/dist/skills/tools/team-tool.d.ts +0 -89
- package/dist/skills/tools/team-tool.js +0 -105
- package/dist/skills/tools/tool-search-tool.d.ts +0 -51
- package/dist/skills/tools/tool-search-tool.js +0 -110
- package/dist/skills/tools/tts-tool.d.ts +0 -38
- package/dist/skills/tools/tts-tool.js +0 -45
- package/dist/skills/tools/video-edit-tool.d.ts +0 -69
- package/dist/skills/tools/video-edit-tool.js +0 -74
- package/dist/skills/tools/video-generate-tool.d.ts +0 -62
- package/dist/skills/tools/video-generate-tool.js +0 -66
- package/dist/skills/tools/video-merge-tool.d.ts +0 -105
- package/dist/skills/tools/video-merge-tool.js +0 -92
- package/dist/skills/tools/video-upscale-tool.d.ts +0 -45
- package/dist/skills/tools/video-upscale-tool.js +0 -52
- package/dist/skills/tools/web-fetch-tool.d.ts +0 -78
- package/dist/skills/tools/web-fetch-tool.js +0 -92
- package/dist/skills/tools/web-search-tool.d.ts +0 -57
- package/dist/skills/tools/web-search-tool.js +0 -86
- package/dist/skills/tools/worktree-tool.d.ts +0 -69
- package/dist/skills/tools/worktree-tool.js +0 -147
- package/dist/skills/tools/write-tool.d.ts +0 -45
- package/dist/skills/tools/write-tool.js +0 -81
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Video Edit Tool — edit existing videos via backend adapter.
|
|
3
|
-
// Category: media
|
|
4
|
-
// ============================================================
|
|
5
|
-
export const VIDEO_EDIT_TOOL_NAME = "video_edit";
|
|
6
|
-
export const VIDEO_EDIT_TOOL_SCHEMA = {
|
|
7
|
-
type: "object",
|
|
8
|
-
properties: {
|
|
9
|
-
prompt: {
|
|
10
|
-
type: "string",
|
|
11
|
-
description: "Edit instruction. Reference videos as 视频1, 视频2, 视频3. " +
|
|
12
|
-
"Reference images as 图片1, 图片2. " +
|
|
13
|
-
"Operations: add/remove/modify elements, extend, track fill.",
|
|
14
|
-
},
|
|
15
|
-
source_videos: {
|
|
16
|
-
type: "array",
|
|
17
|
-
items: { type: "string" },
|
|
18
|
-
minItems: 1,
|
|
19
|
-
maxItems: 3,
|
|
20
|
-
description: "Video(s) to edit (1-3 URLs). Order: [0]=视频1, [1]=视频2, [2]=视频3.",
|
|
21
|
-
},
|
|
22
|
-
reference_images: {
|
|
23
|
-
type: "array",
|
|
24
|
-
items: { type: "string" },
|
|
25
|
-
description: "Optional reference images for element replacement (up to 9).",
|
|
26
|
-
},
|
|
27
|
-
duration: {
|
|
28
|
-
type: "number",
|
|
29
|
-
description: "Output duration in seconds (4-15s). Default: same as source.",
|
|
30
|
-
},
|
|
31
|
-
aspect_ratio: {
|
|
32
|
-
type: "string",
|
|
33
|
-
description: "Output aspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4, 21:9. Default: same as source.",
|
|
34
|
-
},
|
|
35
|
-
resolution: {
|
|
36
|
-
type: "string",
|
|
37
|
-
description: "Output resolution: '480p' or '720p'. Default: '720p'.",
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
required: ["prompt", "source_videos"],
|
|
41
|
-
};
|
|
42
|
-
export function createVideoEditTool(deps) {
|
|
43
|
-
return {
|
|
44
|
-
name: VIDEO_EDIT_TOOL_NAME,
|
|
45
|
-
label: "Video Edit",
|
|
46
|
-
description: "Edit existing videos: add/remove/modify elements, extend, or bridge clips. " +
|
|
47
|
-
"Requires source_videos. Max 3 source videos, max 720p. " +
|
|
48
|
-
"For generating NEW videos from scratch, use video_generate instead.",
|
|
49
|
-
parameters: VIDEO_EDIT_TOOL_SCHEMA,
|
|
50
|
-
execute: async (_toolCallId, params) => {
|
|
51
|
-
if (!params.source_videos?.length) {
|
|
52
|
-
return { content: [{ type: "text", text: "Error: source_videos is required." }] };
|
|
53
|
-
}
|
|
54
|
-
const result = await deps.editVideo({
|
|
55
|
-
prompt: params.prompt,
|
|
56
|
-
sourceVideos: params.source_videos,
|
|
57
|
-
referenceImages: params.reference_images,
|
|
58
|
-
duration: params.duration,
|
|
59
|
-
aspectRatio: params.aspect_ratio,
|
|
60
|
-
resolution: params.resolution,
|
|
61
|
-
});
|
|
62
|
-
const text = `Video edited successfully${result.model ? ` (model: ${result.model})` : ""}`;
|
|
63
|
-
return {
|
|
64
|
-
content: [{ type: "text", text }],
|
|
65
|
-
details: {
|
|
66
|
-
type: "video_edit",
|
|
67
|
-
model: result.model,
|
|
68
|
-
durationMs: result.durationMs,
|
|
69
|
-
mediaUrls: result.mediaUrls,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const VIDEO_GENERATE_TOOL_NAME: "video_generate";
|
|
3
|
-
export interface VideoGenerateToolParams {
|
|
4
|
-
prompt: string;
|
|
5
|
-
purpose?: string;
|
|
6
|
-
style?: string;
|
|
7
|
-
image_url?: string;
|
|
8
|
-
aspect_ratio?: string;
|
|
9
|
-
duration?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const VIDEO_GENERATE_TOOL_SCHEMA: {
|
|
12
|
-
readonly type: "object";
|
|
13
|
-
readonly properties: {
|
|
14
|
-
readonly prompt: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
readonly description: "Video generation prompt. MUST be in English. Include scene, movement, camera motion, lighting, style.";
|
|
17
|
-
};
|
|
18
|
-
readonly purpose: {
|
|
19
|
-
readonly type: "string";
|
|
20
|
-
readonly description: "Intended use: 'social-media', 'short-video', 'presentation', etc.";
|
|
21
|
-
};
|
|
22
|
-
readonly style: {
|
|
23
|
-
readonly type: "string";
|
|
24
|
-
readonly description: "Visual style: 'cinematic', 'anime', 'watercolor', etc.";
|
|
25
|
-
};
|
|
26
|
-
readonly image_url: {
|
|
27
|
-
readonly type: "string";
|
|
28
|
-
readonly description: "Reference image for image-to-video. Preview image from storyboard Step 3, or user-uploaded image.";
|
|
29
|
-
};
|
|
30
|
-
readonly aspect_ratio: {
|
|
31
|
-
readonly type: "string";
|
|
32
|
-
readonly description: "Video aspect ratio: '9:16' (vertical), '16:9' (horizontal), '1:1' (square). Default: '16:9'.";
|
|
33
|
-
};
|
|
34
|
-
readonly duration: {
|
|
35
|
-
readonly type: "number";
|
|
36
|
-
readonly description: "Video duration in seconds (3-10s single-shot, >10s requires multi-shot workflow). Must be confirmed by user.";
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
readonly required: readonly ["prompt"];
|
|
40
|
-
};
|
|
41
|
-
export interface VideoGenerateResult {
|
|
42
|
-
mediaUrls: string[];
|
|
43
|
-
model?: string;
|
|
44
|
-
durationMs?: number;
|
|
45
|
-
}
|
|
46
|
-
/** Deps injected by the host runtime for video generation. */
|
|
47
|
-
export interface VideoGenerateToolDeps {
|
|
48
|
-
/**
|
|
49
|
-
* Generate a video clip via the configured backend.
|
|
50
|
-
* The host handles model selection, duration snapping, failover,
|
|
51
|
-
* watermark, and local storage.
|
|
52
|
-
*/
|
|
53
|
-
generateVideo(params: {
|
|
54
|
-
prompt: string;
|
|
55
|
-
purpose?: string;
|
|
56
|
-
style?: string;
|
|
57
|
-
imageUrl?: string;
|
|
58
|
-
aspectRatio?: string;
|
|
59
|
-
duration?: number;
|
|
60
|
-
}): Promise<VideoGenerateResult>;
|
|
61
|
-
}
|
|
62
|
-
export declare function createVideoGenerateTool(deps: VideoGenerateToolDeps): PortableTool<VideoGenerateToolParams>;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Video Generate Tool — generate video clips via backend.
|
|
3
|
-
// Category: media
|
|
4
|
-
// ============================================================
|
|
5
|
-
export const VIDEO_GENERATE_TOOL_NAME = "video_generate";
|
|
6
|
-
export const VIDEO_GENERATE_TOOL_SCHEMA = {
|
|
7
|
-
type: "object",
|
|
8
|
-
properties: {
|
|
9
|
-
prompt: {
|
|
10
|
-
type: "string",
|
|
11
|
-
description: "Video generation prompt. MUST be in English. Include scene, movement, camera motion, lighting, style.",
|
|
12
|
-
},
|
|
13
|
-
purpose: {
|
|
14
|
-
type: "string",
|
|
15
|
-
description: "Intended use: 'social-media', 'short-video', 'presentation', etc.",
|
|
16
|
-
},
|
|
17
|
-
style: {
|
|
18
|
-
type: "string",
|
|
19
|
-
description: "Visual style: 'cinematic', 'anime', 'watercolor', etc.",
|
|
20
|
-
},
|
|
21
|
-
image_url: {
|
|
22
|
-
type: "string",
|
|
23
|
-
description: "Reference image for image-to-video. Preview image from storyboard Step 3, or user-uploaded image.",
|
|
24
|
-
},
|
|
25
|
-
aspect_ratio: {
|
|
26
|
-
type: "string",
|
|
27
|
-
description: "Video aspect ratio: '9:16' (vertical), '16:9' (horizontal), '1:1' (square). Default: '16:9'.",
|
|
28
|
-
},
|
|
29
|
-
duration: {
|
|
30
|
-
type: "number",
|
|
31
|
-
description: "Video duration in seconds (3-10s single-shot, >10s requires multi-shot workflow). Must be confirmed by user.",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
required: ["prompt"],
|
|
35
|
-
};
|
|
36
|
-
export function createVideoGenerateTool(deps) {
|
|
37
|
-
return {
|
|
38
|
-
name: VIDEO_GENERATE_TOOL_NAME,
|
|
39
|
-
label: "Video Generate",
|
|
40
|
-
description: "Generate a short video clip from a text prompt (and optional reference image). " +
|
|
41
|
-
"Prompt MUST be in English. Include scene, movement, camera motion, lighting details. " +
|
|
42
|
-
"Single-shot: 3–10s. For longer videos (>10s), use multi-shot storyboard workflow.",
|
|
43
|
-
parameters: VIDEO_GENERATE_TOOL_SCHEMA,
|
|
44
|
-
execute: async (_toolCallId, params) => {
|
|
45
|
-
const result = await deps.generateVideo({
|
|
46
|
-
prompt: params.prompt,
|
|
47
|
-
purpose: params.purpose,
|
|
48
|
-
style: params.style,
|
|
49
|
-
imageUrl: params.image_url,
|
|
50
|
-
aspectRatio: params.aspect_ratio,
|
|
51
|
-
duration: params.duration,
|
|
52
|
-
});
|
|
53
|
-
const count = result.mediaUrls.length;
|
|
54
|
-
const text = `Generated ${count} video${count > 1 ? "s" : ""}${result.model ? ` (model: ${result.model})` : ""}`;
|
|
55
|
-
return {
|
|
56
|
-
content: [{ type: "text", text }],
|
|
57
|
-
details: {
|
|
58
|
-
type: "video_generate",
|
|
59
|
-
model: result.model,
|
|
60
|
-
durationMs: result.durationMs,
|
|
61
|
-
mediaUrls: result.mediaUrls,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const VIDEO_MERGE_TOOL_NAME: "video_merge";
|
|
3
|
-
export interface VideoMergeClip {
|
|
4
|
-
video: string;
|
|
5
|
-
audio?: string;
|
|
6
|
-
trimStart?: number;
|
|
7
|
-
trimEnd?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface VideoMergeToolParams {
|
|
10
|
-
clips: VideoMergeClip[];
|
|
11
|
-
transition?: string;
|
|
12
|
-
transitionDuration?: number;
|
|
13
|
-
subtitles?: string;
|
|
14
|
-
bgm?: string;
|
|
15
|
-
bgmVolume?: number;
|
|
16
|
-
outputResolution?: string;
|
|
17
|
-
outputFps?: number;
|
|
18
|
-
}
|
|
19
|
-
export declare const VIDEO_MERGE_TOOL_SCHEMA: {
|
|
20
|
-
readonly type: "object";
|
|
21
|
-
readonly properties: {
|
|
22
|
-
readonly clips: {
|
|
23
|
-
readonly type: "array";
|
|
24
|
-
readonly items: {
|
|
25
|
-
readonly type: "object";
|
|
26
|
-
readonly properties: {
|
|
27
|
-
readonly video: {
|
|
28
|
-
readonly type: "string";
|
|
29
|
-
readonly description: "Video file path.";
|
|
30
|
-
};
|
|
31
|
-
readonly audio: {
|
|
32
|
-
readonly type: "string";
|
|
33
|
-
readonly description: "Narration audio file path (from TTS).";
|
|
34
|
-
};
|
|
35
|
-
readonly trimStart: {
|
|
36
|
-
readonly type: "number";
|
|
37
|
-
readonly description: "Trim start in seconds (default 0).";
|
|
38
|
-
};
|
|
39
|
-
readonly trimEnd: {
|
|
40
|
-
readonly type: "number";
|
|
41
|
-
readonly description: "Trim end in seconds (default: full).";
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
readonly required: readonly ["video"];
|
|
45
|
-
};
|
|
46
|
-
readonly minItems: 2;
|
|
47
|
-
readonly description: "Array of video clips to merge, in order.";
|
|
48
|
-
};
|
|
49
|
-
readonly transition: {
|
|
50
|
-
readonly type: "string";
|
|
51
|
-
readonly description: "Transition effect: 'crossfade' (default), 'fade', 'wipeleft', 'cut', 'dissolve', etc.";
|
|
52
|
-
};
|
|
53
|
-
readonly transitionDuration: {
|
|
54
|
-
readonly type: "number";
|
|
55
|
-
readonly description: "Transition duration in seconds (0.1-2.0, default 0.5).";
|
|
56
|
-
};
|
|
57
|
-
readonly subtitles: {
|
|
58
|
-
readonly type: "string";
|
|
59
|
-
readonly description: "Path to SRT subtitle file to burn-in.";
|
|
60
|
-
};
|
|
61
|
-
readonly bgm: {
|
|
62
|
-
readonly type: "string";
|
|
63
|
-
readonly description: "Background music file path.";
|
|
64
|
-
};
|
|
65
|
-
readonly bgmVolume: {
|
|
66
|
-
readonly type: "number";
|
|
67
|
-
readonly description: "BGM volume (0.0-1.0, default 0.15).";
|
|
68
|
-
};
|
|
69
|
-
readonly outputResolution: {
|
|
70
|
-
readonly type: "string";
|
|
71
|
-
readonly description: "Output resolution: '1920x1080', '1080x1920', etc. Default: auto.";
|
|
72
|
-
};
|
|
73
|
-
readonly outputFps: {
|
|
74
|
-
readonly type: "number";
|
|
75
|
-
readonly description: "Output FPS (default 30).";
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
readonly required: readonly ["clips"];
|
|
79
|
-
};
|
|
80
|
-
export interface VideoMergeResult {
|
|
81
|
-
localPath: string;
|
|
82
|
-
servePath: string;
|
|
83
|
-
durationSec: number;
|
|
84
|
-
clipCount: number;
|
|
85
|
-
mediaUrls: string[];
|
|
86
|
-
}
|
|
87
|
-
/** Deps injected by the host runtime for video merging. */
|
|
88
|
-
export interface VideoMergeToolDeps {
|
|
89
|
-
/**
|
|
90
|
-
* Merge video clips via the configured backend (ffmpeg, relay, etc.).
|
|
91
|
-
* The host handles resolution normalization, transition rendering,
|
|
92
|
-
* subtitle burn-in, BGM mixing, and local storage.
|
|
93
|
-
*/
|
|
94
|
-
mergeVideos(params: {
|
|
95
|
-
clips: VideoMergeClip[];
|
|
96
|
-
transition?: string;
|
|
97
|
-
transitionDuration?: number;
|
|
98
|
-
subtitles?: string;
|
|
99
|
-
bgm?: string;
|
|
100
|
-
bgmVolume?: number;
|
|
101
|
-
outputResolution?: string;
|
|
102
|
-
outputFps?: number;
|
|
103
|
-
}): Promise<VideoMergeResult>;
|
|
104
|
-
}
|
|
105
|
-
export declare function createVideoMergeTool(deps: VideoMergeToolDeps): PortableTool<VideoMergeToolParams>;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Video Merge Tool — merge multiple video clips with transitions.
|
|
3
|
-
// Category: media
|
|
4
|
-
// ============================================================
|
|
5
|
-
export const VIDEO_MERGE_TOOL_NAME = "video_merge";
|
|
6
|
-
export const VIDEO_MERGE_TOOL_SCHEMA = {
|
|
7
|
-
type: "object",
|
|
8
|
-
properties: {
|
|
9
|
-
clips: {
|
|
10
|
-
type: "array",
|
|
11
|
-
items: {
|
|
12
|
-
type: "object",
|
|
13
|
-
properties: {
|
|
14
|
-
video: { type: "string", description: "Video file path." },
|
|
15
|
-
audio: { type: "string", description: "Narration audio file path (from TTS)." },
|
|
16
|
-
trimStart: { type: "number", description: "Trim start in seconds (default 0)." },
|
|
17
|
-
trimEnd: { type: "number", description: "Trim end in seconds (default: full)." },
|
|
18
|
-
},
|
|
19
|
-
required: ["video"],
|
|
20
|
-
},
|
|
21
|
-
minItems: 2,
|
|
22
|
-
description: "Array of video clips to merge, in order.",
|
|
23
|
-
},
|
|
24
|
-
transition: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "Transition effect: 'crossfade' (default), 'fade', 'wipeleft', 'cut', 'dissolve', etc.",
|
|
27
|
-
},
|
|
28
|
-
transitionDuration: {
|
|
29
|
-
type: "number",
|
|
30
|
-
description: "Transition duration in seconds (0.1-2.0, default 0.5).",
|
|
31
|
-
},
|
|
32
|
-
subtitles: {
|
|
33
|
-
type: "string",
|
|
34
|
-
description: "Path to SRT subtitle file to burn-in.",
|
|
35
|
-
},
|
|
36
|
-
bgm: {
|
|
37
|
-
type: "string",
|
|
38
|
-
description: "Background music file path.",
|
|
39
|
-
},
|
|
40
|
-
bgmVolume: {
|
|
41
|
-
type: "number",
|
|
42
|
-
description: "BGM volume (0.0-1.0, default 0.15).",
|
|
43
|
-
},
|
|
44
|
-
outputResolution: {
|
|
45
|
-
type: "string",
|
|
46
|
-
description: "Output resolution: '1920x1080', '1080x1920', etc. Default: auto.",
|
|
47
|
-
},
|
|
48
|
-
outputFps: {
|
|
49
|
-
type: "number",
|
|
50
|
-
description: "Output FPS (default 30).",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
required: ["clips"],
|
|
54
|
-
};
|
|
55
|
-
export function createVideoMergeTool(deps) {
|
|
56
|
-
return {
|
|
57
|
-
name: VIDEO_MERGE_TOOL_NAME,
|
|
58
|
-
label: "Video Merge",
|
|
59
|
-
description: "Merge multiple video clips into a single video with transitions, subtitles, and background music. " +
|
|
60
|
-
"Requires at least 2 clips. Supports crossfade, fade, wipe, dissolve, and cut transitions. " +
|
|
61
|
-
"Audio per clip is preserved; BGM is mixed at adjustable volume.",
|
|
62
|
-
parameters: VIDEO_MERGE_TOOL_SCHEMA,
|
|
63
|
-
execute: async (_toolCallId, params) => {
|
|
64
|
-
if (!params.clips || params.clips.length < 2) {
|
|
65
|
-
return { content: [{ type: "text", text: "Error: at least 2 clips are required for merging." }] };
|
|
66
|
-
}
|
|
67
|
-
const result = await deps.mergeVideos({
|
|
68
|
-
clips: params.clips,
|
|
69
|
-
transition: params.transition,
|
|
70
|
-
transitionDuration: params.transitionDuration,
|
|
71
|
-
subtitles: params.subtitles,
|
|
72
|
-
bgm: params.bgm,
|
|
73
|
-
bgmVolume: params.bgmVolume,
|
|
74
|
-
outputResolution: params.outputResolution,
|
|
75
|
-
outputFps: params.outputFps,
|
|
76
|
-
});
|
|
77
|
-
const text = `Merged ${result.clipCount} clips → ${result.durationSec.toFixed(1)}s video` +
|
|
78
|
-
(params.transition ? ` (transition: ${params.transition})` : "");
|
|
79
|
-
return {
|
|
80
|
-
content: [{ type: "text", text }],
|
|
81
|
-
details: {
|
|
82
|
-
type: "video_merge",
|
|
83
|
-
localPath: result.localPath,
|
|
84
|
-
servePath: result.servePath,
|
|
85
|
-
durationSec: result.durationSec,
|
|
86
|
-
clipCount: result.clipCount,
|
|
87
|
-
mediaUrls: result.mediaUrls,
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const VIDEO_UPSCALE_TOOL_NAME: "video_upscale";
|
|
3
|
-
export interface VideoUpscaleToolParams {
|
|
4
|
-
video: string;
|
|
5
|
-
targetResolution?: string;
|
|
6
|
-
sharpness?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const VIDEO_UPSCALE_TOOL_SCHEMA: {
|
|
9
|
-
readonly type: "object";
|
|
10
|
-
readonly properties: {
|
|
11
|
-
readonly video: {
|
|
12
|
-
readonly type: "string";
|
|
13
|
-
readonly description: "Video file path (local or serve path).";
|
|
14
|
-
};
|
|
15
|
-
readonly targetResolution: {
|
|
16
|
-
readonly type: "string";
|
|
17
|
-
readonly description: "Target resolution: '1080p' (default, 1920x1080/1080x1920), '2k' (2560x1440/1440x2560).";
|
|
18
|
-
};
|
|
19
|
-
readonly sharpness: {
|
|
20
|
-
readonly type: "string";
|
|
21
|
-
readonly description: "Sharpening intensity: 'light' (default), 'medium', 'strong'.";
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
readonly required: readonly ["video"];
|
|
25
|
-
};
|
|
26
|
-
export interface VideoUpscaleResult {
|
|
27
|
-
localPath: string;
|
|
28
|
-
servePath: string;
|
|
29
|
-
resolution: string;
|
|
30
|
-
durationSec: number;
|
|
31
|
-
mediaUrls: string[];
|
|
32
|
-
}
|
|
33
|
-
/** Deps injected by the host runtime for video upscaling. */
|
|
34
|
-
export interface VideoUpscaleToolDeps {
|
|
35
|
-
/**
|
|
36
|
-
* Upscale a video via the configured backend (ffmpeg Lanczos + unsharp mask, etc.).
|
|
37
|
-
* The host handles orientation detection, filter chain, and storage.
|
|
38
|
-
*/
|
|
39
|
-
upscaleVideo(params: {
|
|
40
|
-
video: string;
|
|
41
|
-
targetResolution?: string;
|
|
42
|
-
sharpness?: string;
|
|
43
|
-
}): Promise<VideoUpscaleResult>;
|
|
44
|
-
}
|
|
45
|
-
export declare function createVideoUpscaleTool(deps: VideoUpscaleToolDeps): PortableTool<VideoUpscaleToolParams>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Video Upscale Tool — upscale video resolution + sharpen.
|
|
3
|
-
// Category: media
|
|
4
|
-
// ============================================================
|
|
5
|
-
export const VIDEO_UPSCALE_TOOL_NAME = "video_upscale";
|
|
6
|
-
export const VIDEO_UPSCALE_TOOL_SCHEMA = {
|
|
7
|
-
type: "object",
|
|
8
|
-
properties: {
|
|
9
|
-
video: {
|
|
10
|
-
type: "string",
|
|
11
|
-
description: "Video file path (local or serve path).",
|
|
12
|
-
},
|
|
13
|
-
targetResolution: {
|
|
14
|
-
type: "string",
|
|
15
|
-
description: "Target resolution: '1080p' (default, 1920x1080/1080x1920), '2k' (2560x1440/1440x2560).",
|
|
16
|
-
},
|
|
17
|
-
sharpness: {
|
|
18
|
-
type: "string",
|
|
19
|
-
description: "Sharpening intensity: 'light' (default), 'medium', 'strong'.",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
required: ["video"],
|
|
23
|
-
};
|
|
24
|
-
export function createVideoUpscaleTool(deps) {
|
|
25
|
-
return {
|
|
26
|
-
name: VIDEO_UPSCALE_TOOL_NAME,
|
|
27
|
-
label: "Video Upscale",
|
|
28
|
-
description: "Upscale a video to higher resolution with optional sharpening. " +
|
|
29
|
-
"Auto-detects orientation (landscape/portrait). Uses Lanczos interpolation + unsharp mask. " +
|
|
30
|
-
"Supports 1080p and 2K targets. Best used as post-processing after video_merge.",
|
|
31
|
-
parameters: VIDEO_UPSCALE_TOOL_SCHEMA,
|
|
32
|
-
execute: async (_toolCallId, params) => {
|
|
33
|
-
const result = await deps.upscaleVideo({
|
|
34
|
-
video: params.video,
|
|
35
|
-
targetResolution: params.targetResolution,
|
|
36
|
-
sharpness: params.sharpness,
|
|
37
|
-
});
|
|
38
|
-
const text = `Upscaled to ${result.resolution}${params.sharpness ? ` (sharpness: ${params.sharpness})` : ""}`;
|
|
39
|
-
return {
|
|
40
|
-
content: [{ type: "text", text }],
|
|
41
|
-
details: {
|
|
42
|
-
type: "video_upscale",
|
|
43
|
-
localPath: result.localPath,
|
|
44
|
-
servePath: result.servePath,
|
|
45
|
-
resolution: result.resolution,
|
|
46
|
-
durationSec: result.durationSec,
|
|
47
|
-
mediaUrls: result.mediaUrls,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const WEB_FETCH_TOOL_NAME: "web_fetch";
|
|
3
|
-
export interface WebFetchToolParams {
|
|
4
|
-
url: string;
|
|
5
|
-
extractMode?: "markdown" | "text" | "json";
|
|
6
|
-
maxChars?: number;
|
|
7
|
-
query?: string;
|
|
8
|
-
extract?: boolean;
|
|
9
|
-
summarize?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const WEB_FETCH_TOOL_SCHEMA: {
|
|
12
|
-
readonly type: "object";
|
|
13
|
-
readonly properties: {
|
|
14
|
-
readonly url: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
readonly description: "HTTP or HTTPS URL to fetch.";
|
|
17
|
-
};
|
|
18
|
-
readonly extractMode: {
|
|
19
|
-
readonly type: "string";
|
|
20
|
-
readonly enum: readonly ["markdown", "text", "json"];
|
|
21
|
-
readonly description: "Extraction mode: \"markdown\" (default), \"text\", or \"json\" (LLM-driven structured extraction).";
|
|
22
|
-
};
|
|
23
|
-
readonly maxChars: {
|
|
24
|
-
readonly type: "number";
|
|
25
|
-
readonly description: "Maximum characters to return (truncates when exceeded).";
|
|
26
|
-
readonly minimum: 100;
|
|
27
|
-
};
|
|
28
|
-
readonly query: {
|
|
29
|
-
readonly type: "string";
|
|
30
|
-
readonly description: "Original search query. When provided, returns the most query-relevant sections.";
|
|
31
|
-
};
|
|
32
|
-
readonly extract: {
|
|
33
|
-
readonly type: "boolean";
|
|
34
|
-
readonly description: "When true, returns structured extraction (title, summary, key facts, entities, topics, sentiment).";
|
|
35
|
-
};
|
|
36
|
-
readonly summarize: {
|
|
37
|
-
readonly type: "boolean";
|
|
38
|
-
readonly description: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
readonly required: readonly ["url"];
|
|
42
|
-
};
|
|
43
|
-
export interface WebFetchResult {
|
|
44
|
-
content: string;
|
|
45
|
-
title?: string;
|
|
46
|
-
relevantExcerpts?: string[];
|
|
47
|
-
summary?: string;
|
|
48
|
-
extraction?: {
|
|
49
|
-
title?: string;
|
|
50
|
-
summary?: string;
|
|
51
|
-
keyFacts?: string[];
|
|
52
|
-
entities?: string[];
|
|
53
|
-
topics?: string[];
|
|
54
|
-
sentiment?: string;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/** Deps injected by the host runtime for web fetching. */
|
|
58
|
-
export interface WebFetchToolDeps {
|
|
59
|
-
/**
|
|
60
|
-
* Fetch a URL and extract content.
|
|
61
|
-
* The host handles user-agent rotation, anti-block,
|
|
62
|
-
* JS rendering, caching, and content extraction.
|
|
63
|
-
*/
|
|
64
|
-
fetchUrl(params: {
|
|
65
|
-
url: string;
|
|
66
|
-
extractMode?: "markdown" | "text" | "json";
|
|
67
|
-
maxChars?: number;
|
|
68
|
-
query?: string;
|
|
69
|
-
extract?: boolean;
|
|
70
|
-
}): Promise<WebFetchResult>;
|
|
71
|
-
/**
|
|
72
|
-
* Optional: summarize long content using a small/cheap model.
|
|
73
|
-
* When provided and summarize=true is requested, called after fetchUrl.
|
|
74
|
-
* Should return a concise summary (< 500 chars) preserving key information.
|
|
75
|
-
*/
|
|
76
|
-
summarizeContent?(content: string, query?: string): Promise<string>;
|
|
77
|
-
}
|
|
78
|
-
export declare function createWebFetchTool(deps: WebFetchToolDeps): PortableTool<WebFetchToolParams>;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Web Fetch Tool — fetch and extract web page content.
|
|
3
|
-
// Category: web
|
|
4
|
-
// ============================================================
|
|
5
|
-
export const WEB_FETCH_TOOL_NAME = "web_fetch";
|
|
6
|
-
export const WEB_FETCH_TOOL_SCHEMA = {
|
|
7
|
-
type: "object",
|
|
8
|
-
properties: {
|
|
9
|
-
url: {
|
|
10
|
-
type: "string",
|
|
11
|
-
description: "HTTP or HTTPS URL to fetch.",
|
|
12
|
-
},
|
|
13
|
-
extractMode: {
|
|
14
|
-
type: "string",
|
|
15
|
-
enum: ["markdown", "text", "json"],
|
|
16
|
-
description: 'Extraction mode: "markdown" (default), "text", or "json" (LLM-driven structured extraction).',
|
|
17
|
-
},
|
|
18
|
-
maxChars: {
|
|
19
|
-
type: "number",
|
|
20
|
-
description: "Maximum characters to return (truncates when exceeded).",
|
|
21
|
-
minimum: 100,
|
|
22
|
-
},
|
|
23
|
-
query: {
|
|
24
|
-
type: "string",
|
|
25
|
-
description: "Original search query. When provided, returns the most query-relevant sections.",
|
|
26
|
-
},
|
|
27
|
-
extract: {
|
|
28
|
-
type: "boolean",
|
|
29
|
-
description: "When true, returns structured extraction (title, summary, key facts, entities, topics, sentiment).",
|
|
30
|
-
},
|
|
31
|
-
summarize: {
|
|
32
|
-
type: "boolean",
|
|
33
|
-
description: "When true, returns a concise summary (< 500 chars) of the page content. " +
|
|
34
|
-
"Useful for long pages to reduce context usage while preserving key information.",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
required: ["url"],
|
|
38
|
-
};
|
|
39
|
-
const DEFAULT_MAX_CHARS = 50000;
|
|
40
|
-
export function createWebFetchTool(deps) {
|
|
41
|
-
return {
|
|
42
|
-
name: WEB_FETCH_TOOL_NAME,
|
|
43
|
-
label: "Web Fetch",
|
|
44
|
-
description: "Fetch content from a URL and extract it as markdown, text, or structured JSON. " +
|
|
45
|
-
"Supports query-based relevance filtering and structured extraction " +
|
|
46
|
-
"(title, summary, key facts, entities, topics, sentiment).",
|
|
47
|
-
parameters: WEB_FETCH_TOOL_SCHEMA,
|
|
48
|
-
execute: async (_toolCallId, params) => {
|
|
49
|
-
const result = await deps.fetchUrl({
|
|
50
|
-
url: params.url,
|
|
51
|
-
extractMode: params.extractMode,
|
|
52
|
-
maxChars: params.maxChars ?? DEFAULT_MAX_CHARS,
|
|
53
|
-
query: params.query,
|
|
54
|
-
extract: params.extract,
|
|
55
|
-
});
|
|
56
|
-
// Summarization: if requested and content is long enough to warrant it
|
|
57
|
-
if (params.summarize && deps.summarizeContent && result.content.length > 1000) {
|
|
58
|
-
const summary = await deps.summarizeContent(result.content, params.query);
|
|
59
|
-
return {
|
|
60
|
-
content: [{ type: "text", text: result.title ? `# ${result.title}\n\n${summary}` : summary }],
|
|
61
|
-
details: {
|
|
62
|
-
type: "web_fetch",
|
|
63
|
-
url: params.url,
|
|
64
|
-
summarized: true,
|
|
65
|
-
originalLength: result.content.length,
|
|
66
|
-
summaryLength: summary.length,
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const parts = [];
|
|
71
|
-
if (result.title)
|
|
72
|
-
parts.push(`# ${result.title}\n`);
|
|
73
|
-
parts.push(result.content);
|
|
74
|
-
if (result.relevantExcerpts?.length) {
|
|
75
|
-
parts.push("\n---\n## Relevant Excerpts\n");
|
|
76
|
-
for (const excerpt of result.relevantExcerpts) {
|
|
77
|
-
parts.push(`- ${excerpt}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
content: [{ type: "text", text: parts.join("\n") }],
|
|
82
|
-
details: {
|
|
83
|
-
type: "web_fetch",
|
|
84
|
-
url: params.url,
|
|
85
|
-
extractMode: params.extractMode ?? "markdown",
|
|
86
|
-
hasExtraction: !!result.extraction,
|
|
87
|
-
extraction: result.extraction,
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
}
|