qlogicagent 0.6.0 → 1.0.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/dist/agent.js +9 -9
- package/dist/cli.js +158 -148
- package/dist/index.js +158 -148
- package/dist/orchestration.js +9 -9
- package/dist/types/agent/types.d.ts +50 -0
- package/dist/types/cli/stdio-server.d.ts +60 -0
- package/dist/types/cli/tool-bootstrap.d.ts +5 -13
- package/dist/types/llm/index.d.ts +7 -1
- package/dist/types/llm/media-client.d.ts +43 -0
- package/dist/types/llm/media-transport.d.ts +80 -0
- package/dist/types/llm/model-catalog.d.ts +4 -4
- package/dist/types/llm/provider-def.d.ts +7 -0
- package/dist/types/llm/provider-registry.d.ts +1 -1
- package/dist/types/llm/transport.d.ts +2 -0
- package/dist/types/llm/transports/anthropic-messages.d.ts +34 -11
- package/dist/types/llm/transports/gemini-media.d.ts +21 -0
- package/dist/types/llm/transports/minimax-media.d.ts +21 -0
- package/dist/types/llm/transports/openai-chat.d.ts +1 -1
- package/dist/types/llm/transports/openai-media.d.ts +24 -0
- package/dist/types/llm/transports/qwen-media.d.ts +25 -0
- package/dist/types/llm/transports/volcengine-media.d.ts +34 -0
- package/dist/types/orchestration/tool-loop/tool-schema.d.ts +1 -2
- package/dist/types/protocol/index.d.ts +7 -0
- package/dist/types/protocol/methods.d.ts +380 -0
- package/dist/types/protocol/notifications.d.ts +296 -0
- package/dist/types/runtime/prompt/environment-context.d.ts +1 -1
- package/dist/types/runtime/session/index.d.ts +1 -1
- package/dist/types/runtime/session/session-state.d.ts +18 -9
- package/dist/types/skills/memory/qmemory-adapter.d.ts +1 -0
- package/dist/types/skills/tools/shell/shell-exec.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,31 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Anthropic Messages Transport — SSE streaming for Claude API.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Aligned with Hermes anthropic_messages.py transport.
|
|
4
|
+
* Aligned with CC (claude-code-haha) src/services/api/claude.ts:
|
|
5
|
+
* - cache_control ephemeral injection on system prompt blocks
|
|
6
|
+
* - ensureToolResultPairing() conversation repair before every request
|
|
7
|
+
* - Retry with exponential backoff on transient errors (429/529/overloaded)
|
|
8
|
+
* - Non-streaming fallback when stream errors out
|
|
9
|
+
* - 90s idle watchdog timeout for silently dropped connections
|
|
10
|
+
* - Adaptive/budget thinking with temperature omit
|
|
11
|
+
* - Cache token extraction with >0 guard (CC updateUsage parity)
|
|
12
|
+
* - signature_delta handling for thinking blocks
|
|
14
13
|
*/
|
|
15
14
|
import type { LLMChunk, LLMRequest, LLMTransport } from "../transport.js";
|
|
16
15
|
export interface AnthropicTransportConfig {
|
|
17
16
|
baseUrl: string;
|
|
18
17
|
/** anthropic-version header (default "2023-06-01") */
|
|
19
18
|
apiVersion?: string;
|
|
20
|
-
/**
|
|
19
|
+
/** Per-request timeout in ms (default 180_000) */
|
|
21
20
|
timeoutMs?: number;
|
|
21
|
+
/** Stream idle watchdog timeout in ms (default 90_000, CC parity) */
|
|
22
|
+
streamIdleTimeoutMs?: number;
|
|
23
|
+
/** Enable prompt caching via cache_control ephemeral (default true) */
|
|
24
|
+
enablePromptCaching?: boolean;
|
|
25
|
+
/** Max retry attempts on transient errors (default 3) */
|
|
26
|
+
maxRetries?: number;
|
|
22
27
|
}
|
|
23
28
|
export declare class AnthropicMessagesTransport implements LLMTransport {
|
|
24
29
|
private baseUrl;
|
|
25
30
|
private apiVersion;
|
|
26
31
|
private timeoutMs;
|
|
32
|
+
private streamIdleTimeoutMs;
|
|
33
|
+
private enablePromptCaching;
|
|
34
|
+
private maxRetries;
|
|
27
35
|
constructor(config: AnthropicTransportConfig);
|
|
28
36
|
stream(request: LLMRequest, apiKey: string, signal?: AbortSignal): AsyncGenerator<LLMChunk>;
|
|
37
|
+
/**
|
|
38
|
+
* Stream with idle watchdog timer (CC parity: 90s default).
|
|
39
|
+
* Throws if no chunks received for streamIdleTimeoutMs.
|
|
40
|
+
*/
|
|
41
|
+
private streamWithWatchdog;
|
|
42
|
+
/**
|
|
43
|
+
* Non-streaming fallback (CC executeNonStreamingRequest parity).
|
|
44
|
+
* Used when streaming fails after all retries.
|
|
45
|
+
* Caps max_tokens at 64K and adjusts thinking budget accordingly.
|
|
46
|
+
*/
|
|
47
|
+
private nonStreamingFallback;
|
|
48
|
+
/**
|
|
49
|
+
* Convert a non-streaming API response to LLMChunk sequence.
|
|
50
|
+
*/
|
|
51
|
+
private mapNonStreamingResponse;
|
|
29
52
|
private parseSSEStream;
|
|
30
53
|
private mapEvent;
|
|
31
54
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini Media Transport — Image generation via Gemini generateContent.
|
|
3
|
+
*
|
|
4
|
+
* Uses responseModalities: ["TEXT", "IMAGE"] with the Gemini REST API.
|
|
5
|
+
* POST /v1beta/models/{model}:generateContent
|
|
6
|
+
* Auth: key= query param or x-goog-api-key header
|
|
7
|
+
* Docs: https://ai.google.dev/gemini-api/docs/image-generation
|
|
8
|
+
*/
|
|
9
|
+
import type { MediaTransport, MediaRequest, MediaResult, MediaType } from "../media-transport.js";
|
|
10
|
+
export interface GeminiMediaConfig {
|
|
11
|
+
/** Base URL, e.g. "https://generativelanguage.googleapis.com/v1beta/openai" */
|
|
12
|
+
baseUrl: string;
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class GeminiMediaTransport implements MediaTransport {
|
|
16
|
+
readonly supportedTypes: readonly MediaType[];
|
|
17
|
+
private apiBase;
|
|
18
|
+
private timeoutMs;
|
|
19
|
+
constructor(config: GeminiMediaConfig);
|
|
20
|
+
generate(request: MediaRequest, apiKey: string, signal?: AbortSignal): Promise<MediaResult>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MiniMax Media Transport — Music Generation API (music-2.6, music-cover).
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/music_generation (async job: submit → poll → result)
|
|
5
|
+
* Auth: Authorization: Bearer $MINIMAX_API_KEY
|
|
6
|
+
* Docs: https://platform.minimaxi.com/document/Music
|
|
7
|
+
*/
|
|
8
|
+
import type { MediaTransport, MediaRequest, MediaResult, MediaType } from "../media-transport.js";
|
|
9
|
+
export interface MiniMaxMediaConfig {
|
|
10
|
+
/** Base URL, e.g. "https://api.minimaxi.com" */
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class MiniMaxMediaTransport implements MediaTransport {
|
|
15
|
+
readonly supportedTypes: readonly MediaType[];
|
|
16
|
+
private baseUrl;
|
|
17
|
+
private timeoutMs;
|
|
18
|
+
constructor(config: MiniMaxMediaConfig);
|
|
19
|
+
generate(request: MediaRequest, apiKey: string, signal?: AbortSignal): Promise<MediaResult>;
|
|
20
|
+
private pollTask;
|
|
21
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* OpenAI Chat Completions Transport — SSE streaming implementation.
|
|
3
3
|
*
|
|
4
4
|
* Covers all OpenAI-compatible providers:
|
|
5
|
-
* DeepSeek, Qwen,
|
|
5
|
+
* DeepSeek, Qwen, Minimax, Moonshot, OpenRouter, etc.
|
|
6
6
|
*
|
|
7
7
|
* POST {baseUrl}/v1/chat/completions with stream: true
|
|
8
8
|
* Auth: Authorization: Bearer {apiKey}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI Media Transport — Images API (gpt-image-2) + Audio Speech API (tts-1).
|
|
3
|
+
*
|
|
4
|
+
* Image: POST /v1/images/generations (sync response, returns URLs)
|
|
5
|
+
* TTS: POST /v1/audio/speech (sync response, returns raw audio bytes)
|
|
6
|
+
* Auth: Authorization: Bearer $OPENAI_API_KEY
|
|
7
|
+
* Docs: https://platform.openai.com/docs/api-reference/images/create
|
|
8
|
+
* https://platform.openai.com/docs/api-reference/audio/createSpeech
|
|
9
|
+
*/
|
|
10
|
+
import type { MediaTransport, MediaRequest, MediaResult, MediaType } from "../media-transport.js";
|
|
11
|
+
export interface OpenAIMediaConfig {
|
|
12
|
+
/** Base URL, e.g. "https://api.openai.com" */
|
|
13
|
+
baseUrl: string;
|
|
14
|
+
timeoutMs?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class OpenAIMediaTransport implements MediaTransport {
|
|
17
|
+
readonly supportedTypes: readonly MediaType[];
|
|
18
|
+
private baseUrl;
|
|
19
|
+
private timeoutMs;
|
|
20
|
+
constructor(config: OpenAIMediaConfig);
|
|
21
|
+
generate(request: MediaRequest, apiKey: string, signal?: AbortSignal): Promise<MediaResult>;
|
|
22
|
+
private generateImage;
|
|
23
|
+
private generateTTS;
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qwen (DashScope) Media Transport — TTS via CosyVoice.
|
|
3
|
+
*
|
|
4
|
+
* DashScope TTS uses the async task API:
|
|
5
|
+
* Submit: POST /api/v1/services/aigc/text2audio/generation
|
|
6
|
+
* Poll: GET /api/v1/tasks/{taskId}
|
|
7
|
+
*
|
|
8
|
+
* Auth: Authorization: Bearer $DASHSCOPE_API_KEY
|
|
9
|
+
* Docs: https://help.aliyun.com/zh/model-studio/developer-reference/cosyvoice-large-speech-synthesis
|
|
10
|
+
*/
|
|
11
|
+
import type { MediaTransport, MediaRequest, MediaResult, MediaType } from "../media-transport.js";
|
|
12
|
+
export interface QwenMediaConfig {
|
|
13
|
+
/** Base URL, e.g. "https://dashscope.aliyuncs.com" */
|
|
14
|
+
baseUrl: string;
|
|
15
|
+
timeoutMs?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class QwenMediaTransport implements MediaTransport {
|
|
18
|
+
readonly supportedTypes: readonly MediaType[];
|
|
19
|
+
private baseUrl;
|
|
20
|
+
private timeoutMs;
|
|
21
|
+
constructor(config: QwenMediaConfig);
|
|
22
|
+
generate(request: MediaRequest, apiKey: string, signal?: AbortSignal): Promise<MediaResult>;
|
|
23
|
+
private pollTask;
|
|
24
|
+
private extractAudioUrl;
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Volcengine Media Transport — Doubao Seedream (image), Seedance (video), 3D generation.
|
|
3
|
+
*
|
|
4
|
+
* API reference:
|
|
5
|
+
* Image: POST /v3/images/generations (sync)
|
|
6
|
+
* Video: POST /v3/contents/generations/tasks (async job)
|
|
7
|
+
* 3D: POST /v3/3d-contents/generations/tasks (async job)
|
|
8
|
+
*
|
|
9
|
+
* Auth: Authorization: Bearer $ARK_API_KEY
|
|
10
|
+
* Docs: https://www.volcengine.com/docs/82379/1330310
|
|
11
|
+
*/
|
|
12
|
+
import type { MediaTransport, MediaRequest, MediaResult, MediaType } from "../media-transport.js";
|
|
13
|
+
export interface VolcengineMediaConfig {
|
|
14
|
+
/** Base URL, e.g. "https://ark.cn-beijing.volces.com/api" */
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class VolcengineMediaTransport implements MediaTransport {
|
|
19
|
+
readonly supportedTypes: readonly MediaType[];
|
|
20
|
+
private baseUrl;
|
|
21
|
+
private timeoutMs;
|
|
22
|
+
constructor(config: VolcengineMediaConfig);
|
|
23
|
+
generate(request: MediaRequest, apiKey: string, signal?: AbortSignal): Promise<MediaResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Check if this transport can handle a given operation.
|
|
26
|
+
* Video edit/merge/upscale are routed through the same video endpoint.
|
|
27
|
+
*/
|
|
28
|
+
canHandle(request: MediaRequest): boolean;
|
|
29
|
+
private generateImage;
|
|
30
|
+
private generateVideo;
|
|
31
|
+
private generate3D;
|
|
32
|
+
private submitTask;
|
|
33
|
+
private pollTask;
|
|
34
|
+
}
|
|
@@ -21,7 +21,6 @@ export interface CapabilityToolManifestLike {
|
|
|
21
21
|
description?: string;
|
|
22
22
|
requiredParameters?: string[];
|
|
23
23
|
}
|
|
24
|
-
export declare function isXaiProvider(modelProvider?: string, modelId?: string): boolean;
|
|
25
24
|
export declare function normalizeFunctionToolParameters(parameters: Record<string, unknown> | undefined, options?: ToolSchemaProvider): Record<string, unknown>;
|
|
26
25
|
export declare function convertFunctionTools(tools: readonly FunctionToolSource[], options?: ToolSchemaProvider): FunctionToolDefinition[];
|
|
27
26
|
export declare function convertCapabilityToolManifestsToFunctionTools(tools: readonly CapabilityToolManifestLike[]): FunctionToolDefinition[];
|
|
@@ -30,7 +29,7 @@ export declare function parseOpenAiToolCallsFromChatResponse(responseBody: strin
|
|
|
30
29
|
toolCalls: OpenAiToolCall[];
|
|
31
30
|
responseText: string;
|
|
32
31
|
};
|
|
33
|
-
export declare function buildAssistantToolCallMessage(toolCalls: OpenAiToolCall[]): Record<string, unknown>;
|
|
32
|
+
export declare function buildAssistantToolCallMessage(toolCalls: OpenAiToolCall[], text?: string): Record<string, unknown>;
|
|
34
33
|
export declare function buildToolResultMessage(callId: string, result: {
|
|
35
34
|
ok: boolean;
|
|
36
35
|
payload?: unknown;
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized RPC Method Protocol — all JSON-RPC request methods
|
|
3
|
+
* that qlogicagent exposes to external apps.
|
|
4
|
+
*
|
|
5
|
+
* This is the SINGLE SOURCE OF TRUTH for the agent's inbound API contract.
|
|
6
|
+
*
|
|
7
|
+
* Reference: Codex app-server RPC, Claude Code JSON-RPC, GitHub Copilot Agent API.
|
|
8
|
+
*/
|
|
9
|
+
import type { ChatMessage, ToolDefinition } from "../agent/types.js";
|
|
10
|
+
import type { TodoItem } from "../contracts/todo.js";
|
|
11
|
+
export interface InitializeParams {
|
|
12
|
+
protocolVersion: string;
|
|
13
|
+
host?: {
|
|
14
|
+
name: string;
|
|
15
|
+
version: string;
|
|
16
|
+
};
|
|
17
|
+
/** Legacy flat form. */
|
|
18
|
+
hostName?: string;
|
|
19
|
+
hostVersion?: string;
|
|
20
|
+
capabilities?: {
|
|
21
|
+
streaming?: boolean;
|
|
22
|
+
toolApproval?: boolean;
|
|
23
|
+
threads?: boolean;
|
|
24
|
+
};
|
|
25
|
+
config?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
export interface InitializeResult {
|
|
28
|
+
protocolVersion: string;
|
|
29
|
+
agent: {
|
|
30
|
+
name: string;
|
|
31
|
+
version: string;
|
|
32
|
+
};
|
|
33
|
+
capabilities: {
|
|
34
|
+
tools: string[];
|
|
35
|
+
streaming: boolean;
|
|
36
|
+
threads: boolean;
|
|
37
|
+
/** New: list of notification methods the agent can emit. */
|
|
38
|
+
notifications: string[];
|
|
39
|
+
/** New: list of RPC methods the agent supports. */
|
|
40
|
+
methods: string[];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface ThreadCreateParams {
|
|
44
|
+
id?: string;
|
|
45
|
+
title?: string;
|
|
46
|
+
cwd?: string;
|
|
47
|
+
config?: Record<string, unknown>;
|
|
48
|
+
}
|
|
49
|
+
export interface ThreadCreateResult {
|
|
50
|
+
id: string;
|
|
51
|
+
title?: string;
|
|
52
|
+
status: "active";
|
|
53
|
+
createdAt: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ThreadListParams {
|
|
56
|
+
limit?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface ThreadListResult {
|
|
59
|
+
threads: Array<{
|
|
60
|
+
id: string;
|
|
61
|
+
title?: string;
|
|
62
|
+
status: "active" | "archived";
|
|
63
|
+
turnCount?: number;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
lastActiveAt: string;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
export interface ThreadTurnParams {
|
|
69
|
+
turnId?: string;
|
|
70
|
+
sessionId: string;
|
|
71
|
+
messages?: ChatMessage[];
|
|
72
|
+
tools?: ToolDefinition[];
|
|
73
|
+
config?: Record<string, unknown>;
|
|
74
|
+
}
|
|
75
|
+
export interface ThreadTurnResult {
|
|
76
|
+
accepted: boolean;
|
|
77
|
+
turnId: string;
|
|
78
|
+
}
|
|
79
|
+
export interface SessionResumeParams {
|
|
80
|
+
sessionId: string;
|
|
81
|
+
}
|
|
82
|
+
export interface SessionResumeResult {
|
|
83
|
+
metadata: {
|
|
84
|
+
sessionId: string;
|
|
85
|
+
createdAt: number;
|
|
86
|
+
lastActiveAt: number;
|
|
87
|
+
model?: string;
|
|
88
|
+
cwd?: string;
|
|
89
|
+
turnCount: number;
|
|
90
|
+
messageCount: number;
|
|
91
|
+
title?: string;
|
|
92
|
+
};
|
|
93
|
+
messages: ChatMessage[];
|
|
94
|
+
costSnapshot?: Record<string, unknown>;
|
|
95
|
+
}
|
|
96
|
+
export interface SessionGetInfoParams {
|
|
97
|
+
sessionId?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface SessionGetInfoResult {
|
|
100
|
+
sessionId: string;
|
|
101
|
+
/** Persistent storage paths for this session. */
|
|
102
|
+
paths: {
|
|
103
|
+
/** Session directory (~/.qlogicagent/sessions/<id>/). */
|
|
104
|
+
sessionDir: string;
|
|
105
|
+
/** Transcript file path. */
|
|
106
|
+
transcript: string;
|
|
107
|
+
/** Session state file path. */
|
|
108
|
+
state: string;
|
|
109
|
+
/** Agent home root (~/.qlogicagent/). */
|
|
110
|
+
agentHome: string;
|
|
111
|
+
/** User settings path. */
|
|
112
|
+
settings: string;
|
|
113
|
+
/** Current working directory. */
|
|
114
|
+
cwd: string;
|
|
115
|
+
};
|
|
116
|
+
model?: string;
|
|
117
|
+
provider?: string;
|
|
118
|
+
turnCount: number;
|
|
119
|
+
title?: string;
|
|
120
|
+
/** Cumulative token usage for the session. */
|
|
121
|
+
usage?: {
|
|
122
|
+
totalPromptTokens: number;
|
|
123
|
+
totalCompletionTokens: number;
|
|
124
|
+
totalCost?: number;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export interface MemoryListParams {
|
|
128
|
+
/** Filter by source: "local" (md files), "store" (in-memory), "qmemory" (remote). */
|
|
129
|
+
source?: "local" | "store" | "qmemory" | "all";
|
|
130
|
+
}
|
|
131
|
+
export interface MemoryListResult {
|
|
132
|
+
entries: Array<{
|
|
133
|
+
source: "local" | "store" | "qmemory";
|
|
134
|
+
target?: string;
|
|
135
|
+
path?: string;
|
|
136
|
+
entryCount: number;
|
|
137
|
+
charCount: number;
|
|
138
|
+
lastModified?: string;
|
|
139
|
+
}>;
|
|
140
|
+
}
|
|
141
|
+
export interface MemoryReadParams {
|
|
142
|
+
/** Source to read from. */
|
|
143
|
+
source: "local" | "store" | "qmemory";
|
|
144
|
+
/** Target within source (e.g. "memory", "user"). */
|
|
145
|
+
target?: string;
|
|
146
|
+
/** For local source, file path relative to agent home. */
|
|
147
|
+
path?: string;
|
|
148
|
+
}
|
|
149
|
+
export interface MemoryReadResult {
|
|
150
|
+
content: string;
|
|
151
|
+
source: string;
|
|
152
|
+
target?: string;
|
|
153
|
+
entryCount: number;
|
|
154
|
+
}
|
|
155
|
+
export interface MemoryWriteParams {
|
|
156
|
+
source: "local" | "store";
|
|
157
|
+
target?: string;
|
|
158
|
+
content: string;
|
|
159
|
+
/** Write mode: "append" adds to existing, "replace" overwrites. */
|
|
160
|
+
mode?: "append" | "replace";
|
|
161
|
+
}
|
|
162
|
+
export interface MemoryWriteResult {
|
|
163
|
+
ok: boolean;
|
|
164
|
+
entryCount: number;
|
|
165
|
+
message: string;
|
|
166
|
+
}
|
|
167
|
+
export interface MemoryDreamParams {
|
|
168
|
+
turnId?: string;
|
|
169
|
+
sessionId: string;
|
|
170
|
+
config?: Record<string, unknown>;
|
|
171
|
+
}
|
|
172
|
+
export interface MemoryDreamResult {
|
|
173
|
+
accepted: boolean;
|
|
174
|
+
turnId: string;
|
|
175
|
+
}
|
|
176
|
+
export interface ToolsListParams {
|
|
177
|
+
/** Filter by category. */
|
|
178
|
+
category?: "builtin" | "mcp" | "plugin" | "all";
|
|
179
|
+
/** Include full parameter schemas (default false — names only). */
|
|
180
|
+
includeSchema?: boolean;
|
|
181
|
+
}
|
|
182
|
+
export interface ToolsListResult {
|
|
183
|
+
tools: Array<{
|
|
184
|
+
name: string;
|
|
185
|
+
description: string;
|
|
186
|
+
category: "builtin" | "mcp" | "plugin";
|
|
187
|
+
/** Whether this tool requires approval. */
|
|
188
|
+
requiresApproval?: boolean;
|
|
189
|
+
/** Parameter schema (if includeSchema=true). */
|
|
190
|
+
parameters?: Record<string, unknown>;
|
|
191
|
+
}>;
|
|
192
|
+
}
|
|
193
|
+
export interface ConfigGetParams {
|
|
194
|
+
keys?: string[];
|
|
195
|
+
}
|
|
196
|
+
export interface ConfigGetResult {
|
|
197
|
+
config: Record<string, unknown>;
|
|
198
|
+
}
|
|
199
|
+
export interface ConfigUpdateParams {
|
|
200
|
+
settings: Record<string, unknown>;
|
|
201
|
+
}
|
|
202
|
+
export interface ConfigUpdateResult {
|
|
203
|
+
ok: boolean;
|
|
204
|
+
applied: string[];
|
|
205
|
+
rejected?: Array<{
|
|
206
|
+
key: string;
|
|
207
|
+
reason: string;
|
|
208
|
+
}>;
|
|
209
|
+
}
|
|
210
|
+
export interface TodosListParams {
|
|
211
|
+
/** Filter by status. */
|
|
212
|
+
status?: "not-started" | "in-progress" | "completed" | "all";
|
|
213
|
+
}
|
|
214
|
+
export interface TodosListResult {
|
|
215
|
+
items: TodoItem[];
|
|
216
|
+
summary: {
|
|
217
|
+
total: number;
|
|
218
|
+
completed: number;
|
|
219
|
+
inProgress: number;
|
|
220
|
+
notStarted: number;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
export interface AgentPingResult {
|
|
224
|
+
status: "ok";
|
|
225
|
+
}
|
|
226
|
+
export interface AgentAbortParams {
|
|
227
|
+
turnId?: string;
|
|
228
|
+
}
|
|
229
|
+
export interface AgentAbortResult {
|
|
230
|
+
aborted: boolean;
|
|
231
|
+
}
|
|
232
|
+
export interface ToolApprovalResponseParams {
|
|
233
|
+
approvalId: string;
|
|
234
|
+
decision: "allow-once" | "allow-session" | "allow-always" | "deny";
|
|
235
|
+
updatedInput?: Record<string, unknown>;
|
|
236
|
+
permissionUpdate?: {
|
|
237
|
+
pattern: string;
|
|
238
|
+
behavior: string;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
export interface MemorySearchParams {
|
|
242
|
+
query: string;
|
|
243
|
+
/** Max results (default 10). */
|
|
244
|
+
limit?: number;
|
|
245
|
+
/** Filter by userId (defaults to current session user). */
|
|
246
|
+
userId?: string;
|
|
247
|
+
}
|
|
248
|
+
export interface MemorySearchResult {
|
|
249
|
+
results: Array<{
|
|
250
|
+
id: string;
|
|
251
|
+
text: string;
|
|
252
|
+
score: number;
|
|
253
|
+
source: string;
|
|
254
|
+
metadata?: Record<string, unknown>;
|
|
255
|
+
}>;
|
|
256
|
+
}
|
|
257
|
+
export interface MemoryDeleteParams {
|
|
258
|
+
/** Source: "local" only (QMemory delete via adapter). */
|
|
259
|
+
source: "local" | "qmemory";
|
|
260
|
+
/** For local: target ("memory" | "user"). */
|
|
261
|
+
target?: string;
|
|
262
|
+
/** For local: substring to match and remove. For qmemory: memory block ID. */
|
|
263
|
+
match: string;
|
|
264
|
+
}
|
|
265
|
+
export interface MemoryDeleteResult {
|
|
266
|
+
ok: boolean;
|
|
267
|
+
removedCount: number;
|
|
268
|
+
message: string;
|
|
269
|
+
}
|
|
270
|
+
export interface TasksListParams {
|
|
271
|
+
/** Filter by lifecycle state. */
|
|
272
|
+
lifecycle?: "running" | "completed" | "failed" | "cancelled" | "all";
|
|
273
|
+
}
|
|
274
|
+
export interface TasksListResult {
|
|
275
|
+
tasks: Array<{
|
|
276
|
+
taskId: string;
|
|
277
|
+
type: string;
|
|
278
|
+
lifecycle: string;
|
|
279
|
+
label?: string;
|
|
280
|
+
}>;
|
|
281
|
+
}
|
|
282
|
+
export interface TasksCancelParams {
|
|
283
|
+
taskId: string;
|
|
284
|
+
}
|
|
285
|
+
export interface TasksCancelResult {
|
|
286
|
+
ok: boolean;
|
|
287
|
+
message: string;
|
|
288
|
+
}
|
|
289
|
+
export interface RpcMethodMap {
|
|
290
|
+
"initialize": {
|
|
291
|
+
params: InitializeParams;
|
|
292
|
+
result: InitializeResult;
|
|
293
|
+
};
|
|
294
|
+
"thread.create": {
|
|
295
|
+
params: ThreadCreateParams;
|
|
296
|
+
result: ThreadCreateResult;
|
|
297
|
+
};
|
|
298
|
+
"thread.list": {
|
|
299
|
+
params: ThreadListParams;
|
|
300
|
+
result: ThreadListResult;
|
|
301
|
+
};
|
|
302
|
+
"thread.turn": {
|
|
303
|
+
params: ThreadTurnParams;
|
|
304
|
+
result: ThreadTurnResult;
|
|
305
|
+
};
|
|
306
|
+
"session.resume": {
|
|
307
|
+
params: SessionResumeParams;
|
|
308
|
+
result: SessionResumeResult;
|
|
309
|
+
};
|
|
310
|
+
"session.getInfo": {
|
|
311
|
+
params: SessionGetInfoParams;
|
|
312
|
+
result: SessionGetInfoResult;
|
|
313
|
+
};
|
|
314
|
+
"memory.list": {
|
|
315
|
+
params: MemoryListParams;
|
|
316
|
+
result: MemoryListResult;
|
|
317
|
+
};
|
|
318
|
+
"memory.read": {
|
|
319
|
+
params: MemoryReadParams;
|
|
320
|
+
result: MemoryReadResult;
|
|
321
|
+
};
|
|
322
|
+
"memory.write": {
|
|
323
|
+
params: MemoryWriteParams;
|
|
324
|
+
result: MemoryWriteResult;
|
|
325
|
+
};
|
|
326
|
+
"memory.search": {
|
|
327
|
+
params: MemorySearchParams;
|
|
328
|
+
result: MemorySearchResult;
|
|
329
|
+
};
|
|
330
|
+
"memory.delete": {
|
|
331
|
+
params: MemoryDeleteParams;
|
|
332
|
+
result: MemoryDeleteResult;
|
|
333
|
+
};
|
|
334
|
+
"memory.dream": {
|
|
335
|
+
params: MemoryDreamParams;
|
|
336
|
+
result: MemoryDreamResult;
|
|
337
|
+
};
|
|
338
|
+
"tools.list": {
|
|
339
|
+
params: ToolsListParams;
|
|
340
|
+
result: ToolsListResult;
|
|
341
|
+
};
|
|
342
|
+
"config.get": {
|
|
343
|
+
params: ConfigGetParams;
|
|
344
|
+
result: ConfigGetResult;
|
|
345
|
+
};
|
|
346
|
+
"config.update": {
|
|
347
|
+
params: ConfigUpdateParams;
|
|
348
|
+
result: ConfigUpdateResult;
|
|
349
|
+
};
|
|
350
|
+
"todos.list": {
|
|
351
|
+
params: TodosListParams;
|
|
352
|
+
result: TodosListResult;
|
|
353
|
+
};
|
|
354
|
+
"tasks.list": {
|
|
355
|
+
params: TasksListParams;
|
|
356
|
+
result: TasksListResult;
|
|
357
|
+
};
|
|
358
|
+
"tasks.cancel": {
|
|
359
|
+
params: TasksCancelParams;
|
|
360
|
+
result: TasksCancelResult;
|
|
361
|
+
};
|
|
362
|
+
"agent.ping": {
|
|
363
|
+
params: undefined;
|
|
364
|
+
result: AgentPingResult;
|
|
365
|
+
};
|
|
366
|
+
"agent.abort": {
|
|
367
|
+
params: AgentAbortParams;
|
|
368
|
+
result: AgentAbortResult;
|
|
369
|
+
};
|
|
370
|
+
"tool.approval.response": {
|
|
371
|
+
params: ToolApprovalResponseParams;
|
|
372
|
+
result: {
|
|
373
|
+
received: boolean;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
/** All known RPC method names. */
|
|
378
|
+
export type RpcMethod = keyof RpcMethodMap;
|
|
379
|
+
/** All RPC method names as a runtime array (for capabilities declaration). */
|
|
380
|
+
export declare const ALL_RPC_METHODS: RpcMethod[];
|