glm-acp-agent 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/README.md +365 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/credentials.d.ts +15 -0
- package/dist/llm/credentials.d.ts.map +1 -0
- package/dist/llm/credentials.js +54 -0
- package/dist/llm/credentials.js.map +1 -0
- package/dist/llm/glm-client.d.ts +63 -0
- package/dist/llm/glm-client.d.ts.map +1 -0
- package/dist/llm/glm-client.js +217 -0
- package/dist/llm/glm-client.js.map +1 -0
- package/dist/llm/logger.d.ts +19 -0
- package/dist/llm/logger.d.ts.map +1 -0
- package/dist/llm/logger.js +44 -0
- package/dist/llm/logger.js.map +1 -0
- package/dist/protocol/agent.d.ts +77 -0
- package/dist/protocol/agent.d.ts.map +1 -0
- package/dist/protocol/agent.js +732 -0
- package/dist/protocol/agent.js.map +1 -0
- package/dist/protocol/connection.d.ts +9 -0
- package/dist/protocol/connection.d.ts.map +1 -0
- package/dist/protocol/connection.js +18 -0
- package/dist/protocol/connection.js.map +1 -0
- package/dist/protocol/image-preprocessor.d.ts +32 -0
- package/dist/protocol/image-preprocessor.d.ts.map +1 -0
- package/dist/protocol/image-preprocessor.js +149 -0
- package/dist/protocol/image-preprocessor.js.map +1 -0
- package/dist/protocol/session-store.d.ts +54 -0
- package/dist/protocol/session-store.d.ts.map +1 -0
- package/dist/protocol/session-store.js +109 -0
- package/dist/protocol/session-store.js.map +1 -0
- package/dist/protocol/system-prompt.d.ts +29 -0
- package/dist/protocol/system-prompt.d.ts.map +1 -0
- package/dist/protocol/system-prompt.js +103 -0
- package/dist/protocol/system-prompt.js.map +1 -0
- package/dist/setup.d.ts +8 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +95 -0
- package/dist/setup.js.map +1 -0
- package/dist/tests/agent.test.d.ts +2 -0
- package/dist/tests/agent.test.d.ts.map +1 -0
- package/dist/tests/agent.test.js +1118 -0
- package/dist/tests/agent.test.js.map +1 -0
- package/dist/tests/credentials.test.d.ts +2 -0
- package/dist/tests/credentials.test.d.ts.map +1 -0
- package/dist/tests/credentials.test.js +112 -0
- package/dist/tests/credentials.test.js.map +1 -0
- package/dist/tests/executor.test.d.ts +2 -0
- package/dist/tests/executor.test.d.ts.map +1 -0
- package/dist/tests/executor.test.js +497 -0
- package/dist/tests/executor.test.js.map +1 -0
- package/dist/tests/glm-client.test.d.ts +2 -0
- package/dist/tests/glm-client.test.d.ts.map +1 -0
- package/dist/tests/glm-client.test.js +205 -0
- package/dist/tests/glm-client.test.js.map +1 -0
- package/dist/tests/image-preprocessor.test.d.ts +2 -0
- package/dist/tests/image-preprocessor.test.d.ts.map +1 -0
- package/dist/tests/image-preprocessor.test.js +133 -0
- package/dist/tests/image-preprocessor.test.js.map +1 -0
- package/dist/tests/integration.test.d.ts +2 -0
- package/dist/tests/integration.test.d.ts.map +1 -0
- package/dist/tests/integration.test.js +192 -0
- package/dist/tests/integration.test.js.map +1 -0
- package/dist/tests/logger.test.d.ts +2 -0
- package/dist/tests/logger.test.d.ts.map +1 -0
- package/dist/tests/logger.test.js +14 -0
- package/dist/tests/logger.test.js.map +1 -0
- package/dist/tests/mcp-arg-remap.test.d.ts +2 -0
- package/dist/tests/mcp-arg-remap.test.d.ts.map +1 -0
- package/dist/tests/mcp-arg-remap.test.js +65 -0
- package/dist/tests/mcp-arg-remap.test.js.map +1 -0
- package/dist/tests/vision-mcp-client.test.d.ts +2 -0
- package/dist/tests/vision-mcp-client.test.d.ts.map +1 -0
- package/dist/tests/vision-mcp-client.test.js +129 -0
- package/dist/tests/vision-mcp-client.test.js.map +1 -0
- package/dist/tests/zai-mcp-client.test.d.ts +2 -0
- package/dist/tests/zai-mcp-client.test.d.ts.map +1 -0
- package/dist/tests/zai-mcp-client.test.js +386 -0
- package/dist/tests/zai-mcp-client.test.js.map +1 -0
- package/dist/tools/definitions.d.ts +18 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +149 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/executor.d.ts +48 -0
- package/dist/tools/executor.d.ts.map +1 -0
- package/dist/tools/executor.js +670 -0
- package/dist/tools/executor.js.map +1 -0
- package/dist/tools/mcp-arg-remap.d.ts +21 -0
- package/dist/tools/mcp-arg-remap.d.ts.map +1 -0
- package/dist/tools/mcp-arg-remap.js +70 -0
- package/dist/tools/mcp-arg-remap.js.map +1 -0
- package/dist/tools/vision-mcp-client.d.ts +38 -0
- package/dist/tools/vision-mcp-client.d.ts.map +1 -0
- package/dist/tools/vision-mcp-client.js +191 -0
- package/dist/tools/vision-mcp-client.js.map +1 -0
- package/dist/tools/zai-mcp-client.d.ts +24 -0
- package/dist/tools/zai-mcp-client.d.ts.map +1 -0
- package/dist/tools/zai-mcp-client.js +189 -0
- package/dist/tools/zai-mcp-client.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import OpenAI from "openai";
|
|
2
|
+
import { TOOL_DEFINITIONS } from "../tools/definitions.js";
|
|
3
|
+
import { resolveApiKey } from "./credentials.js";
|
|
4
|
+
import { debug, error } from "./logger.js";
|
|
5
|
+
/** Default base URL for the Z.AI / Zhipu OpenAI-compatible API (Coding endpoint). */
|
|
6
|
+
const DEFAULT_BASE_URL = "https://api.z.ai/api/coding/paas/v4";
|
|
7
|
+
/** Default GLM model when neither client nor user has chosen one. */
|
|
8
|
+
export const DEFAULT_MODEL = "glm-5.1";
|
|
9
|
+
/**
|
|
10
|
+
* Curated list of GLM models the agent advertises to ACP clients via
|
|
11
|
+
* `SessionModelState.availableModels`. Users can override this list via the
|
|
12
|
+
* `ACP_GLM_AVAILABLE_MODELS` environment variable (comma-separated model ids).
|
|
13
|
+
*
|
|
14
|
+
* The descriptions are intentionally short — clients render them in compact
|
|
15
|
+
* model pickers.
|
|
16
|
+
*/
|
|
17
|
+
const BUILTIN_AVAILABLE_MODELS = [
|
|
18
|
+
{
|
|
19
|
+
modelId: "glm-5.1",
|
|
20
|
+
name: "GLM-5.1",
|
|
21
|
+
description: "Latest GLM reasoning model with thinking mode",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
modelId: "glm-5-turbo",
|
|
25
|
+
name: "GLM-5 Turbo",
|
|
26
|
+
description: "Faster Coding Plan reasoning model",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
modelId: "glm-4.7",
|
|
30
|
+
name: "GLM-4.7",
|
|
31
|
+
description: "200K-context reasoning model",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
modelId: "glm-4.5-air",
|
|
35
|
+
name: "GLM-4.5 Air",
|
|
36
|
+
description: "Lightweight, lower-latency model",
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
/**
|
|
40
|
+
* Resolve the list of advertised models, allowing the user to override the
|
|
41
|
+
* built-in list via `ACP_GLM_AVAILABLE_MODELS`.
|
|
42
|
+
*/
|
|
43
|
+
export function getAvailableModels() {
|
|
44
|
+
const override = process.env["ACP_GLM_AVAILABLE_MODELS"];
|
|
45
|
+
if (!override)
|
|
46
|
+
return BUILTIN_AVAILABLE_MODELS;
|
|
47
|
+
const ids = override
|
|
48
|
+
.split(",")
|
|
49
|
+
.map((s) => s.trim())
|
|
50
|
+
.filter((s) => s.length > 0);
|
|
51
|
+
if (ids.length === 0)
|
|
52
|
+
return BUILTIN_AVAILABLE_MODELS;
|
|
53
|
+
return ids.map((id) => {
|
|
54
|
+
const builtin = BUILTIN_AVAILABLE_MODELS.find((m) => m.modelId === id);
|
|
55
|
+
return builtin ?? { modelId: id, name: id };
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** Default model for new sessions: env override → built-in default. */
|
|
59
|
+
export function getDefaultModel() {
|
|
60
|
+
return process.env["ACP_GLM_MODEL"] ?? DEFAULT_MODEL;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Wrapper around the OpenAI-compatible Zhipu AI (Z.AI) API.
|
|
64
|
+
*
|
|
65
|
+
* Uses the standard `openai` npm package pointed at `https://api.z.ai/api/paas/v4`
|
|
66
|
+
* so no Zhipu-specific SDK is required. The Z.AI service speaks the OpenAI
|
|
67
|
+
* Chat Completions wire format, plus a few GLM-specific extras (like the
|
|
68
|
+
* `thinking` field and `delta.reasoning_content` for reasoning tokens).
|
|
69
|
+
*/
|
|
70
|
+
export class GlmClient {
|
|
71
|
+
client;
|
|
72
|
+
maxTokens;
|
|
73
|
+
constructor() {
|
|
74
|
+
const apiKey = resolveApiKey();
|
|
75
|
+
if (!apiKey) {
|
|
76
|
+
throw new Error("No API key found. Set the Z_AI_API_KEY environment variable, or run `glm-acp-agent --setup` to store one.");
|
|
77
|
+
}
|
|
78
|
+
const baseURL = process.env["ACP_GLM_BASE_URL"] ?? DEFAULT_BASE_URL;
|
|
79
|
+
this.maxTokens = parseIntEnv("ACP_GLM_MAX_TOKENS", 8192);
|
|
80
|
+
this.client = new OpenAI({ apiKey, baseURL });
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Stream a chat completion from the GLM model, yielding chunks as they arrive.
|
|
84
|
+
*
|
|
85
|
+
* Reasoning/thinking tokens (from GLM "thinking" mode) are mapped to
|
|
86
|
+
* `thinking` chunks so the ACP agent can forward them as `agent_thought_chunk`
|
|
87
|
+
* blocks.
|
|
88
|
+
*/
|
|
89
|
+
async *streamChat(messages, signal, options) {
|
|
90
|
+
const model = options?.model ?? getDefaultModel();
|
|
91
|
+
const thinkingEnabled = parseThinking(model);
|
|
92
|
+
const tools = TOOL_DEFINITIONS.map((t) => ({
|
|
93
|
+
type: "function",
|
|
94
|
+
function: {
|
|
95
|
+
name: t.function.name,
|
|
96
|
+
description: t.function.description,
|
|
97
|
+
parameters: t.function.parameters,
|
|
98
|
+
},
|
|
99
|
+
}));
|
|
100
|
+
debug(`streamChat: model=${model} baseURL=${this.client.baseURL} messages=${messages.length} tools=${tools.length} thinking=${thinkingEnabled}`);
|
|
101
|
+
// The OpenAI SDK forwards unknown extra body fields verbatim, so we use
|
|
102
|
+
// that to pass GLM-specific fields like `thinking`.
|
|
103
|
+
const extraBody = {};
|
|
104
|
+
if (thinkingEnabled) {
|
|
105
|
+
extraBody["thinking"] = { type: "enabled" };
|
|
106
|
+
}
|
|
107
|
+
let stream;
|
|
108
|
+
try {
|
|
109
|
+
stream = await this.client.chat.completions.create({
|
|
110
|
+
model,
|
|
111
|
+
messages,
|
|
112
|
+
tools,
|
|
113
|
+
tool_choice: "auto",
|
|
114
|
+
stream: true,
|
|
115
|
+
// Always ask the API to include final usage in the streaming response.
|
|
116
|
+
stream_options: { include_usage: true },
|
|
117
|
+
max_tokens: this.maxTokens,
|
|
118
|
+
...extraBody,
|
|
119
|
+
}, { signal });
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
const status = err?.status;
|
|
123
|
+
const body = err?.error;
|
|
124
|
+
error(`streamChat request failed: status=${status}`, JSON.stringify(body) ?? String(err));
|
|
125
|
+
throw err;
|
|
126
|
+
}
|
|
127
|
+
// Tool call deltas arrive interleaved across chunks; assemble by index.
|
|
128
|
+
const pendingToolCalls = new Map();
|
|
129
|
+
let lastFinishReason;
|
|
130
|
+
for await (const chunk of stream) {
|
|
131
|
+
const choice = chunk.choices[0];
|
|
132
|
+
if (choice) {
|
|
133
|
+
const delta = choice.delta;
|
|
134
|
+
// Reasoning / thinking tokens (GLM "thinking" mode).
|
|
135
|
+
const reasoning = delta["reasoning_content"];
|
|
136
|
+
if (typeof reasoning === "string" && reasoning.length > 0) {
|
|
137
|
+
yield { thinking: reasoning };
|
|
138
|
+
}
|
|
139
|
+
// Regular assistant text.
|
|
140
|
+
const content = delta["content"];
|
|
141
|
+
if (typeof content === "string" && content.length > 0) {
|
|
142
|
+
yield { text: content };
|
|
143
|
+
}
|
|
144
|
+
// Tool call deltas.
|
|
145
|
+
const toolCallDeltas = delta["tool_calls"];
|
|
146
|
+
if (Array.isArray(toolCallDeltas)) {
|
|
147
|
+
for (const tc of toolCallDeltas) {
|
|
148
|
+
let pending = pendingToolCalls.get(tc.index);
|
|
149
|
+
if (!pending) {
|
|
150
|
+
pending = { id: "", name: "", arguments: "" };
|
|
151
|
+
pendingToolCalls.set(tc.index, pending);
|
|
152
|
+
}
|
|
153
|
+
if (tc.id)
|
|
154
|
+
pending.id = tc.id;
|
|
155
|
+
if (tc.function?.name)
|
|
156
|
+
pending.name = tc.function.name;
|
|
157
|
+
if (tc.function?.arguments)
|
|
158
|
+
pending.arguments += tc.function.arguments;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (choice.finish_reason) {
|
|
162
|
+
lastFinishReason = choice.finish_reason;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// The final chunk on most providers (GLM included when
|
|
166
|
+
// include_usage: true) ships only a `usage` object with no choices.
|
|
167
|
+
const rawUsage = chunk.usage;
|
|
168
|
+
if (rawUsage) {
|
|
169
|
+
const usage = {
|
|
170
|
+
inputTokens: rawUsage.prompt_tokens ?? 0,
|
|
171
|
+
outputTokens: rawUsage.completion_tokens ?? 0,
|
|
172
|
+
totalTokens: rawUsage.total_tokens ?? 0,
|
|
173
|
+
};
|
|
174
|
+
if (typeof rawUsage.prompt_tokens_details?.cached_tokens === "number") {
|
|
175
|
+
usage.cachedReadTokens = rawUsage.prompt_tokens_details.cached_tokens;
|
|
176
|
+
}
|
|
177
|
+
if (typeof rawUsage.completion_tokens_details?.reasoning_tokens === "number") {
|
|
178
|
+
usage.thoughtTokens = rawUsage.completion_tokens_details.reasoning_tokens;
|
|
179
|
+
}
|
|
180
|
+
debug(`streamChat usage: input=${usage.inputTokens} output=${usage.outputTokens} total=${usage.totalTokens}`);
|
|
181
|
+
yield { usage };
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// Flush any assembled tool calls and emit a final done chunk. Only emit
|
|
185
|
+
// calls that have both an id and a name – partial entries can be left
|
|
186
|
+
// behind by upstream errors and would just confuse the agent loop.
|
|
187
|
+
for (const [, tc] of pendingToolCalls) {
|
|
188
|
+
if (tc.id && tc.name)
|
|
189
|
+
yield { toolCall: tc };
|
|
190
|
+
}
|
|
191
|
+
pendingToolCalls.clear();
|
|
192
|
+
yield { done: true, stopReason: lastFinishReason };
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/** Parse an integer environment variable, falling back to a default. */
|
|
196
|
+
function parseIntEnv(name, fallback) {
|
|
197
|
+
const raw = process.env[name];
|
|
198
|
+
if (!raw)
|
|
199
|
+
return fallback;
|
|
200
|
+
const n = Number.parseInt(raw, 10);
|
|
201
|
+
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Decide whether to enable GLM "thinking" mode for a given model name.
|
|
205
|
+
*
|
|
206
|
+
* The user can force on/off via `ACP_GLM_THINKING=true|false`. Otherwise,
|
|
207
|
+
* we enable thinking for any model whose name suggests it supports it
|
|
208
|
+
* (the GLM-4.5 / GLM-4.6 / GLM-4.7 / GLM-5.x families).
|
|
209
|
+
*/
|
|
210
|
+
function parseThinking(model) {
|
|
211
|
+
const override = process.env["ACP_GLM_THINKING"];
|
|
212
|
+
if (override !== undefined) {
|
|
213
|
+
return override.toLowerCase() === "true" || override === "1";
|
|
214
|
+
}
|
|
215
|
+
return /^glm-(?:4\.[567]|5)/i.test(model);
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=glm-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glm-client.js","sourceRoot":"","sources":["../../src/llm/glm-client.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,KAAK,EAA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D,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAEzB,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;IACrD,CAAC;CACF;AAED,wEAAwE;AACxE,SAAS,WAAW,CAAC,IAAY,EAAE,QAAgB;IACjD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,GAAG;QAAE,OAAO,QAAQ,CAAC;IAC1B,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACpD,CAAC;AAED;;;;;;GAMG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACjD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC,WAAW,EAAE,KAAK,MAAM,IAAI,QAAQ,KAAK,GAAG,CAAC;IAC/D,CAAC;IACD,OAAO,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logging for the GLM ACP agent.
|
|
3
|
+
*
|
|
4
|
+
* Set `ACP_GLM_DEBUG=true` to enable verbose logging to stderr.
|
|
5
|
+
* `warn()` and `error()` always write to stderr regardless of the debug flag.
|
|
6
|
+
*/
|
|
7
|
+
/** Log a debug message. Only writes when `ACP_GLM_DEBUG=true`. */
|
|
8
|
+
export declare function debug(...args: unknown[]): void;
|
|
9
|
+
/** Log a warning. Always written to stderr. */
|
|
10
|
+
export declare function warn(...args: unknown[]): void;
|
|
11
|
+
/** Log an error. Always written to stderr. */
|
|
12
|
+
export declare function error(...args: unknown[]): void;
|
|
13
|
+
/** Mask all but the last 4 characters of a string (e.g. API key). */
|
|
14
|
+
export declare function maskSecret(s: string): string;
|
|
15
|
+
/** Returns true when debug logging is active (`ACP_GLM_DEBUG=true`). */
|
|
16
|
+
export declare function isDebugEnabled(): boolean;
|
|
17
|
+
/** Reset the DEBUG_ENABLED flag (used in tests). */
|
|
18
|
+
export declare function _resetDebugEnabled(): void;
|
|
19
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/llm/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,kEAAkE;AAClE,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAE9C;AAED,+CAA+C;AAC/C,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAE7C;AAED,8CAA8C;AAC9C,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAE9C;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED,wEAAwE;AACxE,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,oDAAoD;AACpD,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logging for the GLM ACP agent.
|
|
3
|
+
*
|
|
4
|
+
* Set `ACP_GLM_DEBUG=true` to enable verbose logging to stderr.
|
|
5
|
+
* `warn()` and `error()` always write to stderr regardless of the debug flag.
|
|
6
|
+
*/
|
|
7
|
+
const DEBUG_ENABLED = typeof process === "object" &&
|
|
8
|
+
typeof process.env === "object" &&
|
|
9
|
+
(process.env["ACP_GLM_DEBUG"] === "true" || process.env["ACP_GLM_DEBUG"] === "1");
|
|
10
|
+
function timestamp() {
|
|
11
|
+
return new Date().toISOString().slice(11, 23);
|
|
12
|
+
}
|
|
13
|
+
function write(level, ...args) {
|
|
14
|
+
const prefix = `[glm-acp-agent] ${timestamp()} [${level}]`;
|
|
15
|
+
process.stderr.write(`${prefix} ${args.join(" ")}\n`);
|
|
16
|
+
}
|
|
17
|
+
/** Log a debug message. Only writes when `ACP_GLM_DEBUG=true`. */
|
|
18
|
+
export function debug(...args) {
|
|
19
|
+
if (DEBUG_ENABLED)
|
|
20
|
+
write("DEBUG", ...args);
|
|
21
|
+
}
|
|
22
|
+
/** Log a warning. Always written to stderr. */
|
|
23
|
+
export function warn(...args) {
|
|
24
|
+
write("WARN", ...args);
|
|
25
|
+
}
|
|
26
|
+
/** Log an error. Always written to stderr. */
|
|
27
|
+
export function error(...args) {
|
|
28
|
+
write("ERROR", ...args);
|
|
29
|
+
}
|
|
30
|
+
/** Mask all but the last 4 characters of a string (e.g. API key). */
|
|
31
|
+
export function maskSecret(s) {
|
|
32
|
+
if (s.length <= 4)
|
|
33
|
+
return "****";
|
|
34
|
+
return "****" + s.slice(-4);
|
|
35
|
+
}
|
|
36
|
+
/** Returns true when debug logging is active (`ACP_GLM_DEBUG=true`). */
|
|
37
|
+
export function isDebugEnabled() {
|
|
38
|
+
return DEBUG_ENABLED;
|
|
39
|
+
}
|
|
40
|
+
/** Reset the DEBUG_ENABLED flag (used in tests). */
|
|
41
|
+
export function _resetDebugEnabled() {
|
|
42
|
+
// no-op in production; tests monkey-patch this module's internals.
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/llm/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,aAAa,GACjB,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;IAC/B,CAAC,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+1,77 @@
|
|
|
1
|
+
import type { Agent, AgentSideConnection, InitializeRequest, InitializeResponse, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse, CancelNotification, AuthenticateRequest, AuthenticateResponse, SetSessionModeRequest, SetSessionModeResponse, CloseSessionRequest, ListSessionsRequest, ListSessionsResponse, LoadSessionRequest, LoadSessionResponse, ForkSessionRequest, ForkSessionResponse, ResumeSessionRequest, ResumeSessionResponse, SetSessionModelRequest, SetSessionModelResponse } from "@agentclientprotocol/sdk";
|
|
2
|
+
import { type GlmMessage, type GlmStreamChunk, type StreamChatOptions } from "../llm/glm-client.js";
|
|
3
|
+
import { SessionStore } from "./session-store.js";
|
|
4
|
+
import { type VisionMcpClient } from "../tools/vision-mcp-client.js";
|
|
5
|
+
/**
|
|
6
|
+
* Optional dependencies for tests.
|
|
7
|
+
*/
|
|
8
|
+
export interface GlmAcpAgentOptions {
|
|
9
|
+
/** Override the GLM client (used in tests). */
|
|
10
|
+
glm?: {
|
|
11
|
+
streamChat: (messages: GlmMessage[], signal?: AbortSignal, options?: StreamChatOptions) => AsyncIterable<GlmStreamChunk>;
|
|
12
|
+
};
|
|
13
|
+
/** Maximum number of model/tool turns per single prompt. Default 20. */
|
|
14
|
+
maxTurns?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Override the session store (used in tests). When undefined the agent
|
|
17
|
+
* uses an on-disk store rooted at `$ACP_GLM_SESSION_DIR` /
|
|
18
|
+
* `$XDG_STATE_HOME/glm-acp-agent/sessions` / `~/.local/state/glm-acp-agent/sessions`.
|
|
19
|
+
* Pass `null` to disable persistence entirely.
|
|
20
|
+
*/
|
|
21
|
+
sessionStore?: SessionStore | null;
|
|
22
|
+
/**
|
|
23
|
+
* Vision MCP client used to analyze ACP image blocks via @z_ai/mcp-server.
|
|
24
|
+
* Pass `null` to disable vision entirely (image blocks degrade to a text
|
|
25
|
+
* placeholder). When undefined the agent lazy-creates a StdioVisionMcpClient
|
|
26
|
+
* on first use.
|
|
27
|
+
*/
|
|
28
|
+
visionClient?: VisionMcpClient | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* GlmAcpAgent implements the ACP `Agent` interface.
|
|
32
|
+
*
|
|
33
|
+
* It bridges the ACP protocol (via `AgentSideConnection`) and the Zhipu AI
|
|
34
|
+
* GLM series models (via `GlmClient`), providing a full prompt loop with
|
|
35
|
+
* tool-calling and streaming support.
|
|
36
|
+
*/
|
|
37
|
+
export declare class GlmAcpAgent implements Agent {
|
|
38
|
+
private connection;
|
|
39
|
+
private sessions;
|
|
40
|
+
private _glm;
|
|
41
|
+
private maxTurns;
|
|
42
|
+
private clientCapabilities;
|
|
43
|
+
private sessionStore;
|
|
44
|
+
private _visionClient;
|
|
45
|
+
private visionClientExplicit;
|
|
46
|
+
constructor(connection: AgentSideConnection, options?: GlmAcpAgentOptions);
|
|
47
|
+
private get glm();
|
|
48
|
+
private get visionClient();
|
|
49
|
+
initialize(params: InitializeRequest): Promise<InitializeResponse>;
|
|
50
|
+
authenticate(_params: AuthenticateRequest): Promise<AuthenticateResponse>;
|
|
51
|
+
newSession(params: NewSessionRequest): Promise<NewSessionResponse>;
|
|
52
|
+
unstable_setSessionModel(params: SetSessionModelRequest): Promise<SetSessionModelResponse>;
|
|
53
|
+
/** Build the SessionModelState we advertise on session create/load/resume/fork. */
|
|
54
|
+
private modelsState;
|
|
55
|
+
setSessionMode(_params: SetSessionModeRequest): Promise<SetSessionModeResponse>;
|
|
56
|
+
prompt(params: PromptRequest): Promise<PromptResponse>;
|
|
57
|
+
cancel(params: CancelNotification): Promise<void>;
|
|
58
|
+
closeSession(params: CloseSessionRequest): Promise<void>;
|
|
59
|
+
listSessions(params: ListSessionsRequest): Promise<ListSessionsResponse>;
|
|
60
|
+
loadSession(params: LoadSessionRequest): Promise<LoadSessionResponse>;
|
|
61
|
+
unstable_forkSession(params: ForkSessionRequest): Promise<ForkSessionResponse>;
|
|
62
|
+
resumeSession(params: ResumeSessionRequest): Promise<ResumeSessionResponse>;
|
|
63
|
+
private snapshot;
|
|
64
|
+
private persistSession;
|
|
65
|
+
private requirePersisted;
|
|
66
|
+
private replayMessages;
|
|
67
|
+
/**
|
|
68
|
+
* Runs the full prompt/tool-calling loop until the model stops or is cancelled.
|
|
69
|
+
*
|
|
70
|
+
* Returns the ACP stop reason and optional token usage reported by the model.
|
|
71
|
+
*/
|
|
72
|
+
private runPromptLoop;
|
|
73
|
+
private mapStopReason;
|
|
74
|
+
/** Names of tools we expose given the client's capabilities. */
|
|
75
|
+
private availableToolNames;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/protocol/agent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,KAAK,EACL,mBAAmB,EAEnB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EAIxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,YAAY,EAAyB,MAAM,oBAAoB,CAAC;AAGzE,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAiC3F;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,GAAG,CAAC,EAAE;QACJ,UAAU,EAAE,CACV,QAAQ,EAAE,UAAU,EAAE,EACtB,MAAM,CAAC,EAAE,WA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