qlogicagent 0.5.2 → 0.6.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.
Files changed (167) hide show
  1. package/README.md +403 -402
  2. package/dist/agent.js +18 -0
  3. package/dist/cli.js +384 -0
  4. package/dist/contracts.js +1 -0
  5. package/dist/index.js +383 -0
  6. package/dist/orchestration.js +34 -0
  7. package/dist/types/agent/agent.d.ts +43 -0
  8. package/dist/types/agent/constants.d.ts +47 -0
  9. package/dist/types/agent/tool-access.d.ts +30 -0
  10. package/dist/types/agent/tool-loop.d.ts +94 -0
  11. package/dist/types/agent/types.d.ts +238 -0
  12. package/dist/types/cli/main.d.ts +11 -0
  13. package/dist/types/cli/stdio-server.d.ts +78 -0
  14. package/dist/types/cli/tool-bootstrap.d.ts +40 -0
  15. package/dist/types/cli/transport.d.ts +40 -0
  16. package/dist/types/config/config.d.ts +17 -0
  17. package/dist/types/contracts/hooks.d.ts +175 -0
  18. package/dist/types/contracts/index.d.ts +9 -0
  19. package/dist/types/contracts/planner.d.ts +35 -0
  20. package/dist/types/contracts/todo.d.ts +23 -0
  21. package/dist/types/index.d.ts +16 -0
  22. package/dist/types/llm/builtin-providers.d.ts +10 -0
  23. package/dist/types/llm/debug-transport.d.ts +12 -0
  24. package/dist/types/llm/index.d.ts +16 -0
  25. package/dist/types/llm/llm-client.d.ts +43 -0
  26. package/dist/types/llm/model-catalog.d.ts +53 -0
  27. package/dist/types/llm/provider-def.d.ts +59 -0
  28. package/dist/types/llm/provider-registry.d.ts +54 -0
  29. package/dist/types/llm/transport.d.ts +62 -0
  30. package/dist/types/llm/transports/anthropic-messages.d.ts +31 -0
  31. package/dist/types/llm/transports/openai-chat.d.ts +36 -0
  32. package/dist/types/orchestration/context/context-collapse.d.ts +58 -0
  33. package/dist/types/orchestration/context/context-compression.d.ts +301 -0
  34. package/dist/types/orchestration/context/reactive-compact.d.ts +73 -0
  35. package/dist/types/orchestration/context/turn-loop-guard.d.ts +86 -0
  36. package/dist/types/orchestration/error-handling/error-classification.d.ts +12 -0
  37. package/dist/types/orchestration/error-handling/failover-classification.d.ts +8 -0
  38. package/dist/types/orchestration/error-handling/failover-error.d.ts +33 -0
  39. package/dist/types/orchestration/error-handling/retry-loop.d.ts +69 -0
  40. package/dist/types/orchestration/index.d.ts +15 -0
  41. package/dist/types/orchestration/skill-improvement.d.ts +59 -0
  42. package/dist/types/orchestration/subagent/agent-registry.d.ts +46 -0
  43. package/dist/types/orchestration/subagent/fork-subagent.d.ts +98 -0
  44. package/dist/types/orchestration/subagent/task-types.d.ts +142 -0
  45. package/dist/types/orchestration/tool-loop/conversation-repair.d.ts +61 -0
  46. package/dist/types/orchestration/tool-loop/tool-choice-policy.d.ts +54 -0
  47. package/dist/types/orchestration/tool-loop/tool-loop-state.d.ts +50 -0
  48. package/dist/types/orchestration/tool-loop/tool-schema.d.ts +39 -0
  49. package/dist/types/runtime/execution/dream-agent.d.ts +199 -0
  50. package/dist/types/runtime/execution/forked-agent.d.ts +109 -0
  51. package/dist/types/runtime/execution/index.d.ts +6 -0
  52. package/dist/types/runtime/execution/progress-tracker.d.ts +78 -0
  53. package/dist/types/runtime/execution/remote-agent.d.ts +63 -0
  54. package/dist/types/runtime/execution/streaming-tool-executor.d.ts +100 -0
  55. package/dist/types/runtime/execution/tool-eligibility.d.ts +59 -0
  56. package/dist/types/runtime/execution/tool-result-storage.d.ts +87 -0
  57. package/dist/types/runtime/hooks/context-compression.d.ts +61 -0
  58. package/dist/types/runtime/hooks/hook-registry.d.ts +12 -0
  59. package/dist/types/runtime/hooks/index.d.ts +3 -0
  60. package/dist/types/runtime/hooks/memory-hooks.d.ts +49 -0
  61. package/dist/types/runtime/index.d.ts +5 -0
  62. package/dist/types/runtime/infra/agent-paths.d.ts +57 -0
  63. package/dist/types/runtime/infra/checkpoint-backend.d.ts +8 -0
  64. package/dist/types/runtime/infra/cleanup-registry.d.ts +23 -0
  65. package/dist/types/runtime/infra/disk-storage.d.ts +36 -0
  66. package/dist/types/runtime/infra/file-watcher.d.ts +72 -0
  67. package/dist/types/runtime/infra/index.d.ts +8 -0
  68. package/dist/types/runtime/infra/secure-storage.d.ts +81 -0
  69. package/dist/types/runtime/infra/task-runtime.d.ts +108 -0
  70. package/dist/types/runtime/infra/token-budget.d.ts +92 -0
  71. package/dist/types/runtime/infra/worktree-backend.d.ts +85 -0
  72. package/dist/types/runtime/prompt/environment-context.d.ts +23 -0
  73. package/dist/types/runtime/prompt/index.d.ts +3 -0
  74. package/dist/types/runtime/prompt/instruction-loader.d.ts +64 -0
  75. package/dist/types/runtime/prompt/system-prompt-sections.d.ts +63 -0
  76. package/dist/types/runtime/session/index.d.ts +2 -0
  77. package/dist/types/runtime/session/session-memory.d.ts +90 -0
  78. package/dist/types/runtime/session/session-persistence.d.ts +94 -0
  79. package/dist/types/runtime/session/session-state.d.ts +117 -0
  80. package/dist/types/skills/index.d.ts +119 -0
  81. package/dist/types/skills/mcp/index.d.ts +3 -0
  82. package/dist/types/skills/mcp/mcp-http-client.d.ts +66 -0
  83. package/dist/types/skills/mcp/mcp-manager.d.ts +83 -0
  84. package/dist/types/skills/mcp/mcp-stdio-client.d.ts +84 -0
  85. package/dist/types/skills/memory/memory-extractor.d.ts +64 -0
  86. package/dist/types/skills/memory/memory-store.d.ts +86 -0
  87. package/dist/types/skills/memory/memory-tool.d.ts +87 -0
  88. package/dist/types/skills/memory/qmemory-adapter.d.ts +42 -0
  89. package/dist/types/skills/permissions/bash-classifier.d.ts +30 -0
  90. package/dist/types/skills/permissions/classifier-cache.d.ts +51 -0
  91. package/dist/types/skills/permissions/denial-tracking.d.ts +42 -0
  92. package/dist/types/skills/permissions/hook-runner.d.ts +85 -0
  93. package/dist/types/skills/permissions/index.d.ts +12 -0
  94. package/dist/types/skills/permissions/permission-classifier.d.ts +41 -0
  95. package/dist/types/skills/permissions/rule-engine.d.ts +41 -0
  96. package/dist/types/skills/permissions/settings-watcher.d.ts +46 -0
  97. package/dist/types/skills/permissions/types.d.ts +113 -0
  98. package/dist/types/skills/plugins/index.d.ts +2 -0
  99. package/dist/types/skills/plugins/plugin-api.d.ts +38 -0
  100. package/dist/types/skills/plugins/plugin-loader.d.ts +42 -0
  101. package/dist/types/skills/plugins/plugin-marketplace.d.ts +61 -0
  102. package/dist/types/skills/portable-tool.d.ts +104 -0
  103. package/dist/types/skills/skill-system/skill-frontmatter.d.ts +19 -0
  104. package/dist/types/skills/skill-system/skill-guard.d.ts +23 -0
  105. package/dist/types/skills/skill-system/skill-loader.d.ts +16 -0
  106. package/dist/types/skills/skill-system/skill-source.d.ts +119 -0
  107. package/dist/types/skills/skill-system/skill-types.d.ts +199 -0
  108. package/dist/types/skills/think-tool.d.ts +16 -0
  109. package/dist/types/skills/todo-tool.d.ts +72 -0
  110. package/dist/types/skills/tools/agent-tool.d.ts +91 -0
  111. package/dist/types/skills/tools/apply-patch-tool.d.ts +29 -0
  112. package/dist/types/skills/tools/ask-user-tool.d.ts +80 -0
  113. package/dist/types/skills/tools/brief-tool.d.ts +74 -0
  114. package/dist/types/skills/tools/browser-tool.d.ts +114 -0
  115. package/dist/types/skills/tools/checkpoint-tool.d.ts +66 -0
  116. package/dist/types/skills/tools/config-tool.d.ts +63 -0
  117. package/dist/types/skills/tools/cron-tool.d.ts +116 -0
  118. package/dist/types/skills/tools/edit-tool.d.ts +43 -0
  119. package/dist/types/skills/tools/exec-tool.d.ts +97 -0
  120. package/dist/types/skills/tools/image-generate-tool.d.ts +62 -0
  121. package/dist/types/skills/tools/instructions-tool.d.ts +65 -0
  122. package/dist/types/skills/tools/lsp-tool.d.ts +153 -0
  123. package/dist/types/skills/tools/mcp-client-types.d.ts +269 -0
  124. package/dist/types/skills/tools/mcp-resource-tools.d.ts +14 -0
  125. package/dist/types/skills/tools/mcp-tool.d.ts +249 -0
  126. package/dist/types/skills/tools/monitor-tool.d.ts +113 -0
  127. package/dist/types/skills/tools/music-generate-tool.d.ts +55 -0
  128. package/dist/types/skills/tools/notebook-edit-tool.d.ts +15 -0
  129. package/dist/types/skills/tools/notify-tool.d.ts +53 -0
  130. package/dist/types/skills/tools/patch-tool.d.ts +45 -0
  131. package/dist/types/skills/tools/plan-mode-tool.d.ts +98 -0
  132. package/dist/types/skills/tools/read-tool.d.ts +51 -0
  133. package/dist/types/skills/tools/repl-tool.d.ts +70 -0
  134. package/dist/types/skills/tools/search-tool.d.ts +112 -0
  135. package/dist/types/skills/tools/send-message-tool.d.ts +51 -0
  136. package/dist/types/skills/tools/shell/bash-provider.d.ts +26 -0
  137. package/dist/types/skills/tools/shell/command-classification.d.ts +44 -0
  138. package/dist/types/skills/tools/shell/command-semantics.d.ts +14 -0
  139. package/dist/types/skills/tools/shell/destructive-command-warning.d.ts +10 -0
  140. package/dist/types/skills/tools/shell/exec-permissions.d.ts +52 -0
  141. package/dist/types/skills/tools/shell/index.d.ts +17 -0
  142. package/dist/types/skills/tools/shell/powershell-provider.d.ts +15 -0
  143. package/dist/types/skills/tools/shell/shell-command.d.ts +54 -0
  144. package/dist/types/skills/tools/shell/shell-exec.d.ts +33 -0
  145. package/dist/types/skills/tools/shell/shell-provider.d.ts +85 -0
  146. package/dist/types/skills/tools/shell/task-output.d.ts +45 -0
  147. package/dist/types/skills/tools/skill-invoke-tool.d.ts +46 -0
  148. package/dist/types/skills/tools/skill-list-tool.d.ts +33 -0
  149. package/dist/types/skills/tools/skill-manage-tool.d.ts +73 -0
  150. package/dist/types/skills/tools/skill-view-tool.d.ts +37 -0
  151. package/dist/types/skills/tools/sleep-tool.d.ts +49 -0
  152. package/dist/types/skills/tools/structured-output-tool.d.ts +116 -0
  153. package/dist/types/skills/tools/task-tool.d.ts +104 -0
  154. package/dist/types/skills/tools/team-tool.d.ts +89 -0
  155. package/dist/types/skills/tools/tool-search-tool.d.ts +51 -0
  156. package/dist/types/skills/tools/tts-tool.d.ts +38 -0
  157. package/dist/types/skills/tools/video-edit-tool.d.ts +69 -0
  158. package/dist/types/skills/tools/video-generate-tool.d.ts +62 -0
  159. package/dist/types/skills/tools/video-merge-tool.d.ts +105 -0
  160. package/dist/types/skills/tools/video-upscale-tool.d.ts +45 -0
  161. package/dist/types/skills/tools/web-fetch-tool.d.ts +78 -0
  162. package/dist/types/skills/tools/web-search-tool.d.ts +57 -0
  163. package/dist/types/skills/tools/workflow-tool.d.ts +44 -0
  164. package/dist/types/skills/tools/worktree-tool.d.ts +69 -0
  165. package/dist/types/skills/tools/write-tool.d.ts +45 -0
  166. package/dist/types/skills/tools.d.ts +65 -0
  167. package/package.json +4 -3
