qlogicagent 0.5.2 → 0.5.3

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 (173) hide show
  1. package/README.md +402 -402
  2. package/dist/agent.js +18 -0
  3. package/dist/cli.js +360 -0
  4. package/dist/contracts.js +1 -0
  5. package/dist/index.js +22 -0
  6. package/dist/orchestration.js +125 -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-loop.d.ts +96 -0
  10. package/dist/types/agent/types.d.ts +250 -0
  11. package/dist/types/cli/main.d.ts +11 -0
  12. package/dist/types/cli/stdio-server.d.ts +56 -0
  13. package/dist/types/cli/tool-bootstrap.d.ts +21 -0
  14. package/dist/types/config/config.d.ts +17 -0
  15. package/dist/types/contracts/hooks.d.ts +175 -0
  16. package/dist/types/contracts/index.d.ts +10 -0
  17. package/dist/types/contracts/planner.d.ts +35 -0
  18. package/dist/types/contracts/skill-candidate.d.ts +63 -0
  19. package/dist/types/contracts/todo.d.ts +14 -0
  20. package/dist/types/index.d.ts +13 -0
  21. package/dist/types/llm/builtin-providers.d.ts +10 -0
  22. package/dist/types/llm/debug-transport.d.ts +12 -0
  23. package/dist/types/llm/index.d.ts +16 -0
  24. package/dist/types/llm/llm-client.d.ts +43 -0
  25. package/dist/types/llm/model-catalog.d.ts +53 -0
  26. package/dist/types/llm/provider-def.d.ts +59 -0
  27. package/dist/types/llm/provider-registry.d.ts +54 -0
  28. package/dist/types/llm/transport.d.ts +62 -0
  29. package/dist/types/llm/transports/anthropic-messages.d.ts +31 -0
  30. package/dist/types/llm/transports/openai-chat.d.ts +36 -0
  31. package/dist/types/orchestration/agent-registry.d.ts +46 -0
  32. package/dist/types/orchestration/context-collapse.d.ts +58 -0
  33. package/dist/types/orchestration/context-compression.d.ts +301 -0
  34. package/dist/types/orchestration/conversation-repair.d.ts +61 -0
  35. package/dist/types/orchestration/curator-scheduler.d.ts +119 -0
  36. package/dist/types/orchestration/error-classification.d.ts +12 -0
  37. package/dist/types/orchestration/failover-classification.d.ts +8 -0
  38. package/dist/types/orchestration/failover-error.d.ts +33 -0
  39. package/dist/types/orchestration/fork-subagent.d.ts +100 -0
  40. package/dist/types/orchestration/index.d.ts +113 -0
  41. package/dist/types/orchestration/memory-provider.d.ts +14 -0
  42. package/dist/types/orchestration/reactive-compact.d.ts +73 -0
  43. package/dist/types/orchestration/retry-loop.d.ts +69 -0
  44. package/dist/types/orchestration/skill-candidate.d.ts +52 -0
  45. package/dist/types/orchestration/skill-consolidation.d.ts +123 -0
  46. package/dist/types/orchestration/skill-improvement.d.ts +59 -0
  47. package/dist/types/orchestration/skill-similarity.d.ts +98 -0
  48. package/dist/types/orchestration/task-types.d.ts +142 -0
  49. package/dist/types/orchestration/team-orchestration.d.ts +195 -0
  50. package/dist/types/orchestration/team-tool-loop-wiring.d.ts +92 -0
  51. package/dist/types/orchestration/tool-choice-policy.d.ts +54 -0
  52. package/dist/types/orchestration/tool-loop-state.d.ts +50 -0
  53. package/dist/types/orchestration/tool-schema.d.ts +39 -0
  54. package/dist/types/orchestration/turn-loop-guard.d.ts +86 -0
  55. package/dist/types/runtime/execution/dream-agent.d.ts +199 -0
  56. package/dist/types/runtime/execution/forked-agent.d.ts +111 -0
  57. package/dist/types/runtime/execution/index.d.ts +6 -0
  58. package/dist/types/runtime/execution/progress-tracker.d.ts +78 -0
  59. package/dist/types/runtime/execution/remote-agent.d.ts +63 -0
  60. package/dist/types/runtime/execution/streaming-tool-executor.d.ts +100 -0
  61. package/dist/types/runtime/execution/tool-eligibility.d.ts +59 -0
  62. package/dist/types/runtime/execution/tool-result-storage.d.ts +87 -0
  63. package/dist/types/runtime/hooks/context-compression.d.ts +61 -0
  64. package/dist/types/runtime/hooks/hook-registry.d.ts +12 -0
  65. package/dist/types/runtime/hooks/index.d.ts +3 -0
  66. package/dist/types/runtime/hooks/memory-hooks.d.ts +49 -0
  67. package/dist/types/runtime/index.d.ts +5 -0
  68. package/dist/types/runtime/infra/cleanup-registry.d.ts +23 -0
  69. package/dist/types/runtime/infra/file-watcher.d.ts +72 -0
  70. package/dist/types/runtime/infra/index.d.ts +6 -0
  71. package/dist/types/runtime/infra/secure-storage.d.ts +81 -0
  72. package/dist/types/runtime/infra/task-runtime.d.ts +108 -0
  73. package/dist/types/runtime/infra/token-budget.d.ts +92 -0
  74. package/dist/types/runtime/infra/worktree-backend.d.ts +85 -0
  75. package/dist/types/runtime/prompt/environment-context.d.ts +23 -0
  76. package/dist/types/runtime/prompt/index.d.ts +3 -0
  77. package/dist/types/runtime/prompt/instruction-loader.d.ts +64 -0
  78. package/dist/types/runtime/prompt/system-prompt-sections.d.ts +63 -0
  79. package/dist/types/runtime/session/index.d.ts +2 -0
  80. package/dist/types/runtime/session/session-memory.d.ts +91 -0
  81. package/dist/types/runtime/session/session-persistence.d.ts +94 -0
  82. package/dist/types/runtime/session/session-state.d.ts +117 -0
  83. package/dist/types/skills/index.d.ts +125 -0
  84. package/dist/types/skills/mcp/index.d.ts +3 -0
  85. package/dist/types/skills/mcp/mcp-http-client.d.ts +66 -0
  86. package/dist/types/skills/mcp/mcp-manager.d.ts +84 -0
  87. package/dist/types/skills/mcp/mcp-stdio-client.d.ts +84 -0
  88. package/dist/types/skills/memory-extractor.d.ts +64 -0
  89. package/dist/types/skills/memory-query-tool.d.ts +43 -0
  90. package/dist/types/skills/memory-store.d.ts +66 -0
  91. package/dist/types/skills/memory-tool.d.ts +67 -0
  92. package/dist/types/skills/permissions/bash-classifier.d.ts +30 -0
  93. package/dist/types/skills/permissions/classifier-cache.d.ts +51 -0
  94. package/dist/types/skills/permissions/denial-tracking.d.ts +42 -0
  95. package/dist/types/skills/permissions/hook-runner.d.ts +85 -0
  96. package/dist/types/skills/permissions/index.d.ts +12 -0
  97. package/dist/types/skills/permissions/permission-classifier.d.ts +41 -0
  98. package/dist/types/skills/permissions/rule-engine.d.ts +41 -0
  99. package/dist/types/skills/permissions/settings-watcher.d.ts +46 -0
  100. package/dist/types/skills/permissions/types.d.ts +113 -0
  101. package/dist/types/skills/plugins/index.d.ts +2 -0
  102. package/dist/types/skills/plugins/plugin-api.d.ts +38 -0
  103. package/dist/types/skills/plugins/plugin-loader.d.ts +45 -0
  104. package/dist/types/skills/plugins/plugin-marketplace.d.ts +61 -0
  105. package/dist/types/skills/portable-tool.d.ts +71 -0
  106. package/dist/types/skills/qmemory-adapter.d.ts +42 -0
  107. package/dist/types/skills/skill-frontmatter.d.ts +19 -0
  108. package/dist/types/skills/skill-guard.d.ts +23 -0
  109. package/dist/types/skills/skill-loader.d.ts +16 -0
  110. package/dist/types/skills/skill-source.d.ts +119 -0
  111. package/dist/types/skills/skill-types.d.ts +199 -0
  112. package/dist/types/skills/think-tool.d.ts +16 -0
  113. package/dist/types/skills/todo-tool.d.ts +63 -0
  114. package/dist/types/skills/tool-registry.d.ts +29 -0
  115. package/dist/types/skills/tools/agent-tool.d.ts +91 -0
  116. package/dist/types/skills/tools/apply-patch-tool.d.ts +29 -0
  117. package/dist/types/skills/tools/ask-user-tool.d.ts +80 -0
  118. package/dist/types/skills/tools/brief-tool.d.ts +74 -0
  119. package/dist/types/skills/tools/browser-tool.d.ts +114 -0
  120. package/dist/types/skills/tools/checkpoint-tool.d.ts +66 -0
  121. package/dist/types/skills/tools/config-tool.d.ts +63 -0
  122. package/dist/types/skills/tools/cron-tool.d.ts +116 -0
  123. package/dist/types/skills/tools/edit-tool.d.ts +43 -0
  124. package/dist/types/skills/tools/exec-tool.d.ts +97 -0
  125. package/dist/types/skills/tools/image-generate-tool.d.ts +62 -0
  126. package/dist/types/skills/tools/instructions-tool.d.ts +103 -0
  127. package/dist/types/skills/tools/lsp-tool.d.ts +153 -0
  128. package/dist/types/skills/tools/mcp-client-types.d.ts +269 -0
  129. package/dist/types/skills/tools/mcp-resource-tools.d.ts +14 -0
  130. package/dist/types/skills/tools/mcp-tool.d.ts +249 -0
  131. package/dist/types/skills/tools/memory-tool.d.ts +74 -0
  132. package/dist/types/skills/tools/monitor-tool.d.ts +113 -0
  133. package/dist/types/skills/tools/music-generate-tool.d.ts +55 -0
  134. package/dist/types/skills/tools/notebook-edit-tool.d.ts +15 -0
  135. package/dist/types/skills/tools/notify-tool.d.ts +53 -0
  136. package/dist/types/skills/tools/patch-tool.d.ts +45 -0
  137. package/dist/types/skills/tools/pdf-tool.d.ts +66 -0
  138. package/dist/types/skills/tools/plan-mode-tool.d.ts +98 -0
  139. package/dist/types/skills/tools/read-tool.d.ts +51 -0
  140. package/dist/types/skills/tools/repl-tool.d.ts +70 -0
  141. package/dist/types/skills/tools/search-tool.d.ts +112 -0
  142. package/dist/types/skills/tools/send-message-tool.d.ts +51 -0
  143. package/dist/types/skills/tools/shell/bash-provider.d.ts +26 -0
  144. package/dist/types/skills/tools/shell/command-classification.d.ts +44 -0
  145. package/dist/types/skills/tools/shell/command-semantics.d.ts +14 -0
  146. package/dist/types/skills/tools/shell/destructive-command-warning.d.ts +10 -0
  147. package/dist/types/skills/tools/shell/exec-permissions.d.ts +52 -0
  148. package/dist/types/skills/tools/shell/index.d.ts +17 -0
  149. package/dist/types/skills/tools/shell/powershell-provider.d.ts +15 -0
  150. package/dist/types/skills/tools/shell/shell-command.d.ts +54 -0
  151. package/dist/types/skills/tools/shell/shell-exec.d.ts +33 -0
  152. package/dist/types/skills/tools/shell/shell-provider.d.ts +85 -0
  153. package/dist/types/skills/tools/shell/task-output.d.ts +45 -0
  154. package/dist/types/skills/tools/skill-invoke-tool.d.ts +46 -0
  155. package/dist/types/skills/tools/skill-list-tool.d.ts +33 -0
  156. package/dist/types/skills/tools/skill-manage-tool.d.ts +73 -0
  157. package/dist/types/skills/tools/skill-view-tool.d.ts +37 -0
  158. package/dist/types/skills/tools/sleep-tool.d.ts +49 -0
  159. package/dist/types/skills/tools/structured-output-tool.d.ts +116 -0
  160. package/dist/types/skills/tools/task-tool.d.ts +104 -0
  161. package/dist/types/skills/tools/team-tool.d.ts +89 -0
  162. package/dist/types/skills/tools/tool-search-tool.d.ts +51 -0
  163. package/dist/types/skills/tools/tts-tool.d.ts +38 -0
  164. package/dist/types/skills/tools/video-edit-tool.d.ts +69 -0
  165. package/dist/types/skills/tools/video-generate-tool.d.ts +62 -0
  166. package/dist/types/skills/tools/video-merge-tool.d.ts +105 -0
  167. package/dist/types/skills/tools/video-upscale-tool.d.ts +45 -0
  168. package/dist/types/skills/tools/web-fetch-tool.d.ts +78 -0
  169. package/dist/types/skills/tools/web-search-tool.d.ts +57 -0
  170. package/dist/types/skills/tools/workflow-tool.d.ts +44 -0
  171. package/dist/types/skills/tools/worktree-tool.d.ts +69 -0
  172. package/dist/types/skills/tools/write-tool.d.ts +45 -0
  173. package/package.json +3 -2
