qlogicagent 0.2.1 → 0.4.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 +45 -45
- package/package.json +56 -42
- package/dist/agent/agent.d.ts +0 -43
- package/dist/agent/agent.js +0 -113
- package/dist/agent/tool-loop.d.ts +0 -64
- package/dist/agent/tool-loop.js +0 -575
- package/dist/agent/types.d.ts +0 -175
- package/dist/agent/types.js +0 -14
- package/dist/cli/main.d.ts +0 -11
- package/dist/cli/main.js +0 -23
- package/dist/cli/stdio-server.d.ts +0 -45
- package/dist/cli/stdio-server.js +0 -463
- package/dist/config/config.d.ts +0 -17
- package/dist/config/config.js +0 -21
- package/dist/contracts/hooks.d.ts +0 -120
- package/dist/contracts/hooks.js +0 -7
- package/dist/contracts/index.d.ts +0 -10
- package/dist/contracts/index.js +0 -10
- package/dist/contracts/planner.d.ts +0 -35
- package/dist/contracts/planner.js +0 -2
- package/dist/contracts/skill-candidate.d.ts +0 -63
- package/dist/contracts/skill-candidate.js +0 -195
- package/dist/contracts/todo.d.ts +0 -14
- package/dist/contracts/todo.js +0 -9
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -15
- package/dist/llm/builtin-providers.d.ts +0 -10
- package/dist/llm/builtin-providers.js +0 -531
- package/dist/llm/index.d.ts +0 -15
- package/dist/llm/index.js +0 -14
- package/dist/llm/llm-client.d.ts +0 -43
- package/dist/llm/llm-client.js +0 -67
- package/dist/llm/model-catalog.d.ts +0 -53
- package/dist/llm/model-catalog.js +0 -191
- package/dist/llm/provider-def.d.ts +0 -59
- package/dist/llm/provider-def.js +0 -12
- package/dist/llm/provider-registry.d.ts +0 -54
- package/dist/llm/provider-registry.js +0 -147
- package/dist/llm/transport.d.ts +0 -62
- package/dist/llm/transport.js +0 -27
- package/dist/llm/transports/anthropic-messages.d.ts +0 -31
- package/dist/llm/transports/anthropic-messages.js +0 -293
- package/dist/llm/transports/openai-chat.d.ts +0 -36
- package/dist/llm/transports/openai-chat.js +0 -165
- package/dist/orchestration/agent-registry.d.ts +0 -41
- package/dist/orchestration/agent-registry.js +0 -116
- package/dist/orchestration/approval-aware-tool-plan.d.ts +0 -32
- package/dist/orchestration/approval-aware-tool-plan.js +0 -87
- package/dist/orchestration/context-compression.d.ts +0 -220
- package/dist/orchestration/context-compression.js +0 -583
- package/dist/orchestration/conversation-repair.d.ts +0 -61
- package/dist/orchestration/conversation-repair.js +0 -429
- package/dist/orchestration/curator-scheduler.d.ts +0 -119
- package/dist/orchestration/curator-scheduler.js +0 -135
- package/dist/orchestration/embedded-failover-policy.d.ts +0 -110
- package/dist/orchestration/embedded-failover-policy.js +0 -168
- package/dist/orchestration/error-classification.d.ts +0 -12
- package/dist/orchestration/error-classification.js +0 -77
- package/dist/orchestration/failover-classification.d.ts +0 -8
- package/dist/orchestration/failover-classification.js +0 -381
- package/dist/orchestration/failover-error.d.ts +0 -33
- package/dist/orchestration/failover-error.js +0 -198
- package/dist/orchestration/fork-subagent.d.ts +0 -100
- package/dist/orchestration/fork-subagent.js +0 -98
- package/dist/orchestration/index.d.ts +0 -120
- package/dist/orchestration/index.js +0 -267
- package/dist/orchestration/memory-flush-policy.d.ts +0 -57
- package/dist/orchestration/memory-flush-policy.js +0 -85
- package/dist/orchestration/memory-provider.d.ts +0 -14
- package/dist/orchestration/memory-provider.js +0 -2
- package/dist/orchestration/parallel-tool-calls.d.ts +0 -41
- package/dist/orchestration/parallel-tool-calls.js +0 -59
- package/dist/orchestration/prompt-cache-strategy.d.ts +0 -126
- package/dist/orchestration/prompt-cache-strategy.js +0 -228
- package/dist/orchestration/reactive-compact.d.ts +0 -73
- package/dist/orchestration/reactive-compact.js +0 -78
- package/dist/orchestration/retry-loop.d.ts +0 -22
- package/dist/orchestration/retry-loop.js +0 -24
- package/dist/orchestration/skill-candidate.d.ts +0 -52
- package/dist/orchestration/skill-candidate.js +0 -141
- package/dist/orchestration/skill-consolidation.d.ts +0 -123
- package/dist/orchestration/skill-consolidation.js +0 -220
- package/dist/orchestration/skill-improvement.d.ts +0 -59
- package/dist/orchestration/skill-improvement.js +0 -66
- package/dist/orchestration/skill-similarity.d.ts +0 -98
- package/dist/orchestration/skill-similarity.js +0 -131
- package/dist/orchestration/streaming-tool-executor.d.ts +0 -73
- package/dist/orchestration/streaming-tool-executor.js +0 -96
- package/dist/orchestration/team-orchestration.d.ts +0 -195
- package/dist/orchestration/team-orchestration.js +0 -369
- package/dist/orchestration/team-tool-loop-wiring.d.ts +0 -92
- package/dist/orchestration/team-tool-loop-wiring.js +0 -147
- package/dist/orchestration/tool-choice-policy.d.ts +0 -54
- package/dist/orchestration/tool-choice-policy.js +0 -164
- package/dist/orchestration/tool-loop-state.d.ts +0 -50
- package/dist/orchestration/tool-loop-state.js +0 -133
- package/dist/orchestration/tool-schema.d.ts +0 -39
- package/dist/orchestration/tool-schema.js +0 -297
- package/dist/orchestration/transcript-repair.d.ts +0 -42
- package/dist/orchestration/transcript-repair.js +0 -426
- package/dist/orchestration/turn-loop-guard.d.ts +0 -86
- package/dist/orchestration/turn-loop-guard.js +0 -92
- package/dist/orchestration/web-browser-policy.d.ts +0 -17
- package/dist/orchestration/web-browser-policy.js +0 -39
- package/dist/runtime/context-compression.d.ts +0 -61
- package/dist/runtime/context-compression.js +0 -274
- package/dist/runtime/hook-registry.d.ts +0 -12
- package/dist/runtime/hook-registry.js +0 -53
- package/dist/runtime/memory-hooks.d.ts +0 -23
- package/dist/runtime/memory-hooks.js +0 -65
- package/dist/runtime/tool-eligibility.d.ts +0 -59
- package/dist/runtime/tool-eligibility.js +0 -111
- package/dist/skills/index.d.ts +0 -108
- package/dist/skills/index.js +0 -82
- package/dist/skills/memory-extractor.d.ts +0 -64
- package/dist/skills/memory-extractor.js +0 -173
- package/dist/skills/memory-query-tool.d.ts +0 -43
- package/dist/skills/memory-query-tool.js +0 -127
- package/dist/skills/memory-store.d.ts +0 -66
- package/dist/skills/memory-store.js +0 -228
- package/dist/skills/memory-tool.d.ts +0 -67
- package/dist/skills/memory-tool.js +0 -192
- package/dist/skills/portable-tool.d.ts +0 -71
- package/dist/skills/portable-tool.js +0 -14
- package/dist/skills/qmemory-adapter.d.ts +0 -52
- package/dist/skills/qmemory-adapter.js +0 -165
- package/dist/skills/skill-frontmatter.d.ts +0 -19
- package/dist/skills/skill-frontmatter.js +0 -344
- package/dist/skills/skill-guard.d.ts +0 -23
- package/dist/skills/skill-guard.js +0 -229
- package/dist/skills/skill-loader.d.ts +0 -16
- package/dist/skills/skill-loader.js +0 -303
- package/dist/skills/skill-source.d.ts +0 -119
- package/dist/skills/skill-source.js +0 -126
- package/dist/skills/skill-types.d.ts +0 -199
- package/dist/skills/skill-types.js +0 -6
- package/dist/skills/think-tool.d.ts +0 -16
- package/dist/skills/think-tool.js +0 -59
- package/dist/skills/todo-tool.d.ts +0 -63
- package/dist/skills/todo-tool.js +0 -114
- package/dist/skills/tools/agent-tool.d.ts +0 -91
- package/dist/skills/tools/agent-tool.js +0 -142
- package/dist/skills/tools/apply-patch-tool.d.ts +0 -29
- package/dist/skills/tools/apply-patch-tool.js +0 -184
- package/dist/skills/tools/ask-user-tool.d.ts +0 -80
- package/dist/skills/tools/ask-user-tool.js +0 -121
- package/dist/skills/tools/brief-tool.d.ts +0 -74
- package/dist/skills/tools/brief-tool.js +0 -95
- package/dist/skills/tools/browser-tool.d.ts +0 -114
- package/dist/skills/tools/browser-tool.js +0 -155
- package/dist/skills/tools/checkpoint-tool.d.ts +0 -66
- package/dist/skills/tools/checkpoint-tool.js +0 -102
- package/dist/skills/tools/config-tool.d.ts +0 -63
- package/dist/skills/tools/config-tool.js +0 -143
- package/dist/skills/tools/cron-tool.d.ts +0 -116
- package/dist/skills/tools/cron-tool.js +0 -175
- package/dist/skills/tools/edit-tool.d.ts +0 -43
- package/dist/skills/tools/edit-tool.js +0 -70
- package/dist/skills/tools/exec-tool.d.ts +0 -102
- package/dist/skills/tools/exec-tool.js +0 -133
- package/dist/skills/tools/image-generate-tool.d.ts +0 -62
- package/dist/skills/tools/image-generate-tool.js +0 -67
- package/dist/skills/tools/instructions-tool.d.ts +0 -103
- package/dist/skills/tools/instructions-tool.js +0 -187
- package/dist/skills/tools/lsp-tool.d.ts +0 -153
- package/dist/skills/tools/lsp-tool.js +0 -227
- package/dist/skills/tools/mcp-client-types.d.ts +0 -269
- package/dist/skills/tools/mcp-client-types.js +0 -53
- package/dist/skills/tools/mcp-tool.d.ts +0 -249
- package/dist/skills/tools/mcp-tool.js +0 -503
- package/dist/skills/tools/memory-tool.d.ts +0 -74
- package/dist/skills/tools/memory-tool.js +0 -88
- package/dist/skills/tools/monitor-tool.d.ts +0 -113
- package/dist/skills/tools/monitor-tool.js +0 -131
- package/dist/skills/tools/music-generate-tool.d.ts +0 -55
- package/dist/skills/tools/music-generate-tool.js +0 -62
- package/dist/skills/tools/notify-tool.d.ts +0 -53
- package/dist/skills/tools/notify-tool.js +0 -62
- package/dist/skills/tools/patch-tool.d.ts +0 -45
- package/dist/skills/tools/patch-tool.js +0 -505
- package/dist/skills/tools/pdf-tool.d.ts +0 -66
- package/dist/skills/tools/pdf-tool.js +0 -88
- package/dist/skills/tools/plan-mode-tool.d.ts +0 -59
- package/dist/skills/tools/plan-mode-tool.js +0 -122
- package/dist/skills/tools/read-tool.d.ts +0 -51
- package/dist/skills/tools/read-tool.js +0 -84
- package/dist/skills/tools/repl-tool.d.ts +0 -70
- package/dist/skills/tools/repl-tool.js +0 -69
- package/dist/skills/tools/search-tool.d.ts +0 -112
- package/dist/skills/tools/search-tool.js +0 -225
- package/dist/skills/tools/send-message-tool.d.ts +0 -51
- package/dist/skills/tools/send-message-tool.js +0 -76
- package/dist/skills/tools/skill-list-tool.d.ts +0 -33
- package/dist/skills/tools/skill-list-tool.js +0 -54
- package/dist/skills/tools/skill-manage-tool.d.ts +0 -73
- package/dist/skills/tools/skill-manage-tool.js +0 -153
- package/dist/skills/tools/skill-view-tool.d.ts +0 -37
- package/dist/skills/tools/skill-view-tool.js +0 -72
- package/dist/skills/tools/sleep-tool.d.ts +0 -49
- package/dist/skills/tools/sleep-tool.js +0 -81
- package/dist/skills/tools/structured-output-tool.d.ts +0 -116
- package/dist/skills/tools/structured-output-tool.js +0 -176
- package/dist/skills/tools/task-tool.d.ts +0 -104
- package/dist/skills/tools/task-tool.js +0 -161
- package/dist/skills/tools/team-tool.d.ts +0 -89
- package/dist/skills/tools/team-tool.js +0 -105
- package/dist/skills/tools/tool-search-tool.d.ts +0 -51
- package/dist/skills/tools/tool-search-tool.js +0 -110
- package/dist/skills/tools/tts-tool.d.ts +0 -38
- package/dist/skills/tools/tts-tool.js +0 -45
- package/dist/skills/tools/video-edit-tool.d.ts +0 -69
- package/dist/skills/tools/video-edit-tool.js +0 -74
- package/dist/skills/tools/video-generate-tool.d.ts +0 -62
- package/dist/skills/tools/video-generate-tool.js +0 -66
- package/dist/skills/tools/video-merge-tool.d.ts +0 -105
- package/dist/skills/tools/video-merge-tool.js +0 -92
- package/dist/skills/tools/video-upscale-tool.d.ts +0 -45
- package/dist/skills/tools/video-upscale-tool.js +0 -52
- package/dist/skills/tools/web-fetch-tool.d.ts +0 -78
- package/dist/skills/tools/web-fetch-tool.js +0 -92
- package/dist/skills/tools/web-search-tool.d.ts +0 -57
- package/dist/skills/tools/web-search-tool.js +0 -86
- package/dist/skills/tools/worktree-tool.d.ts +0 -69
- package/dist/skills/tools/worktree-tool.js +0 -147
- package/dist/skills/tools/write-tool.d.ts +0 -45
- package/dist/skills/tools/write-tool.js +0 -81
package/dist/agent/types.d.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure agent types — zero I/O framework dependencies.
|
|
3
|
-
*
|
|
4
|
-
* These types define the contract between:
|
|
5
|
-
* - CLI stdio layer ↔ Agent class
|
|
6
|
-
* - Agent class ↔ LLM Provider
|
|
7
|
-
* - Agent class ↔ Tool loop
|
|
8
|
-
*
|
|
9
|
-
* Ported from Hub semantic-turn-shared.ts / semantic-turn-tools.ts,
|
|
10
|
-
* with Hub infrastructure (WS/PG/Redis) replaced by DI interfaces.
|
|
11
|
-
*
|
|
12
|
-
* No imports from express/pg/ioredis/ws.
|
|
13
|
-
*/
|
|
14
|
-
import type { SkillInstruction } from "../orchestration/index.js";
|
|
15
|
-
import type { HookRegistry } from "../contracts/hooks.js";
|
|
16
|
-
export type ChatMessageRole = "system" | "user" | "assistant" | "tool";
|
|
17
|
-
export interface ChatMessage {
|
|
18
|
-
role: ChatMessageRole;
|
|
19
|
-
content: string | null;
|
|
20
|
-
/** For assistant messages with tool calls */
|
|
21
|
-
tool_calls?: ToolCallMessage[];
|
|
22
|
-
/** For tool result messages */
|
|
23
|
-
tool_call_id?: string;
|
|
24
|
-
/** For tool result messages — tool name */
|
|
25
|
-
name?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface ToolCallMessage {
|
|
28
|
-
id: string;
|
|
29
|
-
type: "function";
|
|
30
|
-
function: {
|
|
31
|
-
name: string;
|
|
32
|
-
arguments: string;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export interface ToolDefinition {
|
|
36
|
-
type: "function";
|
|
37
|
-
function: {
|
|
38
|
-
name: string;
|
|
39
|
-
description: string;
|
|
40
|
-
parameters?: Record<string, unknown>;
|
|
41
|
-
};
|
|
42
|
-
/** Tool scheduling metadata from host manifest (optional) */
|
|
43
|
-
meta?: {
|
|
44
|
-
serialOnly?: boolean;
|
|
45
|
-
parallelSafe?: boolean;
|
|
46
|
-
/** If true, host should request user approval before execution (CC PreToolUse parity) */
|
|
47
|
-
requiresApproval?: boolean;
|
|
48
|
-
/** Tool is read-only / safe — skip approval even in strict mode */
|
|
49
|
-
isReadOnly?: boolean;
|
|
50
|
-
/** Tool can cause irreversible side-effects — force approval in default mode */
|
|
51
|
-
isDangerous?: boolean;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export interface TokenUsage {
|
|
55
|
-
prompt: number;
|
|
56
|
-
completion: number;
|
|
57
|
-
/** Reasoning tokens (for models like o1/DeepSeek-R1) */
|
|
58
|
-
reasoning?: number;
|
|
59
|
-
}
|
|
60
|
-
export interface TurnRequest {
|
|
61
|
-
turnId: string;
|
|
62
|
-
sessionId: string;
|
|
63
|
-
messages: ChatMessage[];
|
|
64
|
-
tools: ToolDefinition[];
|
|
65
|
-
systemPrompt?: string;
|
|
66
|
-
config?: TurnConfig;
|
|
67
|
-
}
|
|
68
|
-
export interface TurnConfig {
|
|
69
|
-
/** LLM provider id, e.g. "deepseek" */
|
|
70
|
-
provider?: string;
|
|
71
|
-
/** Model id, e.g. "deepseek-chat" */
|
|
72
|
-
model?: string;
|
|
73
|
-
/** User API key */
|
|
74
|
-
apiKey?: string;
|
|
75
|
-
/** Optional base URL override */
|
|
76
|
-
baseUrl?: string;
|
|
77
|
-
/** Max tool-call rounds per turn (default 25, max 100) */
|
|
78
|
-
maxRounds?: number;
|
|
79
|
-
/** Temperature override */
|
|
80
|
-
temperature?: number;
|
|
81
|
-
/** Context window size in tokens (for turn-loop-guard budget checks) */
|
|
82
|
-
contextWindowTokens?: number;
|
|
83
|
-
/** Max output tokens for current model */
|
|
84
|
-
maxOutputTokens?: number;
|
|
85
|
-
/** Model's absolute max output tokens (for escalation ceiling) */
|
|
86
|
-
modelMaxOutputTokens?: number;
|
|
87
|
-
/** Tool choice strategy: "auto" (default), "none", "required" */
|
|
88
|
-
toolChoice?: "auto" | "none" | "required";
|
|
89
|
-
/** Parent sidechain depth (0 = top-level, default 0) */
|
|
90
|
-
parentDepth?: number;
|
|
91
|
-
}
|
|
92
|
-
export type TurnEvent = {
|
|
93
|
-
type: "start";
|
|
94
|
-
turnId: string;
|
|
95
|
-
} | {
|
|
96
|
-
type: "delta";
|
|
97
|
-
turnId: string;
|
|
98
|
-
text: string;
|
|
99
|
-
} | {
|
|
100
|
-
type: "tool_call";
|
|
101
|
-
turnId: string;
|
|
102
|
-
callId: string;
|
|
103
|
-
name: string;
|
|
104
|
-
arguments: string;
|
|
105
|
-
} | {
|
|
106
|
-
type: "end";
|
|
107
|
-
turnId: string;
|
|
108
|
-
content: string;
|
|
109
|
-
usage?: TokenUsage;
|
|
110
|
-
model?: string;
|
|
111
|
-
provider?: string;
|
|
112
|
-
} | {
|
|
113
|
-
type: "error";
|
|
114
|
-
turnId: string;
|
|
115
|
-
error: string;
|
|
116
|
-
code?: string;
|
|
117
|
-
} | {
|
|
118
|
-
type: "skill_instruction";
|
|
119
|
-
turnId: string;
|
|
120
|
-
instruction: SkillInstruction;
|
|
121
|
-
} | {
|
|
122
|
-
type: "tool_result";
|
|
123
|
-
turnId: string;
|
|
124
|
-
callId: string;
|
|
125
|
-
name: string;
|
|
126
|
-
ok: boolean;
|
|
127
|
-
error?: string;
|
|
128
|
-
} | {
|
|
129
|
-
type: "sidechain_started";
|
|
130
|
-
turnId: string;
|
|
131
|
-
depth: number;
|
|
132
|
-
role: "orchestrator" | "leaf";
|
|
133
|
-
} | {
|
|
134
|
-
type: "sidechain_completed";
|
|
135
|
-
turnId: string;
|
|
136
|
-
depth: number;
|
|
137
|
-
toolCallCount: number;
|
|
138
|
-
} | {
|
|
139
|
-
type: "tool_blocked";
|
|
140
|
-
turnId: string;
|
|
141
|
-
callId: string;
|
|
142
|
-
name: string;
|
|
143
|
-
reason: string;
|
|
144
|
-
} | {
|
|
145
|
-
type: "recovery";
|
|
146
|
-
turnId: string;
|
|
147
|
-
action: string;
|
|
148
|
-
detail?: string;
|
|
149
|
-
} | {
|
|
150
|
-
type: "plan_update";
|
|
151
|
-
turnId: string;
|
|
152
|
-
slug: string;
|
|
153
|
-
content: string;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* ToolInvoker: request tool execution from the host process (Gateway).
|
|
157
|
-
* In CLI mode this sends a JSON-RPC notification over stdio and waits for result.
|
|
158
|
-
*/
|
|
159
|
-
export interface ToolInvoker {
|
|
160
|
-
invoke(turnId: string, name: string, args: string, signal?: AbortSignal): Promise<{
|
|
161
|
-
result: string;
|
|
162
|
-
error?: string;
|
|
163
|
-
}>;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* AgentLogger: structured logging interface.
|
|
167
|
-
* In CLI mode this writes to stderr; in Hub mode this uses pino.
|
|
168
|
-
*/
|
|
169
|
-
export interface AgentLogger {
|
|
170
|
-
info(message: string): void;
|
|
171
|
-
warn(message: string): void;
|
|
172
|
-
error(message: string): void;
|
|
173
|
-
debug(message: string): void;
|
|
174
|
-
}
|
|
175
|
-
export type { HookRegistry };
|
package/dist/agent/types.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure agent types — zero I/O framework dependencies.
|
|
3
|
-
*
|
|
4
|
-
* These types define the contract between:
|
|
5
|
-
* - CLI stdio layer ↔ Agent class
|
|
6
|
-
* - Agent class ↔ LLM Provider
|
|
7
|
-
* - Agent class ↔ Tool loop
|
|
8
|
-
*
|
|
9
|
-
* Ported from Hub semantic-turn-shared.ts / semantic-turn-tools.ts,
|
|
10
|
-
* with Hub infrastructure (WS/PG/Redis) replaced by DI interfaces.
|
|
11
|
-
*
|
|
12
|
-
* No imports from express/pg/ioredis/ws.
|
|
13
|
-
*/
|
|
14
|
-
export {};
|
package/dist/cli/main.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* qlogicagent CLI — Agent subprocess entry point.
|
|
4
|
-
*
|
|
5
|
-
* Communicates with openclaw Gateway via JSON-RPC over stdio.
|
|
6
|
-
* All log/debug output goes to stderr (never pollutes the stdio protocol).
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* qlogicagent [--verbose]
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
package/dist/cli/main.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* qlogicagent CLI — Agent subprocess entry point.
|
|
4
|
-
*
|
|
5
|
-
* Communicates with openclaw Gateway via JSON-RPC over stdio.
|
|
6
|
-
* All log/debug output goes to stderr (never pollutes the stdio protocol).
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* qlogicagent [--verbose]
|
|
10
|
-
*/
|
|
11
|
-
import { StdioServer } from "./stdio-server.js";
|
|
12
|
-
import { parseCliArgs } from "../config/config.js";
|
|
13
|
-
const config = parseCliArgs(process.argv);
|
|
14
|
-
const server = new StdioServer({ verbose: config.verbose });
|
|
15
|
-
// Graceful shutdown
|
|
16
|
-
const shutdown = () => {
|
|
17
|
-
server.stop();
|
|
18
|
-
process.exit(0);
|
|
19
|
-
};
|
|
20
|
-
process.on("SIGTERM", shutdown);
|
|
21
|
-
process.on("SIGINT", shutdown);
|
|
22
|
-
// Start the JSON-RPC stdio server
|
|
23
|
-
server.start();
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* StdioServer — JSON-RPC 2.0 over stdio protocol handler.
|
|
3
|
-
*
|
|
4
|
-
* Reads line-delimited JSON from stdin, dispatches to handlers,
|
|
5
|
-
* writes JSON-RPC responses/notifications to stdout.
|
|
6
|
-
* All log output goes to stderr.
|
|
7
|
-
*
|
|
8
|
-
* Protocol: each line on stdin/stdout is a single JSON-RPC 2.0 message.
|
|
9
|
-
*/
|
|
10
|
-
export interface StdioServerConfig {
|
|
11
|
-
verbose: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare class StdioServer {
|
|
14
|
-
private running;
|
|
15
|
-
private activeTurn;
|
|
16
|
-
private pendingToolResults;
|
|
17
|
-
private verbose;
|
|
18
|
-
private registry;
|
|
19
|
-
private agent;
|
|
20
|
-
private lastLlmConfigKey;
|
|
21
|
-
private currentSessionId;
|
|
22
|
-
private currentHooks;
|
|
23
|
-
constructor(config: StdioServerConfig);
|
|
24
|
-
start(): void;
|
|
25
|
-
stop(): void;
|
|
26
|
-
private handleMessage;
|
|
27
|
-
private handleHello;
|
|
28
|
-
private handlePing;
|
|
29
|
-
private handleAbort;
|
|
30
|
-
private handleToolResult;
|
|
31
|
-
private handleTurn;
|
|
32
|
-
private resolveAgent;
|
|
33
|
-
/**
|
|
34
|
-
* Request tool execution from the Gateway host.
|
|
35
|
-
* Sends a turn.tool_call notification and waits for tool.result.
|
|
36
|
-
*/
|
|
37
|
-
requestToolExecution(turnId: string, name: string, args: string, signal?: AbortSignal): Promise<{
|
|
38
|
-
result: string;
|
|
39
|
-
error?: string;
|
|
40
|
-
}>;
|
|
41
|
-
private sendResponse;
|
|
42
|
-
private sendNotification;
|
|
43
|
-
private writeStdout;
|
|
44
|
-
private log;
|
|
45
|
-
}
|