@ai-coders/context 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -580
- package/dist/generators/agents/agentGenerator.d.ts +6 -9
- package/dist/generators/agents/agentGenerator.d.ts.map +1 -1
- package/dist/generators/agents/agentGenerator.js +89 -32
- package/dist/generators/agents/agentGenerator.js.map +1 -1
- package/dist/generators/agents/index.d.ts +0 -2
- package/dist/generators/agents/index.d.ts.map +1 -1
- package/dist/generators/agents/index.js +1 -5
- package/dist/generators/agents/index.js.map +1 -1
- package/dist/generators/agents/templates/index.d.ts +4 -0
- package/dist/generators/agents/templates/index.d.ts.map +1 -0
- package/dist/generators/agents/templates/index.js +8 -0
- package/dist/generators/agents/templates/index.js.map +1 -0
- package/dist/generators/agents/templates/indexTemplate.d.ts +3 -0
- package/dist/generators/agents/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/agents/templates/indexTemplate.js +35 -0
- package/dist/generators/agents/templates/indexTemplate.js.map +1 -0
- package/dist/generators/agents/templates/playbookTemplate.d.ts +4 -0
- package/dist/generators/agents/templates/playbookTemplate.d.ts.map +1 -0
- package/dist/generators/agents/templates/playbookTemplate.js +63 -0
- package/dist/generators/agents/templates/playbookTemplate.js.map +1 -0
- package/dist/generators/agents/templates/types.d.ts +14 -0
- package/dist/generators/agents/templates/types.d.ts.map +1 -0
- package/dist/generators/agents/templates/types.js +3 -0
- package/dist/generators/agents/templates/types.js.map +1 -0
- package/dist/generators/documentation/documentationGenerator.d.ts +9 -15
- package/dist/generators/documentation/documentationGenerator.d.ts.map +1 -1
- package/dist/generators/documentation/documentationGenerator.js +65 -77
- package/dist/generators/documentation/documentationGenerator.js.map +1 -1
- package/dist/generators/documentation/guideRegistry.d.ts +6 -0
- package/dist/generators/documentation/guideRegistry.d.ts.map +1 -0
- package/dist/generators/documentation/guideRegistry.js +82 -0
- package/dist/generators/documentation/guideRegistry.js.map +1 -0
- package/dist/generators/documentation/index.d.ts +0 -6
- package/dist/generators/documentation/index.d.ts.map +1 -1
- package/dist/generators/documentation/index.js +1 -17
- package/dist/generators/documentation/index.js.map +1 -1
- package/dist/generators/documentation/templates/architectureTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/architectureTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/architectureTemplate.js +66 -0
- package/dist/generators/documentation/templates/architectureTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/common.d.ts +7 -0
- package/dist/generators/documentation/templates/common.d.ts.map +1 -0
- package/dist/generators/documentation/templates/common.js +58 -0
- package/dist/generators/documentation/templates/common.js.map +1 -0
- package/dist/generators/documentation/templates/dataFlowTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/dataFlowTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/dataFlowTemplate.js +55 -0
- package/dist/generators/documentation/templates/dataFlowTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.js +59 -0
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/frontMatter.d.ts +11 -0
- package/dist/generators/documentation/templates/frontMatter.d.ts.map +1 -0
- package/dist/generators/documentation/templates/frontMatter.js +29 -0
- package/dist/generators/documentation/templates/frontMatter.js.map +1 -0
- package/dist/generators/documentation/templates/glossaryTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/glossaryTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/glossaryTemplate.js +55 -0
- package/dist/generators/documentation/templates/glossaryTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/index.d.ts +11 -0
- package/dist/generators/documentation/templates/index.d.ts.map +1 -0
- package/dist/generators/documentation/templates/index.js +22 -0
- package/dist/generators/documentation/templates/index.js.map +1 -0
- package/dist/generators/documentation/templates/indexTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/indexTemplate.js +56 -0
- package/dist/generators/documentation/templates/indexTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/projectOverviewTemplate.js +68 -0
- package/dist/generators/documentation/templates/projectOverviewTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/securityTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/securityTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/securityTemplate.js +53 -0
- package/dist/generators/documentation/templates/securityTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/testingTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/testingTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/testingTemplate.js +59 -0
- package/dist/generators/documentation/templates/testingTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/toolingTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/toolingTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/toolingTemplate.js +56 -0
- package/dist/generators/documentation/templates/toolingTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/types.d.ts +23 -0
- package/dist/generators/documentation/templates/types.d.ts.map +1 -0
- package/dist/generators/documentation/templates/types.js +3 -0
- package/dist/generators/documentation/templates/types.js.map +1 -0
- package/dist/generators/documentation/templates.d.ts +31 -0
- package/dist/generators/documentation/templates.d.ts.map +1 -0
- package/dist/generators/documentation/templates.js +566 -0
- package/dist/generators/documentation/templates.js.map +1 -0
- package/dist/generators/plans/index.d.ts +2 -0
- package/dist/generators/plans/index.d.ts.map +1 -0
- package/dist/generators/plans/index.js +6 -0
- package/dist/generators/plans/index.js.map +1 -0
- package/dist/generators/plans/planGenerator.d.ts +22 -0
- package/dist/generators/plans/planGenerator.d.ts.map +1 -0
- package/dist/generators/plans/planGenerator.js +109 -0
- package/dist/generators/plans/planGenerator.js.map +1 -0
- package/dist/generators/plans/templates/indexTemplate.d.ts +3 -0
- package/dist/generators/plans/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/plans/templates/indexTemplate.js +36 -0
- package/dist/generators/plans/templates/indexTemplate.js.map +1 -0
- package/dist/generators/plans/templates/planTemplate.d.ts +3 -0
- package/dist/generators/plans/templates/planTemplate.d.ts.map +1 -0
- package/dist/generators/plans/templates/planTemplate.js +83 -0
- package/dist/generators/plans/templates/planTemplate.js.map +1 -0
- package/dist/generators/plans/templates/types.d.ts +19 -0
- package/dist/generators/plans/templates/types.d.ts.map +1 -0
- package/dist/generators/plans/templates/types.js +3 -0
- package/dist/generators/plans/templates/types.js.map +1 -0
- package/dist/generators/shared/contextGenerator.d.ts +2 -7
- package/dist/generators/shared/contextGenerator.d.ts.map +1 -1
- package/dist/generators/shared/contextGenerator.js +2 -98
- package/dist/generators/shared/contextGenerator.js.map +1 -1
- package/dist/generators/shared/directoryTemplateHelpers.d.ts +2 -0
- package/dist/generators/shared/directoryTemplateHelpers.d.ts.map +1 -0
- package/dist/generators/shared/directoryTemplateHelpers.js +12 -0
- package/dist/generators/shared/directoryTemplateHelpers.js.map +1 -0
- package/dist/generators/shared/index.d.ts +1 -0
- package/dist/generators/shared/index.d.ts.map +1 -1
- package/dist/generators/shared/index.js +3 -1
- package/dist/generators/shared/index.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1300 -609
- package/dist/index.js.map +1 -1
- package/dist/utils/cliUI.d.ts +6 -4
- package/dist/utils/cliUI.d.ts.map +1 -1
- package/dist/utils/cliUI.js +71 -56
- package/dist/utils/cliUI.js.map +1 -1
- package/dist/utils/i18n.d.ts +181 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/dist/utils/i18n.js +401 -0
- package/dist/utils/i18n.js.map +1 -0
- package/package.json +26 -23
- package/prompts/update_plan_prompt.md +42 -0
- package/prompts/update_scaffold_prompt.md +48 -0
- package/dist/generators/agentGenerator.d.ts +0 -23
- package/dist/generators/agentGenerator.d.ts.map +0 -1
- package/dist/generators/agentGenerator.js +0 -357
- package/dist/generators/agentGenerator.js.map +0 -1
- package/dist/generators/documentation/enhancedDocumentationGenerator.d.ts +0 -21
- package/dist/generators/documentation/enhancedDocumentationGenerator.d.ts.map +0 -1
- package/dist/generators/documentation/enhancedDocumentationGenerator.js +0 -216
- package/dist/generators/documentation/enhancedDocumentationGenerator.js.map +0 -1
- package/dist/generators/documentation/newDocumentationTemplates.d.ts +0 -19
- package/dist/generators/documentation/newDocumentationTemplates.d.ts.map +0 -1
- package/dist/generators/documentation/newDocumentationTemplates.js +0 -307
- package/dist/generators/documentation/newDocumentationTemplates.js.map +0 -1
- package/dist/generators/documentationGenerator.d.ts +0 -22
- package/dist/generators/documentationGenerator.d.ts.map +0 -1
- package/dist/generators/documentationGenerator.js +0 -235
- package/dist/generators/documentationGenerator.js.map +0 -1
- package/dist/generators/documentationTemplates.d.ts +0 -16
- package/dist/generators/documentationTemplates.d.ts.map +0 -1
- package/dist/generators/documentationTemplates.js +0 -326
- package/dist/generators/documentationTemplates.js.map +0 -1
- package/dist/generators/documentationUtils.d.ts +0 -7
- package/dist/generators/documentationUtils.d.ts.map +0 -1
- package/dist/generators/documentationUtils.js +0 -38
- package/dist/generators/documentationUtils.js.map +0 -1
- package/dist/generators/incrementalDocumentationGenerator.d.ts +0 -33
- package/dist/generators/incrementalDocumentationGenerator.d.ts.map +0 -1
- package/dist/generators/incrementalDocumentationGenerator.js +0 -400
- package/dist/generators/incrementalDocumentationGenerator.js.map +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PlanGenerator = void 0;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const fs = __importStar(require("fs-extra"));
|
|
39
|
+
const shared_1 = require("../shared");
|
|
40
|
+
const agentTypes_1 = require("../agents/agentTypes");
|
|
41
|
+
const agentConfig_1 = require("../agents/agentConfig");
|
|
42
|
+
const guideRegistry_1 = require("../documentation/guideRegistry");
|
|
43
|
+
const planTemplate_1 = require("./templates/planTemplate");
|
|
44
|
+
const indexTemplate_1 = require("./templates/indexTemplate");
|
|
45
|
+
class PlanGenerator {
|
|
46
|
+
async generatePlan(options) {
|
|
47
|
+
const { planName, outputDir, title, summary, selectedAgentTypes, selectedDocKeys, force = false, verbose = false } = options;
|
|
48
|
+
const slug = shared_1.GeneratorUtils.slugify(planName);
|
|
49
|
+
if (!slug) {
|
|
50
|
+
throw new Error('Plan name must contain at least one alphanumeric character.');
|
|
51
|
+
}
|
|
52
|
+
const planTitle = title?.trim() || shared_1.GeneratorUtils.formatTitle(slug);
|
|
53
|
+
const resolvedOutput = path.resolve(outputDir);
|
|
54
|
+
const plansDir = path.join(resolvedOutput, 'plans');
|
|
55
|
+
await fs.ensureDir(resolvedOutput);
|
|
56
|
+
await shared_1.GeneratorUtils.ensureDirectoryAndLog(plansDir, verbose, 'Ensuring plans directory');
|
|
57
|
+
const planFileName = `${slug}.md`;
|
|
58
|
+
const planPath = path.join(plansDir, planFileName);
|
|
59
|
+
if (!force && await fs.pathExists(planPath)) {
|
|
60
|
+
throw new Error(`Plan already exists at ${planPath}. Use --force to overwrite.`);
|
|
61
|
+
}
|
|
62
|
+
const agentSummaries = this.resolveAgents(selectedAgentTypes);
|
|
63
|
+
const docGuides = selectedDocKeys === null
|
|
64
|
+
? []
|
|
65
|
+
: (0, guideRegistry_1.getGuidesByKeys)(selectedDocKeys || undefined);
|
|
66
|
+
const content = (0, planTemplate_1.renderPlanTemplate)({
|
|
67
|
+
title: planTitle,
|
|
68
|
+
slug,
|
|
69
|
+
summary,
|
|
70
|
+
agents: agentSummaries,
|
|
71
|
+
docs: docGuides
|
|
72
|
+
});
|
|
73
|
+
await shared_1.GeneratorUtils.writeFileWithLogging(planPath, content, verbose, `Created ${planFileName}`);
|
|
74
|
+
await this.updatePlanIndex(plansDir, verbose);
|
|
75
|
+
return {
|
|
76
|
+
planPath,
|
|
77
|
+
relativePath: path.relative(resolvedOutput, planPath),
|
|
78
|
+
slug
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
resolveAgents(selected) {
|
|
82
|
+
const allowed = new Set(Array.from(agentTypes_1.AGENT_TYPES));
|
|
83
|
+
if (selected === null) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
const chosen = selected && selected.length > 0
|
|
87
|
+
? Array.from(new Set(selected.map(value => value.toLowerCase().trim())))
|
|
88
|
+
.filter(value => allowed.has(value))
|
|
89
|
+
: Array.from(allowed);
|
|
90
|
+
return chosen.map(type => ({
|
|
91
|
+
type,
|
|
92
|
+
title: shared_1.GeneratorUtils.formatTitle(type),
|
|
93
|
+
responsibility: agentConfig_1.AGENT_RESPONSIBILITIES[type]?.[0] || 'Document this agent\'s primary responsibility.'
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
async updatePlanIndex(plansDir, verbose) {
|
|
97
|
+
const files = await fs.readdir(plansDir);
|
|
98
|
+
const entries = files
|
|
99
|
+
.filter(file => file.toLowerCase().endsWith('.md') && file.toLowerCase() !== 'readme.md')
|
|
100
|
+
.map(file => file.replace(/\.md$/i, ''))
|
|
101
|
+
.map(slug => ({ slug, title: shared_1.GeneratorUtils.formatTitle(slug) }))
|
|
102
|
+
.sort((a, b) => a.title.localeCompare(b.title));
|
|
103
|
+
const indexContent = (0, indexTemplate_1.renderPlanIndex)(entries);
|
|
104
|
+
const indexPath = path.join(plansDir, 'README.md');
|
|
105
|
+
await shared_1.GeneratorUtils.writeFileWithLogging(indexPath, indexContent, verbose, 'Updated plans index');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.PlanGenerator = PlanGenerator;
|
|
109
|
+
//# sourceMappingURL=planGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planGenerator.js","sourceRoot":"","sources":["../../../src/generators/plans/planGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,6CAA+B;AAE/B,sCAA2C;AAC3C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O,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,MAAM,CAgCjE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderPlanIndex = renderPlanIndex;
|
|
4
|
+
function renderPlanIndex(entries) {
|
|
5
|
+
const planList = entries.length
|
|
6
|
+
? entries
|
|
7
|
+
.map((entry, index) => `${index + 1}. [${entry.title}](./${entry.slug}.md)`)
|
|
8
|
+
.join('\n')
|
|
9
|
+
: '_No plans created yet. Use "ai-context plan <name>" to create the first one._';
|
|
10
|
+
return `# Collaboration Plans
|
|
11
|
+
|
|
12
|
+
This directory is the run queue for AI agents and maintainers coordinating work across documentation and playbooks. Treat the list below as an ordered backlog: finish the first plan before moving on to the next unless a human directs otherwise.
|
|
13
|
+
|
|
14
|
+
## Agent Execution Protocol
|
|
15
|
+
1. **Read the queue** from top to bottom. The numbering reflects execution priority.
|
|
16
|
+
2. **Open the plan file** (e.g., './plans/<slug>.md') and review the YAML front matter and the '<!-- ai-task:plan-... -->' wrapper so you understand the goal, required inputs, and success criteria.
|
|
17
|
+
3. **Gather context** by visiting the linked documentation and agent playbooks referenced in the "Agent Lineup" and "Documentation Touchpoints" tables.
|
|
18
|
+
4. **Execute the stages** exactly as written, capturing evidence and updating linked docs as instructed. If a stage cannot be completed, record the reason inside the plan before pausing.
|
|
19
|
+
5. **Close out the plan** by updating any TODOs, recording outcomes in the "Evidence & Follow-up" section, and notifying maintainers if human review is required.
|
|
20
|
+
6. **Return here** and pick the next plan in the queue. Always leave the README and plan files consistent with the work performed.
|
|
21
|
+
|
|
22
|
+
## Plan Queue (process in order)
|
|
23
|
+
${planList}
|
|
24
|
+
|
|
25
|
+
## How To Create Or Update Plans
|
|
26
|
+
- Run "ai-context plan <name>" to scaffold a new plan template.
|
|
27
|
+
- Run "ai-context plan <name> --fill" (optionally with "--dry-run") to have an LLM refresh the plan using the latest repository context.
|
|
28
|
+
- Cross-link any new documentation or agent resources you introduce so future runs stay discoverable.
|
|
29
|
+
|
|
30
|
+
## Related Resources
|
|
31
|
+
- [Agent Handbook](../agents/README.md)
|
|
32
|
+
- [Documentation Index](../docs/README.md)
|
|
33
|
+
- [Contributor Guidelines](../AGENTS.md)
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=indexTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexTemplate.js","sourceRoot":"","sources":["../../../../src/generators/plans/templates/indexTemplate.ts"],"names":[],"mappings":";;AAEA,0CAgCC;AAhCD,SAAgB,eAAe,CAAC,OAAyB;IACvD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM;QAC7B,CAAC,CAAC,OAAO;aACJ,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,KAAK,OAAO,KAAK,CAAC,IAAI,MAAM,CAAC;aAC3E,IAAI,CAAC,IAAI,CAAC;QACf,CAAC,CAAC,+EAA+E,CAAC;IAEpF,OAAO;;;;;;;;;;;;;EAaP,QAAQ;;;;;;;;;;;CAWT,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/plans/templates/planTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAkFvE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderPlanTemplate = renderPlanTemplate;
|
|
4
|
+
function renderPlanTemplate(context) {
|
|
5
|
+
const { title, slug, summary, agents, docs } = context;
|
|
6
|
+
const relatedAgents = agents.length
|
|
7
|
+
? agents.map(agent => ` - "${agent.type}"`).join('\n')
|
|
8
|
+
: ' - "documentation-writer"';
|
|
9
|
+
const agentTableRows = agents.length
|
|
10
|
+
? agents
|
|
11
|
+
.map(agent => `| ${agent.title} | TODO: Describe why this agent is involved. | [${agent.title}](../agents/${agent.type}.md) | ${agent.responsibility} |`)
|
|
12
|
+
.join('\n')
|
|
13
|
+
: '| Documentation Writer | TODO: Describe why this agent is involved. | [Documentation Writer](../agents/documentation-writer.md) | Create clear, comprehensive documentation |';
|
|
14
|
+
const docsTableRows = docs.length
|
|
15
|
+
? docs
|
|
16
|
+
.map(doc => `| ${doc.title} | [${doc.file}](../docs/${doc.file}) | ${doc.marker} | ${doc.primaryInputs} |`)
|
|
17
|
+
.join('\n')
|
|
18
|
+
: '| Documentation Index | [README.md](../docs/README.md) | ai-task:docs-index | Current docs directory listing |';
|
|
19
|
+
return `---
|
|
20
|
+
id: plan-${slug}
|
|
21
|
+
ai_update_goal: "Define the stages, owners, and evidence required to complete ${title}."
|
|
22
|
+
required_inputs:
|
|
23
|
+
- "Task summary or issue link describing the goal"
|
|
24
|
+
- "Relevant documentation sections from docs/README.md"
|
|
25
|
+
- "Matching agent playbooks from agents/README.md"
|
|
26
|
+
success_criteria:
|
|
27
|
+
- "Stages list clear owners, deliverables, and success signals"
|
|
28
|
+
- "Plan references documentation and agent resources that exist today"
|
|
29
|
+
- "Follow-up actions and evidence expectations are recorded"
|
|
30
|
+
related_agents:
|
|
31
|
+
${relatedAgents}
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<!-- ai-task:plan-${slug} -->
|
|
35
|
+
# ${title} Plan
|
|
36
|
+
|
|
37
|
+
> ${summary?.trim() || 'TODO: Summarize the desired outcome and the problem this plan addresses.'}
|
|
38
|
+
|
|
39
|
+
## Task Snapshot
|
|
40
|
+
- **Primary goal:** TODO: Describe the outcome to achieve.
|
|
41
|
+
- **Success signal:** TODO: Define how the team will know the plan worked.
|
|
42
|
+
- **Key references:**
|
|
43
|
+
- [Documentation Index](../docs/README.md)
|
|
44
|
+
- [Agent Handbook](../agents/README.md)
|
|
45
|
+
- [Plans Index](./README.md)
|
|
46
|
+
|
|
47
|
+
## Agent Lineup
|
|
48
|
+
| Agent | Role in this plan | Playbook | First responsibility focus |
|
|
49
|
+
| --- | --- | --- | --- |
|
|
50
|
+
${agentTableRows}
|
|
51
|
+
|
|
52
|
+
## Documentation Touchpoints
|
|
53
|
+
| Guide | File | Task Marker | Primary Inputs |
|
|
54
|
+
| --- | --- | --- | --- |
|
|
55
|
+
${docsTableRows}
|
|
56
|
+
|
|
57
|
+
## Working Stages
|
|
58
|
+
### Stage 1 — Discovery & Alignment
|
|
59
|
+
- TODO: Outline discovery tasks and the agent/owner who leads them.
|
|
60
|
+
- TODO: Capture open questions that require clarification.
|
|
61
|
+
|
|
62
|
+
### Stage 2 — Implementation & Iteration
|
|
63
|
+
- TODO: Note build tasks, pairing expectations, and review cadence.
|
|
64
|
+
- TODO: Reference docs or playbooks to keep changes aligned.
|
|
65
|
+
|
|
66
|
+
### Stage 3 — Validation & Handoff
|
|
67
|
+
- TODO: Detail testing, verification, and documentation updates.
|
|
68
|
+
- TODO: Document evidence the team must capture for maintainers.
|
|
69
|
+
|
|
70
|
+
## Agent Playbook Checklist
|
|
71
|
+
1. Pick the agent that matches your task.
|
|
72
|
+
2. Enrich the template with project-specific context or links.
|
|
73
|
+
3. Share the final prompt with your AI assistant.
|
|
74
|
+
4. Capture learnings in the relevant documentation file so future runs improve.
|
|
75
|
+
|
|
76
|
+
## Evidence & Follow-up
|
|
77
|
+
- TODO: List artifacts to collect (logs, PR links, test runs, design notes).
|
|
78
|
+
- TODO: Record follow-up actions or owners.
|
|
79
|
+
|
|
80
|
+
<!-- /ai-task:plan-${slug} -->
|
|
81
|
+
`;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=planTemplate.js.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Kd,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;qBAyBM,IAAI;CACxB,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AgentType } from '../../agents/agentTypes';
|
|
2
|
+
import { GuideMeta } from '../../documentation/templates/types';
|
|
3
|
+
export interface PlanAgentSummary {
|
|
4
|
+
type: AgentType;
|
|
5
|
+
title: string;
|
|
6
|
+
responsibility: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PlanTemplateContext {
|
|
9
|
+
title: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
summary?: string;
|
|
12
|
+
agents: PlanAgentSummary[];
|
|
13
|
+
docs: GuideMeta[];
|
|
14
|
+
}
|
|
15
|
+
export interface PlanIndexEntry {
|
|
16
|
+
slug: string;
|
|
17
|
+
title: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/generators/plans/templates/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/generators/plans/templates/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { RepoStructure } from '../../types';
|
|
2
1
|
import { FileMapper } from '../../utils/fileMapper';
|
|
3
2
|
export declare class ContextGenerator {
|
|
4
|
-
|
|
3
|
+
protected readonly fileMapper: FileMapper;
|
|
5
4
|
constructor(fileMapper: FileMapper);
|
|
6
|
-
|
|
7
|
-
createFileContext(repoStructure: RepoStructure, importantFiles?: string[]): Promise<string>;
|
|
8
|
-
createStructureOverview(repoStructure: RepoStructure): string;
|
|
9
|
-
private getFileTypeDistribution;
|
|
10
|
-
private isImportantFile;
|
|
5
|
+
protected loadFileContent(path: string): Promise<string>;
|
|
11
6
|
}
|
|
12
7
|
//# sourceMappingURL=contextGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/shared/contextGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contextGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/shared/contextGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,qBAAa,gBAAgB;IACf,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU;gBAAtB,UAAU,EAAE,UAAU;cAErC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG/D"}
|
|
@@ -1,108 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.ContextGenerator = void 0;
|
|
37
|
-
const path = __importStar(require("path"));
|
|
38
|
-
const generatorUtils_1 = require("./generatorUtils");
|
|
39
4
|
class ContextGenerator {
|
|
40
5
|
constructor(fileMapper) {
|
|
41
6
|
this.fileMapper = fileMapper;
|
|
42
7
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const topExtensions = generatorUtils_1.GeneratorUtils.getTopFileExtensions(repoStructure);
|
|
46
|
-
return `**Project Statistics:**
|
|
47
|
-
- Total Files: ${totalFiles}
|
|
48
|
-
- Total Size: ${generatorUtils_1.GeneratorUtils.formatBytes(totalSize)}
|
|
49
|
-
- Primary Languages: ${topExtensions.map(([ext, count]) => `${ext} (${count})`).join(', ')}
|
|
50
|
-
|
|
51
|
-
**Key Project Files:**
|
|
52
|
-
${files
|
|
53
|
-
.filter(f => ['package.json', 'README.md', 'tsconfig.json'].includes(path.basename(f.path)))
|
|
54
|
-
.map(f => `- ${f.relativePath}`)
|
|
55
|
-
.join('\n')}`;
|
|
56
|
-
}
|
|
57
|
-
async createFileContext(repoStructure, importantFiles = []) {
|
|
58
|
-
const filesToProcess = repoStructure.files
|
|
59
|
-
.filter(f => this.isImportantFile(f.relativePath, importantFiles))
|
|
60
|
-
.slice(0, 10);
|
|
61
|
-
let context = '**Important Files Context:**\n\n';
|
|
62
|
-
for (const file of filesToProcess) {
|
|
63
|
-
try {
|
|
64
|
-
const content = await this.fileMapper.readFileContent(file.path);
|
|
65
|
-
const preview = content.substring(0, 500);
|
|
66
|
-
context += `**${file.relativePath}:**\n\`\`\`\n${preview}${content.length > 500 ? '...' : ''}\n\`\`\`\n\n`;
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
context += `**${file.relativePath}:** (Error reading file)\n\n`;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return context;
|
|
73
|
-
}
|
|
74
|
-
createStructureOverview(repoStructure) {
|
|
75
|
-
const directories = [...new Set(repoStructure.files.map(f => path.dirname(f.relativePath)))].filter(dir => dir !== '.').slice(0, 20);
|
|
76
|
-
return `Repository Structure Overview:
|
|
77
|
-
|
|
78
|
-
Directories:
|
|
79
|
-
${directories.map(dir => `- ${dir}`).join('\n')}
|
|
80
|
-
|
|
81
|
-
File Types:
|
|
82
|
-
${this.getFileTypeDistribution(repoStructure)}
|
|
83
|
-
|
|
84
|
-
Total Files: ${repoStructure.totalFiles}
|
|
85
|
-
`;
|
|
86
|
-
}
|
|
87
|
-
getFileTypeDistribution(repoStructure) {
|
|
88
|
-
const extensions = generatorUtils_1.GeneratorUtils.getFileTypeDistribution(repoStructure);
|
|
89
|
-
return Array.from(extensions.entries())
|
|
90
|
-
.sort((a, b) => b[1] - a[1])
|
|
91
|
-
.slice(0, 10)
|
|
92
|
-
.map(([ext, count]) => `- ${ext}: ${count} files`)
|
|
93
|
-
.join('\n');
|
|
94
|
-
}
|
|
95
|
-
isImportantFile(filePath, customImportantFiles = []) {
|
|
96
|
-
const defaultImportantFiles = [
|
|
97
|
-
'package.json', 'tsconfig.json', 'webpack.config.js',
|
|
98
|
-
'next.config.js', 'tailwind.config.js', 'README.md',
|
|
99
|
-
'.gitignore', 'Dockerfile', 'docker-compose.yml'
|
|
100
|
-
];
|
|
101
|
-
const allImportantFiles = [...defaultImportantFiles, ...customImportantFiles];
|
|
102
|
-
const fileName = path.basename(filePath);
|
|
103
|
-
return allImportantFiles.includes(fileName) ||
|
|
104
|
-
filePath.includes('config') ||
|
|
105
|
-
filePath.includes('index');
|
|
8
|
+
async loadFileContent(path) {
|
|
9
|
+
return this.fileMapper.readFileContent(path);
|
|
106
10
|
}
|
|
107
11
|
}
|
|
108
12
|
exports.ContextGenerator = ContextGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextGenerator.js","sourceRoot":"","sources":["../../../src/generators/shared/contextGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contextGenerator.js","sourceRoot":"","sources":["../../../src/generators/shared/contextGenerator.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;IAC3B,YAA+B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAE/C,KAAK,CAAC,eAAe,CAAC,IAAY;QAC1C,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;CACF;AAND,4CAMC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directoryTemplateHelpers.d.ts","sourceRoot":"","sources":["../../../src/generators/shared/directoryTemplateHelpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ9F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatDirectoryList = formatDirectoryList;
|
|
4
|
+
function formatDirectoryList(directories, placeholderMessage) {
|
|
5
|
+
if (!directories.length) {
|
|
6
|
+
return placeholderMessage ?? '';
|
|
7
|
+
}
|
|
8
|
+
return directories
|
|
9
|
+
.map(dir => `- \`${dir}/\` — TODO: Describe the purpose of this directory.`)
|
|
10
|
+
.join('\n');
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=directoryTemplateHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directoryTemplateHelpers.js","sourceRoot":"","sources":["../../../src/generators/shared/directoryTemplateHelpers.ts"],"names":[],"mappings":";;AAAA,kDAQC;AARD,SAAgB,mBAAmB,CAAC,WAAqB,EAAE,kBAA2B;IACpF,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,kBAAkB,IAAI,EAAE,CAAC;IAClC,CAAC;IAED,OAAO,WAAW;SACf,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,qDAAqD,CAAC;SAC3E,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContextGenerator = exports.GeneratorUtils = void 0;
|
|
3
|
+
exports.formatDirectoryList = exports.ContextGenerator = exports.GeneratorUtils = void 0;
|
|
4
4
|
var generatorUtils_1 = require("./generatorUtils");
|
|
5
5
|
Object.defineProperty(exports, "GeneratorUtils", { enumerable: true, get: function () { return generatorUtils_1.GeneratorUtils; } });
|
|
6
6
|
var contextGenerator_1 = require("./contextGenerator");
|
|
7
7
|
Object.defineProperty(exports, "ContextGenerator", { enumerable: true, get: function () { return contextGenerator_1.ContextGenerator; } });
|
|
8
|
+
var directoryTemplateHelpers_1 = require("./directoryTemplateHelpers");
|
|
9
|
+
Object.defineProperty(exports, "formatDirectoryList", { enumerable: true, get: function () { return directoryTemplateHelpers_1.formatDirectoryList; } });
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generators/shared/index.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generators/shared/index.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,uEAAiE;AAAxD,+HAAA,mBAAmB,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
declare function runInit(repoPath: string, type: string, rawOptions: any): Promise<void>;
|
|
2
3
|
export declare function runGenerate(repoPath: string, options: any): Promise<void>;
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
4
|
+
export declare function runAnalyze(..._args: unknown[]): Promise<void>;
|
|
5
|
+
export declare function runUpdate(..._args: unknown[]): Promise<void>;
|
|
6
|
+
export declare function runPreview(..._args: unknown[]): Promise<void>;
|
|
7
|
+
export declare function runGuidelines(..._args: unknown[]): Promise<void>;
|
|
8
|
+
export { runInit };
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAwNA,iBAAe,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAgFrF;AA6BD,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAa/E;AAED,wBAAsB,UAAU,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnE;AAED,wBAAsB,SAAS,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAElE;AAED,wBAAsB,UAAU,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnE;AAED,wBAAsB,aAAa,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|