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.
- package/README.md +402 -45
- package/package.json +2 -2
- package/dist/agent.js +0 -1
- package/dist/cli.js +0 -9
- package/dist/contracts.js +0 -1
- package/dist/index.js +0 -5
- package/dist/orchestration.js +0 -118
- package/dist/types/agent/agent.d.ts +0 -43
- package/dist/types/agent/tool-loop.d.ts +0 -64
- package/dist/types/agent/types.d.ts +0 -175
- package/dist/types/cli/main.d.ts +0 -11
- package/dist/types/cli/stdio-server.d.ts +0 -45
- package/dist/types/config/config.d.ts +0 -17
- package/dist/types/contracts/hooks.d.ts +0 -120
- package/dist/types/contracts/index.d.ts +0 -10
- package/dist/types/contracts/planner.d.ts +0 -35
- package/dist/types/contracts/skill-candidate.d.ts +0 -63
- package/dist/types/contracts/todo.d.ts +0 -14
- package/dist/types/index.d.ts +0 -13
- package/dist/types/llm/builtin-providers.d.ts +0 -10
- package/dist/types/llm/index.d.ts +0 -15
- package/dist/types/llm/llm-client.d.ts +0 -43
- package/dist/types/llm/model-catalog.d.ts +0 -53
- package/dist/types/llm/provider-def.d.ts +0 -59
- package/dist/types/llm/provider-registry.d.ts +0 -54
- package/dist/types/llm/transport.d.ts +0 -62
- package/dist/types/llm/transports/anthropic-messages.d.ts +0 -31
- package/dist/types/llm/transports/openai-chat.d.ts +0 -36
- package/dist/types/orchestration/agent-registry.d.ts +0 -41
- package/dist/types/orchestration/approval-aware-tool-plan.d.ts +0 -32
- package/dist/types/orchestration/context-compression.d.ts +0 -220
- package/dist/types/orchestration/conversation-repair.d.ts +0 -61
- package/dist/types/orchestration/curator-scheduler.d.ts +0 -119
- package/dist/types/orchestration/embedded-failover-policy.d.ts +0 -110
- package/dist/types/orchestration/error-classification.d.ts +0 -12
- package/dist/types/orchestration/failover-classification.d.ts +0 -8
- package/dist/types/orchestration/failover-error.d.ts +0 -33
- package/dist/types/orchestration/fork-subagent.d.ts +0 -100
- package/dist/types/orchestration/index.d.ts +0 -120
- package/dist/types/orchestration/memory-flush-policy.d.ts +0 -57
- package/dist/types/orchestration/memory-provider.d.ts +0 -14
- package/dist/types/orchestration/parallel-tool-calls.d.ts +0 -41
- package/dist/types/orchestration/prompt-cache-strategy.d.ts +0 -126
- package/dist/types/orchestration/reactive-compact.d.ts +0 -73
- package/dist/types/orchestration/retry-loop.d.ts +0 -22
- package/dist/types/orchestration/skill-candidate.d.ts +0 -52
- package/dist/types/orchestration/skill-consolidation.d.ts +0 -123
- package/dist/types/orchestration/skill-improvement.d.ts +0 -59
- package/dist/types/orchestration/skill-similarity.d.ts +0 -98
- package/dist/types/orchestration/streaming-tool-executor.d.ts +0 -73
- package/dist/types/orchestration/team-orchestration.d.ts +0 -195
- package/dist/types/orchestration/team-tool-loop-wiring.d.ts +0 -92
- package/dist/types/orchestration/tool-choice-policy.d.ts +0 -54
- package/dist/types/orchestration/tool-loop-state.d.ts +0 -50
- package/dist/types/orchestration/tool-schema.d.ts +0 -39
- package/dist/types/orchestration/transcript-repair.d.ts +0 -42
- package/dist/types/orchestration/turn-loop-guard.d.ts +0 -86
- package/dist/types/orchestration/web-browser-policy.d.ts +0 -17
- package/dist/types/runtime/context-compression.d.ts +0 -61
- package/dist/types/runtime/hook-registry.d.ts +0 -12
- package/dist/types/runtime/memory-hooks.d.ts +0 -23
- package/dist/types/runtime/tool-eligibility.d.ts +0 -59
- package/dist/types/skills/index.d.ts +0 -108
- package/dist/types/skills/memory-extractor.d.ts +0 -64
- package/dist/types/skills/memory-query-tool.d.ts +0 -43
- package/dist/types/skills/memory-store.d.ts +0 -66
- package/dist/types/skills/memory-tool.d.ts +0 -67
- package/dist/types/skills/portable-tool.d.ts +0 -71
- package/dist/types/skills/qmemory-adapter.d.ts +0 -52
- package/dist/types/skills/skill-frontmatter.d.ts +0 -19
- package/dist/types/skills/skill-guard.d.ts +0 -23
- package/dist/types/skills/skill-loader.d.ts +0 -16
- package/dist/types/skills/skill-source.d.ts +0 -119
- package/dist/types/skills/skill-types.d.ts +0 -199
- package/dist/types/skills/think-tool.d.ts +0 -16
- package/dist/types/skills/todo-tool.d.ts +0 -63
- package/dist/types/skills/tools/agent-tool.d.ts +0 -91
- package/dist/types/skills/tools/apply-patch-tool.d.ts +0 -29
- package/dist/types/skills/tools/ask-user-tool.d.ts +0 -80
- package/dist/types/skills/tools/brief-tool.d.ts +0 -74
- package/dist/types/skills/tools/browser-tool.d.ts +0 -114
- package/dist/types/skills/tools/checkpoint-tool.d.ts +0 -66
- package/dist/types/skills/tools/config-tool.d.ts +0 -63
- package/dist/types/skills/tools/cron-tool.d.ts +0 -116
- package/dist/types/skills/tools/edit-tool.d.ts +0 -43
- package/dist/types/skills/tools/exec-tool.d.ts +0 -102
- package/dist/types/skills/tools/image-generate-tool.d.ts +0 -62
- package/dist/types/skills/tools/instructions-tool.d.ts +0 -103
- package/dist/types/skills/tools/lsp-tool.d.ts +0 -153
- package/dist/types/skills/tools/mcp-client-types.d.ts +0 -269
- package/dist/types/skills/tools/mcp-tool.d.ts +0 -249
- package/dist/types/skills/tools/memory-tool.d.ts +0 -74
- package/dist/types/skills/tools/monitor-tool.d.ts +0 -113
- package/dist/types/skills/tools/music-generate-tool.d.ts +0 -55
- package/dist/types/skills/tools/notify-tool.d.ts +0 -53
- package/dist/types/skills/tools/patch-tool.d.ts +0 -45
- package/dist/types/skills/tools/pdf-tool.d.ts +0 -66
- package/dist/types/skills/tools/plan-mode-tool.d.ts +0 -59
- package/dist/types/skills/tools/read-tool.d.ts +0 -51
- package/dist/types/skills/tools/repl-tool.d.ts +0 -70
- package/dist/types/skills/tools/search-tool.d.ts +0 -112
- package/dist/types/skills/tools/send-message-tool.d.ts +0 -51
- package/dist/types/skills/tools/skill-list-tool.d.ts +0 -33
- package/dist/types/skills/tools/skill-manage-tool.d.ts +0 -73
- package/dist/types/skills/tools/skill-view-tool.d.ts +0 -37
- package/dist/types/skills/tools/sleep-tool.d.ts +0 -49
- package/dist/types/skills/tools/structured-output-tool.d.ts +0 -116
- package/dist/types/skills/tools/task-tool.d.ts +0 -104
- package/dist/types/skills/tools/team-tool.d.ts +0 -89
- package/dist/types/skills/tools/tool-search-tool.d.ts +0 -51
- package/dist/types/skills/tools/tts-tool.d.ts +0 -38
- package/dist/types/skills/tools/video-edit-tool.d.ts +0 -69
- package/dist/types/skills/tools/video-generate-tool.d.ts +0 -62
- package/dist/types/skills/tools/video-merge-tool.d.ts +0 -105
- package/dist/types/skills/tools/video-upscale-tool.d.ts +0 -45
- package/dist/types/skills/tools/web-fetch-tool.d.ts +0 -78
- package/dist/types/skills/tools/web-search-tool.d.ts +0 -57
- package/dist/types/skills/tools/worktree-tool.d.ts +0 -69
- package/dist/types/skills/tools/write-tool.d.ts +0 -45
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const CRON_TOOL_NAME: "cron";
|
|
3
|
-
export type CronAction = "create" | "list" | "get" | "update" | "delete" | "pause" | "resume" | "trigger";
|
|
4
|
-
export interface CronToolParams {
|
|
5
|
-
action: CronAction;
|
|
6
|
-
/** Job ID (required for get/update/delete/pause/resume/trigger) */
|
|
7
|
-
jobId?: string;
|
|
8
|
-
/** Task prompt to execute on schedule */
|
|
9
|
-
prompt?: string;
|
|
10
|
-
/** Cron expression or shorthand ('5m', '1h', '0 9 * * *') */
|
|
11
|
-
schedule?: string;
|
|
12
|
-
/** Human-readable job name */
|
|
13
|
-
name?: string;
|
|
14
|
-
/** Repeat count (null = infinite) */
|
|
15
|
-
repeat?: number | null;
|
|
16
|
-
/** Allowed tools for the scheduled task */
|
|
17
|
-
allowedTools?: string[];
|
|
18
|
-
/** Whether the job is enabled */
|
|
19
|
-
enabled?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare const CRON_TOOL_SCHEMA: {
|
|
22
|
-
readonly type: "object";
|
|
23
|
-
readonly properties: {
|
|
24
|
-
readonly action: {
|
|
25
|
-
readonly type: "string";
|
|
26
|
-
readonly enum: readonly ["create", "list", "get", "update", "delete", "pause", "resume", "trigger"];
|
|
27
|
-
readonly description: "CRUD action: create/list/get/update/delete/pause/resume/trigger.";
|
|
28
|
-
};
|
|
29
|
-
readonly jobId: {
|
|
30
|
-
readonly type: "string";
|
|
31
|
-
readonly description: "Job ID. Required for get/update/delete/pause/resume/trigger.";
|
|
32
|
-
};
|
|
33
|
-
readonly prompt: {
|
|
34
|
-
readonly type: "string";
|
|
35
|
-
readonly description: "Task prompt to execute on schedule. Required for create.";
|
|
36
|
-
};
|
|
37
|
-
readonly schedule: {
|
|
38
|
-
readonly type: "string";
|
|
39
|
-
readonly description: string;
|
|
40
|
-
};
|
|
41
|
-
readonly name: {
|
|
42
|
-
readonly type: "string";
|
|
43
|
-
readonly description: "Human-readable job name.";
|
|
44
|
-
};
|
|
45
|
-
readonly repeat: {
|
|
46
|
-
readonly type: "number";
|
|
47
|
-
readonly description: "Number of times to repeat (null = infinite). Default: null.";
|
|
48
|
-
};
|
|
49
|
-
readonly allowedTools: {
|
|
50
|
-
readonly type: "array";
|
|
51
|
-
readonly items: {
|
|
52
|
-
readonly type: "string";
|
|
53
|
-
};
|
|
54
|
-
readonly description: "Tools the scheduled task is allowed to use.";
|
|
55
|
-
};
|
|
56
|
-
readonly enabled: {
|
|
57
|
-
readonly type: "boolean";
|
|
58
|
-
readonly description: "Whether the job is enabled (for update).";
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
readonly required: readonly ["action"];
|
|
62
|
-
};
|
|
63
|
-
export interface CronJob {
|
|
64
|
-
id: string;
|
|
65
|
-
name: string;
|
|
66
|
-
prompt: string;
|
|
67
|
-
schedule: string;
|
|
68
|
-
scheduleDisplay: string;
|
|
69
|
-
state: "scheduled" | "paused";
|
|
70
|
-
enabled: boolean;
|
|
71
|
-
repeat: {
|
|
72
|
-
times: number | null;
|
|
73
|
-
completed: number;
|
|
74
|
-
};
|
|
75
|
-
nextRunAt?: string;
|
|
76
|
-
lastRunAt?: string;
|
|
77
|
-
lastStatus?: "success" | "error" | null;
|
|
78
|
-
allowedTools?: string[];
|
|
79
|
-
}
|
|
80
|
-
export interface CronResult {
|
|
81
|
-
success: boolean;
|
|
82
|
-
job?: CronJob;
|
|
83
|
-
jobs?: CronJob[];
|
|
84
|
-
error?: string;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Host-provided cron scheduler backend.
|
|
88
|
-
* Jobs are persisted locally and survive restarts.
|
|
89
|
-
*/
|
|
90
|
-
export interface CronToolDeps {
|
|
91
|
-
createJob(params: {
|
|
92
|
-
prompt: string;
|
|
93
|
-
schedule: string;
|
|
94
|
-
name?: string;
|
|
95
|
-
repeat?: number | null;
|
|
96
|
-
allowedTools?: string[];
|
|
97
|
-
}): Promise<CronResult>;
|
|
98
|
-
listJobs(): Promise<CronResult>;
|
|
99
|
-
getJob(jobId: string): Promise<CronResult>;
|
|
100
|
-
updateJob(jobId: string, updates: Partial<{
|
|
101
|
-
prompt: string;
|
|
102
|
-
schedule: string;
|
|
103
|
-
name: string;
|
|
104
|
-
enabled: boolean;
|
|
105
|
-
repeat: number | null;
|
|
106
|
-
allowedTools: string[];
|
|
107
|
-
}>): Promise<CronResult>;
|
|
108
|
-
deleteJob(jobId: string): Promise<CronResult>;
|
|
109
|
-
pauseJob(jobId: string): Promise<CronResult>;
|
|
110
|
-
resumeJob(jobId: string): Promise<CronResult>;
|
|
111
|
-
triggerJob(jobId: string): Promise<CronResult>;
|
|
112
|
-
/** Validate cron schedule expression. Returns error or null. */
|
|
113
|
-
validateSchedule?(schedule: string): string | null;
|
|
114
|
-
}
|
|
115
|
-
export declare const MAX_CRON_JOBS = 50;
|
|
116
|
-
export declare function createCronTool(deps: CronToolDeps): PortableTool<CronToolParams>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const EDIT_TOOL_NAME: "edit";
|
|
3
|
-
export interface EditToolParams {
|
|
4
|
-
path: string;
|
|
5
|
-
oldText: string;
|
|
6
|
-
newText: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const EDIT_TOOL_SCHEMA: {
|
|
9
|
-
readonly type: "object";
|
|
10
|
-
readonly properties: {
|
|
11
|
-
readonly path: {
|
|
12
|
-
readonly type: "string";
|
|
13
|
-
readonly description: "Path to the file to edit (relative or absolute).";
|
|
14
|
-
};
|
|
15
|
-
readonly oldText: {
|
|
16
|
-
readonly type: "string";
|
|
17
|
-
readonly description: "Exact text to find and replace (must match exactly, including whitespace).";
|
|
18
|
-
};
|
|
19
|
-
readonly newText: {
|
|
20
|
-
readonly type: "string";
|
|
21
|
-
readonly description: "New text to replace the old text with.";
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
readonly required: readonly ["path", "oldText", "newText"];
|
|
25
|
-
};
|
|
26
|
-
/** Deps injected by the host runtime for file editing. */
|
|
27
|
-
export interface EditToolDeps {
|
|
28
|
-
/** Read file content as text. */
|
|
29
|
-
readFile(path: string): Promise<string>;
|
|
30
|
-
/** Write content back. */
|
|
31
|
-
writeFile(path: string, content: string): Promise<void>;
|
|
32
|
-
/** Resolve a relative path to absolute. */
|
|
33
|
-
resolvePath(input: string): string;
|
|
34
|
-
/**
|
|
35
|
-
* Check for concurrent modification before writing.
|
|
36
|
-
* The host tracks when each file was last read vs last modified on disk.
|
|
37
|
-
* Returns null if safe to write, or a descriptive warning if the file
|
|
38
|
-
* has been modified since last read (by user, another tool, or external process).
|
|
39
|
-
* If not provided, no concurrent modification check is performed.
|
|
40
|
-
*/
|
|
41
|
-
checkConcurrentModification?(path: string): string | null;
|
|
42
|
-
}
|
|
43
|
-
export declare function createEditTool(deps: EditToolDeps): PortableTool<EditToolParams>;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const EXEC_TOOL_NAME: "exec";
|
|
3
|
-
export interface ExecToolParams {
|
|
4
|
-
command: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
workdir?: string;
|
|
7
|
-
timeout?: number;
|
|
8
|
-
background?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare const EXEC_TOOL_SCHEMA: {
|
|
11
|
-
readonly type: "object";
|
|
12
|
-
readonly properties: {
|
|
13
|
-
readonly command: {
|
|
14
|
-
readonly type: "string";
|
|
15
|
-
readonly description: "Shell command to execute. On Windows uses PowerShell, on Unix uses bash.";
|
|
16
|
-
};
|
|
17
|
-
readonly description: {
|
|
18
|
-
readonly type: "string";
|
|
19
|
-
readonly description: string;
|
|
20
|
-
};
|
|
21
|
-
readonly workdir: {
|
|
22
|
-
readonly type: "string";
|
|
23
|
-
readonly description: "Working directory for the command.";
|
|
24
|
-
};
|
|
25
|
-
readonly timeout: {
|
|
26
|
-
readonly type: "number";
|
|
27
|
-
readonly description: "Timeout in seconds (default: 120). Only applies to foreground commands.";
|
|
28
|
-
};
|
|
29
|
-
readonly background: {
|
|
30
|
-
readonly type: "boolean";
|
|
31
|
-
readonly description: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
readonly required: readonly ["command"];
|
|
35
|
-
};
|
|
36
|
-
export interface ExecResult {
|
|
37
|
-
exitCode: number;
|
|
38
|
-
stdout: string;
|
|
39
|
-
stderr: string;
|
|
40
|
-
timedOut?: boolean;
|
|
41
|
-
}
|
|
42
|
-
export interface BackgroundExecResult {
|
|
43
|
-
pid: string;
|
|
44
|
-
started: boolean;
|
|
45
|
-
hint?: string;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Deps injected by the host runtime for command execution.
|
|
49
|
-
* The host is responsible for sandboxing, approval, path restrictions,
|
|
50
|
-
* and security policies (dangerous command blocking).
|
|
51
|
-
*/
|
|
52
|
-
export interface ExecToolDeps {
|
|
53
|
-
/**
|
|
54
|
-
* Execute a shell command in the foreground and return the result.
|
|
55
|
-
*/
|
|
56
|
-
exec(command: string, options?: {
|
|
57
|
-
workdir?: string;
|
|
58
|
-
timeout?: number;
|
|
59
|
-
}): Promise<ExecResult>;
|
|
60
|
-
/**
|
|
61
|
-
* Start a background process and return its ID.
|
|
62
|
-
* The host manages the process lifecycle.
|
|
63
|
-
* If not provided, background=true will be rejected.
|
|
64
|
-
*/
|
|
65
|
-
execBackground?(command: string, options?: {
|
|
66
|
-
workdir?: string;
|
|
67
|
-
}): Promise<BackgroundExecResult>;
|
|
68
|
-
/**
|
|
69
|
-
* Retrieve partial output from a background process.
|
|
70
|
-
* If not provided, background output queries are not supported.
|
|
71
|
-
*/
|
|
72
|
-
getBackgroundOutput?(pid: string): Promise<{
|
|
73
|
-
stdout: string;
|
|
74
|
-
stderr: string;
|
|
75
|
-
running: boolean;
|
|
76
|
-
}>;
|
|
77
|
-
/**
|
|
78
|
-
* Validate a command before execution (skill-guard integration point).
|
|
79
|
-
* The host MUST implement this to block dangerous commands
|
|
80
|
-
* (rm -rf /, format, del /f /s /q, etc.).
|
|
81
|
-
* Returns null/undefined if allowed, or an error message string if blocked.
|
|
82
|
-
* If not provided, all commands are allowed (UNSAFE — only for tests).
|
|
83
|
-
*/
|
|
84
|
-
validateCommand?(command: string): Promise<string | null | undefined>;
|
|
85
|
-
/**
|
|
86
|
-
* Persist large output to disk and return a reference URI.
|
|
87
|
-
* Called when stdout+stderr exceeds MAX_OUTPUT_CHARS.
|
|
88
|
-
* If provided, the tool returns a truncated preview + the persisted URI.
|
|
89
|
-
* This avoids flooding the LLM context with huge outputs.
|
|
90
|
-
*/
|
|
91
|
-
persistOutput?(output: string, meta: {
|
|
92
|
-
command: string;
|
|
93
|
-
exitCode: number;
|
|
94
|
-
}): Promise<string>;
|
|
95
|
-
/**
|
|
96
|
-
* Interpret a non-zero exit code into a human-readable explanation.
|
|
97
|
-
* E.g. exit 127 → "command not found", exit 137 → "killed by SIGKILL (OOM?)".
|
|
98
|
-
* If not provided, raw exit code is shown.
|
|
99
|
-
*/
|
|
100
|
-
interpretExitCode?(exitCode: number, stderr: string): string | undefined;
|
|
101
|
-
}
|
|
102
|
-
export declare function createExecTool(deps: ExecToolDeps): PortableTool<ExecToolParams>;
|
|
@@ -1,62 +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
|
-
n?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const IMAGE_GENERATE_TOOL_SCHEMA: {
|
|
12
|
-
readonly type: "object";
|
|
13
|
-
readonly properties: {
|
|
14
|
-
readonly prompt: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
readonly description: "Image generation prompt. Enrich vague requests with style, lighting, composition, color, mood details.";
|
|
17
|
-
};
|
|
18
|
-
readonly purpose: {
|
|
19
|
-
readonly type: "string";
|
|
20
|
-
readonly description: "Intended use: 'social-media', 'short-video-cover', 'phone-wallpaper', 'avatar', 'poster', etc.";
|
|
21
|
-
};
|
|
22
|
-
readonly style: {
|
|
23
|
-
readonly type: "string";
|
|
24
|
-
readonly description: "Visual art style: 'photorealistic', 'anime', 'watercolor', 'oil-painting', '3d-render', etc.";
|
|
25
|
-
};
|
|
26
|
-
readonly size: {
|
|
27
|
-
readonly type: "string";
|
|
28
|
-
readonly description: "Dimensions: e.g. '1024x1792' (portrait), '1792x1024' (landscape), '1024x1024' (square). Default: '1024x1024'.";
|
|
29
|
-
};
|
|
30
|
-
readonly image_url: {
|
|
31
|
-
readonly type: "string";
|
|
32
|
-
readonly description: "Reference image URL for image-to-image generation (img2img). Character reference sheet or style transfer.";
|
|
33
|
-
};
|
|
34
|
-
readonly n: {
|
|
35
|
-
readonly type: "number";
|
|
36
|
-
readonly description: "Number of images to generate (1-4). Default: 1.";
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
readonly required: readonly ["prompt"];
|
|
40
|
-
};
|
|
41
|
-
export interface ImageGenerateResult {
|
|
42
|
-
mediaUrls: string[];
|
|
43
|
-
model?: string;
|
|
44
|
-
size?: string;
|
|
45
|
-
durationMs?: number;
|
|
46
|
-
}
|
|
47
|
-
/** Deps injected by the host runtime for image generation. */
|
|
48
|
-
export interface ImageGenerateToolDeps {
|
|
49
|
-
/**
|
|
50
|
-
* Generate images via the configured backend (relay, direct API, etc.).
|
|
51
|
-
* The host handles model selection, failover, watermark, and storage.
|
|
52
|
-
*/
|
|
53
|
-
generateImage(params: {
|
|
54
|
-
prompt: string;
|
|
55
|
-
purpose?: string;
|
|
56
|
-
style?: string;
|
|
57
|
-
size?: string;
|
|
58
|
-
imageUrl?: string;
|
|
59
|
-
n?: number;
|
|
60
|
-
}): Promise<ImageGenerateResult>;
|
|
61
|
-
}
|
|
62
|
-
export declare function createImageGenerateTool(deps: ImageGenerateToolDeps): PortableTool<ImageGenerateToolParams>;
|
|
@@ -1,103 +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;
|
|
21
|
-
/** Remove an instruction file. Returns true if deleted. */
|
|
22
|
-
remove(projectId: string, filename: string): boolean;
|
|
23
|
-
}
|
|
24
|
-
export declare const INSTRUCTIONS_LIST_TOOL_NAME: "instructions_list";
|
|
25
|
-
export interface InstructionsListParams {
|
|
26
|
-
project_id: string;
|
|
27
|
-
}
|
|
28
|
-
export declare const INSTRUCTIONS_LIST_SCHEMA: {
|
|
29
|
-
readonly type: "object";
|
|
30
|
-
readonly properties: {
|
|
31
|
-
readonly project_id: {
|
|
32
|
-
readonly type: "string";
|
|
33
|
-
readonly description: "Project ID to list instructions for. Use \"default\" for the default project.";
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
readonly required: readonly ["project_id"];
|
|
37
|
-
};
|
|
38
|
-
export declare function createInstructionsListTool(deps: InstructionsToolDeps): PortableTool<InstructionsListParams>;
|
|
39
|
-
export declare const INSTRUCTIONS_READ_TOOL_NAME: "instructions_read";
|
|
40
|
-
export interface InstructionsReadParams {
|
|
41
|
-
project_id: string;
|
|
42
|
-
filename: string;
|
|
43
|
-
}
|
|
44
|
-
export declare const INSTRUCTIONS_READ_SCHEMA: {
|
|
45
|
-
readonly type: "object";
|
|
46
|
-
readonly properties: {
|
|
47
|
-
readonly project_id: {
|
|
48
|
-
readonly type: "string";
|
|
49
|
-
readonly description: "Project ID. Use \"default\" for the default project.";
|
|
50
|
-
};
|
|
51
|
-
readonly filename: {
|
|
52
|
-
readonly type: "string";
|
|
53
|
-
readonly description: "Instruction file name (e.g. \"code-style.md\"). Supports sub-paths like \"testing/unit-test.md\".";
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
readonly required: readonly ["project_id", "filename"];
|
|
57
|
-
};
|
|
58
|
-
export declare function createInstructionsReadTool(deps: InstructionsToolDeps): PortableTool<InstructionsReadParams>;
|
|
59
|
-
export declare const INSTRUCTIONS_WRITE_TOOL_NAME: "instructions_write";
|
|
60
|
-
export interface InstructionsWriteParams {
|
|
61
|
-
project_id: string;
|
|
62
|
-
filename: string;
|
|
63
|
-
content: string;
|
|
64
|
-
}
|
|
65
|
-
export declare const INSTRUCTIONS_WRITE_SCHEMA: {
|
|
66
|
-
readonly type: "object";
|
|
67
|
-
readonly properties: {
|
|
68
|
-
readonly project_id: {
|
|
69
|
-
readonly type: "string";
|
|
70
|
-
readonly description: "Project ID. Use \"default\" for the default project.";
|
|
71
|
-
};
|
|
72
|
-
readonly filename: {
|
|
73
|
-
readonly type: "string";
|
|
74
|
-
readonly description: "Instruction file name ending in .md (e.g. \"code-style.md\"). Sub-paths like \"testing/unit-test.md\" are supported.";
|
|
75
|
-
};
|
|
76
|
-
readonly content: {
|
|
77
|
-
readonly type: "string";
|
|
78
|
-
readonly description: "Markdown content for the instruction file.";
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
readonly required: readonly ["project_id", "filename", "content"];
|
|
82
|
-
};
|
|
83
|
-
export declare function createInstructionsWriteTool(deps: InstructionsToolDeps): PortableTool<InstructionsWriteParams>;
|
|
84
|
-
export declare const INSTRUCTIONS_DELETE_TOOL_NAME: "instructions_delete";
|
|
85
|
-
export interface InstructionsDeleteParams {
|
|
86
|
-
project_id: string;
|
|
87
|
-
filename: string;
|
|
88
|
-
}
|
|
89
|
-
export declare const INSTRUCTIONS_DELETE_SCHEMA: {
|
|
90
|
-
readonly type: "object";
|
|
91
|
-
readonly properties: {
|
|
92
|
-
readonly project_id: {
|
|
93
|
-
readonly type: "string";
|
|
94
|
-
readonly description: "Project ID. Use \"default\" for the default project.";
|
|
95
|
-
};
|
|
96
|
-
readonly filename: {
|
|
97
|
-
readonly type: "string";
|
|
98
|
-
readonly description: "Instruction file name to delete (e.g. \"code-style.md\").";
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
readonly required: readonly ["project_id", "filename"];
|
|
102
|
-
};
|
|
103
|
-
export declare function createInstructionsDeleteTool(deps: InstructionsToolDeps): PortableTool<InstructionsDeleteParams>;
|
|
@@ -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
|
-
}): 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>;
|