qlogicagent 0.3.0 → 0.5.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 (119) hide show
  1. package/README.md +402 -45
  2. package/package.json +2 -2
  3. package/dist/agent.js +0 -1
  4. package/dist/cli.js +0 -9
  5. package/dist/contracts.js +0 -1
  6. package/dist/index.js +0 -5
  7. package/dist/orchestration.js +0 -118
  8. package/dist/types/agent/agent.d.ts +0 -43
  9. package/dist/types/agent/tool-loop.d.ts +0 -64
  10. package/dist/types/agent/types.d.ts +0 -175
  11. package/dist/types/cli/main.d.ts +0 -11
  12. package/dist/types/cli/stdio-server.d.ts +0 -45
  13. package/dist/types/config/config.d.ts +0 -17
  14. package/dist/types/contracts/hooks.d.ts +0 -120
  15. package/dist/types/contracts/index.d.ts +0 -10
  16. package/dist/types/contracts/planner.d.ts +0 -35
  17. package/dist/types/contracts/skill-candidate.d.ts +0 -63
  18. package/dist/types/contracts/todo.d.ts +0 -14
  19. package/dist/types/index.d.ts +0 -13
  20. package/dist/types/llm/builtin-providers.d.ts +0 -10
  21. package/dist/types/llm/index.d.ts +0 -15
  22. package/dist/types/llm/llm-client.d.ts +0 -43
  23. package/dist/types/llm/model-catalog.d.ts +0 -53
  24. package/dist/types/llm/provider-def.d.ts +0 -59
  25. package/dist/types/llm/provider-registry.d.ts +0 -54
  26. package/dist/types/llm/transport.d.ts +0 -62
  27. package/dist/types/llm/transports/anthropic-messages.d.ts +0 -31
  28. package/dist/types/llm/transports/openai-chat.d.ts +0 -36
  29. package/dist/types/orchestration/agent-registry.d.ts +0 -41
  30. package/dist/types/orchestration/approval-aware-tool-plan.d.ts +0 -32
  31. package/dist/types/orchestration/context-compression.d.ts +0 -220
  32. package/dist/types/orchestration/conversation-repair.d.ts +0 -61
  33. package/dist/types/orchestration/curator-scheduler.d.ts +0 -119
  34. package/dist/types/orchestration/embedded-failover-policy.d.ts +0 -110
  35. package/dist/types/orchestration/error-classification.d.ts +0 -12
  36. package/dist/types/orchestration/failover-classification.d.ts +0 -8
  37. package/dist/types/orchestration/failover-error.d.ts +0 -33
  38. package/dist/types/orchestration/fork-subagent.d.ts +0 -100
  39. package/dist/types/orchestration/index.d.ts +0 -120
  40. package/dist/types/orchestration/memory-flush-policy.d.ts +0 -57
  41. package/dist/types/orchestration/memory-provider.d.ts +0 -14
  42. package/dist/types/orchestration/parallel-tool-calls.d.ts +0 -41
  43. package/dist/types/orchestration/prompt-cache-strategy.d.ts +0 -126
  44. package/dist/types/orchestration/reactive-compact.d.ts +0 -73
  45. package/dist/types/orchestration/retry-loop.d.ts +0 -22
  46. package/dist/types/orchestration/skill-candidate.d.ts +0 -52
  47. package/dist/types/orchestration/skill-consolidation.d.ts +0 -123
  48. package/dist/types/orchestration/skill-improvement.d.ts +0 -59
  49. package/dist/types/orchestration/skill-similarity.d.ts +0 -98
  50. package/dist/types/orchestration/streaming-tool-executor.d.ts +0 -73
  51. package/dist/types/orchestration/team-orchestration.d.ts +0 -195
  52. package/dist/types/orchestration/team-tool-loop-wiring.d.ts +0 -92
  53. package/dist/types/orchestration/tool-choice-policy.d.ts +0 -54
  54. package/dist/types/orchestration/tool-loop-state.d.ts +0 -50
  55. package/dist/types/orchestration/tool-schema.d.ts +0 -39
  56. package/dist/types/orchestration/transcript-repair.d.ts +0 -42
  57. package/dist/types/orchestration/turn-loop-guard.d.ts +0 -86
  58. package/dist/types/orchestration/web-browser-policy.d.ts +0 -17
  59. package/dist/types/runtime/context-compression.d.ts +0 -61
  60. package/dist/types/runtime/hook-registry.d.ts +0 -12
  61. package/dist/types/runtime/memory-hooks.d.ts +0 -23
  62. package/dist/types/runtime/tool-eligibility.d.ts +0 -59
  63. package/dist/types/skills/index.d.ts +0 -108
  64. package/dist/types/skills/memory-extractor.d.ts +0 -64
  65. package/dist/types/skills/memory-query-tool.d.ts +0 -43
  66. package/dist/types/skills/memory-store.d.ts +0 -66
  67. package/dist/types/skills/memory-tool.d.ts +0 -67
  68. package/dist/types/skills/portable-tool.d.ts +0 -71
  69. package/dist/types/skills/qmemory-adapter.d.ts +0 -52
  70. package/dist/types/skills/skill-frontmatter.d.ts +0 -19
  71. package/dist/types/skills/skill-guard.d.ts +0 -23
  72. package/dist/types/skills/skill-loader.d.ts +0 -16
  73. package/dist/types/skills/skill-source.d.ts +0 -119
  74. package/dist/types/skills/skill-types.d.ts +0 -199
  75. package/dist/types/skills/think-tool.d.ts +0 -16
  76. package/dist/types/skills/todo-tool.d.ts +0 -63
  77. package/dist/types/skills/tools/agent-tool.d.ts +0 -91
  78. package/dist/types/skills/tools/apply-patch-tool.d.ts +0 -29
  79. package/dist/types/skills/tools/ask-user-tool.d.ts +0 -80
  80. package/dist/types/skills/tools/brief-tool.d.ts +0 -74
  81. package/dist/types/skills/tools/browser-tool.d.ts +0 -114
  82. package/dist/types/skills/tools/checkpoint-tool.d.ts +0 -66
  83. package/dist/types/skills/tools/config-tool.d.ts +0 -63
  84. package/dist/types/skills/tools/cron-tool.d.ts +0 -116
  85. package/dist/types/skills/tools/edit-tool.d.ts +0 -43
  86. package/dist/types/skills/tools/exec-tool.d.ts +0 -102
  87. package/dist/types/skills/tools/image-generate-tool.d.ts +0 -62
  88. package/dist/types/skills/tools/instructions-tool.d.ts +0 -103
  89. package/dist/types/skills/tools/lsp-tool.d.ts +0 -153
  90. package/dist/types/skills/tools/mcp-client-types.d.ts +0 -269
  91. package/dist/types/skills/tools/mcp-tool.d.ts +0 -249
  92. package/dist/types/skills/tools/memory-tool.d.ts +0 -74
  93. package/dist/types/skills/tools/monitor-tool.d.ts +0 -113
  94. package/dist/types/skills/tools/music-generate-tool.d.ts +0 -55
  95. package/dist/types/skills/tools/notify-tool.d.ts +0 -53
  96. package/dist/types/skills/tools/patch-tool.d.ts +0 -45
  97. package/dist/types/skills/tools/pdf-tool.d.ts +0 -66
  98. package/dist/types/skills/tools/plan-mode-tool.d.ts +0 -59
  99. package/dist/types/skills/tools/read-tool.d.ts +0 -51
  100. package/dist/types/skills/tools/repl-tool.d.ts +0 -70
  101. package/dist/types/skills/tools/search-tool.d.ts +0 -112
  102. package/dist/types/skills/tools/send-message-tool.d.ts +0 -51
  103. package/dist/types/skills/tools/skill-list-tool.d.ts +0 -33
  104. package/dist/types/skills/tools/skill-manage-tool.d.ts +0 -73
  105. package/dist/types/skills/tools/skill-view-tool.d.ts +0 -37
  106. package/dist/types/skills/tools/sleep-tool.d.ts +0 -49
  107. package/dist/types/skills/tools/structured-output-tool.d.ts +0 -116
  108. package/dist/types/skills/tools/task-tool.d.ts +0 -104
  109. package/dist/types/skills/tools/team-tool.d.ts +0 -89
  110. package/dist/types/skills/tools/tool-search-tool.d.ts +0 -51
  111. package/dist/types/skills/tools/tts-tool.d.ts +0 -38
  112. package/dist/types/skills/tools/video-edit-tool.d.ts +0 -69
  113. package/dist/types/skills/tools/video-generate-tool.d.ts +0 -62
  114. package/dist/types/skills/tools/video-merge-tool.d.ts +0 -105
  115. package/dist/types/skills/tools/video-upscale-tool.d.ts +0 -45
  116. package/dist/types/skills/tools/web-fetch-tool.d.ts +0 -78
  117. package/dist/types/skills/tools/web-search-tool.d.ts +0 -57
  118. package/dist/types/skills/tools/worktree-tool.d.ts +0 -69
  119. package/dist/types/skills/tools/write-tool.d.ts +0 -45
@@ -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,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,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,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,57 +0,0 @@
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>;
@@ -1,69 +0,0 @@
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>;
@@ -1,45 +0,0 @@
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>;