@@ -0,0 +1,104 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const TASK_TOOL_NAME: "task";
3
+ export type TaskAction = "create" | "get" | "list" | "output" | "stop";
4
+ export type TaskStatus = "pending" | "running" | "completed" | "failed" | "stopped";
5
+ export interface TaskToolParams {
6
+ action: TaskAction;
7
+ /** Task ID (required for get/output/stop) */
8
+ taskId?: string;
9
+ /** Task prompt (required for create) */
10
+ prompt?: string;
11
+ /** Short description (3-7 words, for create) */
12
+ description?: string;
13
+ /** Allowed tools for the background agent */
14
+ allowedTools?: string[];
15
+ /** Working directory for the task */
16
+ cwd?: string;
17
+ /** Model override for the task agent */
18
+ model?: string;
19
+ /** Max output lines to return (for output action, default 100) */
20
+ maxLines?: number;
21
+ }
22
+ export declare const TASK_TOOL_SCHEMA: {
23
+ readonly type: "object";
24
+ readonly properties: {
25
+ readonly action: {
26
+ readonly type: "string";
27
+ readonly enum: readonly ["create", "get", "list", "output", "stop"];
28
+ readonly description: string;
29
+ };
30
+ readonly taskId: {
31
+ readonly type: "string";
32
+ readonly description: "Task ID. Required for get/output/stop.";
33
+ };
34
+ readonly prompt: {
35
+ readonly type: "string";
36
+ readonly description: string;
37
+ };
38
+ readonly description: {
39
+ readonly type: "string";
40
+ readonly description: "Short (3-7 word) description of the task. Used for tracking and display.";
41
+ };
42
+ readonly allowedTools: {
43
+ readonly type: "array";
44
+ readonly items: {
45
+ readonly type: "string";
46
+ };
47
+ readonly description: "Restrict background agent to only these tools. If omitted, inherits parent's tools.";
48
+ };
49
+ readonly cwd: {
50
+ readonly type: "string";
51
+ readonly description: "Working directory for the background task (absolute path).";
52
+ };
53
+ readonly model: {
54
+ readonly type: "string";
55
+ readonly description: "Model override for the task agent (e.g. 'sonnet', 'opus').";
56
+ };
57
+ readonly maxLines: {
58
+ readonly type: "number";
59
+ readonly description: "Max output lines to return for the 'output' action (default: 100).";
60
+ readonly minimum: 1;
61
+ readonly maximum: 2000;
62
+ };
63
+ };
64
+ readonly required: readonly ["action"];
65
+ };
66
+ export interface TaskInfo {
67
+ taskId: string;
68
+ status: TaskStatus;
69
+ description?: string;
70
+ prompt?: string;
71
+ createdAt: number;
72
+ completedAt?: number;
73
+ result?: string;
74
+ error?: string;
75
+ }
76
+ export interface TaskResult {
77
+ success: boolean;
78
+ task?: TaskInfo;
79
+ tasks?: TaskInfo[];
80
+ output?: string;
81
+ error?: string;
82
+ }
83
+ /** Host-provided task management backend. */
84
+ export interface TaskToolDeps {
85
+ /** Create a new background agent task. Returns the created task info. */
86
+ createTask(params: {
87
+ prompt: string;
88
+ description?: string;
89
+ allowedTools?: string[];
90
+ cwd?: string;
91
+ model?: string;
92
+ }): Promise<TaskInfo>;
93
+ /** Get a task by ID. Returns null if not found. */
94
+ getTask(taskId: string): Promise<TaskInfo | null>;
95
+ /** List all tasks (optionally filtered by status). */
96
+ listTasks(filter?: {
97
+ status?: TaskStatus;
98
+ }): Promise<TaskInfo[]>;
99
+ /** Get output/logs from a task. */
100
+ getTaskOutput(taskId: string, maxLines?: number): Promise<string>;
101
+ /** Stop a running task. Returns true if stopped successfully. */
102
+ stopTask(taskId: string): Promise<boolean>;
103
+ }
104
+ export declare function createTaskTool(deps: TaskToolDeps): PortableTool<TaskToolParams>;
@@ -0,0 +1,89 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const TEAM_TOOL_NAME: "team";
3
+ export type TeamAction = "create" | "delete" | "list" | "status";
4
+ export interface TeamMember {
5
+ name: string;
6
+ role: string;
7
+ tools?: string[];
8
+ }
9
+ export interface TeamToolParams {
10
+ action: TeamAction;
11
+ /** Team name (required for create/delete) */
12
+ teamName?: string;
13
+ /** Team description */
14
+ description?: string;
15
+ /** Members to include (for create) */
16
+ members?: TeamMember[];
17
+ }
18
+ export declare const TEAM_TOOL_SCHEMA: {
19
+ readonly type: "object";
20
+ readonly properties: {
21
+ readonly action: {
22
+ readonly type: "string";
23
+ readonly enum: readonly ["create", "delete", "list", "status"];
24
+ readonly description: "Team action: create (new team), delete (disband), list (all teams), status (team details).";
25
+ };
26
+ readonly teamName: {
27
+ readonly type: "string";
28
+ readonly description: "Team name. Required for create/delete/status.";
29
+ };
30
+ readonly description: {
31
+ readonly type: "string";
32
+ readonly description: "Team description/objective. Used for create.";
33
+ };
34
+ readonly members: {
35
+ readonly type: "array";
36
+ readonly description: "Team members with roles and tool restrictions.";
37
+ readonly items: {
38
+ readonly type: "object";
39
+ readonly properties: {
40
+ readonly name: {
41
+ readonly type: "string";
42
+ readonly description: "Agent name/role identifier.";
43
+ };
44
+ readonly role: {
45
+ readonly type: "string";
46
+ readonly description: "Role description (e.g. 'frontend developer').";
47
+ };
48
+ readonly tools: {
49
+ readonly type: "array";
50
+ readonly items: {
51
+ readonly type: "string";
52
+ };
53
+ readonly description: "Allowed tools for this member.";
54
+ };
55
+ };
56
+ readonly required: readonly ["name", "role"];
57
+ };
58
+ };
59
+ };
60
+ readonly required: readonly ["action"];
61
+ };
62
+ export interface Team {
63
+ name: string;
64
+ description?: string;
65
+ leadId: string;
66
+ members: TeamMember[];
67
+ createdAt: string;
68
+ }
69
+ export interface TeamResult {
70
+ success: boolean;
71
+ team?: Team;
72
+ teams?: Team[];
73
+ error?: string;
74
+ }
75
+ /**
76
+ * Host-provided team management backend.
77
+ * Creates agent teams where members coordinate via send_message.
78
+ */
79
+ export interface TeamToolDeps {
80
+ createTeam(params: {
81
+ teamName: string;
82
+ description?: string;
83
+ members?: TeamMember[];
84
+ }): Promise<TeamResult>;
85
+ deleteTeam(teamName: string): Promise<TeamResult>;
86
+ listTeams(): Promise<TeamResult>;
87
+ getTeamStatus(teamName: string): Promise<TeamResult>;
88
+ }
89
+ export declare function createTeamTool(deps: TeamToolDeps): PortableTool<TeamToolParams>;
@@ -0,0 +1,51 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const TOOL_SEARCH_TOOL_NAME: "tool_search";
3
+ export interface ToolSearchToolParams {
4
+ query: string;
5
+ maxResults?: number;
6
+ }
7
+ export declare const TOOL_SEARCH_TOOL_SCHEMA: {
8
+ readonly type: "object";
9
+ readonly properties: {
10
+ readonly query: {
11
+ readonly type: "string";
12
+ readonly description: string;
13
+ };
14
+ readonly maxResults: {
15
+ readonly type: "number";
16
+ readonly description: "Maximum number of results to return (default: 5).";
17
+ };
18
+ };
19
+ readonly required: readonly ["query"];
20
+ };
21
+ export interface DeferredToolInfo {
22
+ name: string;
23
+ description: string;
24
+ /** Optional search hint for better discovery */
25
+ searchHint?: string;
26
+ }
27
+ export interface ToolSearchOutput {
28
+ matches: DeferredToolInfo[];
29
+ query: string;
30
+ totalDeferred: number;
31
+ }
32
+ /**
33
+ * Host-provided deferred tool registry.
34
+ * The host manages which tools are loaded vs deferred,
35
+ * and handles activation when selected.
36
+ */
37
+ export interface ToolSearchToolDeps {
38
+ /**
39
+ * Search deferred tools by query.
40
+ * Supports "select:name" for direct activation and keyword search.
41
+ */
42
+ searchTools(query: string, options?: {
43
+ maxResults?: number;
44
+ }): Promise<ToolSearchOutput>;
45
+ /**
46
+ * Activate a deferred tool so it appears in subsequent turns.
47
+ * Returns true if activation succeeded.
48
+ */
49
+ activateTool?(name: string): Promise<boolean>;
50
+ }
51
+ export declare function createToolSearchTool(deps: ToolSearchToolDeps): PortableTool<ToolSearchToolParams>;
@@ -0,0 +1,38 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const TTS_TOOL_NAME: "tts";
3
+ export interface TtsToolParams {
4
+ text: string;
5
+ channel?: string;
6
+ }
7
+ export declare const TTS_TOOL_SCHEMA: {
8
+ readonly type: "object";
9
+ readonly properties: {
10
+ readonly text: {
11
+ readonly type: "string";
12
+ readonly description: "Text to convert to speech.";
13
+ };
14
+ readonly channel: {
15
+ readonly type: "string";
16
+ readonly description: "Optional channel id to pick output format (e.g. telegram).";
17
+ };
18
+ };
19
+ readonly required: readonly ["text"];
20
+ };
21
+ export interface TtsResult {
22
+ audioPath: string;
23
+ provider?: string;
24
+ voiceCompatible?: boolean;
25
+ mediaUrls: string[];
26
+ }
27
+ /** Deps injected by the host runtime for TTS. */
28
+ export interface TtsToolDeps {
29
+ /**
30
+ * Convert text to speech via the configured backend.
31
+ * The host handles voice selection, format conversion, and storage.
32
+ */
33
+ textToSpeech(params: {
34
+ text: string;
35
+ channel?: string;
36
+ }): Promise<TtsResult>;
37
+ }
38
+ export declare function createTtsTool(deps: TtsToolDeps): PortableTool<TtsToolParams>;
@@ -0,0 +1,69 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const VIDEO_EDIT_TOOL_NAME: "video_edit";
3
+ export interface VideoEditToolParams {
4
+ prompt: string;
5
+ source_videos: string[];
6
+ reference_images?: string[];
7
+ duration?: number;
8
+ aspect_ratio?: string;
9
+ resolution?: string;
10
+ }
11
+ export declare const VIDEO_EDIT_TOOL_SCHEMA: {
12
+ readonly type: "object";
13
+ readonly properties: {
14
+ readonly prompt: {
15
+ readonly type: "string";
16
+ readonly description: string;
17
+ };
18
+ readonly source_videos: {
19
+ readonly type: "array";
20
+ readonly items: {
21
+ readonly type: "string";
22
+ };
23
+ readonly minItems: 1;
24
+ readonly maxItems: 3;
25
+ readonly description: "Video(s) to edit (1-3 URLs). Order: [0]=视频1, [1]=视频2, [2]=视频3.";
26
+ };
27
+ readonly reference_images: {
28
+ readonly type: "array";
29
+ readonly items: {
30
+ readonly type: "string";
31
+ };
32
+ readonly description: "Optional reference images for element replacement (up to 9).";
33
+ };
34
+ readonly duration: {
35
+ readonly type: "number";
36
+ readonly description: "Output duration in seconds (4-15s). Default: same as source.";
37
+ };
38
+ readonly aspect_ratio: {
39
+ readonly type: "string";
40
+ readonly description: "Output aspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4, 21:9. Default: same as source.";
41
+ };
42
+ readonly resolution: {
43
+ readonly type: "string";
44
+ readonly description: "Output resolution: '480p' or '720p'. Default: '720p'.";
45
+ };
46
+ };
47
+ readonly required: readonly ["prompt", "source_videos"];
48
+ };
49
+ export interface VideoEditResult {
50
+ mediaUrls: string[];
51
+ model?: string;
52
+ durationMs?: number;
53
+ }
54
+ /** Deps injected by the host runtime for video editing. */
55
+ export interface VideoEditToolDeps {
56
+ /**
57
+ * Edit a video via the configured backend (Seedance 2.0, etc.).
58
+ * The host handles URL resolution, model routing, and storage.
59
+ */
60
+ editVideo(params: {
61
+ prompt: string;
62
+ sourceVideos: string[];
63
+ referenceImages?: string[];
64
+ duration?: number;
65
+ aspectRatio?: string;
66
+ resolution?: string;
67
+ }): Promise<VideoEditResult>;
68
+ }
69
+ export declare function createVideoEditTool(deps: VideoEditToolDeps): PortableTool<VideoEditToolParams>;
@@ -0,0 +1,62 @@
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>;
@@ -0,0 +1,105 @@
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>;
@@ -0,0 +1,45 @@
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>;
@@ -0,0 +1,78 @@
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>;