@kernel.chat/kbot 3.55.0 → 3.57.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/dist/auth.js +8 -8
- package/dist/auth.js.map +1 -1
- package/dist/cli.js +314 -41
- package/dist/cli.js.map +1 -1
- package/dist/gitagent-export.d.ts +42 -0
- package/dist/gitagent-export.d.ts.map +1 -0
- package/dist/gitagent-export.js +161 -0
- package/dist/gitagent-export.js.map +1 -0
- package/dist/migrate.d.ts +17 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +378 -0
- package/dist/migrate.js.map +1 -0
- package/dist/tools/admin.d.ts +2 -0
- package/dist/tools/admin.d.ts.map +1 -0
- package/dist/tools/admin.js +422 -0
- package/dist/tools/admin.js.map +1 -0
- package/dist/tools/analytics.d.ts +2 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +338 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/db-admin.d.ts +2 -0
- package/dist/tools/db-admin.d.ts.map +1 -0
- package/dist/tools/db-admin.js +364 -0
- package/dist/tools/db-admin.js.map +1 -0
- package/dist/tools/deploy-all.d.ts +2 -0
- package/dist/tools/deploy-all.d.ts.map +1 -0
- package/dist/tools/deploy-all.js +261 -0
- package/dist/tools/deploy-all.js.map +1 -0
- package/dist/tools/env-manager.d.ts +2 -0
- package/dist/tools/env-manager.d.ts.map +1 -0
- package/dist/tools/env-manager.js +240 -0
- package/dist/tools/env-manager.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +7 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/mcp-marketplace.d.ts.map +1 -1
- package/dist/tools/mcp-marketplace.js +24 -0
- package/dist/tools/mcp-marketplace.js.map +1 -1
- package/dist/tools/monitor.d.ts +2 -0
- package/dist/tools/monitor.d.ts.map +1 -0
- package/dist/tools/monitor.js +270 -0
- package/dist/tools/monitor.js.map +1 -0
- package/dist/tools/visa-payments.d.ts +2 -0
- package/dist/tools/visa-payments.d.ts.map +1 -0
- package/dist/tools/visa-payments.js +166 -0
- package/dist/tools/visa-payments.js.map +1 -0
- package/dist/voice.d.ts +1 -1
- package/dist/voice.d.ts.map +1 -1
- package/dist/voice.js +26 -0
- package/dist/voice.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface GitAgentManifest {
|
|
2
|
+
version: '1.0';
|
|
3
|
+
agent: GitAgentDefinition;
|
|
4
|
+
metadata: GitAgentMetadata;
|
|
5
|
+
}
|
|
6
|
+
export interface GitAgentDefinition {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
instructions: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
tools: GitAgentTool[];
|
|
12
|
+
capabilities: string[];
|
|
13
|
+
input_modes: string[];
|
|
14
|
+
output_modes: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface GitAgentTool {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
parameters: Record<string, {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface GitAgentMetadata {
|
|
26
|
+
source: 'kbot';
|
|
27
|
+
source_version: string;
|
|
28
|
+
exported_at: string;
|
|
29
|
+
agent_id: string;
|
|
30
|
+
compatibility: string[];
|
|
31
|
+
}
|
|
32
|
+
export declare function exportAgent(agentId: string): GitAgentManifest | null;
|
|
33
|
+
export declare function exportAllAgents(): GitAgentManifest[];
|
|
34
|
+
export declare function writeGitAgentFile(agentId: string, outputDir?: string): string;
|
|
35
|
+
export declare function writeAllGitAgentFiles(outputDir?: string): string[];
|
|
36
|
+
export declare function listExportableAgents(): Array<{
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
}>;
|
|
41
|
+
export declare function formatExportableAgentList(): string;
|
|
42
|
+
//# sourceMappingURL=gitagent-export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitagent-export.d.ts","sourceRoot":"","sources":["../src/gitagent-export.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,KAAK,CAAA;IACd,KAAK,EAAE,kBAAkB,CAAA;IACzB,QAAQ,EAAE,gBAAgB,CAAA;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CACtF;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB;AAmHD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAuBpE;AAED,wBAAgB,eAAe,IAAI,gBAAgB,EAAE,CAEpD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAU7E;AAED,wBAAgB,qBAAqB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAElE;AAED,wBAAgB,oBAAoB,IAAI,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAE/F;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CASlD"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// kbot GitAgent Export — Universal agent format for cross-platform portability
|
|
2
|
+
// GitAgent spec: framework-agnostic agent definitions that work across
|
|
3
|
+
// OpenAI Assistants, Claude Code, LangChain, CrewAI, and more.
|
|
4
|
+
//
|
|
5
|
+
// Usage: kbot export --format gitagent [agent-id]
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'node:fs';
|
|
8
|
+
const EXPORTABLE_AGENTS = [
|
|
9
|
+
{
|
|
10
|
+
id: 'kernel',
|
|
11
|
+
name: 'Kernel',
|
|
12
|
+
description: 'General-purpose AI agent — personal assistant, coding, research, and conversation',
|
|
13
|
+
instructions: 'You are Kernel, a general-purpose AI agent. You help with coding, research, writing, analysis, and conversation. You have access to file system tools, web search, and shell execution. Be concise, act autonomously, and verify your work.',
|
|
14
|
+
capabilities: ['coding', 'research', 'writing', 'analysis', 'conversation', 'file-management'],
|
|
15
|
+
tools: ['file_read', 'file_write', 'bash', 'web_search', 'git_status'],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'coder',
|
|
19
|
+
name: 'Coder',
|
|
20
|
+
description: 'Programming specialist — writes, reviews, refactors, and debugs code',
|
|
21
|
+
instructions: 'You are Coder, a programming specialist. You write clean, tested, production-ready code. You review code for bugs, security issues, and performance problems. You refactor for clarity and maintainability. Always run tests after changes.',
|
|
22
|
+
capabilities: ['code-generation', 'code-review', 'refactoring', 'debugging', 'testing'],
|
|
23
|
+
tools: ['file_read', 'file_write', 'file_glob', 'file_grep', 'bash', 'git_diff', 'git_commit'],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'researcher',
|
|
27
|
+
name: 'Researcher',
|
|
28
|
+
description: 'Research and fact-finding specialist — deep dives, source verification, synthesis',
|
|
29
|
+
instructions: 'You are Researcher, a research specialist. You find accurate information, verify sources, synthesize findings, and present clear summaries. You search the web, read documentation, and cross-reference data. Cite sources.',
|
|
30
|
+
capabilities: ['research', 'fact-checking', 'synthesis', 'source-verification'],
|
|
31
|
+
tools: ['web_search', 'url_fetch', 'file_read', 'file_write'],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'writer',
|
|
35
|
+
name: 'Writer',
|
|
36
|
+
description: 'Content creation specialist — articles, documentation, copywriting',
|
|
37
|
+
instructions: 'You are Writer, a content creation specialist. You write clear, engaging prose for technical documentation, blog posts, README files, and marketing copy. You adapt tone and style to the audience.',
|
|
38
|
+
capabilities: ['writing', 'documentation', 'copywriting', 'editing'],
|
|
39
|
+
tools: ['file_read', 'file_write', 'web_search'],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'guardian',
|
|
43
|
+
name: 'Guardian',
|
|
44
|
+
description: 'Security specialist — vulnerability scanning, secret detection, dependency audit',
|
|
45
|
+
instructions: 'You are Guardian, a security specialist. You scan code for vulnerabilities (OWASP Top 10), detect hardcoded secrets, audit dependencies for CVEs, check SSL configurations, and review authentication flows. Report findings with severity and remediation steps.',
|
|
46
|
+
capabilities: ['security-audit', 'vulnerability-scanning', 'secret-detection', 'dependency-audit'],
|
|
47
|
+
tools: ['file_read', 'file_grep', 'bash', 'web_search'],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'analyst',
|
|
51
|
+
name: 'Analyst',
|
|
52
|
+
description: 'Strategy and evaluation specialist — data analysis, market research, decision frameworks',
|
|
53
|
+
instructions: 'You are Analyst, a strategy specialist. You analyze data, evaluate options using structured frameworks, conduct market research, and provide actionable recommendations. Use quantitative reasoning where possible.',
|
|
54
|
+
capabilities: ['data-analysis', 'strategy', 'market-research', 'evaluation'],
|
|
55
|
+
tools: ['web_search', 'file_read', 'file_write', 'bash'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'infrastructure',
|
|
59
|
+
name: 'Infrastructure',
|
|
60
|
+
description: 'DevOps and infrastructure specialist — CI/CD, containers, cloud deployment',
|
|
61
|
+
instructions: 'You are Infrastructure, a DevOps specialist. You manage CI/CD pipelines, containerize applications, configure cloud deployments, monitor system health, and optimize infrastructure costs. You work with Docker, Kubernetes, Terraform, and cloud providers.',
|
|
62
|
+
capabilities: ['devops', 'ci-cd', 'containers', 'cloud-deployment', 'monitoring'],
|
|
63
|
+
tools: ['bash', 'file_read', 'file_write', 'git_status', 'git_commit'],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'investigator',
|
|
67
|
+
name: 'Investigator',
|
|
68
|
+
description: 'Deep research specialist — multi-source investigation, pattern detection, timeline analysis',
|
|
69
|
+
instructions: 'You are Investigator, a deep research specialist. You conduct thorough multi-source investigations, detect patterns across data, build timelines, and produce comprehensive reports. You go deeper than surface-level research.',
|
|
70
|
+
capabilities: ['deep-research', 'investigation', 'pattern-detection', 'timeline-analysis'],
|
|
71
|
+
tools: ['web_search', 'url_fetch', 'file_read', 'file_write', 'bash'],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'trader',
|
|
75
|
+
name: 'Trader',
|
|
76
|
+
description: 'Finance and trading specialist — market analysis, portfolio management, DeFi',
|
|
77
|
+
instructions: 'You are Trader, a finance specialist. You analyze markets, manage portfolios, execute trades, track whale movements, and evaluate DeFi protocols. You use technical analysis and sentiment data. Always assess risk before recommending actions.',
|
|
78
|
+
capabilities: ['trading', 'market-analysis', 'portfolio-management', 'defi', 'risk-assessment'],
|
|
79
|
+
tools: ['web_search', 'bash', 'file_read', 'file_write'],
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
// ── Export Functions ──
|
|
83
|
+
function getVersion() {
|
|
84
|
+
try {
|
|
85
|
+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url).pathname, 'utf-8'));
|
|
86
|
+
return pkg.version || '0.0.0';
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return '0.0.0';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function kbotToolToGitAgent(toolName) {
|
|
93
|
+
const toolMap = {
|
|
94
|
+
file_read: { name: 'read_file', description: 'Read file contents', parameters: { path: { type: 'string', description: 'File path', required: true } } },
|
|
95
|
+
file_write: { name: 'write_file', description: 'Write content to file', parameters: { path: { type: 'string', description: 'File path', required: true }, content: { type: 'string', description: 'File content', required: true } } },
|
|
96
|
+
file_glob: { name: 'glob', description: 'Find files matching a pattern', parameters: { pattern: { type: 'string', description: 'Glob pattern', required: true } } },
|
|
97
|
+
file_grep: { name: 'grep', description: 'Search file contents with regex', parameters: { pattern: { type: 'string', description: 'Regex pattern', required: true }, path: { type: 'string', description: 'Search path' } } },
|
|
98
|
+
bash: { name: 'run_command', description: 'Execute a shell command', parameters: { command: { type: 'string', description: 'Shell command', required: true } } },
|
|
99
|
+
web_search: { name: 'web_search', description: 'Search the web', parameters: { query: { type: 'string', description: 'Search query', required: true } } },
|
|
100
|
+
url_fetch: { name: 'fetch_url', description: 'Fetch content from a URL', parameters: { url: { type: 'string', description: 'URL to fetch', required: true } } },
|
|
101
|
+
git_status: { name: 'git_status', description: 'Get git repository status', parameters: {} },
|
|
102
|
+
git_diff: { name: 'git_diff', description: 'Show git diff', parameters: { ref: { type: 'string', description: 'Git ref to diff against' } } },
|
|
103
|
+
git_commit: { name: 'git_commit', description: 'Create a git commit', parameters: { message: { type: 'string', description: 'Commit message', required: true } } },
|
|
104
|
+
};
|
|
105
|
+
return toolMap[toolName] ?? { name: toolName, description: toolName, parameters: {} };
|
|
106
|
+
}
|
|
107
|
+
export function exportAgent(agentId) {
|
|
108
|
+
const agent = EXPORTABLE_AGENTS.find(a => a.id === agentId);
|
|
109
|
+
if (!agent)
|
|
110
|
+
return null;
|
|
111
|
+
return {
|
|
112
|
+
version: '1.0',
|
|
113
|
+
agent: {
|
|
114
|
+
name: agent.name,
|
|
115
|
+
description: agent.description,
|
|
116
|
+
instructions: agent.instructions,
|
|
117
|
+
tools: agent.tools.map(kbotToolToGitAgent),
|
|
118
|
+
capabilities: agent.capabilities,
|
|
119
|
+
input_modes: ['text'],
|
|
120
|
+
output_modes: ['text'],
|
|
121
|
+
},
|
|
122
|
+
metadata: {
|
|
123
|
+
source: 'kbot',
|
|
124
|
+
source_version: getVersion(),
|
|
125
|
+
exported_at: new Date().toISOString(),
|
|
126
|
+
agent_id: agentId,
|
|
127
|
+
compatibility: ['openai-assistants', 'claude-code', 'langchain', 'crewai', 'autogen'],
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export function exportAllAgents() {
|
|
132
|
+
return EXPORTABLE_AGENTS.map(a => exportAgent(a.id)).filter(Boolean);
|
|
133
|
+
}
|
|
134
|
+
export function writeGitAgentFile(agentId, outputDir) {
|
|
135
|
+
const manifest = exportAgent(agentId);
|
|
136
|
+
if (!manifest)
|
|
137
|
+
throw new Error(`Agent not found: ${agentId}. Available: ${EXPORTABLE_AGENTS.map(a => a.id).join(', ')}`);
|
|
138
|
+
const dir = outputDir ?? process.cwd();
|
|
139
|
+
if (!existsSync(dir))
|
|
140
|
+
mkdirSync(dir, { recursive: true });
|
|
141
|
+
const filePath = join(dir, `${agentId}.gitagent.json`);
|
|
142
|
+
writeFileSync(filePath, JSON.stringify(manifest, null, 2));
|
|
143
|
+
return filePath;
|
|
144
|
+
}
|
|
145
|
+
export function writeAllGitAgentFiles(outputDir) {
|
|
146
|
+
return EXPORTABLE_AGENTS.map(a => writeGitAgentFile(a.id, outputDir));
|
|
147
|
+
}
|
|
148
|
+
export function listExportableAgents() {
|
|
149
|
+
return EXPORTABLE_AGENTS.map(a => ({ id: a.id, name: a.name, description: a.description }));
|
|
150
|
+
}
|
|
151
|
+
export function formatExportableAgentList() {
|
|
152
|
+
const lines = ['Available agents for GitAgent export:', ''];
|
|
153
|
+
for (const a of EXPORTABLE_AGENTS) {
|
|
154
|
+
lines.push(` ${a.id.padEnd(16)} ${a.description}`);
|
|
155
|
+
}
|
|
156
|
+
lines.push('');
|
|
157
|
+
lines.push('Export: kbot export --format gitagent <agent-id>');
|
|
158
|
+
lines.push('Export all: kbot export --format gitagent --all');
|
|
159
|
+
return lines.join('\n');
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=gitagent-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitagent-export.js","sourceRoot":"","sources":["../src/gitagent-export.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,uEAAuE;AACvE,+DAA+D;AAC/D,EAAE;AACF,kDAAkD;AAGlD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AA8C5E,MAAM,iBAAiB,GAAoB;IACzC;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mFAAmF;QAChG,YAAY,EAAE,6OAA6O;QAC3P,YAAY,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,CAAC;QAC9F,KAAK,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,CAAC;KACvE;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,sEAAsE;QACnF,YAAY,EAAE,6OAA6O;QAC3P,YAAY,EAAE,CAAC,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,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,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IAC1D,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,SAAkB;IACtD,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,CAAA;AACvE,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;AAC7F,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,MAAM,KAAK,GAAG,CAAC,uCAAuC,EAAE,EAAE,CAAC,CAAA;IAC3D,KAAK,MAAM,CAAC,IAAI,iBAAiB,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA;IACrD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACd,KAAK,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAA;IAC9D,KAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAA;IAC7D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface MigrationResult {
|
|
2
|
+
success: boolean;
|
|
3
|
+
imported: number;
|
|
4
|
+
skipped: number;
|
|
5
|
+
errors: string[];
|
|
6
|
+
details: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function detectInstalledAgents(): Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function migrate(sourceId: string): MigrationResult;
|
|
13
|
+
export declare function migrateAll(): MigrationResult;
|
|
14
|
+
export declare function formatMigrationResult(result: MigrationResult): string;
|
|
15
|
+
export declare function formatDetectedAgents(): string;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AA0BA,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAoUD,wBAAgB,qBAAqB,IAAI,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAE3E;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CA0BzD;AAED,wBAAgB,UAAU,IAAI,eAAe,CAc5C;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAwBrE;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAa7C"}
|
package/dist/migrate.js
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
// kbot Migrate — Import configurations and history from other AI CLI agents
|
|
2
|
+
// Supports: Claude Code, Junie CLI, Codex CLI, Aider, Cursor, Cline
|
|
3
|
+
//
|
|
4
|
+
// Usage: kbot migrate --from claude-code
|
|
5
|
+
// kbot migrate --from junie
|
|
6
|
+
// kbot migrate --from aider
|
|
7
|
+
import { homedir } from 'node:os';
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync } from 'node:fs';
|
|
10
|
+
import chalk from 'chalk';
|
|
11
|
+
const KBOT_DIR = join(homedir(), '.kbot');
|
|
12
|
+
function combinedResult(results) {
|
|
13
|
+
return {
|
|
14
|
+
success: results.every(r => r.success),
|
|
15
|
+
imported: results.reduce((s, r) => s + r.imported, 0),
|
|
16
|
+
skipped: results.reduce((s, r) => s + r.skipped, 0),
|
|
17
|
+
errors: results.flatMap(r => r.errors),
|
|
18
|
+
details: results.flatMap(r => r.details),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function emptyResult() {
|
|
22
|
+
return { success: true, imported: 0, skipped: 0, errors: [], details: [] };
|
|
23
|
+
}
|
|
24
|
+
// ── Claude Code ──
|
|
25
|
+
function detectClaudeCode() {
|
|
26
|
+
return existsSync(join(homedir(), '.claude')) || existsSync(join(homedir(), '.claude', 'settings.json'));
|
|
27
|
+
}
|
|
28
|
+
function migrateClaudeCodeConfig() {
|
|
29
|
+
const result = emptyResult();
|
|
30
|
+
const claudeDir = join(homedir(), '.claude');
|
|
31
|
+
// Import CLAUDE.md project instructions as kbot memory
|
|
32
|
+
const claudeMd = join(process.cwd(), 'CLAUDE.md');
|
|
33
|
+
if (existsSync(claudeMd)) {
|
|
34
|
+
try {
|
|
35
|
+
const content = readFileSync(claudeMd, 'utf-8');
|
|
36
|
+
const memDir = join(KBOT_DIR, 'memory');
|
|
37
|
+
mkdirSync(memDir, { recursive: true });
|
|
38
|
+
const memFile = join(memDir, 'imported-claude-md.json');
|
|
39
|
+
writeFileSync(memFile, JSON.stringify({
|
|
40
|
+
source: 'claude-code',
|
|
41
|
+
type: 'project-instructions',
|
|
42
|
+
content,
|
|
43
|
+
importedAt: new Date().toISOString(),
|
|
44
|
+
}, null, 2));
|
|
45
|
+
result.imported++;
|
|
46
|
+
result.details.push('Imported CLAUDE.md as project memory');
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
result.errors.push(`Failed to import CLAUDE.md: ${err instanceof Error ? err.message : String(err)}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Import Claude Code settings
|
|
53
|
+
const settingsFile = join(claudeDir, 'settings.json');
|
|
54
|
+
if (existsSync(settingsFile)) {
|
|
55
|
+
try {
|
|
56
|
+
const settings = JSON.parse(readFileSync(settingsFile, 'utf-8'));
|
|
57
|
+
const importFile = join(KBOT_DIR, 'imports', 'claude-code-settings.json');
|
|
58
|
+
mkdirSync(join(KBOT_DIR, 'imports'), { recursive: true });
|
|
59
|
+
writeFileSync(importFile, JSON.stringify({
|
|
60
|
+
source: 'claude-code',
|
|
61
|
+
type: 'settings',
|
|
62
|
+
original: settings,
|
|
63
|
+
importedAt: new Date().toISOString(),
|
|
64
|
+
}, null, 2));
|
|
65
|
+
result.imported++;
|
|
66
|
+
result.details.push('Imported Claude Code settings');
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
result.errors.push(`Failed to import settings: ${err instanceof Error ? err.message : String(err)}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
function migrateClaudeCodeHistory() {
|
|
75
|
+
const result = emptyResult();
|
|
76
|
+
const claudeDir = join(homedir(), '.claude');
|
|
77
|
+
const projectsDir = join(claudeDir, 'projects');
|
|
78
|
+
if (!existsSync(projectsDir))
|
|
79
|
+
return result;
|
|
80
|
+
try {
|
|
81
|
+
const projects = readdirSync(projectsDir, { withFileTypes: true }).filter((d) => d.isDirectory());
|
|
82
|
+
const sessionsDir = join(KBOT_DIR, 'sessions');
|
|
83
|
+
mkdirSync(sessionsDir, { recursive: true });
|
|
84
|
+
for (const project of projects) {
|
|
85
|
+
const convDir = join(projectsDir, project.name);
|
|
86
|
+
const files = readdirSync(convDir).filter((f) => f.endsWith('.json'));
|
|
87
|
+
for (const file of files.slice(0, 10)) { // limit to 10 most recent
|
|
88
|
+
try {
|
|
89
|
+
const data = JSON.parse(readFileSync(join(convDir, file), 'utf-8'));
|
|
90
|
+
const sessionId = `imported-cc-${project.name}-${file.replace('.json', '')}`;
|
|
91
|
+
const sessionFile = join(sessionsDir, `${sessionId}.json`);
|
|
92
|
+
if (existsSync(sessionFile)) {
|
|
93
|
+
result.skipped++;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
writeFileSync(sessionFile, JSON.stringify({
|
|
97
|
+
id: sessionId,
|
|
98
|
+
name: `[Claude Code] ${project.name}`,
|
|
99
|
+
created: data.created || new Date().toISOString(),
|
|
100
|
+
updated: data.updated || new Date().toISOString(),
|
|
101
|
+
cwd: data.cwd || process.cwd(),
|
|
102
|
+
turnCount: Array.isArray(data.messages) ? data.messages.length : 0,
|
|
103
|
+
preview: 'Imported from Claude Code',
|
|
104
|
+
history: Array.isArray(data.messages)
|
|
105
|
+
? data.messages.slice(0, 50).map((m) => ({
|
|
106
|
+
role: m.role || 'user',
|
|
107
|
+
content: typeof m.content === 'string' ? m.content : JSON.stringify(m.content),
|
|
108
|
+
}))
|
|
109
|
+
: [],
|
|
110
|
+
source: 'claude-code',
|
|
111
|
+
}, null, 2));
|
|
112
|
+
result.imported++;
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
result.skipped++;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (result.imported > 0) {
|
|
120
|
+
result.details.push(`Imported ${result.imported} conversation(s) from Claude Code`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
result.errors.push(`History migration failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
// ── Junie CLI ──
|
|
129
|
+
function detectJunie() {
|
|
130
|
+
return existsSync(join(homedir(), '.junie')) || existsSync(join(homedir(), '.config', 'junie'));
|
|
131
|
+
}
|
|
132
|
+
function migrateJunieConfig() {
|
|
133
|
+
const result = emptyResult();
|
|
134
|
+
const junieDirs = [join(homedir(), '.junie'), join(homedir(), '.config', 'junie')];
|
|
135
|
+
for (const dir of junieDirs) {
|
|
136
|
+
const configFile = join(dir, 'config.json');
|
|
137
|
+
if (existsSync(configFile)) {
|
|
138
|
+
try {
|
|
139
|
+
const config = JSON.parse(readFileSync(configFile, 'utf-8'));
|
|
140
|
+
mkdirSync(join(KBOT_DIR, 'imports'), { recursive: true });
|
|
141
|
+
writeFileSync(join(KBOT_DIR, 'imports', 'junie-config.json'), JSON.stringify({
|
|
142
|
+
source: 'junie',
|
|
143
|
+
type: 'config',
|
|
144
|
+
original: config,
|
|
145
|
+
importedAt: new Date().toISOString(),
|
|
146
|
+
}, null, 2));
|
|
147
|
+
result.imported++;
|
|
148
|
+
result.details.push('Imported Junie CLI configuration');
|
|
149
|
+
// Map Junie provider keys to kbot format
|
|
150
|
+
if (config.apiKey && config.provider) {
|
|
151
|
+
result.details.push(`Detected ${config.provider} API key — run 'kbot auth' to configure provider`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
result.errors.push(`Failed to read Junie config: ${err instanceof Error ? err.message : String(err)}`);
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
function migrateJunieHistory() {
|
|
163
|
+
return emptyResult(); // Junie CLI is new — history format TBD
|
|
164
|
+
}
|
|
165
|
+
// ── Aider ──
|
|
166
|
+
function detectAider() {
|
|
167
|
+
return existsSync(join(homedir(), '.aider.conf.yml')) ||
|
|
168
|
+
existsSync(join(homedir(), '.aider'));
|
|
169
|
+
}
|
|
170
|
+
function migrateAiderConfig() {
|
|
171
|
+
const result = emptyResult();
|
|
172
|
+
const confFile = join(homedir(), '.aider.conf.yml');
|
|
173
|
+
if (existsSync(confFile)) {
|
|
174
|
+
try {
|
|
175
|
+
const content = readFileSync(confFile, 'utf-8');
|
|
176
|
+
mkdirSync(join(KBOT_DIR, 'imports'), { recursive: true });
|
|
177
|
+
writeFileSync(join(KBOT_DIR, 'imports', 'aider-config.yml'), content);
|
|
178
|
+
result.imported++;
|
|
179
|
+
result.details.push('Imported Aider configuration');
|
|
180
|
+
// Parse YAML-like key detection
|
|
181
|
+
if (content.includes('openai-api-key') || content.includes('OPENAI_API_KEY')) {
|
|
182
|
+
result.details.push('Detected OpenAI API key reference — run \'kbot auth\' to configure');
|
|
183
|
+
}
|
|
184
|
+
if (content.includes('anthropic-api-key') || content.includes('ANTHROPIC_API_KEY')) {
|
|
185
|
+
result.details.push('Detected Anthropic API key reference — run \'kbot auth\' to configure');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
result.errors.push(`Failed to read Aider config: ${err instanceof Error ? err.message : String(err)}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
function migrateAiderHistory() {
|
|
195
|
+
const result = emptyResult();
|
|
196
|
+
// Aider stores chat history in .aider.chat.history.md
|
|
197
|
+
const historyFile = join(process.cwd(), '.aider.chat.history.md');
|
|
198
|
+
if (existsSync(historyFile)) {
|
|
199
|
+
try {
|
|
200
|
+
const content = readFileSync(historyFile, 'utf-8');
|
|
201
|
+
const sessionsDir = join(KBOT_DIR, 'sessions');
|
|
202
|
+
mkdirSync(sessionsDir, { recursive: true });
|
|
203
|
+
const sessionFile = join(sessionsDir, 'imported-aider-history.json');
|
|
204
|
+
if (!existsSync(sessionFile)) {
|
|
205
|
+
writeFileSync(sessionFile, JSON.stringify({
|
|
206
|
+
id: 'imported-aider-history',
|
|
207
|
+
name: '[Aider] Chat History',
|
|
208
|
+
created: new Date().toISOString(),
|
|
209
|
+
updated: new Date().toISOString(),
|
|
210
|
+
cwd: process.cwd(),
|
|
211
|
+
turnCount: 1,
|
|
212
|
+
preview: 'Imported from Aider chat history',
|
|
213
|
+
history: [{ role: 'assistant', content: content.slice(0, 50_000) }],
|
|
214
|
+
source: 'aider',
|
|
215
|
+
}, null, 2));
|
|
216
|
+
result.imported++;
|
|
217
|
+
result.details.push('Imported Aider chat history');
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
result.skipped++;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
catch (err) {
|
|
224
|
+
result.errors.push(`Failed to import Aider history: ${err instanceof Error ? err.message : String(err)}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return result;
|
|
228
|
+
}
|
|
229
|
+
// ── Codex CLI ──
|
|
230
|
+
function detectCodex() {
|
|
231
|
+
return existsSync(join(homedir(), '.codex')) || existsSync(join(homedir(), '.config', 'codex'));
|
|
232
|
+
}
|
|
233
|
+
function migrateCodexConfig() {
|
|
234
|
+
const result = emptyResult();
|
|
235
|
+
const codexDirs = [join(homedir(), '.codex'), join(homedir(), '.config', 'codex')];
|
|
236
|
+
for (const dir of codexDirs) {
|
|
237
|
+
if (existsSync(dir)) {
|
|
238
|
+
try {
|
|
239
|
+
const files = readdirSync(dir).filter((f) => f.endsWith('.json'));
|
|
240
|
+
mkdirSync(join(KBOT_DIR, 'imports'), { recursive: true });
|
|
241
|
+
for (const file of files) {
|
|
242
|
+
const content = readFileSync(join(dir, file), 'utf-8');
|
|
243
|
+
writeFileSync(join(KBOT_DIR, 'imports', `codex-${file}`), content);
|
|
244
|
+
result.imported++;
|
|
245
|
+
}
|
|
246
|
+
if (result.imported > 0) {
|
|
247
|
+
result.details.push(`Imported ${result.imported} Codex config file(s)`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
catch (err) {
|
|
251
|
+
result.errors.push(`Failed to read Codex config: ${err instanceof Error ? err.message : String(err)}`);
|
|
252
|
+
}
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return result;
|
|
257
|
+
}
|
|
258
|
+
function migrateCodexHistory() {
|
|
259
|
+
return emptyResult();
|
|
260
|
+
}
|
|
261
|
+
// ── Source Registry ──
|
|
262
|
+
const SOURCES = [
|
|
263
|
+
{
|
|
264
|
+
id: 'claude-code',
|
|
265
|
+
name: 'Claude Code',
|
|
266
|
+
configPaths: [join(homedir(), '.claude')],
|
|
267
|
+
historyPaths: [join(homedir(), '.claude', 'projects')],
|
|
268
|
+
detect: detectClaudeCode,
|
|
269
|
+
migrateConfig: migrateClaudeCodeConfig,
|
|
270
|
+
migrateHistory: migrateClaudeCodeHistory,
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
id: 'junie',
|
|
274
|
+
name: 'Junie CLI',
|
|
275
|
+
configPaths: [join(homedir(), '.junie'), join(homedir(), '.config', 'junie')],
|
|
276
|
+
historyPaths: [],
|
|
277
|
+
detect: detectJunie,
|
|
278
|
+
migrateConfig: migrateJunieConfig,
|
|
279
|
+
migrateHistory: migrateJunieHistory,
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
id: 'aider',
|
|
283
|
+
name: 'Aider',
|
|
284
|
+
configPaths: [join(homedir(), '.aider.conf.yml')],
|
|
285
|
+
historyPaths: [join(process.cwd(), '.aider.chat.history.md')],
|
|
286
|
+
detect: detectAider,
|
|
287
|
+
migrateConfig: migrateAiderConfig,
|
|
288
|
+
migrateHistory: migrateAiderHistory,
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
id: 'codex',
|
|
292
|
+
name: 'Codex CLI',
|
|
293
|
+
configPaths: [join(homedir(), '.codex'), join(homedir(), '.config', 'codex')],
|
|
294
|
+
historyPaths: [],
|
|
295
|
+
detect: detectCodex,
|
|
296
|
+
migrateConfig: migrateCodexConfig,
|
|
297
|
+
migrateHistory: migrateCodexHistory,
|
|
298
|
+
},
|
|
299
|
+
];
|
|
300
|
+
// ── Public API ──
|
|
301
|
+
export function detectInstalledAgents() {
|
|
302
|
+
return SOURCES.filter(s => s.detect()).map(s => ({ id: s.id, name: s.name }));
|
|
303
|
+
}
|
|
304
|
+
export function migrate(sourceId) {
|
|
305
|
+
const source = SOURCES.find(s => s.id === sourceId);
|
|
306
|
+
if (!source) {
|
|
307
|
+
return {
|
|
308
|
+
success: false,
|
|
309
|
+
imported: 0,
|
|
310
|
+
skipped: 0,
|
|
311
|
+
errors: [`Unknown source: ${sourceId}. Available: ${SOURCES.map(s => s.id).join(', ')}`],
|
|
312
|
+
details: [],
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
if (!source.detect()) {
|
|
316
|
+
return {
|
|
317
|
+
success: false,
|
|
318
|
+
imported: 0,
|
|
319
|
+
skipped: 0,
|
|
320
|
+
errors: [`${source.name} not detected on this system.`],
|
|
321
|
+
details: [],
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
mkdirSync(KBOT_DIR, { recursive: true });
|
|
325
|
+
const configResult = source.migrateConfig();
|
|
326
|
+
const historyResult = source.migrateHistory();
|
|
327
|
+
return combinedResult([configResult, historyResult]);
|
|
328
|
+
}
|
|
329
|
+
export function migrateAll() {
|
|
330
|
+
const detected = detectInstalledAgents();
|
|
331
|
+
if (detected.length === 0) {
|
|
332
|
+
return {
|
|
333
|
+
success: true,
|
|
334
|
+
imported: 0,
|
|
335
|
+
skipped: 0,
|
|
336
|
+
errors: [],
|
|
337
|
+
details: ['No other AI agents detected on this system.'],
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
const results = detected.map(d => migrate(d.id));
|
|
341
|
+
return combinedResult(results);
|
|
342
|
+
}
|
|
343
|
+
export function formatMigrationResult(result) {
|
|
344
|
+
const lines = [];
|
|
345
|
+
if (result.success && result.imported > 0) {
|
|
346
|
+
lines.push(chalk.green(`Migration complete: ${result.imported} item(s) imported`));
|
|
347
|
+
}
|
|
348
|
+
else if (result.imported === 0 && result.errors.length === 0) {
|
|
349
|
+
lines.push(chalk.yellow('Nothing to import.'));
|
|
350
|
+
}
|
|
351
|
+
else if (!result.success) {
|
|
352
|
+
lines.push(chalk.red('Migration completed with errors.'));
|
|
353
|
+
}
|
|
354
|
+
if (result.skipped > 0) {
|
|
355
|
+
lines.push(chalk.dim(` Skipped: ${result.skipped} (already imported)`));
|
|
356
|
+
}
|
|
357
|
+
for (const detail of result.details) {
|
|
358
|
+
lines.push(chalk.dim(` ${detail}`));
|
|
359
|
+
}
|
|
360
|
+
for (const error of result.errors) {
|
|
361
|
+
lines.push(chalk.red(` Error: ${error}`));
|
|
362
|
+
}
|
|
363
|
+
return lines.join('\n');
|
|
364
|
+
}
|
|
365
|
+
export function formatDetectedAgents() {
|
|
366
|
+
const detected = detectInstalledAgents();
|
|
367
|
+
if (detected.length === 0) {
|
|
368
|
+
return chalk.dim('No other AI agents detected.');
|
|
369
|
+
}
|
|
370
|
+
const lines = ['Detected AI agents:', ''];
|
|
371
|
+
for (const agent of detected) {
|
|
372
|
+
lines.push(` ${chalk.green('●')} ${agent.name} (${agent.id})`);
|
|
373
|
+
}
|
|
374
|
+
lines.push('');
|
|
375
|
+
lines.push(`Run ${chalk.cyan('kbot migrate --from <id>')} to import, or ${chalk.cyan('kbot migrate --all')} to import all.`);
|
|
376
|
+
return lines.join('\n');
|
|
377
|
+
}
|
|
378
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,oEAAoE;AACpE,EAAE;AACF,yCAAyC;AACzC,mCAAmC;AACnC,mCAAmC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAA;AAsBzC,SAAS,cAAc,CAAC,OAA0B;IAChD,OAAO;QACL,OA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