@@ -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>;
@@ -0,0 +1,57 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const WEB_SEARCH_TOOL_NAME: "web_search";
3
+ export interface WebSearchToolParams {
4
+ query: string;
5
+ allowedDomains?: string[];
6
+ blockedDomains?: string[];
7
+ }
8
+ export declare const WEB_SEARCH_TOOL_SCHEMA: {
9
+ readonly type: "object";
10
+ readonly properties: {
11
+ readonly query: {
12
+ readonly type: "string";
13
+ readonly description: "Search query string. Be specific and concise for best results.";
14
+ };
15
+ readonly allowedDomains: {
16
+ readonly type: "array";
17
+ readonly items: {
18
+ readonly type: "string";
19
+ };
20
+ readonly description: string;
21
+ };
22
+ readonly blockedDomains: {
23
+ readonly type: "array";
24
+ readonly items: {
25
+ readonly type: "string";
26
+ };
27
+ readonly description: "Exclude results from these domains. Cannot be used together with allowedDomains.";
28
+ };
29
+ };
30
+ readonly required: readonly ["query"];
31
+ };
32
+ export interface WebSearchResult {
33
+ title: string;
34
+ url: string;
35
+ snippet: string;
36
+ }
37
+ export interface WebSearchOutput {
38
+ query: string;
39
+ results: WebSearchResult[];
40
+ totalResults?: number;
41
+ }
42
+ /**
43
+ * Host-provided web search backend.
44
+ * The host may use any search engine (SearXNG, Brave, Tavily, etc.).
45
+ */
46
+ export interface WebSearchToolDeps {
47
+ /**
48
+ * Execute a web search and return results.
49
+ * The host is responsible for API key management and rate limiting.
50
+ */
51
+ search(query: string, options?: {
52
+ allowedDomains?: string[];
53
+ blockedDomains?: string[];
54
+ maxResults?: number;
55
+ }): Promise<WebSearchOutput>;
56
+ }
57
+ export declare function createWebSearchTool(deps: WebSearchToolDeps): PortableTool<WebSearchToolParams>;
@@ -0,0 +1,44 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export type WorkflowAction = "list" | "run" | "describe";
3
+ export interface WorkflowStep {
4
+ /** Step identifier */
5
+ id: string;
6
+ /** Tool name to invoke */
7
+ tool: string;
8
+ /** Tool arguments (supports ${prev.result} interpolation) */
9
+ args: Record<string, unknown>;
10
+ /** Step IDs this step depends on (for DAG ordering) */
11
+ dependsOn?: string[];
12
+ /** Condition expression: "always" | "on_success" | "on_failure" (default: "on_success") */
13
+ condition?: "always" | "on_success" | "on_failure";
14
+ /** Human-readable label */
15
+ label?: string;
16
+ }
17
+ export interface WorkflowDefinition {
18
+ /** Workflow name */
19
+ name: string;
20
+ /** Description */
21
+ description?: string;
22
+ /** Ordered steps (executed in dependency order) */
23
+ steps: WorkflowStep[];
24
+ /** Variables that can be overridden at runtime */
25
+ variables?: Record<string, string>;
26
+ }
27
+ export interface WorkflowToolParams {
28
+ /** Action to perform */
29
+ action: WorkflowAction;
30
+ /** Workflow name (for run/describe) */
31
+ workflow?: string;
32
+ /** Variable overrides (for run) */
33
+ variables?: Record<string, string>;
34
+ }
35
+ export interface WorkflowToolDeps {
36
+ /** Execute a tool by name and return its text result */
37
+ invokeTool(toolName: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<{
38
+ result: string;
39
+ error?: string;
40
+ }>;
41
+ /** Get current working directory */
42
+ getCwd(): string;
43
+ }
44
+ export declare function createWorkflowTool(deps: WorkflowToolDeps): PortableTool<WorkflowToolParams>;
@@ -0,0 +1,69 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const WORKTREE_TOOL_NAME: "worktree";
3
+ export type WorktreeAction = "enter" | "exit" | "list";
4
+ export interface WorktreeToolParams {
5
+ /** Action: enter (create worktree), exit (leave worktree), list (show all) */
6
+ action: WorktreeAction;
7
+ /** Branch/worktree name (for enter). kebab-case, max 64 chars. */
8
+ name?: string;
9
+ /** For exit: 'keep' retains the worktree, 'remove' deletes it */
10
+ exitAction?: "keep" | "remove";
11
+ /** Required true to discard uncommitted changes on exit with remove */
12
+ discardChanges?: boolean;
13
+ }
14
+ export declare const WORKTREE_TOOL_SCHEMA: {
15
+ readonly type: "object";
16
+ readonly properties: {
17
+ readonly action: {
18
+ readonly type: "string";
19
+ readonly enum: readonly ["enter", "exit", "list"];
20
+ readonly description: string;
21
+ };
22
+ readonly name: {
23
+ readonly type: "string";
24
+ readonly description: string;
25
+ };
26
+ readonly exitAction: {
27
+ readonly type: "string";
28
+ readonly enum: readonly ["keep", "remove"];
29
+ readonly description: "For exit: 'keep' retains the worktree for later use; 'remove' deletes it.";
30
+ };
31
+ readonly discardChanges: {
32
+ readonly type: "boolean";
33
+ readonly description: string;
34
+ };
35
+ };
36
+ readonly required: readonly ["action"];
37
+ };
38
+ export interface WorktreeInfo {
39
+ name: string;
40
+ path: string;
41
+ branch: string;
42
+ isCurrent: boolean;
43
+ hasChanges: boolean;
44
+ unpushedCommits: number;
45
+ }
46
+ export interface WorktreeResult {
47
+ success: boolean;
48
+ worktree?: WorktreeInfo;
49
+ worktrees?: WorktreeInfo[];
50
+ previousCwd?: string;
51
+ error?: string;
52
+ }
53
+ /**
54
+ * Host-provided git worktree backend.
55
+ * Manages worktree creation, switching, and cleanup.
56
+ */
57
+ export interface WorktreeToolDeps {
58
+ /** Create a new worktree and switch session cwd */
59
+ enterWorktree(name?: string): Promise<WorktreeResult>;
60
+ /** Exit worktree (keep or remove) */
61
+ exitWorktree(action: "keep" | "remove", discardChanges?: boolean): Promise<WorktreeResult>;
62
+ /** List all worktrees */
63
+ listWorktrees(): Promise<WorktreeResult>;
64
+ /** Check if currently in a worktree */
65
+ isInWorktree(): boolean;
66
+ /** Get current worktree info */
67
+ currentWorktree?(): WorktreeInfo | null;
68
+ }
69
+ export declare function createWorktreeTool(deps: WorktreeToolDeps): PortableTool<WorktreeToolParams>;
@@ -0,0 +1,45 @@
1
+ import type { PortableTool } from "../portable-tool.js";
2
+ export declare const WRITE_TOOL_NAME: "write";
3
+ export interface WriteToolParams {
4
+ path: string;
5
+ content: string;
6
+ }
7
+ export declare const WRITE_TOOL_SCHEMA: {
8
+ readonly type: "object";
9
+ readonly properties: {
10
+ readonly path: {
11
+ readonly type: "string";
12
+ readonly description: "Absolute path to the file to write.";
13
+ };
14
+ readonly content: {
15
+ readonly type: "string";
16
+ readonly description: "Content to write to the file.";
17
+ };
18
+ };
19
+ readonly required: readonly ["path", "content"];
20
+ };
21
+ /** Deps injected by the host runtime for file writing. */
22
+ export interface WriteToolDeps {
23
+ /** Write content to a file. Create parent dirs as needed. */
24
+ writeFile(path: string, content: string): Promise<void>;
25
+ /** Resolve a relative path to absolute. */
26
+ resolvePath(input: string): string;
27
+ /**
28
+ * Check if file has been read before writing (first-read-then-write protection).
29
+ * Returns null if write is allowed, or a warning message.
30
+ * If not provided, no protection is applied.
31
+ */
32
+ checkReadBeforeWrite?(path: string): string | null;
33
+ /**
34
+ * Validate write access for the given path.
35
+ * Returns null if allowed, or an error message if blocked.
36
+ */
37
+ validatePath?(path: string): string | null;
38
+ /**
39
+ * Check for concurrent modification before overwriting an existing file.
40
+ * Returns null if safe to write, or a warning if modified since last read.
41
+ * If not provided, no concurrent modification check is performed.
42
+ */
43
+ checkConcurrentModification?(path: string): string | null;
44
+ }
45
+ export declare function createWriteTool(deps: WriteToolDeps): PortableTool<WriteToolParams>;