@openacp/cli 0.4.10 → 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 +57 -4
- package/dist/agent-catalog-4IAJ7HEG.js +10 -0
- package/dist/agent-registry-B5YAMA4T.js +8 -0
- package/dist/agent-store-ZBXGOFPH.js +8 -0
- package/dist/api-client-UN7BXQOQ.js +11 -0
- package/dist/{autostart-DZ3MHHMM.js → autostart-K73RQZVV.js} +3 -3
- package/dist/chunk-5HGXUCMX.js +83 -0
- package/dist/chunk-5HGXUCMX.js.map +1 -0
- package/dist/{chunk-UAUTLC4E.js → chunk-D73LCTPF.js} +75 -37
- package/dist/chunk-D73LCTPF.js.map +1 -0
- package/dist/{chunk-LYKCQTH5.js → chunk-ESOPMQAY.js} +5 -1
- package/dist/chunk-ESOPMQAY.js.map +1 -0
- package/dist/{chunk-KPI4HGJC.js → chunk-FWN3UIRT.js} +1631 -970
- package/dist/chunk-FWN3UIRT.js.map +1 -0
- package/dist/chunk-IRGYTNLP.js +650 -0
- package/dist/chunk-IRGYTNLP.js.map +1 -0
- package/dist/{chunk-ZRFBLD3W.js → chunk-JRF4G4X7.js} +71 -25
- package/dist/chunk-JRF4G4X7.js.map +1 -0
- package/dist/{chunk-6MJLVZXV.js → chunk-LAFKARV3.js} +58 -21
- package/dist/{chunk-6MJLVZXV.js.map → chunk-LAFKARV3.js.map} +1 -1
- package/dist/chunk-NAMYZIS5.js +1 -0
- package/dist/{chunk-HZD3CGPK.js → chunk-NDR5JCS7.js} +3 -3
- package/dist/chunk-OORPX73T.js +30 -0
- package/dist/chunk-OORPX73T.js.map +1 -0
- package/dist/{chunk-V3BA2MJ6.js → chunk-RF3DUYFO.js} +2 -2
- package/dist/chunk-S3DRLJPM.js +422 -0
- package/dist/chunk-S3DRLJPM.js.map +1 -0
- package/dist/chunk-UG6X672R.js +90 -0
- package/dist/chunk-UG6X672R.js.map +1 -0
- package/dist/{chunk-C6YIUTGR.js → chunk-VBEWSWVL.js} +2 -2
- package/dist/{chunk-MRKYJ422.js → chunk-X6LLG7XN.js} +2 -2
- package/dist/chunk-XJJ7LPXP.js +85 -0
- package/dist/chunk-XJJ7LPXP.js.map +1 -0
- package/dist/chunk-Z46LGZ7R.js +110 -0
- package/dist/chunk-Z46LGZ7R.js.map +1 -0
- package/dist/cli.js +313 -52
- package/dist/cli.js.map +1 -1
- package/dist/{config-H2DSEHNW.js → config-PCPIBPUA.js} +3 -3
- package/dist/config-editor-5L7AJ5AF.js +12 -0
- package/dist/config-editor-5L7AJ5AF.js.map +1 -0
- package/dist/config-registry-SNKA2EH2.js +17 -0
- package/dist/config-registry-SNKA2EH2.js.map +1 -0
- package/dist/{daemon-VF6HJQXD.js → daemon-JZLFRUW6.js} +4 -4
- package/dist/daemon-JZLFRUW6.js.map +1 -0
- package/dist/data/registry-snapshot.json +876 -0
- package/dist/doctor-N2HKKUUQ.js +9 -0
- package/dist/doctor-N2HKKUUQ.js.map +1 -0
- package/dist/index.d.ts +212 -43
- package/dist/index.js +43 -14
- package/dist/install-cloudflared-BTGUD7SW.js +8 -0
- package/dist/install-cloudflared-BTGUD7SW.js.map +1 -0
- package/dist/log-SPS2S6FO.js +19 -0
- package/dist/log-SPS2S6FO.js.map +1 -0
- package/dist/{main-G6XDM7EZ.js → main-37GLOJ7G.js} +21 -15
- package/dist/{main-G6XDM7EZ.js.map → main-37GLOJ7G.js.map} +1 -1
- package/dist/menu-6RCPBVGQ.js +15 -0
- package/dist/menu-6RCPBVGQ.js.map +1 -0
- package/dist/{setup-FCVL75K6.js → setup-QAS3QW3M.js} +5 -4
- package/dist/setup-QAS3QW3M.js.map +1 -0
- package/dist/{tunnel-service-DASSH7OA.js → tunnel-service-LEVPLXAZ.js} +3 -3
- package/package.json +10 -2
- package/dist/agent-registry-7HC6D4CH.js +0 -7
- package/dist/chunk-KPI4HGJC.js.map +0 -1
- package/dist/chunk-LYKCQTH5.js.map +0 -1
- package/dist/chunk-UAUTLC4E.js.map +0 -1
- package/dist/chunk-VA2M52CM.js +0 -15
- package/dist/chunk-VA2M52CM.js.map +0 -1
- package/dist/chunk-ZRFBLD3W.js.map +0 -1
- package/dist/config-editor-SKS4LJLT.js +0 -11
- package/dist/install-cloudflared-ILUXKLAC.js +0 -8
- /package/dist/{agent-registry-7HC6D4CH.js.map → agent-catalog-4IAJ7HEG.js.map} +0 -0
- /package/dist/{autostart-DZ3MHHMM.js.map → agent-registry-B5YAMA4T.js.map} +0 -0
- /package/dist/{config-H2DSEHNW.js.map → agent-store-ZBXGOFPH.js.map} +0 -0
- /package/dist/{config-editor-SKS4LJLT.js.map → api-client-UN7BXQOQ.js.map} +0 -0
- /package/dist/{daemon-VF6HJQXD.js.map → autostart-K73RQZVV.js.map} +0 -0
- /package/dist/{install-cloudflared-ILUXKLAC.js.map → chunk-NAMYZIS5.js.map} +0 -0
- /package/dist/{chunk-HZD3CGPK.js.map → chunk-NDR5JCS7.js.map} +0 -0
- /package/dist/{chunk-V3BA2MJ6.js.map → chunk-RF3DUYFO.js.map} +0 -0
- /package/dist/{chunk-C6YIUTGR.js.map → chunk-VBEWSWVL.js.map} +0 -0
- /package/dist/{chunk-MRKYJ422.js.map → chunk-X6LLG7XN.js.map} +0 -0
- /package/dist/{setup-FCVL75K6.js.map → config-PCPIBPUA.js.map} +0 -0
- /package/dist/{tunnel-service-DASSH7OA.js.map → tunnel-service-LEVPLXAZ.js.map} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/core/agent-dependencies.ts
|
|
2
|
+
import { execFileSync } from "child_process";
|
|
3
|
+
import * as fs from "fs";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
var AGENT_DEPENDENCIES = {
|
|
6
|
+
"claude-acp": [
|
|
7
|
+
{
|
|
8
|
+
command: "claude",
|
|
9
|
+
label: "Claude CLI",
|
|
10
|
+
installHint: "npm install -g @anthropic-ai/claude-code"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"codex-acp": [
|
|
14
|
+
{
|
|
15
|
+
command: "codex",
|
|
16
|
+
label: "Codex CLI",
|
|
17
|
+
installHint: "npm install -g @openai/codex"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
};
|
|
21
|
+
var AGENT_CAPABILITIES = {
|
|
22
|
+
claude: {
|
|
23
|
+
supportsResume: true,
|
|
24
|
+
resumeCommand: (sid) => `claude --resume ${sid}`
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var REGISTRY_AGENT_ALIASES = {
|
|
28
|
+
"claude-acp": "claude",
|
|
29
|
+
"codex-acp": "codex",
|
|
30
|
+
"gemini": "gemini",
|
|
31
|
+
"cursor": "cursor",
|
|
32
|
+
"github-copilot-cli": "copilot",
|
|
33
|
+
"cline": "cline",
|
|
34
|
+
"goose": "goose",
|
|
35
|
+
"kilo": "kilo",
|
|
36
|
+
"qwen-code": "qwen"
|
|
37
|
+
};
|
|
38
|
+
function getAgentAlias(registryId) {
|
|
39
|
+
return REGISTRY_AGENT_ALIASES[registryId] ?? registryId;
|
|
40
|
+
}
|
|
41
|
+
function getAgentDependencies(registryId) {
|
|
42
|
+
return AGENT_DEPENDENCIES[registryId] ?? [];
|
|
43
|
+
}
|
|
44
|
+
function getAgentCapabilities(agentName) {
|
|
45
|
+
return AGENT_CAPABILITIES[agentName] ?? { supportsResume: false };
|
|
46
|
+
}
|
|
47
|
+
function commandExists(cmd) {
|
|
48
|
+
try {
|
|
49
|
+
execFileSync("which", [cmd], { stdio: "pipe" });
|
|
50
|
+
return true;
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
let dir = process.cwd();
|
|
54
|
+
while (true) {
|
|
55
|
+
const binPath = path.join(dir, "node_modules", ".bin", cmd);
|
|
56
|
+
if (fs.existsSync(binPath)) return true;
|
|
57
|
+
const parent = path.dirname(dir);
|
|
58
|
+
if (parent === dir) break;
|
|
59
|
+
dir = parent;
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
function checkDependencies(registryId) {
|
|
64
|
+
const deps = getAgentDependencies(registryId);
|
|
65
|
+
if (deps.length === 0) return { available: true };
|
|
66
|
+
const missing = deps.filter((d) => !commandExists(d.command));
|
|
67
|
+
if (missing.length === 0) return { available: true };
|
|
68
|
+
return {
|
|
69
|
+
available: false,
|
|
70
|
+
reason: `Requires: ${missing.map((m) => m.label).join(", ")}`,
|
|
71
|
+
missing: missing.map((m) => ({ label: m.label, installHint: m.installHint }))
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function checkRuntimeAvailable(runtime) {
|
|
75
|
+
return commandExists(runtime);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
getAgentAlias,
|
|
80
|
+
getAgentCapabilities,
|
|
81
|
+
commandExists,
|
|
82
|
+
checkDependencies,
|
|
83
|
+
checkRuntimeAvailable
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=chunk-XJJ7LPXP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/agent-dependencies.ts"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { AvailabilityResult } from \"./types.js\";\n\nexport interface AgentDependency {\n command: string;\n label: string;\n installHint: string;\n}\n\nexport interface AgentCapability {\n supportsResume: boolean;\n resumeCommand?: (sessionId: string) => string;\n}\n\nconst AGENT_DEPENDENCIES: Record<string, AgentDependency[]> = {\n \"claude-acp\": [\n {\n command: \"claude\",\n label: \"Claude CLI\",\n installHint: \"npm install -g @anthropic-ai/claude-code\",\n },\n ],\n \"codex-acp\": [\n {\n command: \"codex\",\n label: \"Codex CLI\",\n installHint: \"npm install -g @openai/codex\",\n },\n ],\n};\n\nconst AGENT_CAPABILITIES: Record<string, AgentCapability> = {\n claude: {\n supportsResume: true,\n resumeCommand: (sid) => `claude --resume ${sid}`,\n },\n};\n\nexport const REGISTRY_AGENT_ALIASES: Record<string, string> = {\n \"claude-acp\": \"claude\",\n \"codex-acp\": \"codex\",\n \"gemini\": \"gemini\",\n \"cursor\": \"cursor\",\n \"github-copilot-cli\": \"copilot\",\n \"cline\": \"cline\",\n \"goose\": \"goose\",\n \"kilo\": \"kilo\",\n \"qwen-code\": \"qwen\",\n};\n\nexport function getAgentAlias(registryId: string): string {\n return REGISTRY_AGENT_ALIASES[registryId] ?? registryId;\n}\n\nexport function getAgentDependencies(registryId: string): AgentDependency[] {\n return AGENT_DEPENDENCIES[registryId] ?? [];\n}\n\nexport function getAgentCapabilities(agentName: string): AgentCapability {\n return AGENT_CAPABILITIES[agentName] ?? { supportsResume: false };\n}\n\nexport function commandExists(cmd: string): boolean {\n try {\n execFileSync(\"which\", [cmd], { stdio: \"pipe\" });\n return true;\n } catch {\n // not in PATH\n }\n // Check node_modules/.bin (walks up from cwd)\n let dir = process.cwd();\n while (true) {\n const binPath = path.join(dir, \"node_modules\", \".bin\", cmd);\n if (fs.existsSync(binPath)) return true;\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return false;\n}\n\nexport function checkDependencies(registryId: string): AvailabilityResult {\n const deps = getAgentDependencies(registryId);\n if (deps.length === 0) return { available: true };\n\n const missing = deps.filter((d) => !commandExists(d.command));\n if (missing.length === 0) return { available: true };\n\n return {\n available: false,\n reason: `Requires: ${missing.map((m) => m.label).join(\", \")}`,\n missing: missing.map((m) => ({ label: m.label, installHint: m.installHint })),\n };\n}\n\nexport function checkRuntimeAvailable(runtime: \"npx\" | \"uvx\"): boolean {\n return commandExists(runtime);\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,YAAY,QAAQ;AACpB,YAAY,UAAU;AActB,IAAM,qBAAwD;AAAA,EAC5D,cAAc;AAAA,IACZ;AAAA,MACE,SAAS;AAAA,MACT,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,aAAa;AAAA,IACX;AAAA,MACE,SAAS;AAAA,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W;AAAA,IACX,QAAQ,aAAa,QAAQ,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;AAAA,IAC3D,SAAS,QAAQ,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,aAAa,EAAE,YAAY,EAAE;AAAA,EAC9E;AACF;AAEO,SAAS,sBAAsB,SAAiC;AACrE,SAAO,cAAc,OAAO;AAC9B;","names":[]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// src/core/config-registry.ts
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
import * as os from "os";
|
|
5
|
+
var CONFIG_REGISTRY = [
|
|
6
|
+
{
|
|
7
|
+
path: "defaultAgent",
|
|
8
|
+
displayName: "Default Agent",
|
|
9
|
+
group: "agent",
|
|
10
|
+
type: "select",
|
|
11
|
+
options: (config) => {
|
|
12
|
+
try {
|
|
13
|
+
const agentsPath = path.join(os.homedir(), ".openacp", "agents.json");
|
|
14
|
+
if (fs.existsSync(agentsPath)) {
|
|
15
|
+
const data = JSON.parse(fs.readFileSync(agentsPath, "utf-8"));
|
|
16
|
+
return Object.keys(data.installed ?? {});
|
|
17
|
+
}
|
|
18
|
+
} catch {
|
|
19
|
+
}
|
|
20
|
+
return Object.keys(config.agents ?? {});
|
|
21
|
+
},
|
|
22
|
+
scope: "safe",
|
|
23
|
+
hotReload: true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
path: "logging.level",
|
|
27
|
+
displayName: "Log Level",
|
|
28
|
+
group: "logging",
|
|
29
|
+
type: "select",
|
|
30
|
+
options: ["silent", "debug", "info", "warn", "error", "fatal"],
|
|
31
|
+
scope: "safe",
|
|
32
|
+
hotReload: true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
path: "tunnel.enabled",
|
|
36
|
+
displayName: "Tunnel",
|
|
37
|
+
group: "tunnel",
|
|
38
|
+
type: "toggle",
|
|
39
|
+
scope: "safe",
|
|
40
|
+
hotReload: false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
path: "security.maxConcurrentSessions",
|
|
44
|
+
displayName: "Max Concurrent Sessions",
|
|
45
|
+
group: "security",
|
|
46
|
+
type: "number",
|
|
47
|
+
scope: "safe",
|
|
48
|
+
hotReload: true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
path: "security.sessionTimeoutMinutes",
|
|
52
|
+
displayName: "Session Timeout (min)",
|
|
53
|
+
group: "security",
|
|
54
|
+
type: "number",
|
|
55
|
+
scope: "safe",
|
|
56
|
+
hotReload: true
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
path: "workspace.baseDir",
|
|
60
|
+
displayName: "Workspace Directory",
|
|
61
|
+
group: "workspace",
|
|
62
|
+
type: "string",
|
|
63
|
+
scope: "safe",
|
|
64
|
+
hotReload: true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
path: "sessionStore.ttlDays",
|
|
68
|
+
displayName: "Session Store TTL (days)",
|
|
69
|
+
group: "storage",
|
|
70
|
+
type: "number",
|
|
71
|
+
scope: "safe",
|
|
72
|
+
hotReload: true
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
function getFieldDef(path2) {
|
|
76
|
+
return CONFIG_REGISTRY.find((f) => f.path === path2);
|
|
77
|
+
}
|
|
78
|
+
function getSafeFields() {
|
|
79
|
+
return CONFIG_REGISTRY.filter((f) => f.scope === "safe");
|
|
80
|
+
}
|
|
81
|
+
function isHotReloadable(path2) {
|
|
82
|
+
const def = getFieldDef(path2);
|
|
83
|
+
return def?.hotReload ?? false;
|
|
84
|
+
}
|
|
85
|
+
function resolveOptions(def, config) {
|
|
86
|
+
if (!def.options) return void 0;
|
|
87
|
+
return typeof def.options === "function" ? def.options(config) : def.options;
|
|
88
|
+
}
|
|
89
|
+
function getConfigValue(config, path2) {
|
|
90
|
+
const parts = path2.split(".");
|
|
91
|
+
let current = config;
|
|
92
|
+
for (const part of parts) {
|
|
93
|
+
if (current && typeof current === "object" && part in current) {
|
|
94
|
+
current = current[part];
|
|
95
|
+
} else {
|
|
96
|
+
return void 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return current;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
CONFIG_REGISTRY,
|
|
104
|
+
getFieldDef,
|
|
105
|
+
getSafeFields,
|
|
106
|
+
isHotReloadable,
|
|
107
|
+
resolveOptions,
|
|
108
|
+
getConfigValue
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=chunk-Z46LGZ7R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/config-registry.ts"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport * as os from \"node:os\";\nimport type { Config } from './config.js'\n\nexport interface ConfigFieldDef {\n path: string\n displayName: string\n group: string\n type: 'toggle' | 'select' | 'number' | 'string'\n options?: string[] | ((config: Config) => string[])\n scope: 'safe' | 'sensitive'\n hotReload: boolean\n}\n\nexport const CONFIG_REGISTRY: ConfigFieldDef[] = [\n {\n path: 'defaultAgent',\n displayName: 'Default Agent',\n group: 'agent',\n type: 'select',\n options: (config) => {\n try {\n const agentsPath = path.join(os.homedir(), \".openacp\", \"agents.json\");\n if (fs.existsSync(agentsPath)) {\n const data = JSON.parse(fs.readFileSync(agentsPath, \"utf-8\"));\n return Object.keys(data.installed ?? {});\n }\n } catch { /* fallback */ }\n return Object.keys(config.agents ?? {});\n },\n scope: 'safe',\n hotReload: true,\n },\n {\n path: 'logging.level',\n displayName: 'Log Level',\n group: 'logging',\n type: 'select',\n options: ['silent', 'debug', 'info', 'warn', 'error', 'fatal'],\n scope: 'safe',\n hotReload: true,\n },\n {\n path: 'tunnel.enabled',\n displayName: 'Tunnel',\n group: 'tunnel',\n type: 'toggle',\n scope: 'safe',\n hotReload: false,\n },\n {\n path: 'security.maxConcurrentSessions',\n displayName: 'Max Concurrent Sessions',\n group: 'security',\n type: 'number',\n scope: 'safe',\n hotReload: true,\n },\n {\n path: 'security.sessionTimeoutMinutes',\n displayName: 'Session Timeout (min)',\n group: 'security',\n type: 'number',\n scope: 'safe',\n hotReload: true,\n },\n {\n path: 'workspace.baseDir',\n displayName: 'Workspace Directory',\n group: 'workspace',\n type: 'string',\n scope: 'safe',\n hotReload: true,\n },\n {\n path: 'sessionStore.ttlDays',\n displayName: 'Session Store TTL (days)',\n group: 'storage',\n type: 'number',\n scope: 'safe',\n hotReload: true,\n },\n]\n\nexport function getFieldDef(path: string): ConfigFieldDef | undefined {\n return CONFIG_REGISTRY.find((f) => f.path === path)\n}\n\nexport function getSafeFields(): ConfigFieldDef[] {\n return CONFIG_REGISTRY.filter((f) => f.scope === 'safe')\n}\n\nexport function isHotReloadable(path: string): boolean {\n const def = getFieldDef(path)\n return def?.hotReload ?? false\n}\n\nexport function resolveOptions(def: ConfigFieldDef, config: Config): string[] | undefined {\n if (!def.options) return undefined\n return typeof def.options === 'function' ? def.options(config) : def.options\n}\n\nexport function getConfigValue(config: Config, path: string): unknown {\n const parts = path.split('.')\n let current: unknown = config\n for (const part of parts) {\n if (current && typeof current === 'object' && part in current) {\n current = (current as Record<string, unknown>)[part]\n } else {\n return undefined\n }\n }\n return current\n}\n"],"mappings":";AAAA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,YAAY,QAAQ;AAab,IAAM,kBAAoC;AAAA,EAC/C;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS,CAAC,WAAW;AACnB,UAAI;AACF,cAAM,aAAkB,UAAQ,WAAQ,GAAG,YAAY,aAAa;AACpE,YAAO,cAAW,UAAU,GAAG;AAC7B,gBAAM,OAAO,KAAK,MAAS,gBAAa,YAAY,OAAO,CAAC;AAC5D,iBAAO,OAAO,KAAK,KAAK,aAAa,CAAC,CAAC;AAAA,QACzC;AAAA,MACF,QAAQ;AAAA,MAAiB;AACz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