qlogicagent 2.20.6 → 2.20.7

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 (183) hide show
  1. package/README.md +27 -54
  2. package/dist/agent-contract.js +1 -1
  3. package/dist/agent.js +42 -41
  4. package/dist/cli.js +1 -1
  5. package/dist/host-contract.js +1 -1
  6. package/dist/index.js +539 -565
  7. package/dist/orchestration.js +14 -14
  8. package/dist/project-memory-host.js +30 -33
  9. package/dist/protocol.js +1 -1
  10. package/dist/types/agent/memory-recall-context.d.ts +7 -0
  11. package/dist/types/agent/tool-loop/artifact-final-contract.d.ts +2 -0
  12. package/dist/types/agent/tool-loop/direct-response-contract.d.ts +12 -0
  13. package/dist/types/agent/tool-loop/final-status-stream-suppressor.d.ts +22 -0
  14. package/dist/types/agent/tool-loop/loop-helpers.d.ts +2 -2
  15. package/dist/types/agent/tool-loop.d.ts +5 -1
  16. package/dist/types/agent/types.d.ts +27 -15
  17. package/dist/types/cli/acp-commands.d.ts +1 -1
  18. package/dist/types/cli/acp-extended-handlers.d.ts +13 -3
  19. package/dist/types/cli/agent-runtime-session-state.d.ts +1 -0
  20. package/dist/types/cli/base-tool-bootstrap.d.ts +0 -7
  21. package/dist/types/cli/community-skill-installer.d.ts +2 -0
  22. package/dist/types/cli/core-tool-coordinator.d.ts +0 -3
  23. package/dist/types/cli/core-tools/registry.d.ts +1 -4
  24. package/dist/types/cli/handlers/config-handler.d.ts +0 -1
  25. package/dist/types/cli/handlers/goal-handler.d.ts +24 -0
  26. package/dist/types/cli/handlers/memory-handler.d.ts +1 -2
  27. package/dist/types/cli/handlers/skill-curator-handler.d.ts +8 -0
  28. package/dist/types/cli/handlers/turn-handler.d.ts +9 -12
  29. package/dist/types/cli/memory-candidate-service.d.ts +1 -8
  30. package/dist/types/cli/memory-coordinator.d.ts +1 -13
  31. package/dist/types/cli/product-acp-params.d.ts +1 -0
  32. package/dist/types/cli/provider-core-facade.d.ts +2 -30
  33. package/dist/types/cli/rpc-registry.d.ts +2 -4
  34. package/dist/types/cli/runtime-hook-bootstrap.d.ts +1 -2
  35. package/dist/types/cli/stdio-acp-request-host.d.ts +1 -2
  36. package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +0 -2
  37. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +0 -7
  38. package/dist/types/cli/stdio-runtime-services.d.ts +1 -8
  39. package/dist/types/cli/stdio-server.d.ts +0 -4
  40. package/dist/types/cli/tool-bootstrap-core-registration.d.ts +0 -4
  41. package/dist/types/cli/tool-bootstrap.d.ts +0 -17
  42. package/dist/types/contracts/memory-recall-packet.d.ts +31 -0
  43. package/dist/types/contracts/memory-response-contract.d.ts +2 -0
  44. package/dist/types/contracts/tool-execution-evidence.d.ts +8 -0
  45. package/dist/types/contracts/tool-name.d.ts +10 -0
  46. package/dist/types/contracts/turn-event.d.ts +36 -3
  47. package/dist/types/host-contract/acp-content.d.ts +45 -0
  48. package/dist/types/host-contract/index.d.ts +59 -48
  49. package/dist/types/orchestration/agent-instance.d.ts +21 -1
  50. package/dist/types/orchestration/agent-roster.d.ts +14 -15
  51. package/dist/types/orchestration/dag-scheduler.d.ts +4 -0
  52. package/dist/types/orchestration/goal-context-envelope.d.ts +7 -0
  53. package/dist/types/orchestration/goal-loop-coordinator.d.ts +55 -12
  54. package/dist/types/orchestration/goal-mode-adapters.d.ts +13 -1
  55. package/dist/types/orchestration/goal-run-persistence.d.ts +9 -2
  56. package/dist/types/orchestration/goal-run-types.d.ts +127 -13
  57. package/dist/types/orchestration/index.d.ts +1 -1
  58. package/dist/types/orchestration/product-persistence.d.ts +10 -1
  59. package/dist/types/orchestration/product-planner.d.ts +3 -3
  60. package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +1 -0
  61. package/dist/types/orchestration/workflow/data-item.d.ts +1 -1
  62. package/dist/types/orchestration/workflow/expression.d.ts +1 -2
  63. package/dist/types/orchestration/workflow/workflow-patch.d.ts +1 -2
  64. package/dist/types/orchestration/workflow/workflow-render.d.ts +1 -2
  65. package/dist/types/project-memory-host.d.ts +1 -0
  66. package/dist/types/protocol/agent-contract.d.ts +10 -8
  67. package/dist/types/protocol/methods.d.ts +2 -19
  68. package/dist/types/protocol/notifications.d.ts +1 -1
  69. package/dist/types/protocol/wire/acp-agent-management.d.ts +48 -6
  70. package/dist/types/protocol/wire/acp-protocol.d.ts +11 -24
  71. package/dist/types/protocol/wire/agent-methods.d.ts +5 -142
  72. package/dist/types/protocol/wire/chat-types.d.ts +50 -0
  73. package/dist/types/protocol/wire/index.d.ts +2 -2
  74. package/dist/types/protocol/wire/notification-payloads.d.ts +73 -122
  75. package/dist/types/protocol/wire/thread-protocol.d.ts +4 -40
  76. package/dist/types/runtime/community/community-consent-client.d.ts +0 -13
  77. package/dist/types/runtime/context/context-compression-strategies.d.ts +29 -0
  78. package/dist/types/runtime/context/context-envelope.d.ts +3 -0
  79. package/dist/types/runtime/execution/dream-agent.d.ts +4 -5
  80. package/dist/types/runtime/execution/mcp-capability-selection.d.ts +54 -0
  81. package/dist/types/runtime/execution/memory-decay.d.ts +1 -1
  82. package/dist/types/runtime/execution/search-result-quality.d.ts +22 -0
  83. package/dist/types/runtime/execution/streaming-tool-executor.d.ts +2 -0
  84. package/dist/types/runtime/execution/tool-result-storage.d.ts +44 -0
  85. package/dist/types/runtime/hooks/memory-hooks.d.ts +3 -2
  86. package/dist/types/runtime/infra/agent-paths.d.ts +0 -8
  87. package/dist/types/runtime/infra/default-path-service.d.ts +0 -2
  88. package/dist/types/runtime/infra/llmrouter-managed-inference.d.ts +54 -1
  89. package/dist/types/runtime/infra/media-persistence.d.ts +6 -36
  90. package/dist/types/runtime/memory/implicit-extraction.d.ts +7 -15
  91. package/dist/types/runtime/memory/memory-recall-attribution.d.ts +24 -0
  92. package/dist/types/runtime/ports/agent-runtime-ports.d.ts +14 -0
  93. package/dist/types/runtime/ports/index.d.ts +1 -3
  94. package/dist/types/runtime/ports/memory-provider.d.ts +2 -19
  95. package/dist/types/runtime/ports/memory-writer.d.ts +1 -1
  96. package/dist/types/runtime/ports/path-service.d.ts +0 -2
  97. package/dist/types/runtime/prompt/capability-routing-policy.d.ts +13 -0
  98. package/dist/types/runtime/prompt/environment-context.d.ts +3 -6
  99. package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +8 -13
  100. package/dist/types/runtime/prompt/tool-necessity-policy.d.ts +12 -0
  101. package/dist/types/skills/mcp/mcp-manager.d.ts +29 -4
  102. package/dist/types/skills/memory/host-memory-provider.d.ts +3 -9
  103. package/dist/types/skills/memory/memdir.d.ts +1 -1
  104. package/dist/types/skills/memory/memory-content-safety.d.ts +1 -0
  105. package/dist/types/skills/permissions/hook-runner.d.ts +3 -3
  106. package/dist/types/skills/portable-tool.d.ts +5 -0
  107. package/dist/types/skills/skill-system/skill-lifecycle.d.ts +1 -0
  108. package/dist/types/skills/tools/exec-tool.d.ts +1 -5
  109. package/dist/types/skills/tools/shell/command-compatibility.d.ts +3 -0
  110. package/dist/types/skills/tools/shell/index.d.ts +4 -3
  111. package/dist/types/skills/tools/shell/shell-exec.d.ts +15 -8
  112. package/dist/types/skills/tools/shell/shell-provider.d.ts +26 -0
  113. package/dist/types/transport/acp-server.d.ts +4 -1
  114. package/dist/types/transport/host-community-client.d.ts +0 -1
  115. package/dist/types/transport/host-request-client.d.ts +1 -0
  116. package/dist/types/transport/host-run-state-client.d.ts +1 -1
  117. package/dist/workflow-host.js +6 -6
  118. package/package.json +4 -3
  119. package/dist/skills/mcp/astraclaw-native-mcp-server.js +0 -12
  120. package/dist/types/cli/core-tools/checkpoint-tool-bootstrap.d.ts +0 -9
  121. package/dist/types/cli/core-tools/checkpoint-tool-service.d.ts +0 -7
  122. package/dist/types/cli/core-tools/config-tool-bootstrap.d.ts +0 -7
  123. package/dist/types/cli/core-tools/config-tool-service.d.ts +0 -13
  124. package/dist/types/cli/core-tools/monitor-tool-bootstrap.d.ts +0 -7
  125. package/dist/types/cli/core-tools/monitor-tool-service.d.ts +0 -6
  126. package/dist/types/cli/dev-tool-bootstrap.d.ts +0 -9
  127. package/dist/types/cli/dev-tools/dev-tool-bootstrap-service.d.ts +0 -7
  128. package/dist/types/cli/dev-tools/dev-tool-registry.d.ts +0 -8
  129. package/dist/types/cli/dev-tools/incremental-repo-map.d.ts +0 -81
  130. package/dist/types/cli/dev-tools/lsp-supervisor.d.ts +0 -59
  131. package/dist/types/cli/dev-tools/lsp-tool-service.d.ts +0 -7
  132. package/dist/types/cli/handlers/media-handler.d.ts +0 -19
  133. package/dist/types/cli/handlers/skills-handler.d.ts +0 -37
  134. package/dist/types/cli/industrial-runtime-store.d.ts +0 -16
  135. package/dist/types/cli/media-capability-schema.d.ts +0 -49
  136. package/dist/types/cli/media-file-api-service.d.ts +0 -73
  137. package/dist/types/cli/media-file-tool-service.d.ts +0 -13
  138. package/dist/types/cli/media-inline.d.ts +0 -31
  139. package/dist/types/cli/media-runtime-facade.d.ts +0 -51
  140. package/dist/types/cli/media-understanding.d.ts +0 -102
  141. package/dist/types/cli/skill-invocation-service.d.ts +0 -10
  142. package/dist/types/cli/skill-tools-bootstrap.d.ts +0 -35
  143. package/dist/types/cli/skills-query-service.d.ts +0 -41
  144. package/dist/types/cli/tool-bootstrap-media-registration.d.ts +0 -20
  145. package/dist/types/cli/turn-media-setup.d.ts +0 -34
  146. package/dist/types/cli/turn-preview-browser-setup.d.ts +0 -15
  147. package/dist/types/runtime/infra/astraclaw-capabilities.d.ts +0 -33
  148. package/dist/types/runtime/infra/builtin-skills-seed.d.ts +0 -31
  149. package/dist/types/runtime/infra/checkpoint-backend.d.ts +0 -9
  150. package/dist/types/runtime/infra/industrial-runtime-session-server.d.ts +0 -20
  151. package/dist/types/runtime/infra/migrate-project-skills.d.ts +0 -24
  152. package/dist/types/runtime/infra/project-skill-manifest.d.ts +0 -21
  153. package/dist/types/runtime/infra/skill-resolver.d.ts +0 -74
  154. package/dist/types/runtime/infra/worktree-backend.d.ts +0 -86
  155. package/dist/types/runtime/ports/checkpoint-contracts.d.ts +0 -19
  156. package/dist/types/runtime/ports/worktree-contracts.d.ts +0 -22
  157. package/dist/types/skills/mcp/astraclaw-native-mcp-server.d.ts +0 -1
  158. package/dist/types/skills/memory/memory-tool.d.ts +0 -87
  159. package/dist/types/skills/tools/checkpoint-tool.d.ts +0 -66
  160. package/dist/types/skills/tools/config-tool.d.ts +0 -61
  161. package/dist/types/skills/tools/file-management-tool.d.ts +0 -90
  162. package/dist/types/skills/tools/image-generate-tool.d.ts +0 -98
  163. package/dist/types/skills/tools/instructions-tool.d.ts +0 -65
  164. package/dist/types/skills/tools/lsp-tool.d.ts +0 -153
  165. package/dist/types/skills/tools/media-cancel-tool.d.ts +0 -30
  166. package/dist/types/skills/tools/media-understand-tool.d.ts +0 -28
  167. package/dist/types/skills/tools/monitor-tool.d.ts +0 -113
  168. package/dist/types/skills/tools/music-generate-tool.d.ts +0 -80
  169. package/dist/types/skills/tools/notebook-edit-tool.d.ts +0 -15
  170. package/dist/types/skills/tools/preview-browser-tool.d.ts +0 -136
  171. package/dist/types/skills/tools/repo-map-tool.d.ts +0 -52
  172. package/dist/types/skills/tools/skill-tool.d.ts +0 -142
  173. package/dist/types/skills/tools/sleep-tool.d.ts +0 -49
  174. package/dist/types/skills/tools/stt-tool.d.ts +0 -33
  175. package/dist/types/skills/tools/subagent-decision-tool.d.ts +0 -15
  176. package/dist/types/skills/tools/three-d-generate-tool.d.ts +0 -46
  177. package/dist/types/skills/tools/tts-tool.d.ts +0 -50
  178. package/dist/types/skills/tools/video-edit-tool.d.ts +0 -72
  179. package/dist/types/skills/tools/video-generate-tool.d.ts +0 -162
  180. package/dist/types/skills/tools/video-merge-tool.d.ts +0 -105
  181. package/dist/types/skills/tools/video-upscale-tool.d.ts +0 -45
  182. package/dist/types/skills/tools/voice-clone-tool.d.ts +0 -40
  183. package/dist/types/skills/tools/worktree-tool.d.ts +0 -69
