claude-cognitive 0.1.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/LICENSE +21 -0
- package/README.md +256 -0
- package/bin/claude-cognitive.js +9 -0
- package/dist/agents/context.d.ts +40 -0
- package/dist/agents/context.d.ts.map +1 -0
- package/dist/agents/context.js +144 -0
- package/dist/agents/context.js.map +1 -0
- package/dist/agents/index.d.ts +9 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +11 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/loader.d.ts +48 -0
- package/dist/agents/loader.d.ts.map +1 -0
- package/dist/agents/loader.js +157 -0
- package/dist/agents/loader.js.map +1 -0
- package/dist/agents/templates.d.ts +51 -0
- package/dist/agents/templates.d.ts.map +1 -0
- package/dist/agents/templates.js +186 -0
- package/dist/agents/templates.js.map +1 -0
- package/dist/agents/types.d.ts +52 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +6 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/cli/commands/config.d.ts +10 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +22 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/index.d.ts +17 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +17 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/init.d.ts +10 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +109 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/install.d.ts +10 -0
- package/dist/cli/commands/install.d.ts.map +1 -0
- package/dist/cli/commands/install.js +440 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/learn.d.ts +10 -0
- package/dist/cli/commands/learn.d.ts.map +1 -0
- package/dist/cli/commands/learn.js +33 -0
- package/dist/cli/commands/learn.js.map +1 -0
- package/dist/cli/commands/recall.d.ts +10 -0
- package/dist/cli/commands/recall.d.ts.map +1 -0
- package/dist/cli/commands/recall.js +52 -0
- package/dist/cli/commands/recall.js.map +1 -0
- package/dist/cli/commands/reflect.d.ts +10 -0
- package/dist/cli/commands/reflect.d.ts.map +1 -0
- package/dist/cli/commands/reflect.js +48 -0
- package/dist/cli/commands/reflect.js.map +1 -0
- package/dist/cli/commands/semantic.d.ts +10 -0
- package/dist/cli/commands/semantic.d.ts.map +1 -0
- package/dist/cli/commands/semantic.js +67 -0
- package/dist/cli/commands/semantic.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +10 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +61 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/status.d.ts +10 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +44 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +10 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +260 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/commands/uninstall.d.ts +10 -0
- package/dist/cli/commands/uninstall.d.ts.map +1 -0
- package/dist/cli/commands/uninstall.js +205 -0
- package/dist/cli/commands/uninstall.js.map +1 -0
- package/dist/cli/commands/update-bank.d.ts +10 -0
- package/dist/cli/commands/update-bank.d.ts.map +1 -0
- package/dist/cli/commands/update-bank.js +129 -0
- package/dist/cli/commands/update-bank.js.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +56 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/utils/errors.d.ts +42 -0
- package/dist/cli/utils/errors.d.ts.map +1 -0
- package/dist/cli/utils/errors.js +78 -0
- package/dist/cli/utils/errors.js.map +1 -0
- package/dist/cli/utils/index.d.ts +9 -0
- package/dist/cli/utils/index.d.ts.map +1 -0
- package/dist/cli/utils/index.js +7 -0
- package/dist/cli/utils/index.js.map +1 -0
- package/dist/cli/utils/output.d.ts +90 -0
- package/dist/cli/utils/output.d.ts.map +1 -0
- package/dist/cli/utils/output.js +164 -0
- package/dist/cli/utils/output.js.map +1 -0
- package/dist/client.d.ts +200 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +447 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +44 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +264 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +72 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +188 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +148 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +115 -0
- package/dist/events.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/inject-context.d.ts +18 -0
- package/dist/hooks/inject-context.d.ts.map +1 -0
- package/dist/hooks/inject-context.js +57 -0
- package/dist/hooks/inject-context.js.map +1 -0
- package/dist/hooks/process-session.d.ts +18 -0
- package/dist/hooks/process-session.d.ts.map +1 -0
- package/dist/hooks/process-session.js +119 -0
- package/dist/hooks/process-session.js.map +1 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/learn/analyzers/git.d.ts +62 -0
- package/dist/learn/analyzers/git.d.ts.map +1 -0
- package/dist/learn/analyzers/git.js +183 -0
- package/dist/learn/analyzers/git.js.map +1 -0
- package/dist/learn/analyzers/index.d.ts +15 -0
- package/dist/learn/analyzers/index.d.ts.map +1 -0
- package/dist/learn/analyzers/index.js +10 -0
- package/dist/learn/analyzers/index.js.map +1 -0
- package/dist/learn/analyzers/package.d.ts +57 -0
- package/dist/learn/analyzers/package.d.ts.map +1 -0
- package/dist/learn/analyzers/package.js +245 -0
- package/dist/learn/analyzers/package.js.map +1 -0
- package/dist/learn/analyzers/readme.d.ts +27 -0
- package/dist/learn/analyzers/readme.d.ts.map +1 -0
- package/dist/learn/analyzers/readme.js +163 -0
- package/dist/learn/analyzers/readme.js.map +1 -0
- package/dist/learn/analyzers/source.d.ts +70 -0
- package/dist/learn/analyzers/source.d.ts.map +1 -0
- package/dist/learn/analyzers/source.js +231 -0
- package/dist/learn/analyzers/source.js.map +1 -0
- package/dist/learn/analyzers/structure.d.ts +39 -0
- package/dist/learn/analyzers/structure.d.ts.map +1 -0
- package/dist/learn/analyzers/structure.js +172 -0
- package/dist/learn/analyzers/structure.js.map +1 -0
- package/dist/learn/extractor.d.ts +76 -0
- package/dist/learn/extractor.d.ts.map +1 -0
- package/dist/learn/extractor.js +302 -0
- package/dist/learn/extractor.js.map +1 -0
- package/dist/learn/index.d.ts +31 -0
- package/dist/learn/index.d.ts.map +1 -0
- package/dist/learn/index.js +165 -0
- package/dist/learn/index.js.map +1 -0
- package/dist/mcp/handlers.d.ts +23 -0
- package/dist/mcp/handlers.d.ts.map +1 -0
- package/dist/mcp/handlers.js +124 -0
- package/dist/mcp/handlers.js.map +1 -0
- package/dist/mcp/index.d.ts +32 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +40 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +79 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +277 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +59 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +43 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/types.d.ts +65 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +6 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/mind.d.ts +250 -0
- package/dist/mind.d.ts.map +1 -0
- package/dist/mind.js +637 -0
- package/dist/mind.js.map +1 -0
- package/dist/promotion.d.ts +112 -0
- package/dist/promotion.d.ts.map +1 -0
- package/dist/promotion.js +196 -0
- package/dist/promotion.js.map +1 -0
- package/dist/retry.d.ts +70 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +122 -0
- package/dist/retry.js.map +1 -0
- package/dist/semantic.d.ts +202 -0
- package/dist/semantic.d.ts.map +1 -0
- package/dist/semantic.js +424 -0
- package/dist/semantic.js.map +1 -0
- package/dist/types.d.ts +363 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +30 -0
- package/dist/types.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom agent template loading from .claude/agents/ directory.
|
|
3
|
+
* @module agents/loader
|
|
4
|
+
*/
|
|
5
|
+
import { readFile, readdir, stat } from "node:fs/promises";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
/**
|
|
8
|
+
* Parse a markdown agent template file.
|
|
9
|
+
*
|
|
10
|
+
* Expected format:
|
|
11
|
+
* ```markdown
|
|
12
|
+
* # Agent: name
|
|
13
|
+
*
|
|
14
|
+
* ## Mission
|
|
15
|
+
* ...
|
|
16
|
+
*
|
|
17
|
+
* ## Tools Available
|
|
18
|
+
* - Tool 1
|
|
19
|
+
* - Tool 2
|
|
20
|
+
*
|
|
21
|
+
* ## Output Format
|
|
22
|
+
* ...
|
|
23
|
+
*
|
|
24
|
+
* ## Constraints
|
|
25
|
+
* - Constraint 1
|
|
26
|
+
* - Constraint 2
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param content - Markdown file content
|
|
30
|
+
* @returns Parsed AgentTemplate, or null if parsing failed
|
|
31
|
+
*/
|
|
32
|
+
export function parseAgentMarkdown(content) {
|
|
33
|
+
const lines = content.split("\n");
|
|
34
|
+
// Extract name from # Agent: name
|
|
35
|
+
const nameLine = lines.find((l) => l.startsWith("# Agent:"));
|
|
36
|
+
if (!nameLine)
|
|
37
|
+
return null;
|
|
38
|
+
const name = nameLine.replace("# Agent:", "").trim();
|
|
39
|
+
if (!name)
|
|
40
|
+
return null;
|
|
41
|
+
// Parse sections
|
|
42
|
+
const sections = {};
|
|
43
|
+
let currentSection = "";
|
|
44
|
+
let currentContent = [];
|
|
45
|
+
for (const line of lines) {
|
|
46
|
+
if (line.startsWith("## ")) {
|
|
47
|
+
if (currentSection) {
|
|
48
|
+
sections[currentSection] = currentContent.join("\n").trim();
|
|
49
|
+
}
|
|
50
|
+
currentSection = line.replace("## ", "").trim();
|
|
51
|
+
currentContent = [];
|
|
52
|
+
}
|
|
53
|
+
else if (currentSection) {
|
|
54
|
+
currentContent.push(line);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Don't forget the last section
|
|
58
|
+
if (currentSection) {
|
|
59
|
+
sections[currentSection] = currentContent.join("\n").trim();
|
|
60
|
+
}
|
|
61
|
+
// Build template
|
|
62
|
+
return {
|
|
63
|
+
name,
|
|
64
|
+
mission: sections["Mission"] || "",
|
|
65
|
+
tools: parseList(sections["Tools Available"] || ""),
|
|
66
|
+
outputFormat: sections["Output Format"] || "",
|
|
67
|
+
constraints: parseList(sections["Constraints"] || ""),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Parse a markdown list into an array of strings.
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
function parseList(content) {
|
|
75
|
+
return content
|
|
76
|
+
.split("\n")
|
|
77
|
+
.filter((l) => l.trim().startsWith("-") || l.trim().startsWith("*"))
|
|
78
|
+
.map((l) => {
|
|
79
|
+
// Remove list marker and leading whitespace
|
|
80
|
+
let text = l.replace(/^[\s\-\*]+/, "").trim();
|
|
81
|
+
// Remove bold markers if present
|
|
82
|
+
text = text.replace(/\*\*([^*]+)\*\*/g, "$1");
|
|
83
|
+
return text;
|
|
84
|
+
})
|
|
85
|
+
.filter(Boolean);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Load custom agents from .claude/agents/ directory.
|
|
89
|
+
*
|
|
90
|
+
* @param projectPath - Project root directory
|
|
91
|
+
* @returns Array of custom agent templates
|
|
92
|
+
*/
|
|
93
|
+
export async function loadCustomAgents(projectPath) {
|
|
94
|
+
const agentsDir = join(projectPath, ".claude", "agents");
|
|
95
|
+
// Check if directory exists
|
|
96
|
+
try {
|
|
97
|
+
const dirStat = await stat(agentsDir);
|
|
98
|
+
if (!dirStat.isDirectory())
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return []; // Directory doesn't exist
|
|
103
|
+
}
|
|
104
|
+
// Read all .md files
|
|
105
|
+
const files = await readdir(agentsDir);
|
|
106
|
+
const templates = [];
|
|
107
|
+
for (const file of files) {
|
|
108
|
+
if (!file.endsWith(".md"))
|
|
109
|
+
continue;
|
|
110
|
+
try {
|
|
111
|
+
const content = await readFile(join(agentsDir, file), "utf-8");
|
|
112
|
+
const template = parseAgentMarkdown(content);
|
|
113
|
+
if (template) {
|
|
114
|
+
templates.push(template);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// Skip invalid files
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return templates;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Generate markdown content from an agent template.
|
|
125
|
+
*
|
|
126
|
+
* Useful for creating template files programmatically.
|
|
127
|
+
*
|
|
128
|
+
* @param template - Agent template to convert
|
|
129
|
+
* @returns Markdown string
|
|
130
|
+
*/
|
|
131
|
+
export function templateToMarkdown(template) {
|
|
132
|
+
const sections = [];
|
|
133
|
+
sections.push(`# Agent: ${template.name}`);
|
|
134
|
+
sections.push("");
|
|
135
|
+
sections.push("## Mission");
|
|
136
|
+
sections.push("");
|
|
137
|
+
sections.push(template.mission);
|
|
138
|
+
sections.push("");
|
|
139
|
+
sections.push("## Tools Available");
|
|
140
|
+
sections.push("");
|
|
141
|
+
for (const tool of template.tools) {
|
|
142
|
+
sections.push(`- ${tool}`);
|
|
143
|
+
}
|
|
144
|
+
sections.push("");
|
|
145
|
+
sections.push("## Output Format");
|
|
146
|
+
sections.push("");
|
|
147
|
+
sections.push(template.outputFormat);
|
|
148
|
+
sections.push("");
|
|
149
|
+
sections.push("## Constraints");
|
|
150
|
+
sections.push("");
|
|
151
|
+
for (const constraint of template.constraints) {
|
|
152
|
+
sections.push(`- ${constraint}`);
|
|
153
|
+
}
|
|
154
|
+
sections.push("");
|
|
155
|
+
return sections.join("\n");
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/agents/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAElC,kCAAkC;IAClC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7D,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACrD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,iBAAiB;IACjB,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAC5C,IAAI,cAAc,GAAG,EAAE,CAAC;I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C,KAAK,UAAU,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAElB,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in agent template definitions.
|
|
3
|
+
* @module agents/templates
|
|
4
|
+
*/
|
|
5
|
+
import type { AgentTemplate, BuiltInAgentType } from "./types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Code Explorer agent template.
|
|
8
|
+
*
|
|
9
|
+
* Specializes in read-only codebase analysis, tracing execution paths,
|
|
10
|
+
* mapping architecture, and documenting dependencies.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CODE_EXPLORER_TEMPLATE: AgentTemplate;
|
|
13
|
+
/**
|
|
14
|
+
* Code Architect agent template.
|
|
15
|
+
*
|
|
16
|
+
* Specializes in designing implementation solutions and creating
|
|
17
|
+
* technical blueprints.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CODE_ARCHITECT_TEMPLATE: AgentTemplate;
|
|
20
|
+
/**
|
|
21
|
+
* Code Reviewer agent template.
|
|
22
|
+
*
|
|
23
|
+
* Specializes in reviewing code changes for quality, correctness,
|
|
24
|
+
* and adherence to project patterns.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CODE_REVIEWER_TEMPLATE: AgentTemplate;
|
|
27
|
+
/**
|
|
28
|
+
* Map of built-in agent templates.
|
|
29
|
+
*/
|
|
30
|
+
export declare const BUILT_IN_TEMPLATES: Record<BuiltInAgentType, AgentTemplate>;
|
|
31
|
+
/**
|
|
32
|
+
* Get a built-in agent template by name.
|
|
33
|
+
*
|
|
34
|
+
* @param name - Built-in agent type name
|
|
35
|
+
* @returns Agent template
|
|
36
|
+
*/
|
|
37
|
+
export declare function getBuiltInTemplate(name: BuiltInAgentType): AgentTemplate;
|
|
38
|
+
/**
|
|
39
|
+
* Get all built-in agent templates.
|
|
40
|
+
*
|
|
41
|
+
* @returns Array of all built-in templates
|
|
42
|
+
*/
|
|
43
|
+
export declare function getAllBuiltInTemplates(): AgentTemplate[];
|
|
44
|
+
/**
|
|
45
|
+
* Check if a name is a built-in agent type.
|
|
46
|
+
*
|
|
47
|
+
* @param name - Agent name to check
|
|
48
|
+
* @returns True if it's a built-in type
|
|
49
|
+
*/
|
|
50
|
+
export declare function isBuiltInAgent(name: string): name is BuiltInAgentType;
|
|
51
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/agents/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAmCpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,aA6CrC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,aA8CpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAItE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,aAAa,CAExE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,aAAa,EAAE,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,gBAAgB,CAErE"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in agent template definitions.
|
|
3
|
+
* @module agents/templates
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Code Explorer agent template.
|
|
7
|
+
*
|
|
8
|
+
* Specializes in read-only codebase analysis, tracing execution paths,
|
|
9
|
+
* mapping architecture, and documenting dependencies.
|
|
10
|
+
*/
|
|
11
|
+
export const CODE_EXPLORER_TEMPLATE = {
|
|
12
|
+
name: "code-explorer",
|
|
13
|
+
mission: `Deeply analyze existing codebase features by tracing execution paths,
|
|
14
|
+
mapping architecture layers, and documenting dependencies. Your goal is to
|
|
15
|
+
build understanding, not to make changes.`,
|
|
16
|
+
tools: [
|
|
17
|
+
"Glob - Find files by pattern",
|
|
18
|
+
"Grep - Search file contents",
|
|
19
|
+
"Read - Read file contents",
|
|
20
|
+
"LSP - Go to definition, find references",
|
|
21
|
+
"Bash - Read-only commands (ls, git log, etc.)",
|
|
22
|
+
],
|
|
23
|
+
outputFormat: `Return findings in structured format:
|
|
24
|
+
|
|
25
|
+
## Key Files Discovered
|
|
26
|
+
- [file path]: [purpose/role]
|
|
27
|
+
|
|
28
|
+
## Architecture Patterns
|
|
29
|
+
- [pattern name]: [description and examples]
|
|
30
|
+
|
|
31
|
+
## Dependencies Mapped
|
|
32
|
+
- [component/module]: depends on [list of dependencies]
|
|
33
|
+
|
|
34
|
+
## Code Flow
|
|
35
|
+
- [entry point] -> [step 1] -> [step 2] -> [result]
|
|
36
|
+
|
|
37
|
+
## Recommendations
|
|
38
|
+
- [actionable insights for next steps]`,
|
|
39
|
+
constraints: [
|
|
40
|
+
"Read-only operations only - no file modifications",
|
|
41
|
+
"No memory operations - orchestrator handles memory",
|
|
42
|
+
"Focus on assigned exploration task",
|
|
43
|
+
"Report findings, do not implement changes",
|
|
44
|
+
"Ask orchestrator for clarification if scope is unclear",
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Code Architect agent template.
|
|
49
|
+
*
|
|
50
|
+
* Specializes in designing implementation solutions and creating
|
|
51
|
+
* technical blueprints.
|
|
52
|
+
*/
|
|
53
|
+
export const CODE_ARCHITECT_TEMPLATE = {
|
|
54
|
+
name: "code-architect",
|
|
55
|
+
mission: `Design implementation solutions and create technical blueprints.
|
|
56
|
+
Analyze requirements, consider trade-offs, and produce detailed plans that
|
|
57
|
+
others can follow to implement features correctly.`,
|
|
58
|
+
tools: [
|
|
59
|
+
"Glob - Find files by pattern",
|
|
60
|
+
"Grep - Search file contents",
|
|
61
|
+
"Read - Read file contents",
|
|
62
|
+
"LSP - Understand code structure",
|
|
63
|
+
"WebSearch - Research best practices",
|
|
64
|
+
"WebFetch - Read documentation",
|
|
65
|
+
],
|
|
66
|
+
outputFormat: `Return design in structured format:
|
|
67
|
+
|
|
68
|
+
## Problem Analysis
|
|
69
|
+
- Requirements understood
|
|
70
|
+
- Constraints identified
|
|
71
|
+
- Existing patterns to follow
|
|
72
|
+
|
|
73
|
+
## Proposed Solution
|
|
74
|
+
- Architecture overview
|
|
75
|
+
- Key components and their responsibilities
|
|
76
|
+
- Data flow
|
|
77
|
+
|
|
78
|
+
## Implementation Plan
|
|
79
|
+
1. [Step with specific files/changes]
|
|
80
|
+
2. [Step with specific files/changes]
|
|
81
|
+
...
|
|
82
|
+
|
|
83
|
+
## Files to Create/Modify
|
|
84
|
+
- [path]: [what changes]
|
|
85
|
+
|
|
86
|
+
## Trade-offs Considered
|
|
87
|
+
- [option A] vs [option B]: chose [X] because [reasoning]
|
|
88
|
+
|
|
89
|
+
## Risks and Mitigations
|
|
90
|
+
- [risk]: [mitigation strategy]`,
|
|
91
|
+
constraints: [
|
|
92
|
+
"Design only - do not implement",
|
|
93
|
+
"No memory operations - orchestrator handles memory",
|
|
94
|
+
"Consider existing patterns in the codebase",
|
|
95
|
+
"Provide specific, actionable steps",
|
|
96
|
+
"Highlight uncertainty where it exists",
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Code Reviewer agent template.
|
|
101
|
+
*
|
|
102
|
+
* Specializes in reviewing code changes for quality, correctness,
|
|
103
|
+
* and adherence to project patterns.
|
|
104
|
+
*/
|
|
105
|
+
export const CODE_REVIEWER_TEMPLATE = {
|
|
106
|
+
name: "code-reviewer",
|
|
107
|
+
mission: `Review code changes for quality, correctness, and adherence to
|
|
108
|
+
project patterns. Identify bugs, security issues, performance problems,
|
|
109
|
+
and maintainability concerns. Provide constructive feedback.`,
|
|
110
|
+
tools: [
|
|
111
|
+
"Read - Read file contents",
|
|
112
|
+
"Grep - Search for patterns",
|
|
113
|
+
"Bash - git diff, git log (read-only)",
|
|
114
|
+
"LSP - Check types, find usages",
|
|
115
|
+
],
|
|
116
|
+
outputFormat: `Return review in structured format:
|
|
117
|
+
|
|
118
|
+
## Summary
|
|
119
|
+
- Overall assessment: [approve/request changes/needs discussion]
|
|
120
|
+
- Risk level: [low/medium/high]
|
|
121
|
+
|
|
122
|
+
## Issues Found
|
|
123
|
+
|
|
124
|
+
### Critical (must fix)
|
|
125
|
+
- [file:line]: [issue description]
|
|
126
|
+
|
|
127
|
+
### Major (should fix)
|
|
128
|
+
- [file:line]: [issue description]
|
|
129
|
+
|
|
130
|
+
### Minor (nice to fix)
|
|
131
|
+
- [file:line]: [issue description]
|
|
132
|
+
|
|
133
|
+
## Positive Observations
|
|
134
|
+
- [what was done well]
|
|
135
|
+
|
|
136
|
+
## Suggestions
|
|
137
|
+
- [improvement ideas, not blocking]
|
|
138
|
+
|
|
139
|
+
## Checklist
|
|
140
|
+
- [ ] Tests cover changes
|
|
141
|
+
- [ ] No security issues
|
|
142
|
+
- [ ] Follows project patterns
|
|
143
|
+
- [ ] Documentation updated`,
|
|
144
|
+
constraints: [
|
|
145
|
+
"Review only - do not modify code",
|
|
146
|
+
"No memory operations - orchestrator handles memory",
|
|
147
|
+
"Be specific about issues (file, line, description)",
|
|
148
|
+
"Distinguish severity levels clearly",
|
|
149
|
+
"Provide actionable feedback, not vague criticism",
|
|
150
|
+
],
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Map of built-in agent templates.
|
|
154
|
+
*/
|
|
155
|
+
export const BUILT_IN_TEMPLATES = {
|
|
156
|
+
"code-explorer": CODE_EXPLORER_TEMPLATE,
|
|
157
|
+
"code-architect": CODE_ARCHITECT_TEMPLATE,
|
|
158
|
+
"code-reviewer": CODE_REVIEWER_TEMPLATE,
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Get a built-in agent template by name.
|
|
162
|
+
*
|
|
163
|
+
* @param name - Built-in agent type name
|
|
164
|
+
* @returns Agent template
|
|
165
|
+
*/
|
|
166
|
+
export function getBuiltInTemplate(name) {
|
|
167
|
+
return BUILT_IN_TEMPLATES[name];
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Get all built-in agent templates.
|
|
171
|
+
*
|
|
172
|
+
* @returns Array of all built-in templates
|
|
173
|
+
*/
|
|
174
|
+
export function getAllBuiltInTemplates() {
|
|
175
|
+
return Object.values(BUILT_IN_TEMPLATES);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Check if a name is a built-in agent type.
|
|
179
|
+
*
|
|
180
|
+
* @param name - Agent name to check
|
|
181
|
+
* @returns True if it's a built-in type
|
|
182
|
+
*/
|
|
183
|
+
export function isBuiltInAgent(name) {
|
|
184
|
+
return name in BUILT_IN_TEMPLATES;
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/agents/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE;;0CAE+B;IACxC,KAAK,EAAE;QACL,8BAA8B;QAC9B,6BAA6B;QAC7B,2BAA2B;QAC3B,yCAAyC;QACzC,+CAA+C;KAChD;IACD,YAAY,EAAE;;;;;;;;;;;;;;;uCAeuB;IACrC,WAAW,EAAE;QACX,mDAAmD;QACnD,oDAAoD;QACpD,oCAAoC;QACpC,2CAA2C;QAC3C,wDAAwD;KACzD;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,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|
+
* Agent template type definitions.
|
|
3
|
+
* @module agents/types
|
|
4
|
+
*/
|
|
5
|
+
import type { Memory } from "../types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Base agent template structure.
|
|
8
|
+
* Defines what an agent does and how it operates.
|
|
9
|
+
*/
|
|
10
|
+
export interface AgentTemplate {
|
|
11
|
+
/** Unique agent identifier */
|
|
12
|
+
name: string;
|
|
13
|
+
/** What this agent specializes in */
|
|
14
|
+
mission: string;
|
|
15
|
+
/** Tools the agent can use */
|
|
16
|
+
tools: string[];
|
|
17
|
+
/** Expected output format/structure */
|
|
18
|
+
outputFormat: string;
|
|
19
|
+
/** Operational constraints */
|
|
20
|
+
constraints: string[];
|
|
21
|
+
/** Optional system prompt additions */
|
|
22
|
+
systemPromptAdditions?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Agent context prepared by orchestrator before delegation.
|
|
26
|
+
*/
|
|
27
|
+
export interface AgentContext {
|
|
28
|
+
/** The agent template */
|
|
29
|
+
template: AgentTemplate;
|
|
30
|
+
/** Relevant memories retrieved via recall() */
|
|
31
|
+
memories: Memory[];
|
|
32
|
+
/** The specific task to perform */
|
|
33
|
+
task: string;
|
|
34
|
+
/** Additional context from orchestrator */
|
|
35
|
+
additionalContext?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Built-in agent type identifiers.
|
|
39
|
+
*/
|
|
40
|
+
export type BuiltInAgentType = "code-explorer" | "code-architect" | "code-reviewer";
|
|
41
|
+
/**
|
|
42
|
+
* Options for preparing agent context.
|
|
43
|
+
*/
|
|
44
|
+
export interface GetAgentContextOptions {
|
|
45
|
+
/** Recall budget for memory retrieval */
|
|
46
|
+
budget?: "low" | "mid" | "high";
|
|
47
|
+
/** Additional context to include */
|
|
48
|
+
additionalContext?: string;
|
|
49
|
+
/** Maximum memories to include */
|
|
50
|
+
maxMemories?: number;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,uCAAuC;IACvC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,QAAQ,EAAE,aAAa,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAChC,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI config command - show configuration.
|
|
3
|
+
* @module cli/commands/config
|
|
4
|
+
*/
|
|
5
|
+
import type { CAC } from "cac";
|
|
6
|
+
/**
|
|
7
|
+
* Register the config command.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerConfigCommand(cli: CAC): void;
|
|
10
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAU/B;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAapD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI config command - show configuration.
|
|
3
|
+
* @module cli/commands/config
|
|
4
|
+
*/
|
|
5
|
+
import { loadConfig } from "../../config.js";
|
|
6
|
+
import { output, formatConfig } from "../utils/index.js";
|
|
7
|
+
/**
|
|
8
|
+
* Register the config command.
|
|
9
|
+
*/
|
|
10
|
+
export function registerConfigCommand(cli) {
|
|
11
|
+
cli
|
|
12
|
+
.command("config", "Show current configuration")
|
|
13
|
+
.option("--project <path>", "Project directory (default: current directory)")
|
|
14
|
+
.option("--json", "Output as JSON")
|
|
15
|
+
.option("--quiet", "Suppress output")
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
const projectPath = options.project ?? process.cwd();
|
|
18
|
+
const config = await loadConfig(projectPath);
|
|
19
|
+
output(config, formatConfig, options);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/cli/commands/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQzD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAQ;IAC5C,GAAG;SACA,OAAO,CAAC,QAAQ,EAAE,4BAA4B,CAAC;SAC/C,MAAM,CAAC,kBAAkB,EAAE,gDAAgD,CAAC;SAC5E,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,SAAS,EAAE,iBAAiB,CAAC;SACpC,MAAM,CAAC,KAAK,EAAE,OAAsB,EAAE,EAAE;QACvC,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAErD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC;QAE7C,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command exports.
|
|
3
|
+
* @module cli/commands
|
|
4
|
+
*/
|
|
5
|
+
export { registerInitCommand } from "./init.js";
|
|
6
|
+
export { registerInstallCommand } from "./install.js";
|
|
7
|
+
export { registerServeCommand } from "./serve.js";
|
|
8
|
+
export { registerStatusCommand } from "./status.js";
|
|
9
|
+
export { registerLearnCommand } from "./learn.js";
|
|
10
|
+
export { registerRecallCommand } from "./recall.js";
|
|
11
|
+
export { registerReflectCommand } from "./reflect.js";
|
|
12
|
+
export { registerSemanticCommand } from "./semantic.js";
|
|
13
|
+
export { registerConfigCommand } from "./config.js";
|
|
14
|
+
export { registerUpdateBankCommand } from "./update-bank.js";
|
|
15
|
+
export { registerUninstallCommand } from "./uninstall.js";
|
|
16
|
+
export { registerSyncCommand } from "./sync.js";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI command exports.
|
|
3
|
+
* @module cli/commands
|
|
4
|
+
*/
|
|
5
|
+
export { registerInitCommand } from "./init.js";
|
|
6
|
+
export { registerInstallCommand } from "./install.js";
|
|
7
|
+
export { registerServeCommand } from "./serve.js";
|
|
8
|
+
export { registerStatusCommand } from "./status.js";
|
|
9
|
+
export { registerLearnCommand } from "./learn.js";
|
|
10
|
+
export { registerRecallCommand } from "./recall.js";
|
|
11
|
+
export { registerReflectCommand } from "./reflect.js";
|
|
12
|
+
export { registerSemanticCommand } from "./semantic.js";
|
|
13
|
+
export { registerConfigCommand } from "./config.js";
|
|
14
|
+
export { registerUpdateBankCommand } from "./update-bank.js";
|
|
15
|
+
export { registerUninstallCommand } from "./uninstall.js";
|
|
16
|
+
export { registerSyncCommand } from "./sync.js";
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI init command - initialize claude-cognitive for a project.
|
|
3
|
+
* @module cli/commands/init
|
|
4
|
+
*/
|
|
5
|
+
import type { CAC } from "cac";
|
|
6
|
+
/**
|
|
7
|
+
* Register the init command.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerInitCommand(cli: CAC): void;
|
|
10
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAuB/B;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAuHlD"}
|