glm-acp-agent 1.9.0 → 1.11.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 +16 -9
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/llm/credentials.d.ts.map +1 -1
- package/dist/llm/credentials.js +10 -2
- package/dist/llm/credentials.js.map +1 -1
- package/dist/protocol/agent.d.ts +3 -0
- package/dist/protocol/agent.d.ts.map +1 -1
- package/dist/protocol/agent.js +232 -91
- package/dist/protocol/agent.js.map +1 -1
- package/dist/protocol/image-preprocessor.d.ts +10 -1
- package/dist/protocol/image-preprocessor.d.ts.map +1 -1
- package/dist/protocol/image-preprocessor.js +123 -42
- package/dist/protocol/image-preprocessor.js.map +1 -1
- package/dist/protocol/session-store.d.ts.map +1 -1
- package/dist/protocol/session-store.js +241 -38
- package/dist/protocol/session-store.js.map +1 -1
- package/dist/protocol/system-prompt.d.ts.map +1 -1
- package/dist/protocol/system-prompt.js +2 -1
- package/dist/protocol/system-prompt.js.map +1 -1
- package/dist/tests/agent.test.js +188 -4
- package/dist/tests/agent.test.js.map +1 -1
- package/dist/tests/cli-args.test.js +4 -3
- package/dist/tests/cli-args.test.js.map +1 -1
- package/dist/tests/command-limits.test.d.ts +2 -0
- package/dist/tests/command-limits.test.d.ts.map +1 -0
- package/dist/tests/command-limits.test.js +229 -0
- package/dist/tests/command-limits.test.js.map +1 -0
- package/dist/tests/credentials.test.js +14 -2
- package/dist/tests/credentials.test.js.map +1 -1
- package/dist/tests/executor.test.js +465 -5
- package/dist/tests/executor.test.js.map +1 -1
- package/dist/tests/integration.test.js +98 -3
- package/dist/tests/integration.test.js.map +1 -1
- package/dist/tests/prompt-lifecycle.test.d.ts +2 -0
- package/dist/tests/prompt-lifecycle.test.d.ts.map +1 -0
- package/dist/tests/prompt-lifecycle.test.js +321 -0
- package/dist/tests/prompt-lifecycle.test.js.map +1 -0
- package/dist/tests/session-context.test.d.ts +2 -0
- package/dist/tests/session-context.test.d.ts.map +1 -0
- package/dist/tests/session-context.test.js +213 -0
- package/dist/tests/session-context.test.js.map +1 -0
- package/dist/tests/session-store.test.d.ts +2 -0
- package/dist/tests/session-store.test.d.ts.map +1 -0
- package/dist/tests/session-store.test.js +263 -0
- package/dist/tests/session-store.test.js.map +1 -0
- package/dist/tests/slash-commands.test.js +2 -0
- package/dist/tests/slash-commands.test.js.map +1 -1
- package/dist/tools/command-limits.d.ts +11 -0
- package/dist/tools/command-limits.d.ts.map +1 -0
- package/dist/tools/command-limits.js +26 -0
- package/dist/tools/command-limits.js.map +1 -0
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +45 -1
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/executor.d.ts +11 -2
- package/dist/tools/executor.d.ts.map +1 -1
- package/dist/tools/executor.js +454 -44
- package/dist/tools/executor.js.map +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -33,8 +33,8 @@ Built-in web tools use Coding Plan-compatible MCP endpoints, not the general `/a
|
|
|
33
33
|
- **Slash commands** – commands and skills found under the session's `.claude/` directory are advertised to the client with `available_commands_update`, so `/` autocomplete is populated (see [Slash commands](#slash-commands))
|
|
34
34
|
- **Image input via Coding Plan-native vision or Vision MCP** – `promptCapabilities.image` is advertised; `glm-5.3-flash` sends supported pasted ACP image blocks directly as native `image_url` content parts, while the other advertised coding models (including default `glm-5.3`) route them through Z.AI Vision MCP (`@z_ai/mcp-server`). `glm-5v-turbo` keeps the same native-vision path when re-added via `ACP_GLM_AVAILABLE_MODELS` — it is no longer on the Coding Plan allowlist. Direct chat-image-only models (e.g. `glm-4v-plus`) are intentionally not used.
|
|
35
35
|
- **Session persistence** – conversations are written to `~/.local/state/glm-acp-agent/sessions/` and can be reloaded via `session/load`, branched via `session/fork`, or resumed without replay via `session/resume`
|
|
36
|
-
- **
|
|
37
|
-
- **Self-sufficient local tools** –
|
|
36
|
+
- **Nine built-in tools** (see below)
|
|
37
|
+
- **Self-sufficient local tools** – directory listings and shell commands always run in the agent process; file tools fall back to local filesystem access when ACP client `fs` capabilities are unavailable
|
|
38
38
|
- **Configurable permissions** – `write_file` and `run_command` behavior depends on the active session mode (prompts by default)
|
|
39
39
|
- **Protocol-correct stop reasons** – maps model and runtime conditions to ACP `end_turn`, `max_tokens`, `max_turn_requests`, `refusal`, and `cancelled`
|
|
40
40
|
- **Protocol-correct tool statuses** – `pending` → `in_progress` → `completed` / `failed`
|
|
@@ -53,16 +53,19 @@ ACP Client (IDE plugin, CLI, …)
|
|
|
53
53
|
├─ GlmClient ← Z.AI / Zhipu AI Coding Plan Chat Completions (src/llm/)
|
|
54
54
|
│
|
|
55
55
|
├─ ToolExecutor ← executes tool calls (src/tools/)
|
|
56
|
-
│ ├─ read_file / list_files → Agent process (Node fs)
|
|
56
|
+
│ ├─ read_file / list_files → ACP client fs for read_file when read/write are advertised, else Agent process (Node fs); read_file paginated (offset/limit)
|
|
57
57
|
│ ├─ write_file / edit_file → ACP client fs when advertised (editor-buffer diffs), else Agent process (Node fs)
|
|
58
58
|
│ ├─ list_files / run_command → Agent process (Node fs / child_process)
|
|
59
59
|
│ ├─ web_search / web_reader → Z.AI Coding Plan Web MCP (HTTP)
|
|
60
|
-
│
|
|
60
|
+
│ ├─ image_analysis → Z.AI Coding Plan Vision MCP (stdio)
|
|
61
|
+
│ └─ todowrite → Agent process (per-session task list; replaces chat narration)
|
|
61
62
|
│
|
|
62
63
|
└─ VisionMcpClient ← spawns `npx @z_ai/mcp-server` on demand
|
|
63
64
|
```
|
|
64
65
|
|
|
65
|
-
The agent process needs network access to `api.z.ai` for chat completions and Web MCP, plus `npx` available on `PATH` so it can launch `@z_ai/mcp-server` for vision. Filesystem and shell operations
|
|
66
|
+
The agent process needs network access to `api.z.ai` for chat completions and Web MCP, plus `npx` available on `PATH` so it can launch `@z_ai/mcp-server` for vision. Filesystem and shell operations use paths resolved against the ACP session working directory. When the client advertises `fs.writeTextFile`, writes and edits are routed through the ACP client so they render as native diffs. When it advertises both `fs.readTextFile` and `fs.writeTextFile`, `read_file` and edit-file reads also use the editor buffer; otherwise those reads fall back to the agent process filesystem. Writes and arbitrary shell commands still go through ACP `session/request_permission`, and the permission payload is always the **full** tool arguments — the user approves exactly what will run.
|
|
67
|
+
|
|
68
|
+
Client-facing tool cards stay compact: long strings in `rawInput`/`rawOutput` (and in the `read_file` content preview) are elided to a short head plus a character count, while the model keeps receiving complete payloads through the tool-result channel. Progress narration lives in the `todowrite` task list rather than prose, and reasoning tokens are only forwarded as `agent_thought_chunk` when `ACP_GLM_STREAM_THINKING` is not `false` (the default preserves streaming).
|
|
66
69
|
|
|
67
70
|
---
|
|
68
71
|
|
|
@@ -70,11 +73,12 @@ The agent process needs network access to `api.z.ai` for chat completions and We
|
|
|
70
73
|
|
|
71
74
|
| Tool | Runs on | Permission behavior | Description |
|
|
72
75
|
|------|---------|---------------------|-------------|
|
|
73
|
-
| `read_file` |
|
|
76
|
+
| `read_file` | ACP client when both fs read/write capabilities are advertised, otherwise agent process | Always silent | Read a text file or editor buffer, paginated by offset/limit (default 2000 lines, capped at 5000); the result reports the shown range, advertises the next offset only while lines remain, and reports EOF past the last line |
|
|
74
77
|
| `write_file` | Agent process (ACP client `fs` when advertised) | Mode-dependent | Write or overwrite a text file. Silent in `accept_edits` and `bypass_permissions`. |
|
|
75
78
|
| `edit_file` | Agent process (ACP client `fs` when advertised) | Mode-dependent | Replace one exact, unique snippet in an existing file — a surgical edit instead of a full rewrite. Re-reads and re-validates after the permission prompt so concurrent edits are not overwritten. Silent in `accept_edits` and `bypass_permissions`. |
|
|
79
|
+
| `todowrite` | Agent process | Always silent | Create or replace the session's structured task list so multi-step progress is tracked instead of narrated in chat. Each call replaces the list; the tool result renders it back to the model. |
|
|
76
80
|
| `list_files` | Agent process | Always silent | List a directory using Node filesystem APIs |
|
|
77
|
-
| `run_command` | Agent process | Mode-dependent | Run an arbitrary shell command. Silent only in `bypass_permissions`. |
|
|
81
|
+
| `run_command` | Agent process | Mode-dependent | Run an arbitrary shell command; cancelling a turn terminates its shell process group, while intentionally backgrounded processes survive a normal shell exit. Silent only in `bypass_permissions`. |
|
|
78
82
|
| `web_search` | Agent (Z.AI Coding Plan MCP) | Always silent | Search the web — returns titles, URLs, and summaries |
|
|
79
83
|
| `web_reader` | Agent (Z.AI Coding Plan MCP) | Always silent | Fetch and parse a web page (markdown or plain text) |
|
|
80
84
|
| `image_analysis` | Agent (Z.AI Vision MCP, stdio) | Always silent | Analyze a local image path or remote URL using `@z_ai/mcp-server` |
|
|
@@ -125,7 +129,7 @@ as prose, so typing a slash by accident never fails the turn.
|
|
|
125
129
|
|
|
126
130
|
## Prerequisites
|
|
127
131
|
|
|
128
|
-
- **Node.js** 20 or
|
|
132
|
+
- **Node.js** 20.19.0+, 22.13.0+, or 24+ (native `fetch` and Web Streams required)
|
|
129
133
|
- **npm** 9 or later
|
|
130
134
|
- A **Z.AI API key** — obtain one at <https://z.ai/manage-apikey/apikey-list>
|
|
131
135
|
|
|
@@ -177,7 +181,10 @@ The agent reads its configuration from environment variables, plus an optional c
|
|
|
177
181
|
| `ACP_GLM_BASE_URL` | No | `https://api.z.ai/api/coding/paas/v4` | Override the API base URL |
|
|
178
182
|
| `ACP_GLM_MAX_TOKENS` | No | `32768` | Cap on `max_tokens` for each completion |
|
|
179
183
|
| `ACP_GLM_MAX_TURNS` | No | `100` | Max model/tool turns per prompt (also settable via `--max-turns`) |
|
|
184
|
+
| `ACP_GLM_COMMAND_TIMEOUT_MS` | No | `120000` | Deadline for each `run_command`, in milliseconds. Invalid values fall back to the default with a stderr warning. |
|
|
185
|
+
| `ACP_GLM_COMMAND_OUTPUT_LIMIT_BYTES` | No | `65536` | Maximum combined bytes captured from each `run_command` stdout and stderr. Further output is drained and reported as truncated. Invalid values fall back to the default with a stderr warning. |
|
|
180
186
|
| `ACP_GLM_THINKING` | No | auto-detected | Force thinking mode `true` / `false` |
|
|
187
|
+
| `ACP_GLM_STREAM_THINKING` | No | `true` | Forward reasoning tokens to the client as `agent_thought_chunk`; set `false` to keep reasoning off the wire (the model still thinks — only the client-side stream is silenced) |
|
|
181
188
|
| `ACP_GLM_SESSION_DIR` | No | `$XDG_STATE_HOME/glm-acp-agent/sessions` | Where session JSON files are persisted |
|
|
182
189
|
| `ACP_GLM_DEBUG` | No | — | Set to `true` or `1` to enable verbose debug logging to stderr (shows model selection, API key resolution, tool calls, and usage stats) |
|
|
183
190
|
| `XDG_CONFIG_HOME` | No | `~/.config` | Where the credentials file is read/written |
|
|
@@ -290,7 +297,7 @@ npm run dev # tsc --watch
|
|
|
290
297
|
#### 1. Prerequisites
|
|
291
298
|
|
|
292
299
|
- A recent build of [Zed](https://zed.dev/download) that supports the `agent_servers` setting
|
|
293
|
-
- Node.js 20 or
|
|
300
|
+
- Node.js 20.19.0+, 22.13.0+, or 24+ on your `PATH` (`node --version`)
|
|
294
301
|
- A Z.AI API key — create one at <https://z.ai/manage-apikey/apikey-list>
|
|
295
302
|
|
|
296
303
|
#### 2. Install the agent
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
* falls back to the credentials file written by --setup.
|
|
12
12
|
* ACP_GLM_MODEL - (optional) Override the default model (default: glm-5.3)
|
|
13
13
|
* ACP_GLM_MAX_TURNS - (optional) Max model/tool turns per prompt (default: 100)
|
|
14
|
+
* ACP_GLM_COMMAND_TIMEOUT_MS - (optional) run_command deadline in milliseconds (default: 120000)
|
|
15
|
+
* ACP_GLM_COMMAND_OUTPUT_LIMIT_BYTES - (optional) combined run_command stdout/stderr capture limit (default: 65536)
|
|
14
16
|
*/
|
|
15
17
|
import { startConnection } from "./protocol/connection.js";
|
|
16
18
|
import { parseMaxTurnsFlag } from "./cli-args.js";
|
|
@@ -39,10 +41,13 @@ else if (args.includes("--help") || args.includes("-h")) {
|
|
|
39
41
|
" Z_AI_API_KEY API key (overrides the stored credentials)",
|
|
40
42
|
" ACP_GLM_MODEL Default model id (e.g. glm-5.3)",
|
|
41
43
|
" ACP_GLM_MAX_TURNS Max model/tool turns per prompt (default 100)",
|
|
44
|
+
" ACP_GLM_COMMAND_TIMEOUT_MS run_command deadline in milliseconds (default 120000)",
|
|
45
|
+
" ACP_GLM_COMMAND_OUTPUT_LIMIT_BYTES Combined run_command stdout/stderr limit in bytes (default 65536)",
|
|
42
46
|
" ACP_GLM_AVAILABLE_MODELS Comma-separated list of advertised models",
|
|
43
47
|
" ACP_GLM_BASE_URL Override the Z.AI API base URL",
|
|
44
48
|
" ACP_GLM_MAX_TOKENS Per-call max output tokens (default 32768)",
|
|
45
49
|
" ACP_GLM_THINKING Force thinking mode (true / false)",
|
|
50
|
+
" ACP_GLM_STREAM_THINKING Forward reasoning to the client as thought chunks (default true)",
|
|
46
51
|
" ACP_GLM_SESSION_DIR Where to persist sessions (default: ~/.local/state/glm-acp-agent/sessions)",
|
|
47
52
|
" ACP_GLM_DEBUG Enable verbose stderr logging (true or 1)",
|
|
48
53
|
" XDG_CONFIG_HOME Where to read/write credentials.json (default: ~/.config)",
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;IAC7B,QAAQ,EAAE;SACP,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAA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,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,OAAO,IAAI,CAAC,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/llm/credentials.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/llm/credentials.ts"],"names":[],"mappings":"AAgCA,qEAAqE;AACrE,wBAAgB,eAAe,IAAI,MAAM,CAIxC;AAED,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAA0B,GAAG,MAAM,GAAG,SAAS,CASvF;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,SAAS,CAalD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,MAA0B,GAAG,IAAI,CAcvF"}
|
package/dist/llm/credentials.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { closeSync, constants, fchmodSync, ftruncateSync, mkdirSync, openSync, readFileSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join, dirname } from "node:path";
|
|
4
4
|
import { debug, maskSecret } from "./logger.js";
|
|
@@ -49,6 +49,14 @@ export function writeCredentials(apiKey, path = credentialsPath()) {
|
|
|
49
49
|
}
|
|
50
50
|
mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
|
|
51
51
|
const body = { z_ai_api_key: apiKey };
|
|
52
|
-
|
|
52
|
+
const fd = openSync(path, constants.O_WRONLY | constants.O_CREAT, 0o600);
|
|
53
|
+
try {
|
|
54
|
+
fchmodSync(fd, 0o600);
|
|
55
|
+
ftruncateSync(fd, 0);
|
|
56
|
+
writeFileSync(fd, JSON.stringify(body, null, 2) + "\n", "utf8");
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
closeSync(fd);
|
|
60
|
+
}
|
|
53
61
|
}
|
|
54
62
|
//# sourceMappingURL=credentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/llm/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/llm/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAoBhD,qEAAqE;AACrE,MAAM,UAAU,eAAe;IAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACtE,OAAO,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,kBAAkB,CAAC,OAAe,eAAe,EAAE;IACjE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,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AM,IAAI,GAAoB,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvD,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACzE,IAAI,CAAC;QACH,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACtB,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACrB,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;AACH,CAAC"}
|
package/dist/protocol/agent.d.ts
CHANGED
|
@@ -46,8 +46,11 @@ export declare const DEFAULT_MAX_TURNS = 100;
|
|
|
46
46
|
export declare class GlmAcpAgent implements Agent {
|
|
47
47
|
private connection;
|
|
48
48
|
private sessions;
|
|
49
|
+
private sessionTodos;
|
|
49
50
|
private _glm;
|
|
50
51
|
private maxTurns;
|
|
52
|
+
/** Forward GLM reasoning to the client as agent_thought_chunk. Default on; disable with ACP_GLM_STREAM_THINKING=false. */
|
|
53
|
+
private streamThinking;
|
|
51
54
|
private clientCapabilities;
|
|
52
55
|
private sessionStore;
|
|
53
56
|
private _visionClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/protocol/agent.ts"],"names":[],"mappings":"AAIA,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,kBAA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