@@ -1,87 +0,0 @@
1
- import type { MemoryProvider, MemorySearchResult, MemoryToolLocalProvider, ProjectMemoryStore } from "../../runtime/ports/index.js";
2
- export declare const MEMORY_TOOL_NAME: "memory";
3
- export declare const MEMORY_TOOL_LABEL = "Memory";
4
- export declare const MEMORY_TOOL_ACTIONS: readonly ["add", "replace", "remove", "create_file", "write_file", "read_file", "delete_file", "list_files", "search", "remember", "temporal", "feedback"];
5
- export type MemoryToolAction = (typeof MEMORY_TOOL_ACTIONS)[number];
6
- export declare const MEMORY_TOOL_SCHEMA: {
7
- readonly type: "object";
8
- readonly properties: {
9
- readonly action: {
10
- readonly type: "string";
11
- readonly enum: string[];
12
- readonly description: string;
13
- };
14
- readonly content: {
15
- readonly type: "string";
16
- readonly description: string;
17
- };
18
- readonly old_text: {
19
- readonly type: "string";
20
- readonly description: "For 'replace'/'remove': the exact text to find in INDEX.md.";
21
- };
22
- readonly new_text: {
23
- readonly type: "string";
24
- readonly description: "For 'replace': the replacement text.";
25
- };
26
- readonly file: {
27
- readonly type: "string";
28
- readonly description: "Filename for file operations (e.g. 'project-notes.md', 'lesson-esbuild.md'). Must be kebab-case .md.";
29
- };
30
- readonly query: {
31
- readonly type: "string";
32
- readonly description: "For 'search'/'temporal': natural language query to find relevant memories.";
33
- };
34
- readonly days: {
35
- readonly type: "number";
36
- readonly description: "For 'temporal': look back N days from today (default: 7).";
37
- };
38
- readonly memory_ids: {
39
- readonly type: "array";
40
- readonly items: {
41
- readonly type: "string";
42
- };
43
- readonly description: "For 'feedback': IDs of memories to give feedback on.";
44
- };
45
- readonly signal: {
46
- readonly type: "string";
47
- readonly enum: readonly ["useful", "irrelevant", "outdated", "wrong"];
48
- readonly description: "For 'feedback': the feedback signal to apply.";
49
- };
50
- readonly category: {
51
- readonly type: "string";
52
- readonly enum: string[];
53
- readonly description: "For 'remember': categorize the memory (helps with future recall precision).";
54
- };
55
- };
56
- readonly required: readonly ["action"];
57
- };
58
- export declare const MEMORY_TOOL_DESCRIPTION: string;
59
- export declare function isMemoryContentSafe(text: string): boolean;
60
- export interface MemoryToolParams {
61
- action: MemoryToolAction;
62
- content?: string;
63
- old_text?: string;
64
- new_text?: string;
65
- file?: string;
66
- query?: string;
67
- days?: number;
68
- memory_ids?: string[];
69
- signal?: "useful" | "irrelevant" | "outdated" | "wrong";
70
- category?: string;
71
- }
72
- export interface MemoryToolResult {
73
- ok: boolean;
74
- message: string;
75
- action: string;
76
- results?: MemorySearchResult[];
77
- }
78
- export interface MemoryToolExecutorDeps {
79
- memdir: ProjectMemoryStore;
80
- provider?: MemoryProvider;
81
- /** Runtime memory provider for temporal/feedback (typed narrow for advanced ops). */
82
- localProvider?: MemoryToolLocalProvider;
83
- userId: string;
84
- /** Owning foreground session for user-visible memory mutations. */
85
- sessionId?: string;
86
- }
87
- export declare function executeMemoryTool(params: MemoryToolParams, deps: MemoryToolExecutorDeps): Promise<MemoryToolResult>;
@@ -1,66 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const CHECKPOINT_TOOL_NAME: "checkpoint";
3
- export type CheckpointAction = "create" | "list" | "restore" | "diff";
4
- export interface CheckpointToolParams {
5
- action: CheckpointAction;
6
- /** Checkpoint ID (for restore/diff) */
7
- checkpointId?: string;
8
- /** Optional message for create */
9
- message?: string;
10
- /** File paths to restore (partial restore). If empty, restores all. */
11
- paths?: string[];
12
- }
13
- export declare const CHECKPOINT_TOOL_SCHEMA: {
14
- readonly type: "object";
15
- readonly properties: {
16
- readonly action: {
17
- readonly type: "string";
18
- readonly enum: readonly ["create", "list", "restore", "diff"];
19
- readonly description: string;
20
- };
21
- readonly checkpointId: {
22
- readonly type: "string";
23
- readonly description: "Checkpoint ID. Required for restore and diff.";
24
- };
25
- readonly message: {
26
- readonly type: "string";
27
- readonly description: "Optional descriptive message for the checkpoint.";
28
- };
29
- readonly paths: {
30
- readonly type: "array";
31
- readonly items: {
32
- readonly type: "string";
33
- };
34
- readonly description: "File paths to restore (partial restore). Omit to restore everything.";
35
- };
36
- };
37
- readonly required: readonly ["action"];
38
- };
39
- export interface Checkpoint {
40
- id: string;
41
- message: string;
42
- timestamp: string;
43
- fileCount: number;
44
- }
45
- export interface CheckpointResult {
46
- success: boolean;
47
- checkpoint?: Checkpoint;
48
- checkpoints?: Checkpoint[];
49
- diff?: string;
50
- error?: string;
51
- }
52
- /**
53
- * Host-provided checkpoint backend.
54
- * Uses shadow git repos (isolated from user project) for snapshots.
55
- */
56
- export interface CheckpointToolDeps {
57
- /** Create a snapshot of the current workspace state */
58
- createCheckpoint(message?: string): Promise<CheckpointResult>;
59
- /** List all available checkpoints */
60
- listCheckpoints(): Promise<CheckpointResult>;
61
- /** Restore workspace to a checkpoint state (optionally partial) */
62
- restoreCheckpoint(checkpointId: string, paths?: string[]): Promise<CheckpointResult>;
63
- /** Show diff between current state and a checkpoint */
64
- diffCheckpoint(checkpointId: string): Promise<CheckpointResult>;
65
- }
66
- export declare function createCheckpointTool(deps: CheckpointToolDeps): PortableTool<CheckpointToolParams>;
@@ -1,61 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const CONFIG_TOOL_NAME: "config";
3
- export type ConfigAction = "get" | "set" | "list" | "reset";
4
- export interface ConfigToolParams {
5
- /** Config action */
6
- action: ConfigAction;
7
- /** Setting key path (e.g. "model", "language", "theme") */
8
- key?: string;
9
- /** Value to set (for 'set' action) */
10
- value?: string | boolean | number;
11
- }
12
- export declare const CONFIG_TOOL_SCHEMA: {
13
- readonly type: "object";
14
- readonly properties: {
15
- readonly action: {
16
- readonly type: "string";
17
- readonly enum: readonly ["get", "set", "list", "reset"];
18
- readonly description: string;
19
- };
20
- readonly key: {
21
- readonly type: "string";
22
- readonly description: string;
23
- };
24
- readonly value: {
25
- readonly description: "Value to set. Type must match the tunable (numeric strings are coerced). Required for 'set'.";
26
- };
27
- };
28
- readonly required: readonly ["action"];
29
- };
30
- export interface ConfigSetting {
31
- key: string;
32
- value: unknown;
33
- type: "string" | "boolean" | "number" | "enum";
34
- description: string;
35
- options?: string[];
36
- readOnly?: boolean;
37
- }
38
- export interface ConfigResult {
39
- success: boolean;
40
- setting?: ConfigSetting;
41
- settings?: ConfigSetting[];
42
- previousValue?: unknown;
43
- error?: string;
44
- }
45
- /**
46
- * Host-provided config backend.
47
- * Manages persistent agent settings with safety guardrails.
48
- */
49
- export interface ConfigToolDeps {
50
- /** Get a single config value */
51
- getConfig(key: string): Promise<ConfigResult>;
52
- /** Set a config value (respects readonly/whitelist) */
53
- setConfig(key: string, value: unknown): Promise<ConfigResult>;
54
- /** List all available config settings */
55
- listConfig(): Promise<ConfigResult>;
56
- /** Reset a setting to default */
57
- resetConfig(key: string): Promise<ConfigResult>;
58
- /** Check if a key is supported/valid */
59
- isValidKey?(key: string): boolean;
60
- }
61
- export declare function createConfigTool(deps: ConfigToolDeps): PortableTool<ConfigToolParams>;
@@ -1,90 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const FILE_UPLOAD_TOOL_NAME: "file_upload";
3
- export interface FileUploadToolParams {
4
- file_path: string;
5
- purpose?: string;
6
- }
7
- export declare const FILE_UPLOAD_TOOL_SCHEMA: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly file_path: {
11
- readonly type: "string";
12
- readonly description: string;
13
- };
14
- readonly purpose: {
15
- readonly type: "string";
16
- readonly description: string;
17
- };
18
- };
19
- readonly required: readonly ["file_path"];
20
- };
21
- export interface FileUploadResult {
22
- fileId: string;
23
- url?: string;
24
- filename: string;
25
- bytes: number;
26
- provider: string;
27
- }
28
- export interface FileUploadToolDeps {
29
- uploadFile(params: {
30
- filePath: string;
31
- purpose?: string;
32
- }): Promise<FileUploadResult>;
33
- }
34
- export declare function createFileUploadTool(deps: FileUploadToolDeps): PortableTool<FileUploadToolParams>;
35
- export declare const FILE_QUERY_TOOL_NAME: "file_query";
36
- export interface FileQueryToolParams {
37
- file_id?: string;
38
- limit?: number;
39
- }
40
- export declare const FILE_QUERY_TOOL_SCHEMA: {
41
- readonly type: "object";
42
- readonly properties: {
43
- readonly file_id: {
44
- readonly type: "string";
45
- readonly description: "Query a specific file by ID. If omitted, lists recent uploaded files.";
46
- };
47
- readonly limit: {
48
- readonly type: "number";
49
- readonly description: "Max number of files to list when file_id is omitted. Default: 10, max: 100.";
50
- };
51
- };
52
- readonly required: readonly [];
53
- };
54
- export interface FileInfo {
55
- id: string;
56
- filename: string;
57
- bytes: number;
58
- status: string;
59
- createdAt?: string;
60
- url?: string;
61
- }
62
- export interface FileQueryToolDeps {
63
- queryFile(params: {
64
- fileId: string;
65
- }): Promise<FileInfo>;
66
- listFiles(params: {
67
- limit?: number;
68
- }): Promise<FileInfo[]>;
69
- }
70
- export declare function createFileQueryTool(deps: FileQueryToolDeps): PortableTool<FileQueryToolParams>;
71
- export declare const FILE_DELETE_TOOL_NAME: "file_delete";
72
- export interface FileDeleteToolParams {
73
- file_id: string;
74
- }
75
- export declare const FILE_DELETE_TOOL_SCHEMA: {
76
- readonly type: "object";
77
- readonly properties: {
78
- readonly file_id: {
79
- readonly type: "string";
80
- readonly description: "ID of the uploaded file to delete.";
81
- };
82
- };
83
- readonly required: readonly ["file_id"];
84
- };
85
- export interface FileDeleteToolDeps {
86
- deleteFile(params: {
87
- fileId: string;
88
- }): Promise<void>;
89
- }
90
- export declare function createFileDeleteTool(deps: FileDeleteToolDeps): PortableTool<FileDeleteToolParams>;
@@ -1,98 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const IMAGE_GENERATE_TOOL_NAME: "image_generate";
3
- export interface ImageGenerateToolParams {
4
- prompt: string;
5
- purpose?: string;
6
- style?: string;
7
- size?: string;
8
- image_url?: string;
9
- output_path?: string;
10
- output_paths?: string[];
11
- n?: number;
12
- quality?: string;
13
- seed?: number;
14
- }
15
- export declare const IMAGE_GENERATE_TOOL_SCHEMA: {
16
- readonly type: "object";
17
- readonly properties: {
18
- readonly prompt: {
19
- readonly type: "string";
20
- readonly description: "Image generation prompt. Enrich vague requests with style, lighting, composition, color, mood details.";
21
- };
22
- readonly purpose: {
23
- readonly type: "string";
24
- readonly description: "Intended use: 'social-media', 'short-video-cover', 'phone-wallpaper', 'avatar', 'poster', etc.";
25
- };
26
- readonly style: {
27
- readonly type: "string";
28
- readonly description: "Visual art style: 'photorealistic', 'anime', 'watercolor', 'oil-painting', '3d-render', etc.";
29
- };
30
- readonly size: {
31
- readonly type: "string";
32
- readonly description: string;
33
- };
34
- readonly image_url: {
35
- readonly type: "string";
36
- readonly description: string;
37
- };
38
- readonly output_path: {
39
- readonly type: "string";
40
- readonly description: "Optional absolute or workspace-relative path where the generated image should be saved. Use only for a single generated image.";
41
- };
42
- readonly output_paths: {
43
- readonly type: "array";
44
- readonly items: {
45
- readonly type: "string";
46
- };
47
- readonly description: "Optional absolute or workspace-relative paths where generated images should be saved. Must match the number of generated images.";
48
- };
49
- readonly n: {
50
- readonly type: "number";
51
- readonly description: "Number of images to generate (1-4). Default: 1.";
52
- };
53
- readonly quality: {
54
- readonly type: "string";
55
- readonly description: "Image quality level: 'auto', 'high', 'low', 'hd'. Provider-specific.";
56
- };
57
- readonly seed: {
58
- readonly type: "number";
59
- readonly description: "Random seed for reproducible generation. Same seed + prompt = same result.";
60
- };
61
- };
62
- readonly required: readonly ["prompt"];
63
- };
64
- export interface ImageGenerateResult {
65
- mediaUrls: string[];
66
- model?: string;
67
- size?: string;
68
- durationMs?: number;
69
- }
70
- export interface SavedGeneratedImage {
71
- remoteUrl: string;
72
- localPath: string;
73
- bytes: number;
74
- mimeType: string;
75
- headerHex?: string;
76
- }
77
- /** Deps injected by the host runtime for image generation. */
78
- export interface ImageGenerateToolDeps {
79
- /**
80
- * Generate images via the configured backend (relay, direct API, etc.).
81
- * The host handles model selection, failover, watermark, and storage.
82
- */
83
- generateImage(params: {
84
- prompt: string;
85
- purpose?: string;
86
- style?: string;
87
- size?: string;
88
- imageUrl?: string;
89
- n?: number;
90
- quality?: string;
91
- seed?: number;
92
- }): Promise<ImageGenerateResult>;
93
- saveGeneratedImages?(params: {
94
- mediaUrls: string[];
95
- outputPaths: string[];
96
- }): Promise<SavedGeneratedImage[]>;
97
- }
98
- export declare function createImageGenerateTool(deps: ImageGenerateToolDeps): PortableTool<ImageGenerateToolParams>;
@@ -1,65 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- /** A single instruction file entry. */
3
- export interface InstructionFileInfo {
4
- filename: string;
5
- path: string;
6
- size: number;
7
- updatedAt: string;
8
- }
9
- /** Full instruction file (with content). */
10
- export interface InstructionFileContent extends InstructionFileInfo {
11
- content: string;
12
- }
13
- /** Deps injected by the host runtime for instructions CRUD. */
14
- export interface InstructionsToolDeps {
15
- /** List all instruction files for a project (recursive). */
16
- list(projectId: string): InstructionFileInfo[];
17
- /** Read a single instruction file. Returns null if not found. */
18
- read(projectId: string, filename: string): InstructionFileContent | null;
19
- /** Write (create or overwrite) an instruction file. */
20
- write(projectId: string, filename: string, content: string): InstructionFileContent | Promise<InstructionFileContent>;
21
- /** Remove an instruction file. Returns true if deleted. */
22
- remove(projectId: string, filename: string): boolean | Promise<boolean>;
23
- }
24
- export declare const INSTRUCTIONS_TOOL_NAME: "instructions";
25
- export type InstructionsAction = "list" | "read" | "write" | "edit" | "delete";
26
- export interface InstructionsToolParams {
27
- action: InstructionsAction;
28
- project_id: string;
29
- filename?: string;
30
- content?: string;
31
- old_text?: string;
32
- new_text?: string;
33
- }
34
- export declare const INSTRUCTIONS_TOOL_SCHEMA: {
35
- readonly type: "object";
36
- readonly properties: {
37
- readonly action: {
38
- readonly type: "string";
39
- readonly enum: readonly ["list", "read", "write", "edit", "delete"];
40
- readonly description: "Operation: list all files, read a file, write (create/overwrite), edit (partial replace), or delete a file.";
41
- };
42
- readonly project_id: {
43
- readonly type: "string";
44
- readonly description: "Project ID. Use \"default\" for the default project.";
45
- };
46
- readonly filename: {
47
- readonly type: "string";
48
- readonly description: "Instruction file name ending in .md (e.g. \"code-style.md\"). Required for read/write/delete. Sub-paths like \"testing/unit-test.md\" are supported.";
49
- };
50
- readonly content: {
51
- readonly type: "string";
52
- readonly description: "Markdown content for the instruction file. Required for write action.";
53
- };
54
- readonly old_text: {
55
- readonly type: "string";
56
- readonly description: "Required for edit action: the exact existing text to find and replace (must appear exactly once).";
57
- };
58
- readonly new_text: {
59
- readonly type: "string";
60
- readonly description: "Required for edit action: the replacement text.";
61
- };
62
- };
63
- readonly required: readonly ["action", "project_id"];
64
- };
65
- export declare function createInstructionsTool(deps: InstructionsToolDeps): PortableTool<InstructionsToolParams>;
@@ -1,153 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const LSP_TOOL_NAME: "lsp";
3
- export type LspOperation = "goToDefinition" | "findReferences" | "hover" | "documentSymbol" | "diagnostics" | "completion" | "signatureHelp" | "rename" | "codeAction";
4
- export interface LspToolParams {
5
- /** LSP operation to perform */
6
- operation: LspOperation;
7
- /** File path (absolute or relative to workspace root) */
8
- filePath: string;
9
- /** Line number (1-indexed) */
10
- line?: number;
11
- /** Character position (1-indexed) */
12
- character?: number;
13
- /** New name (for rename operation) */
14
- newName?: string;
15
- /** Include context lines around results */
16
- includeContext?: boolean;
17
- }
18
- export declare const LSP_TOOL_SCHEMA: {
19
- readonly type: "object";
20
- readonly properties: {
21
- readonly operation: {
22
- readonly type: "string";
23
- readonly enum: readonly ["goToDefinition", "findReferences", "hover", "documentSymbol", "diagnostics", "completion", "signatureHelp", "rename", "codeAction"];
24
- readonly description: string;
25
- };
26
- readonly filePath: {
27
- readonly type: "string";
28
- readonly description: "File path. Absolute or relative to workspace root.";
29
- };
30
- readonly line: {
31
- readonly type: "number";
32
- readonly description: "Line number (1-indexed). Required for positional operations.";
33
- };
34
- readonly character: {
35
- readonly type: "number";
36
- readonly description: "Character position (1-indexed). Required for positional operations.";
37
- };
38
- readonly newName: {
39
- readonly type: "string";
40
- readonly description: "New name for rename operation.";
41
- };
42
- readonly includeContext: {
43
- readonly type: "boolean";
44
- readonly description: "Include surrounding code context in results (default: true).";
45
- };
46
- };
47
- readonly required: readonly ["operation", "filePath"];
48
- };
49
- export interface LspLocation {
50
- filePath: string;
51
- line: number;
52
- character: number;
53
- endLine?: number;
54
- endCharacter?: number;
55
- context?: string;
56
- }
57
- export interface LspSymbol {
58
- name: string;
59
- kind: string;
60
- range: {
61
- startLine: number;
62
- endLine: number;
63
- };
64
- children?: LspSymbol[];
65
- }
66
- export interface LspDiagnostic {
67
- message: string;
68
- severity: "error" | "warning" | "info" | "hint";
69
- line: number;
70
- character: number;
71
- source?: string;
72
- code?: string | number;
73
- }
74
- export interface LspHoverInfo {
75
- contents: string;
76
- range?: {
77
- startLine: number;
78
- startCharacter: number;
79
- endLine: number;
80
- endCharacter: number;
81
- };
82
- }
83
- export interface LspCompletion {
84
- label: string;
85
- kind: string;
86
- detail?: string;
87
- insertText?: string;
88
- }
89
- export interface LspRenameEdit {
90
- filePath: string;
91
- edits: Array<{
92
- line: number;
93
- character: number;
94
- endLine: number;
95
- endCharacter: number;
96
- newText: string;
97
- }>;
98
- }
99
- export interface LspCodeAction {
100
- title: string;
101
- kind?: string;
102
- isPreferred?: boolean;
103
- }
104
- export type LspResult = {
105
- type: "locations";
106
- locations: LspLocation[];
107
- } | {
108
- type: "symbols";
109
- symbols: LspSymbol[];
110
- } | {
111
- type: "diagnostics";
112
- diagnostics: LspDiagnostic[];
113
- } | {
114
- type: "hover";
115
- hover: LspHoverInfo | null;
116
- } | {
117
- type: "completions";
118
- completions: LspCompletion[];
119
- } | {
120
- type: "rename";
121
- edits: LspRenameEdit[];
122
- } | {
123
- type: "codeActions";
124
- actions: LspCodeAction[];
125
- } | {
126
- type: "signatureHelp";
127
- signatures: string[];
128
- };
129
- /**
130
- * Host-provided LSP backend.
131
- * The host manages language server lifecycle and connections.
132
- */
133
- export interface LspToolDeps {
134
- /** Execute an LSP operation. Host dispatches to appropriate language server. */
135
- executeOperation(params: {
136
- operation: LspOperation;
137
- filePath: string;
138
- line?: number;
139
- character?: number;
140
- newName?: string;
141
- includeContext?: boolean;
142
- }, signal?: AbortSignal): Promise<LspResult>;
143
- /** Check if file exists and get its size */
144
- statFile?(filePath: string): Promise<{
145
- exists: boolean;
146
- size: number;
147
- } | null>;
148
- /** Resolve relative path to absolute */
149
- resolvePath(filePath: string): string;
150
- /** List supported language IDs (e.g. ['typescript', 'python', 'rust']) */
151
- supportedLanguages?(): string[];
152
- }
153
- export declare function createLspTool(deps: LspToolDeps): PortableTool<LspToolParams>;
@@ -1,30 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const MEDIA_CANCEL_TOOL_NAME: "media_cancel";
3
- export interface MediaCancelToolParams {
4
- task_id: string;
5
- provider?: string;
6
- }
7
- export declare const MEDIA_CANCEL_TOOL_SCHEMA: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly task_id: {
11
- readonly type: "string";
12
- readonly description: "The task ID of the media generation to cancel (returned in previous generation results).";
13
- };
14
- readonly provider: {
15
- readonly type: "string";
16
- readonly description: "Provider name (e.g. 'doubao', 'zhipu'). If omitted, auto-detects from task context.";
17
- };
18
- };
19
- readonly required: readonly ["task_id"];
20
- };
21
- export interface MediaCancelToolDeps {
22
- cancelTask(params: {
23
- taskId: string;
24
- provider?: string;
25
- }): Promise<{
26
- ok: boolean;
27
- message: string;
28
- }>;
29
- }
30
- export declare function createMediaCancelTool(deps: MediaCancelToolDeps): PortableTool<MediaCancelToolParams>;
@@ -1,28 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const IMAGE_UNDERSTAND_TOOL_NAME: "image_understand";
3
- export declare const VIDEO_UNDERSTAND_TOOL_NAME: "video_understand";
4
- export interface MediaUnderstandToolParams {
5
- query?: string;
6
- /** The URL field name varies per tool (image_url / video_url), so it's read via the index. */
7
- [key: string]: unknown;
8
- }
9
- /** What the injected backend returns for one understanding call. */
10
- export interface MediaUnderstandOutcome {
11
- /** The model's answer/description (empty ⇔ nothing usable came back — see `failure`). */
12
- text: string;
13
- /** Why `text` is empty: "fetch_failed" (medium never reached the model) / "stream_error" /
14
- * "empty_output" (model saw it, said nothing) / "no_model" (purpose unbound). undefined ⇔ success. */
15
- failure?: string;
16
- /** Input tokens billed, if known (diagnostic — a near-zero value on a media request corroborates fetch_failed). */
17
- promptTokens?: number;
18
- /** The resolved understanding model id, for the tool details. */
19
- model?: string;
20
- }
21
- export interface MediaUnderstandToolDeps {
22
- understand(params: {
23
- url: string;
24
- query?: string;
25
- }): Promise<MediaUnderstandOutcome>;
26
- }
27
- export declare function createImageUnderstandTool(deps: MediaUnderstandToolDeps): PortableTool<MediaUnderstandToolParams>;
28
- export declare function createVideoUnderstandTool(deps: MediaUnderstandToolDeps): PortableTool<MediaUnderstandToolParams>;