@sparkleideas/cli 3.1.0-alpha.66 → 3.5.15-patch.14
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/.claude/agents/core/coder.md +1 -1
- package/.claude/agents/core/planner.md +2 -2
- package/.claude/agents/core/researcher.md +1 -1
- package/.claude/agents/core/reviewer.md +1 -1
- package/.claude/agents/core/tester.md +1 -1
- package/.claude/agents/data/data-ml-model.md +4 -4
- package/.claude/agents/development/dev-backend-api.md +4 -4
- package/.claude/agents/documentation/docs-api-openapi.md +4 -4
- package/.claude/agents/github/code-review-swarm.md +2 -2
- package/.claude/agents/github/issue-tracker.md +2 -2
- package/.claude/agents/github/pr-manager.md +2 -2
- package/.claude/agents/github/release-manager.md +2 -2
- package/.claude/agents/github/workflow-automation.md +2 -2
- package/.claude/agents/sparc/architecture.md +3 -3
- package/.claude/agents/sparc/pseudocode.md +2 -2
- package/.claude/agents/sparc/refinement.md +3 -3
- package/.claude/agents/sparc/specification.md +2 -2
- package/.claude/agents/swarm/adaptive-coordinator.md +1 -1
- package/.claude/agents/swarm/hierarchical-coordinator.md +1 -1
- package/.claude/agents/swarm/mesh-coordinator.md +1 -1
- package/.claude/agents/templates/base-template-generator.md +3 -3
- package/.claude/agents/templates/sparc-coordinator.md +3 -3
- package/.claude/helpers/auto-memory-hook.mjs +365 -0
- package/.claude/helpers/hook-handler.cjs +271 -0
- package/.claude/helpers/intelligence.cjs +916 -0
- package/.claude/helpers/learning-service.mjs +3 -3
- package/.claude/helpers/session.js +8 -0
- package/.claude/helpers/statusline.cjs +96 -28
- package/.claude/settings.json +86 -141
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
- package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
- package/README.md +952 -481
- package/bin/preinstall.cjs +2 -0
- package/dist/src/appliance/gguf-engine.d.ts +91 -0
- package/dist/src/appliance/gguf-engine.d.ts.map +1 -0
- package/dist/src/appliance/gguf-engine.js +425 -0
- package/dist/src/appliance/gguf-engine.js.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
- package/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.js +292 -0
- package/dist/src/appliance/ruvllm-bridge.js.map +1 -0
- package/dist/src/appliance/rvfa-builder.d.ts +44 -0
- package/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-builder.js +329 -0
- package/dist/src/appliance/rvfa-builder.js.map +1 -0
- package/dist/src/appliance/rvfa-distribution.d.ts +97 -0
- package/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-distribution.js +370 -0
- package/dist/src/appliance/rvfa-distribution.js.map +1 -0
- package/dist/src/appliance/rvfa-format.d.ts +111 -0
- package/dist/src/appliance/rvfa-format.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-format.js +393 -0
- package/dist/src/appliance/rvfa-format.js.map +1 -0
- package/dist/src/appliance/rvfa-runner.d.ts +69 -0
- package/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-runner.js +237 -0
- package/dist/src/appliance/rvfa-runner.js.map +1 -0
- package/dist/src/appliance/rvfa-signing.d.ts +123 -0
- package/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-signing.js +347 -0
- package/dist/src/appliance/rvfa-signing.js.map +1 -0
- package/dist/src/commands/appliance-advanced.d.ts +9 -0
- package/dist/src/commands/appliance-advanced.d.ts.map +1 -0
- package/dist/src/commands/appliance-advanced.js +215 -0
- package/dist/src/commands/appliance-advanced.js.map +1 -0
- package/dist/src/commands/appliance.d.ts +8 -0
- package/dist/src/commands/appliance.d.ts.map +1 -0
- package/dist/src/commands/appliance.js +406 -0
- package/dist/src/commands/appliance.js.map +1 -0
- package/dist/src/commands/benchmark.js +2 -2
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/claims.js +1 -1
- package/dist/src/commands/claims.js.map +1 -1
- package/dist/src/commands/config.js +1 -1
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.d.ts.map +1 -1
- package/dist/src/commands/daemon.js +28 -12
- package/dist/src/commands/daemon.js.map +1 -1
- package/dist/src/commands/deployment.js +1 -1
- package/dist/src/commands/deployment.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +76 -45
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.js +1 -1
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +84 -81
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +7 -2
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +11 -2
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +29 -34
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +18 -3
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +25 -1
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/neural.js +1 -1
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.js +1 -1
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.js +1 -1
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/providers.js +1 -1
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/security.js +1 -1
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/start.js +11 -11
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +12 -5
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/transfer-store.js +1 -1
- package/dist/src/commands/transfer-store.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +5 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/claudemd-generator.js +1 -1
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +233 -97
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts +18 -0
- package/dist/src/init/helpers-generator.d.ts.map +1 -1
- package/dist/src/init/helpers-generator.js +587 -15
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/mcp-generator.d.ts +0 -1
- package/dist/src/init/mcp-generator.d.ts.map +1 -1
- package/dist/src/init/mcp-generator.js +33 -17
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +140 -137
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts +16 -8
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +506 -930
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +8 -0
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +8 -1
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +4 -0
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +27 -1
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.d.ts +30 -0
- package/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/agentdb-tools.js +557 -0
- package/dist/src/mcp-tools/agentdb-tools.js.map +1 -0
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +11 -1
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.js +1 -1
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js +5 -5
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +1 -1
- package/dist/src/mcp-tools/github-tools.js +2 -2
- package/dist/src/mcp-tools/github-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +205 -33
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +18 -1
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +32 -27
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +1 -1
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +109 -6
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +36 -0
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.js +91 -0
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
- package/dist/src/memory/intelligence.d.ts.map +1 -1
- package/dist/src/memory/intelligence.js +34 -6
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +407 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -0
- package/dist/src/memory/memory-bridge.js +1494 -0
- package/dist/src/memory/memory-bridge.js.map +1 -0
- package/dist/src/memory/memory-initializer.d.ts +10 -1
- package/dist/src/memory/memory-initializer.d.ts.map +1 -1
- package/dist/src/memory/memory-initializer.js +182 -10
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +1 -0
- package/dist/src/output.js.map +1 -1
- package/dist/src/plugins/manager.d.ts.map +1 -1
- package/dist/src/plugins/manager.js +24 -7
- package/dist/src/plugins/manager.js.map +1 -1
- package/dist/src/plugins/store/discovery.js +1 -1
- package/dist/src/plugins/store/discovery.js.map +1 -1
- package/dist/src/production/error-handler.js +1 -1
- package/dist/src/production/error-handler.js.map +1 -1
- package/dist/src/runtime/headless.js +3 -3
- package/dist/src/runtime/headless.js.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.js +25 -15
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
- package/dist/src/services/agentic-flow-bridge.d.ts +50 -0
- package/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
- package/dist/src/services/agentic-flow-bridge.js +95 -0
- package/dist/src/services/agentic-flow-bridge.js.map +1 -0
- package/dist/src/services/claim-service.js +1 -1
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/src/services/container-worker-pool.d.ts.map +1 -1
- package/dist/src/services/container-worker-pool.js +2 -0
- package/dist/src/services/container-worker-pool.js.map +1 -1
- package/dist/src/services/ruvector-training.d.ts +2 -1
- package/dist/src/services/ruvector-training.d.ts.map +1 -1
- package/dist/src/services/ruvector-training.js +1 -2
- package/dist/src/services/ruvector-training.js.map +1 -1
- package/dist/src/services/worker-queue.d.ts.map +1 -1
- package/dist/src/services/worker-queue.js +2 -0
- package/dist/src/services/worker-queue.js.map +1 -1
- package/dist/src/transfer/ipfs/client.d.ts.map +1 -1
- package/dist/src/transfer/ipfs/client.js +8 -0
- package/dist/src/transfer/ipfs/client.js.map +1 -1
- package/dist/src/transfer/ipfs/upload.d.ts.map +1 -1
- package/dist/src/transfer/ipfs/upload.js +0 -2
- package/dist/src/transfer/ipfs/upload.js.map +1 -1
- package/dist/src/transfer/serialization/cfp.d.ts.map +1 -1
- package/dist/src/transfer/serialization/cfp.js +8 -5
- package/dist/src/transfer/serialization/cfp.js.map +1 -1
- package/dist/src/transfer/storage/gcs.d.ts.map +1 -1
- package/dist/src/transfer/storage/gcs.js +49 -23
- package/dist/src/transfer/storage/gcs.js.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.js +1 -1
- package/dist/src/update/validator.js +1 -1
- package/dist/src/update/validator.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +16 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-generator.d.ts","sourceRoot":"","sources":["../../../src/init/mcp-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-generator.d.ts","sourceRoot":"","sources":["../../../src/init/mcp-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;AAqCzD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA2C9D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAG5D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,EAAE,CA2BlE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAW5E"}
|
|
@@ -11,20 +11,22 @@ function isWindows() {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Generate platform-specific MCP server entry
|
|
14
|
-
* Windows
|
|
14
|
+
* - Windows: uses 'cmd /c npx' directly
|
|
15
|
+
* - Unix: uses 'npx' directly (simple, reliable)
|
|
15
16
|
*/
|
|
16
17
|
function createMCPServerEntry(npxArgs, env, additionalProps = {}) {
|
|
17
18
|
if (isWindows()) {
|
|
18
19
|
return {
|
|
19
20
|
command: 'cmd',
|
|
20
|
-
args: ['/c', 'npx', ...npxArgs],
|
|
21
|
+
args: ['/c', 'npx', '-y', ...npxArgs],
|
|
21
22
|
env,
|
|
22
23
|
...additionalProps,
|
|
23
24
|
};
|
|
24
25
|
}
|
|
26
|
+
// Unix: direct npx invocation — simple and reliable
|
|
25
27
|
return {
|
|
26
28
|
command: 'npx',
|
|
27
|
-
args: npxArgs,
|
|
29
|
+
args: ['-y', ...npxArgs],
|
|
28
30
|
env,
|
|
29
31
|
...additionalProps,
|
|
30
32
|
};
|
|
@@ -35,23 +37,27 @@ function createMCPServerEntry(npxArgs, env, additionalProps = {}) {
|
|
|
35
37
|
export function generateMCPConfig(options) {
|
|
36
38
|
const config = options.mcp;
|
|
37
39
|
const mcpServers = {};
|
|
40
|
+
const npmEnv = {
|
|
41
|
+
npm_config_update_notifier: 'false',
|
|
42
|
+
};
|
|
38
43
|
// Claude Flow MCP server (core)
|
|
39
44
|
if (config.claudeFlow) {
|
|
40
45
|
mcpServers['claude-flow'] = createMCPServerEntry(['@sparkleideas/cli@latest', 'mcp', 'start'], {
|
|
46
|
+
...npmEnv,
|
|
41
47
|
CLAUDE_FLOW_MODE: 'v3',
|
|
42
48
|
CLAUDE_FLOW_HOOKS_ENABLED: 'true',
|
|
43
49
|
CLAUDE_FLOW_TOPOLOGY: options.runtime.topology,
|
|
44
50
|
CLAUDE_FLOW_MAX_AGENTS: String(options.runtime.maxAgents),
|
|
45
51
|
CLAUDE_FLOW_MEMORY_BACKEND: options.runtime.memoryBackend,
|
|
46
|
-
});
|
|
52
|
+
}, {});
|
|
47
53
|
}
|
|
48
54
|
// Ruv-Swarm MCP server (enhanced coordination)
|
|
49
55
|
if (config.ruvSwarm) {
|
|
50
|
-
mcpServers['ruv-swarm'] = createMCPServerEntry(['ruv-swarm', 'mcp', 'start'], {}, { optional: true });
|
|
56
|
+
mcpServers['ruv-swarm'] = createMCPServerEntry(['ruv-swarm', 'mcp', 'start'], { ...npmEnv }, { optional: true });
|
|
51
57
|
}
|
|
52
58
|
// Flow Nexus MCP server (cloud features)
|
|
53
59
|
if (config.flowNexus) {
|
|
54
|
-
mcpServers['flow-nexus'] = createMCPServerEntry(['flow-nexus@latest', 'mcp', 'start'], {}, { optional: true, requiresAuth: true });
|
|
60
|
+
mcpServers['flow-nexus'] = createMCPServerEntry(['flow-nexus@latest', 'mcp', 'start'], { ...npmEnv }, { optional: true, requiresAuth: true });
|
|
55
61
|
}
|
|
56
62
|
return { mcpServers };
|
|
57
63
|
}
|
|
@@ -64,21 +70,31 @@ export function generateMCPJson(options) {
|
|
|
64
70
|
}
|
|
65
71
|
/**
|
|
66
72
|
* Generate MCP server add commands for manual setup
|
|
67
|
-
* Windows uses 'cmd /c' wrapper for npx execution
|
|
68
73
|
*/
|
|
69
74
|
export function generateMCPCommands(options) {
|
|
70
75
|
const commands = [];
|
|
71
76
|
const config = options.mcp;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
if (isWindows()) {
|
|
78
|
+
if (config.claudeFlow) {
|
|
79
|
+
commands.push('claude mcp add claude-flow -- cmd /c npx -y @sparkleideas/cli@latest mcp start');
|
|
80
|
+
}
|
|
81
|
+
if (config.ruvSwarm) {
|
|
82
|
+
commands.push('claude mcp add ruv-swarm -- cmd /c npx -y ruv-swarm mcp start');
|
|
83
|
+
}
|
|
84
|
+
if (config.flowNexus) {
|
|
85
|
+
commands.push('claude mcp add flow-nexus -- cmd /c npx -y flow-nexus@latest mcp start');
|
|
86
|
+
}
|
|
79
87
|
}
|
|
80
|
-
|
|
81
|
-
|
|
88
|
+
else {
|
|
89
|
+
if (config.claudeFlow) {
|
|
90
|
+
commands.push("claude mcp add claude-flow -- npx -y @sparkleideas/cli@latest mcp start");
|
|
91
|
+
}
|
|
92
|
+
if (config.ruvSwarm) {
|
|
93
|
+
commands.push("claude mcp add ruv-swarm -- npx -y ruv-swarm mcp start");
|
|
94
|
+
}
|
|
95
|
+
if (config.flowNexus) {
|
|
96
|
+
commands.push("claude mcp add flow-nexus -- npx -y flow-nexus@latest mcp start");
|
|
97
|
+
}
|
|
82
98
|
}
|
|
83
99
|
return commands;
|
|
84
100
|
}
|
|
@@ -94,7 +110,7 @@ export function getPlatformInstructions() {
|
|
|
94
110
|
}
|
|
95
111
|
return {
|
|
96
112
|
platform: process.platform === 'darwin' ? 'macOS' : 'Linux',
|
|
97
|
-
note: 'MCP configuration uses
|
|
113
|
+
note: 'MCP configuration uses npx directly.',
|
|
98
114
|
};
|
|
99
115
|
}
|
|
100
116
|
//# sourceMappingURL=mcp-generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-generator.js","sourceRoot":"","sources":["../../../src/init/mcp-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AACtC,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"mcp-generator.js","sourceRoot":"","sources":["../../../src/init/mcp-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,SAAS,oBAAoB,CAC3B,OAAiB,EACjB,GAA2B,EAC3B,kBAA2C,EAAE;IAE7C,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE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QACnF,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,OAAO;YACL,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,8DAA8D;SACrE,CAAC;IACJ,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;QAC3D,IAAI,EAAE,sCAAsC;KAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-generator.d.ts","sourceRoot":"","sources":["../../../src/init/settings-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"settings-generator.d.ts","sourceRoot":"","sources":["../../../src/init/settings-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,YAAY,CAAC;AAGzE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAuJ7D;AAsQD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAGjE"}
|
|
@@ -18,15 +18,16 @@ export function generateSettings(options) {
|
|
|
18
18
|
}
|
|
19
19
|
// Add permissions
|
|
20
20
|
settings.permissions = {
|
|
21
|
-
// Auto-allow claude-flow MCP tools
|
|
22
|
-
// Note: Use ":*" for prefix matching (not just "*")
|
|
23
21
|
allow: [
|
|
24
|
-
'Bash(npx claude-flow
|
|
25
|
-
'Bash(npx
|
|
22
|
+
'Bash(npx @claude-flow*)',
|
|
23
|
+
'Bash(npx claude-flow*)',
|
|
24
|
+
'Bash(node .claude/*)',
|
|
26
25
|
'mcp__claude-flow__:*',
|
|
27
26
|
],
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
deny: [
|
|
28
|
+
'Read(./.env)',
|
|
29
|
+
'Read(./.env.*)',
|
|
30
|
+
],
|
|
30
31
|
};
|
|
31
32
|
// Add claude-flow attribution for git commits and PRs
|
|
32
33
|
settings.attribution = {
|
|
@@ -44,10 +45,17 @@ export function generateSettings(options) {
|
|
|
44
45
|
CLAUDE_FLOW_V3_ENABLED: 'true',
|
|
45
46
|
CLAUDE_FLOW_HOOKS_ENABLED: 'true',
|
|
46
47
|
};
|
|
48
|
+
// Detect platform for platform-aware configuration
|
|
49
|
+
const platform = detectPlatform();
|
|
47
50
|
// Add V3-specific settings
|
|
48
51
|
settings.claudeFlow = {
|
|
49
52
|
version: '3.0.0',
|
|
50
53
|
enabled: true,
|
|
54
|
+
platform: {
|
|
55
|
+
os: platform.os,
|
|
56
|
+
arch: platform.arch,
|
|
57
|
+
shell: platform.shell,
|
|
58
|
+
},
|
|
51
59
|
modelPreferences: {
|
|
52
60
|
default: 'claude-opus-4-6',
|
|
53
61
|
routing: 'claude-haiku-4-5-20251001',
|
|
@@ -83,6 +91,9 @@ export function generateSettings(options) {
|
|
|
83
91
|
memory: {
|
|
84
92
|
backend: options.runtime.memoryBackend,
|
|
85
93
|
enableHNSW: options.runtime.enableHNSW,
|
|
94
|
+
learningBridge: { enabled: options.runtime.enableLearningBridge ?? true },
|
|
95
|
+
memoryGraph: { enabled: options.runtime.enableMemoryGraph ?? true },
|
|
96
|
+
agentScopes: { enabled: options.runtime.enableAgentScopes ?? true },
|
|
86
97
|
},
|
|
87
98
|
neural: {
|
|
88
99
|
enabled: options.runtime.enableNeural,
|
|
@@ -138,252 +149,244 @@ export function generateSettings(options) {
|
|
|
138
149
|
};
|
|
139
150
|
return settings;
|
|
140
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Detect if we're on Windows for platform-aware hook commands.
|
|
154
|
+
*/
|
|
155
|
+
const IS_WINDOWS = process.platform === 'win32';
|
|
156
|
+
/**
|
|
157
|
+
* Build a cross-platform hook command.
|
|
158
|
+
* On Windows, wraps with `cmd /c` to avoid PowerShell stdin/process issues
|
|
159
|
+
* that cause "UserPromptSubmit hook error" in Claude Code.
|
|
160
|
+
*/
|
|
161
|
+
function hookCmd(script, subcommand) {
|
|
162
|
+
const cmd = `node ${script} ${subcommand}`.trim();
|
|
163
|
+
return IS_WINDOWS ? `cmd /c ${cmd}` : cmd;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Build a cross-platform hook command for ESM scripts (.mjs).
|
|
167
|
+
*/
|
|
168
|
+
function hookCmdEsm(script, subcommand) {
|
|
169
|
+
const cmd = `node ${script} ${subcommand}`.trim();
|
|
170
|
+
return IS_WINDOWS ? `cmd /c ${cmd}` : cmd;
|
|
171
|
+
}
|
|
172
|
+
/** Shorthand for CJS hook-handler commands */
|
|
173
|
+
function hookHandlerCmd(subcommand) {
|
|
174
|
+
return hookCmd('"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs"', subcommand);
|
|
175
|
+
}
|
|
176
|
+
/** Shorthand for ESM auto-memory-hook commands */
|
|
177
|
+
function autoMemoryCmd(subcommand) {
|
|
178
|
+
return hookCmdEsm('"$CLAUDE_PROJECT_DIR/.claude/helpers/auto-memory-hook.mjs"', subcommand);
|
|
179
|
+
}
|
|
141
180
|
/**
|
|
142
181
|
* Generate statusLine configuration for Claude Code
|
|
143
|
-
*
|
|
182
|
+
* Uses local helper script for cross-platform compatibility (no npx cold-start)
|
|
144
183
|
*/
|
|
145
|
-
function generateStatusLineConfig(
|
|
146
|
-
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
//
|
|
151
|
-
const statuslineCommand = 'npx @sparkleideas/cli@latest hooks statusline 2>/dev/null || node .claude/helpers/statusline.cjs 2>/dev/null || echo "▊ Claude Flow V3"';
|
|
184
|
+
function generateStatusLineConfig(_options) {
|
|
185
|
+
// Claude Code pipes JSON session data to the script via stdin.
|
|
186
|
+
// Valid fields: type, command, padding (optional).
|
|
187
|
+
// The script runs after each assistant message (debounced 300ms).
|
|
188
|
+
// NOTE: statusline must NOT use `cmd /c` — Claude Code manages its stdin
|
|
189
|
+
// directly for statusline commands, and `cmd /c` blocks stdin forwarding.
|
|
152
190
|
return {
|
|
153
|
-
// Type must be "command" for Claude Code validation
|
|
154
191
|
type: 'command',
|
|
155
|
-
|
|
156
|
-
command: statuslineCommand,
|
|
157
|
-
// Refresh interval in milliseconds (5 seconds default)
|
|
158
|
-
refreshMs: config.refreshInterval,
|
|
159
|
-
// Enable the statusline
|
|
160
|
-
enabled: config.enabled,
|
|
192
|
+
command: `node "$CLAUDE_PROJECT_DIR/.claude/helpers/statusline.cjs"`,
|
|
161
193
|
};
|
|
162
194
|
}
|
|
163
195
|
/**
|
|
164
196
|
* Generate hooks configuration
|
|
165
|
-
*
|
|
197
|
+
* Uses local hook-handler.cjs for cross-platform compatibility.
|
|
198
|
+
* All hooks invoke scripts directly via `node <script> <subcommand>`,
|
|
199
|
+
* working identically on Windows, macOS, and Linux.
|
|
166
200
|
*/
|
|
167
201
|
function generateHooksConfig(config) {
|
|
168
202
|
const hooks = {};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
//
|
|
172
|
-
// Windows: PowerShell syntax with 2>$null and ; exit 0
|
|
173
|
-
// Mac/Linux: Bash syntax with 2>/dev/null || true
|
|
174
|
-
const cmd = {
|
|
175
|
-
// Check if variable is set and run command
|
|
176
|
-
ifVar: (varName, command) => isWindows
|
|
177
|
-
? `if ($env:${varName}) { ${command} 2>$null }; exit 0`
|
|
178
|
-
: `[ -n "$${varName}" ] && ${command} 2>/dev/null || true`,
|
|
179
|
-
// Simple command with error suppression
|
|
180
|
-
simple: (command) => isWindows
|
|
181
|
-
? `${command} 2>$null; exit 0`
|
|
182
|
-
: `${command} 2>/dev/null || true`,
|
|
183
|
-
// Echo JSON (different quote escaping)
|
|
184
|
-
echoJson: (json) => isWindows
|
|
185
|
-
? `Write-Output '${json}'`
|
|
186
|
-
: `echo '${json}'`,
|
|
187
|
-
// Generate timestamp (for unique keys)
|
|
188
|
-
timestamp: () => isWindows
|
|
189
|
-
? '$(Get-Date -UFormat %s)'
|
|
190
|
-
: '$(date +%s)',
|
|
191
|
-
};
|
|
192
|
-
// PreToolUse hooks - cross-platform via npx with defensive guards
|
|
203
|
+
// Node.js scripts handle errors internally via try/catch.
|
|
204
|
+
// No shell-level error suppression needed (2>/dev/null || true breaks Windows).
|
|
205
|
+
// PreToolUse — validate commands and edits before execution
|
|
193
206
|
if (config.preToolUse) {
|
|
194
207
|
hooks.PreToolUse = [
|
|
195
|
-
// File edit hooks with intelligence routing
|
|
196
|
-
{
|
|
197
|
-
matcher: '^(Write|Edit|MultiEdit)$',
|
|
198
|
-
hooks: [
|
|
199
|
-
{
|
|
200
|
-
type: 'command',
|
|
201
|
-
command: cmd.ifVar('TOOL_INPUT_file_path', isWindows
|
|
202
|
-
? 'npx @sparkleideas/cli@latest hooks pre-edit --file $env:TOOL_INPUT_file_path'
|
|
203
|
-
: 'npx @sparkleideas/cli@latest hooks pre-edit --file "$TOOL_INPUT_file_path"'),
|
|
204
|
-
timeout: config.timeout,
|
|
205
|
-
continueOnError: true,
|
|
206
|
-
},
|
|
207
|
-
],
|
|
208
|
-
},
|
|
209
|
-
// Bash command hooks with safety validation
|
|
210
208
|
{
|
|
211
|
-
matcher: '
|
|
209
|
+
matcher: 'Bash',
|
|
212
210
|
hooks: [
|
|
213
211
|
{
|
|
214
212
|
type: 'command',
|
|
215
|
-
command:
|
|
216
|
-
? 'npx @sparkleideas/cli@latest hooks pre-command --command $env:TOOL_INPUT_command'
|
|
217
|
-
: 'npx @sparkleideas/cli@latest hooks pre-command --command "$TOOL_INPUT_command"'),
|
|
213
|
+
command: hookHandlerCmd('pre-bash'),
|
|
218
214
|
timeout: config.timeout,
|
|
219
|
-
continueOnError: true,
|
|
220
215
|
},
|
|
221
216
|
],
|
|
222
217
|
},
|
|
223
|
-
// Task/Agent hooks - require task-id for tracking
|
|
224
218
|
{
|
|
225
|
-
matcher: '
|
|
219
|
+
matcher: 'Write|Edit|MultiEdit',
|
|
226
220
|
hooks: [
|
|
227
221
|
{
|
|
228
222
|
type: 'command',
|
|
229
|
-
command:
|
|
230
|
-
? `npx @sparkleideas/cli@latest hooks pre-task --task-id "task-${cmd.timestamp()}" --description $env:TOOL_INPUT_prompt`
|
|
231
|
-
: `npx @sparkleideas/cli@latest hooks pre-task --task-id "task-${cmd.timestamp()}" --description "$TOOL_INPUT_prompt"`),
|
|
223
|
+
command: hookHandlerCmd('pre-edit'),
|
|
232
224
|
timeout: config.timeout,
|
|
233
|
-
continueOnError: true,
|
|
234
225
|
},
|
|
235
226
|
],
|
|
236
227
|
},
|
|
237
228
|
];
|
|
238
229
|
}
|
|
239
|
-
// PostToolUse
|
|
230
|
+
// PostToolUse — record edits and commands for session metrics / learning
|
|
240
231
|
if (config.postToolUse) {
|
|
241
232
|
hooks.PostToolUse = [
|
|
242
|
-
// File edit hooks with neural pattern training
|
|
243
233
|
{
|
|
244
|
-
matcher: '
|
|
234
|
+
matcher: 'Write|Edit|MultiEdit',
|
|
245
235
|
hooks: [
|
|
246
236
|
{
|
|
247
237
|
type: 'command',
|
|
248
|
-
command:
|
|
249
|
-
|
|
250
|
-
: 'npx @sparkleideas/cli@latest hooks post-edit --file "$TOOL_INPUT_file_path" --success "${TOOL_SUCCESS:-true}"'),
|
|
251
|
-
timeout: config.timeout,
|
|
252
|
-
continueOnError: true,
|
|
238
|
+
command: hookHandlerCmd('post-edit'),
|
|
239
|
+
timeout: 10000,
|
|
253
240
|
},
|
|
254
241
|
],
|
|
255
242
|
},
|
|
256
|
-
// Bash command hooks with metrics tracking
|
|
257
243
|
{
|
|
258
|
-
matcher: '
|
|
244
|
+
matcher: 'Bash',
|
|
259
245
|
hooks: [
|
|
260
246
|
{
|
|
261
247
|
type: 'command',
|
|
262
|
-
command:
|
|
263
|
-
? 'npx @sparkleideas/cli@latest hooks post-command --command $env:TOOL_INPUT_command --success $($env:TOOL_SUCCESS ?? "true")'
|
|
264
|
-
: 'npx @sparkleideas/cli@latest hooks post-command --command "$TOOL_INPUT_command" --success "${TOOL_SUCCESS:-true}"'),
|
|
248
|
+
command: hookHandlerCmd('post-bash'),
|
|
265
249
|
timeout: config.timeout,
|
|
266
|
-
continueOnError: true,
|
|
267
250
|
},
|
|
268
251
|
],
|
|
269
252
|
},
|
|
270
|
-
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
// UserPromptSubmit — intelligent task routing
|
|
256
|
+
if (config.userPromptSubmit) {
|
|
257
|
+
hooks.UserPromptSubmit = [
|
|
271
258
|
{
|
|
272
|
-
matcher: '^Task$',
|
|
273
259
|
hooks: [
|
|
274
260
|
{
|
|
275
261
|
type: 'command',
|
|
276
|
-
command:
|
|
277
|
-
|
|
278
|
-
: 'npx @sparkleideas/cli@latest hooks post-task --task-id "$TOOL_RESULT_agent_id" --success "${TOOL_SUCCESS:-true}"'),
|
|
279
|
-
timeout: config.timeout,
|
|
280
|
-
continueOnError: true,
|
|
262
|
+
command: hookHandlerCmd('route'),
|
|
263
|
+
timeout: 10000,
|
|
281
264
|
},
|
|
282
265
|
],
|
|
283
266
|
},
|
|
284
267
|
];
|
|
285
268
|
}
|
|
286
|
-
//
|
|
287
|
-
if (config.
|
|
288
|
-
hooks.
|
|
269
|
+
// SessionStart — restore session state + import auto memory
|
|
270
|
+
if (config.sessionStart) {
|
|
271
|
+
hooks.SessionStart = [
|
|
289
272
|
{
|
|
290
273
|
hooks: [
|
|
291
274
|
{
|
|
292
275
|
type: 'command',
|
|
293
|
-
command:
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
276
|
+
command: hookHandlerCmd('session-restore'),
|
|
277
|
+
timeout: 15000,
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
type: 'command',
|
|
281
|
+
command: autoMemoryCmd('import'),
|
|
282
|
+
timeout: 8000,
|
|
298
283
|
},
|
|
299
284
|
],
|
|
300
285
|
},
|
|
301
286
|
];
|
|
302
287
|
}
|
|
303
|
-
//
|
|
288
|
+
// SessionEnd — persist session state
|
|
304
289
|
if (config.sessionStart) {
|
|
305
|
-
hooks.
|
|
290
|
+
hooks.SessionEnd = [
|
|
306
291
|
{
|
|
307
292
|
hooks: [
|
|
308
293
|
{
|
|
309
294
|
type: 'command',
|
|
310
|
-
command:
|
|
311
|
-
timeout: 5000,
|
|
312
|
-
continueOnError: true,
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
type: 'command',
|
|
316
|
-
command: cmd.ifVar('SESSION_ID', isWindows
|
|
317
|
-
? 'npx @sparkleideas/cli@latest hooks session-restore --session-id $env:SESSION_ID'
|
|
318
|
-
: 'npx @sparkleideas/cli@latest hooks session-restore --session-id "$SESSION_ID"'),
|
|
295
|
+
command: hookHandlerCmd('session-end'),
|
|
319
296
|
timeout: 10000,
|
|
320
|
-
continueOnError: true,
|
|
321
297
|
},
|
|
322
298
|
],
|
|
323
299
|
},
|
|
324
300
|
];
|
|
325
301
|
}
|
|
326
|
-
// Stop
|
|
327
|
-
// The hook outputs JSON that Claude Code validates
|
|
302
|
+
// Stop — sync auto memory on exit
|
|
328
303
|
if (config.stop) {
|
|
329
304
|
hooks.Stop = [
|
|
330
305
|
{
|
|
331
306
|
hooks: [
|
|
332
307
|
{
|
|
333
308
|
type: 'command',
|
|
334
|
-
command:
|
|
335
|
-
timeout:
|
|
309
|
+
command: autoMemoryCmd('sync'),
|
|
310
|
+
timeout: 10000,
|
|
336
311
|
},
|
|
337
312
|
],
|
|
338
313
|
},
|
|
339
314
|
];
|
|
340
315
|
}
|
|
341
|
-
//
|
|
342
|
-
if (config.
|
|
343
|
-
hooks.
|
|
316
|
+
// PreCompact — preserve context before compaction
|
|
317
|
+
if (config.preCompact) {
|
|
318
|
+
hooks.PreCompact = [
|
|
344
319
|
{
|
|
320
|
+
matcher: 'manual',
|
|
345
321
|
hooks: [
|
|
346
322
|
{
|
|
347
323
|
type: 'command',
|
|
348
|
-
command:
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
324
|
+
command: hookHandlerCmd('compact-manual'),
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
type: 'command',
|
|
328
|
+
command: hookHandlerCmd('session-end'),
|
|
329
|
+
timeout: 5000,
|
|
330
|
+
},
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
matcher: 'auto',
|
|
335
|
+
hooks: [
|
|
336
|
+
{
|
|
337
|
+
type: 'command',
|
|
338
|
+
command: hookHandlerCmd('compact-auto'),
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
type: 'command',
|
|
342
|
+
command: hookHandlerCmd('session-end'),
|
|
343
|
+
timeout: 6000,
|
|
353
344
|
},
|
|
354
345
|
],
|
|
355
346
|
},
|
|
356
347
|
];
|
|
357
348
|
}
|
|
358
|
-
//
|
|
359
|
-
|
|
360
|
-
// Agent Teams hooks - TeammateIdle for task assignment, TaskCompleted for coordination
|
|
361
|
-
hooks.TeammateIdle = [
|
|
349
|
+
// SubagentStart — status update when a sub-agent is spawned
|
|
350
|
+
hooks.SubagentStart = [
|
|
362
351
|
{
|
|
363
352
|
hooks: [
|
|
364
353
|
{
|
|
365
354
|
type: 'command',
|
|
366
|
-
command:
|
|
367
|
-
timeout:
|
|
368
|
-
continueOnError: true,
|
|
355
|
+
command: hookHandlerCmd('status'),
|
|
356
|
+
timeout: 3000,
|
|
369
357
|
},
|
|
370
358
|
],
|
|
371
359
|
},
|
|
372
360
|
];
|
|
373
|
-
|
|
361
|
+
// SubagentStop — track agent completion for metrics
|
|
362
|
+
// NOTE: The valid event is "SubagentStop" (not "SubagentEnd")
|
|
363
|
+
hooks.SubagentStop = [
|
|
374
364
|
{
|
|
375
365
|
hooks: [
|
|
376
366
|
{
|
|
377
367
|
type: 'command',
|
|
378
|
-
command:
|
|
379
|
-
? 'npx @sparkleideas/cli@latest hooks task-completed --task-id $env:TASK_ID --train-patterns true'
|
|
380
|
-
: 'npx @sparkleideas/cli@latest hooks task-completed --task-id "$TASK_ID" --train-patterns true'),
|
|
368
|
+
command: hookHandlerCmd('post-task'),
|
|
381
369
|
timeout: 5000,
|
|
382
|
-
continueOnError: true,
|
|
383
370
|
},
|
|
384
371
|
],
|
|
385
372
|
},
|
|
386
373
|
];
|
|
374
|
+
// Notification — capture Claude Code notifications for logging
|
|
375
|
+
if (config.notification) {
|
|
376
|
+
hooks.Notification = [
|
|
377
|
+
{
|
|
378
|
+
hooks: [
|
|
379
|
+
{
|
|
380
|
+
type: 'command',
|
|
381
|
+
command: hookHandlerCmd('notify'),
|
|
382
|
+
timeout: 3000,
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
},
|
|
386
|
+
];
|
|
387
|
+
}
|
|
388
|
+
// NOTE: TeammateIdle and TaskCompleted are NOT valid Claude Code hook events.
|
|
389
|
+
// Their configuration lives in claudeFlow.agentTeams.hooks instead (see generateSettings).
|
|
387
390
|
return hooks;
|
|
388
391
|
}
|
|
389
392
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-generator.js","sourceRoot":"","sources":["../../../src/init/settings-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAoB;IACnD,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAE7C,uBAAuB;IACvB,IAAI,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAChC,QAAQ,CAAC,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,0CAA0C;IAC1C,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAC/B,QAAQ,CAAC,UAAU,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC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