@liriraid/agentflow-ai 1.0.10
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 +79 -0
- package/bin/agentflow.mjs +332 -0
- package/orchestrator.js +1585 -0
- package/package.json +64 -0
- package/scripts/scaffold-agent-configs.mjs +100 -0
- package/scripts/scaffold-openspec-change.mjs +84 -0
- package/scripts/update-skill-registry.mjs +174 -0
- package/src/ink/app.mjs +240 -0
- package/src/ink/index.mjs +400 -0
- package/templates/en/.atl/skill-registry.md +27 -0
- package/templates/en/.claude/README.md +7 -0
- package/templates/en/.claude/skills/orchestrator-apply/SKILL.md +31 -0
- package/templates/en/.claude/skills/orchestrator-archive/SKILL.md +26 -0
- package/templates/en/.claude/skills/orchestrator-design/SKILL.md +27 -0
- package/templates/en/.claude/skills/orchestrator-explore/SKILL.md +29 -0
- package/templates/en/.claude/skills/orchestrator-init/SKILL.md +32 -0
- package/templates/en/.claude/skills/orchestrator-memory/SKILL.md +26 -0
- package/templates/en/.claude/skills/orchestrator-openspec/SKILL.md +35 -0
- package/templates/en/.claude/skills/orchestrator-propose/SKILL.md +26 -0
- package/templates/en/.claude/skills/orchestrator-queue-planning/SKILL.md +31 -0
- package/templates/en/.claude/skills/orchestrator-spec/SKILL.md +27 -0
- package/templates/en/.claude/skills/orchestrator-tasks/SKILL.md +27 -0
- package/templates/en/.claude/skills/orchestrator-verify/SKILL.md +27 -0
- package/templates/en/.codex/README.md +7 -0
- package/templates/en/.opencode/README.md +7 -0
- package/templates/en/AGENT-CONFIG.md +75 -0
- package/templates/en/CLAUDE.md +91 -0
- package/templates/en/ENGRAM.md +50 -0
- package/templates/en/ORCHESTRATOR.md +192 -0
- package/templates/en/PROJECT.md +70 -0
- package/templates/en/QUEUE.md +17 -0
- package/templates/en/README.md +188 -0
- package/templates/en/agents/ABACUS.md +36 -0
- package/templates/en/agents/BACKEND.md +37 -0
- package/templates/en/agents/CODEX.md +45 -0
- package/templates/en/agents/CURSOR.md +37 -0
- package/templates/en/agents/FRONTEND.md +36 -0
- package/templates/en/agents/GEMINI.md +37 -0
- package/templates/en/agents/OPENCODE.md +41 -0
- package/templates/en/docs/README.md +14 -0
- package/templates/en/docs/agents.md +33 -0
- package/templates/en/docs/architecture.md +43 -0
- package/templates/en/docs/components.md +14 -0
- package/templates/en/docs/engram.md +16 -0
- package/templates/en/docs/openspec.md +32 -0
- package/templates/en/docs/usage.md +66 -0
- package/templates/en/openspec/FLOW.md +24 -0
- package/templates/en/openspec/README.md +29 -0
- package/templates/en/openspec/changes/.gitkeep +1 -0
- package/templates/en/openspec/changes/archive/.gitkeep +1 -0
- package/templates/en/openspec/specs/.gitkeep +1 -0
- package/templates/en/openspec/templates/archive-report.md +21 -0
- package/templates/en/openspec/templates/change-metadata.yaml +9 -0
- package/templates/en/openspec/templates/design.md +26 -0
- package/templates/en/openspec/templates/proposal.md +27 -0
- package/templates/en/openspec/templates/spec.md +18 -0
- package/templates/en/openspec/templates/tasks.md +14 -0
- package/templates/en/openspec/templates/verify-report.md +21 -0
- package/templates/en/orchestrator.config.json +99 -0
- package/templates/es/.atl/skill-registry.md +133 -0
- package/templates/es/.claude/README.md +7 -0
- package/templates/es/.claude/skills/orchestrator-apply/SKILL.md +32 -0
- package/templates/es/.claude/skills/orchestrator-archive/SKILL.md +28 -0
- package/templates/es/.claude/skills/orchestrator-design/SKILL.md +32 -0
- package/templates/es/.claude/skills/orchestrator-explore/SKILL.md +31 -0
- package/templates/es/.claude/skills/orchestrator-init/SKILL.md +32 -0
- package/templates/es/.claude/skills/orchestrator-memory/SKILL.md +31 -0
- package/templates/es/.claude/skills/orchestrator-openspec/SKILL.md +55 -0
- package/templates/es/.claude/skills/orchestrator-propose/SKILL.md +33 -0
- package/templates/es/.claude/skills/orchestrator-queue-planning/SKILL.md +35 -0
- package/templates/es/.claude/skills/orchestrator-spec/SKILL.md +28 -0
- package/templates/es/.claude/skills/orchestrator-tasks/SKILL.md +32 -0
- package/templates/es/.claude/skills/orchestrator-verify/SKILL.md +31 -0
- package/templates/es/.codex/README.md +7 -0
- package/templates/es/.opencode/README.md +7 -0
- package/templates/es/AGENT-CONFIG.md +83 -0
- package/templates/es/CLAUDE.md +136 -0
- package/templates/es/ENGRAM.md +70 -0
- package/templates/es/ORCHESTRATOR.md +199 -0
- package/templates/es/PROJECT.md +237 -0
- package/templates/es/QUEUE.md +17 -0
- package/templates/es/README.md +568 -0
- package/templates/es/agents/ABACUS.md +25 -0
- package/templates/es/agents/BACKEND.md +28 -0
- package/templates/es/agents/CODEX.md +37 -0
- package/templates/es/agents/CURSOR.md +27 -0
- package/templates/es/agents/FRONTEND.md +29 -0
- package/templates/es/agents/GEMINI.md +26 -0
- package/templates/es/agents/OPENCODE.md +32 -0
- package/templates/es/docs/README.md +12 -0
- package/templates/es/docs/agents.md +57 -0
- package/templates/es/docs/architecture.md +41 -0
- package/templates/es/docs/components.md +33 -0
- package/templates/es/docs/engram.md +30 -0
- package/templates/es/docs/openspec.md +34 -0
- package/templates/es/docs/usage.md +54 -0
- package/templates/es/openspec/FLOW.md +139 -0
- package/templates/es/openspec/README.md +77 -0
- package/templates/es/openspec/changes/.gitkeep +1 -0
- package/templates/es/openspec/changes/archive/.gitkeep +1 -0
- package/templates/es/openspec/specs/.gitkeep +1 -0
- package/templates/es/openspec/templates/archive-report.md +23 -0
- package/templates/es/openspec/templates/change-metadata.yaml +9 -0
- package/templates/es/openspec/templates/design.md +33 -0
- package/templates/es/openspec/templates/proposal.md +36 -0
- package/templates/es/openspec/templates/spec.md +33 -0
- package/templates/es/openspec/templates/tasks.md +22 -0
- package/templates/es/openspec/templates/verify-report.md +24 -0
- package/templates/es/orchestrator.config.json +99 -0
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@liriraid/agentflow-ai",
|
|
3
|
+
"version": "1.0.10",
|
|
4
|
+
"description": "Multi-agent workspace orchestrator with TUI. Coordinates AI coding agents over your real frontend and backend projects.",
|
|
5
|
+
"author": "LiriRaid",
|
|
6
|
+
"homepage": "https://github.com/LiriRaid/agentflow-ai#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/LiriRaid/agentflow-ai.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/LiriRaid/agentflow-ai/issues"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"main": "orchestrator.js",
|
|
18
|
+
"bin": {
|
|
19
|
+
"agentflow": "bin/agentflow.mjs"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"bin",
|
|
23
|
+
"src",
|
|
24
|
+
"templates",
|
|
25
|
+
"scripts",
|
|
26
|
+
"orchestrator.js",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"start": "node orchestrator.js",
|
|
31
|
+
"start:paused": "node orchestrator.js --paused",
|
|
32
|
+
"start:ink": "node src/ink/index.mjs",
|
|
33
|
+
"start:ink:paused": "node src/ink/index.mjs --paused",
|
|
34
|
+
"skills:registry": "node scripts/update-skill-registry.mjs",
|
|
35
|
+
"openspec:new": "node scripts/scaffold-openspec-change.mjs",
|
|
36
|
+
"agent-config:init": "node scripts/scaffold-agent-configs.mjs",
|
|
37
|
+
"cli:help": "node bin/agentflow.mjs --help"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"ai",
|
|
41
|
+
"agents",
|
|
42
|
+
"orchestrator",
|
|
43
|
+
"agentflow-ai",
|
|
44
|
+
"claude",
|
|
45
|
+
"codex",
|
|
46
|
+
"gemini",
|
|
47
|
+
"cursor",
|
|
48
|
+
"opencode",
|
|
49
|
+
"abacus",
|
|
50
|
+
"tui",
|
|
51
|
+
"multi-agent",
|
|
52
|
+
"coding-assistant",
|
|
53
|
+
"openspec",
|
|
54
|
+
"engram",
|
|
55
|
+
"skills",
|
|
56
|
+
"agent-config"
|
|
57
|
+
],
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"blessed": "^0.1.81",
|
|
61
|
+
"ink": "^5.2.1",
|
|
62
|
+
"react": "^18.3.1"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
|
|
6
|
+
const ROOT = process.cwd();
|
|
7
|
+
const CONFIG_FILE = path.join(ROOT, 'orchestrator.config.json');
|
|
8
|
+
const CONFIG = fs.existsSync(CONFIG_FILE)
|
|
9
|
+
? JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'))
|
|
10
|
+
: {};
|
|
11
|
+
const LANGUAGE = CONFIG.workspaceLanguage === 'en' ? 'en' : 'es';
|
|
12
|
+
|
|
13
|
+
const CONTENT = {
|
|
14
|
+
es: {
|
|
15
|
+
claude: [
|
|
16
|
+
'# Claude Local Config',
|
|
17
|
+
'',
|
|
18
|
+
'Esta carpeta contiene la configuración local del proyecto para Claude.',
|
|
19
|
+
'',
|
|
20
|
+
'- `skills/` guarda skills propias del repo',
|
|
21
|
+
'- `CLAUDE.md` en la raíz define el routing del proyecto',
|
|
22
|
+
'- esta capa local debe priorizarse sobre configuración global del usuario'
|
|
23
|
+
],
|
|
24
|
+
codex: [
|
|
25
|
+
'# Codex Local Config',
|
|
26
|
+
'',
|
|
27
|
+
'Esta carpeta reserva la configuración local del proyecto para Codex.',
|
|
28
|
+
'',
|
|
29
|
+
'- hoy se usa como base reusable del proyecto',
|
|
30
|
+
'- mañana puede alojar prompts, perfiles, reglas o plugins locales',
|
|
31
|
+
'- no debe depender solo de configuración global del usuario'
|
|
32
|
+
],
|
|
33
|
+
opencode: [
|
|
34
|
+
'# OpenCode Local Config',
|
|
35
|
+
'',
|
|
36
|
+
'Esta carpeta reserva la configuración local del proyecto para OpenCode.',
|
|
37
|
+
'',
|
|
38
|
+
'- hoy se usa como base reusable del proyecto',
|
|
39
|
+
'- mañana puede alojar reglas, prompts o convenciones específicas',
|
|
40
|
+
'- no debe depender solo de configuración global del usuario'
|
|
41
|
+
],
|
|
42
|
+
done: 'Configuración local por agente creada o verificada.'
|
|
43
|
+
},
|
|
44
|
+
en: {
|
|
45
|
+
claude: [
|
|
46
|
+
'# Claude Local Config',
|
|
47
|
+
'',
|
|
48
|
+
'This folder contains project-local Claude configuration.',
|
|
49
|
+
'',
|
|
50
|
+
'- `skills/` stores repo-specific skills',
|
|
51
|
+
'- root `CLAUDE.md` defines project routing',
|
|
52
|
+
'- this local layer should take priority over global user config'
|
|
53
|
+
],
|
|
54
|
+
codex: [
|
|
55
|
+
'# Codex Local Config',
|
|
56
|
+
'',
|
|
57
|
+
'This folder reserves project-local configuration for Codex.',
|
|
58
|
+
'',
|
|
59
|
+
'- today it is used as the reusable local project base',
|
|
60
|
+
'- later it can hold prompts, profiles, rules, or local plugins',
|
|
61
|
+
'- it should not depend only on global user config'
|
|
62
|
+
],
|
|
63
|
+
opencode: [
|
|
64
|
+
'# OpenCode Local Config',
|
|
65
|
+
'',
|
|
66
|
+
'This folder reserves project-local configuration for OpenCode.',
|
|
67
|
+
'',
|
|
68
|
+
'- today it is used as the reusable local project base',
|
|
69
|
+
'- later it can hold rules, prompts, or specific conventions',
|
|
70
|
+
'- it should not depend only on global user config'
|
|
71
|
+
],
|
|
72
|
+
done: 'Local agent configuration created or verified.'
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const L = CONTENT[LANGUAGE];
|
|
76
|
+
|
|
77
|
+
const files = [
|
|
78
|
+
[
|
|
79
|
+
'.claude/README.md',
|
|
80
|
+
L.claude.join('\n')
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
'.codex/README.md',
|
|
84
|
+
L.codex.join('\n')
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
'.opencode/README.md',
|
|
88
|
+
L.opencode.join('\n')
|
|
89
|
+
]
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
for (const [relativePath, content] of files) {
|
|
93
|
+
const absolutePath = path.join(ROOT, relativePath);
|
|
94
|
+
fs.mkdirSync(path.dirname(absolutePath), {recursive: true});
|
|
95
|
+
if (!fs.existsSync(absolutePath)) {
|
|
96
|
+
fs.writeFileSync(absolutePath, `${content}\n`, 'utf8');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
console.log(L.done);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
|
|
6
|
+
const ROOT = process.cwd();
|
|
7
|
+
const CHANGE_NAME = process.argv[2];
|
|
8
|
+
const CONFIG_FILE = path.join(ROOT, 'orchestrator.config.json');
|
|
9
|
+
const CONFIG = fs.existsSync(CONFIG_FILE)
|
|
10
|
+
? JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'))
|
|
11
|
+
: {};
|
|
12
|
+
const LANGUAGE = CONFIG.workspaceLanguage === 'en' ? 'en' : 'es';
|
|
13
|
+
const TEXT = {
|
|
14
|
+
es: {
|
|
15
|
+
usage: 'Uso: npm run openspec:new -- <change-name>',
|
|
16
|
+
readmeIntro: 'Este change fue generado desde las plantillas locales de `openspec/`.',
|
|
17
|
+
created: base => `OpenSpec change creado en ${base}`
|
|
18
|
+
},
|
|
19
|
+
en: {
|
|
20
|
+
usage: 'Usage: npm run openspec:new -- <change-name>',
|
|
21
|
+
readmeIntro: 'This change was generated from the local `openspec/` templates.',
|
|
22
|
+
created: base => `OpenSpec change created at ${base}`
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const L = TEXT[LANGUAGE];
|
|
26
|
+
|
|
27
|
+
if (!CHANGE_NAME) {
|
|
28
|
+
console.error(L.usage);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const base = path.join(ROOT, 'openspec', 'changes', CHANGE_NAME);
|
|
33
|
+
const templates = path.join(ROOT, 'openspec', 'templates');
|
|
34
|
+
|
|
35
|
+
const files = [
|
|
36
|
+
['proposal.md', 'proposal.md'],
|
|
37
|
+
['design.md', 'design.md'],
|
|
38
|
+
['tasks.md', 'tasks.md'],
|
|
39
|
+
['verify-report.md', 'verify-report.md'],
|
|
40
|
+
['archive-report.md', 'archive-report.md'],
|
|
41
|
+
['.openspec.yaml', 'change-metadata.yaml']
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
fs.mkdirSync(base, {recursive: true});
|
|
45
|
+
const specsDir = path.join(base, 'specs');
|
|
46
|
+
fs.mkdirSync(specsDir, {recursive: true});
|
|
47
|
+
|
|
48
|
+
for (const [targetName, templateName] of files) {
|
|
49
|
+
const target = path.join(base, targetName);
|
|
50
|
+
if (fs.existsSync(target)) continue;
|
|
51
|
+
const template = fs.readFileSync(path.join(templates, templateName), 'utf8');
|
|
52
|
+
const content = template.replaceAll('<change-name>', CHANGE_NAME);
|
|
53
|
+
fs.writeFileSync(target, content.endsWith('\n') ? content : `${content}\n`, 'utf8');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const specTemplate = fs.readFileSync(path.join(templates, 'spec.md'), 'utf8');
|
|
57
|
+
const specTarget = path.join(specsDir, 'spec.md');
|
|
58
|
+
if (!fs.existsSync(specTarget)) {
|
|
59
|
+
const specContent = specTemplate.replaceAll('<change-name>', CHANGE_NAME);
|
|
60
|
+
fs.writeFileSync(specTarget, specContent.endsWith('\n') ? specContent : `${specContent}\n`, 'utf8');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const readme = [
|
|
64
|
+
`# ${CHANGE_NAME}`,
|
|
65
|
+
'',
|
|
66
|
+
L.readmeIntro,
|
|
67
|
+
'',
|
|
68
|
+
'## Files',
|
|
69
|
+
'',
|
|
70
|
+
'- `proposal.md`',
|
|
71
|
+
'- `design.md`',
|
|
72
|
+
'- `tasks.md`',
|
|
73
|
+
'- `verify-report.md`',
|
|
74
|
+
'- `archive-report.md`',
|
|
75
|
+
'- `.openspec.yaml`',
|
|
76
|
+
'- `specs/spec.md`'
|
|
77
|
+
].join('\n');
|
|
78
|
+
|
|
79
|
+
const changeReadme = path.join(base, 'README.md');
|
|
80
|
+
if (!fs.existsSync(changeReadme)) {
|
|
81
|
+
fs.writeFileSync(changeReadme, `${readme}\n`, 'utf8');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
console.log(L.created(base));
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
|
|
6
|
+
const ROOT = process.cwd();
|
|
7
|
+
const SKILLS_DIR = path.join(ROOT, '.claude', 'skills');
|
|
8
|
+
const OUTPUT_DIR = path.join(ROOT, '.atl');
|
|
9
|
+
const OUTPUT_FILE = path.join(OUTPUT_DIR, 'skill-registry.md');
|
|
10
|
+
const CONFIG_FILE = path.join(ROOT, 'orchestrator.config.json');
|
|
11
|
+
const CONFIG = fs.existsSync(CONFIG_FILE)
|
|
12
|
+
? JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'))
|
|
13
|
+
: {};
|
|
14
|
+
const LANGUAGE = CONFIG.workspaceLanguage === 'en' ? 'en' : 'es';
|
|
15
|
+
const TEXT = {
|
|
16
|
+
es: {
|
|
17
|
+
fallbackRule: 'Usa esta skill solo para el propósito definido en su descripción.',
|
|
18
|
+
entryPoint: 'Punto de entrada de la sesión del orquestador',
|
|
19
|
+
intro:
|
|
20
|
+
'**Project-local only.** Este registry prioriza las skills dentro de `./.claude/skills/` para evitar depender de instalaciones globales como `gentle-ai`.',
|
|
21
|
+
noSkills: '| manual | none | _No hay skills locales todavía_ |',
|
|
22
|
+
noRegistered: 'No hay skills locales registradas todavía.',
|
|
23
|
+
noConventions: '| none | none | No se encontraron archivos de convención |',
|
|
24
|
+
policy: [
|
|
25
|
+
'Prioriza siempre skills locales de `./.claude/skills/`.',
|
|
26
|
+
'No dependas de `~/.claude/skills/` para el funcionamiento principal del orquestador.',
|
|
27
|
+
'Si una skill global existe con el mismo nombre, la local del proyecto gana.',
|
|
28
|
+
'Regenera este archivo después de crear, borrar o cambiar skills locales.'
|
|
29
|
+
],
|
|
30
|
+
updated: file => `Skill registry actualizado en ${file}`
|
|
31
|
+
},
|
|
32
|
+
en: {
|
|
33
|
+
fallbackRule: 'Use this skill only for the purpose defined in its description.',
|
|
34
|
+
entryPoint: 'Orchestrator session entry point',
|
|
35
|
+
intro:
|
|
36
|
+
'**Project-local only.** This registry prioritizes skills inside `./.claude/skills/` so the workflow does not depend on global installations such as `gentle-ai`.',
|
|
37
|
+
noSkills: '| manual | none | _No local skills yet_ |',
|
|
38
|
+
noRegistered: 'No local skills are registered yet.',
|
|
39
|
+
noConventions: '| none | none | No convention files found |',
|
|
40
|
+
policy: [
|
|
41
|
+
'Always prefer local skills from `./.claude/skills/`.',
|
|
42
|
+
'Do not depend on `~/.claude/skills/` for the main orchestrator workflow.',
|
|
43
|
+
'If a global skill has the same name as a project-local skill, the local skill wins.',
|
|
44
|
+
'Regenerate this file after creating, deleting, or changing local skills.'
|
|
45
|
+
],
|
|
46
|
+
updated: file => `Skill registry updated at ${file}`
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const L = TEXT[LANGUAGE];
|
|
50
|
+
|
|
51
|
+
const CONVENTION_FILES = [
|
|
52
|
+
'AGENTS.md',
|
|
53
|
+
'agents.md',
|
|
54
|
+
'CLAUDE.md',
|
|
55
|
+
'ORCHESTRATOR.md',
|
|
56
|
+
'PROJECT.md',
|
|
57
|
+
'README.md'
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
function ensureDir(dir) {
|
|
61
|
+
fs.mkdirSync(dir, {recursive: true});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function listSkillFiles(dir) {
|
|
65
|
+
if (!fs.existsSync(dir)) return [];
|
|
66
|
+
const entries = fs.readdirSync(dir, {withFileTypes: true});
|
|
67
|
+
const files = [];
|
|
68
|
+
for (const entry of entries) {
|
|
69
|
+
if (!entry.isDirectory()) continue;
|
|
70
|
+
const name = entry.name;
|
|
71
|
+
if (name === '_shared') continue;
|
|
72
|
+
const file = path.join(dir, name, 'SKILL.md');
|
|
73
|
+
if (fs.existsSync(file)) files.push(file);
|
|
74
|
+
}
|
|
75
|
+
return files.sort((a, b) => a.localeCompare(b));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function extractName(content, fallback) {
|
|
79
|
+
const match = content.match(/^\s*name:\s*(.+)$/im);
|
|
80
|
+
return match ? match[1].trim().replace(/^['"]|['"]$/g, '') : fallback;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function extractTrigger(content = '') {
|
|
84
|
+
const triggerLine = content.match(/^Trigger:\s*(.+)$/im);
|
|
85
|
+
if (triggerLine) return triggerLine[1].trim();
|
|
86
|
+
const descriptionTrigger = content.match(/Trigger:\s*([^.\n]+)/im);
|
|
87
|
+
return descriptionTrigger ? descriptionTrigger[1].trim() : 'manual';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function compactRules(content) {
|
|
91
|
+
const lines = content
|
|
92
|
+
.split('\n')
|
|
93
|
+
.map(line => line.trim())
|
|
94
|
+
.filter(Boolean);
|
|
95
|
+
|
|
96
|
+
const bullets = [];
|
|
97
|
+
for (const line of lines) {
|
|
98
|
+
if (line.startsWith('- ') || line.startsWith('* ')) {
|
|
99
|
+
bullets.push(line.replace(/^[-*]\s*/, ''));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const selected = bullets.slice(0, 8);
|
|
104
|
+
return selected.length > 0
|
|
105
|
+
? selected
|
|
106
|
+
: [L.fallbackRule];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function toPosix(filePath) {
|
|
110
|
+
return filePath.replaceAll('\\', '/');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function buildRegistry() {
|
|
114
|
+
const skillFiles = listSkillFiles(SKILLS_DIR);
|
|
115
|
+
const skills = skillFiles.map(file => {
|
|
116
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
117
|
+
return {
|
|
118
|
+
name: extractName(content, path.basename(path.dirname(file))),
|
|
119
|
+
trigger: extractTrigger(content),
|
|
120
|
+
path: toPosix(path.relative(ROOT, file)),
|
|
121
|
+
rules: compactRules(content)
|
|
122
|
+
};
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const conventions = CONVENTION_FILES.filter(file => fs.existsSync(path.join(ROOT, file))).map(
|
|
126
|
+
file => ({
|
|
127
|
+
file,
|
|
128
|
+
path: toPosix(file),
|
|
129
|
+
notes: file === 'ORCHESTRATOR.md' ? L.entryPoint : ''
|
|
130
|
+
})
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const registry = [
|
|
134
|
+
'# Skill Registry',
|
|
135
|
+
'',
|
|
136
|
+
L.intro,
|
|
137
|
+
'',
|
|
138
|
+
'## User Skills',
|
|
139
|
+
'',
|
|
140
|
+
'| Trigger | Skill | Path |',
|
|
141
|
+
'|---------|-------|------|',
|
|
142
|
+
...(skills.length > 0
|
|
143
|
+
? skills.map(skill => `| ${skill.trigger.replaceAll('|', '\\|')} | ${skill.name} | \`${skill.path}\` |`)
|
|
144
|
+
: [L.noSkills]),
|
|
145
|
+
'',
|
|
146
|
+
'## Compact Rules',
|
|
147
|
+
'',
|
|
148
|
+
...(skills.length > 0
|
|
149
|
+
? skills.flatMap(skill => [
|
|
150
|
+
`### ${skill.name}`,
|
|
151
|
+
...skill.rules.map(rule => `- ${rule}`),
|
|
152
|
+
''
|
|
153
|
+
])
|
|
154
|
+
: [L.noRegistered, '']),
|
|
155
|
+
'## Project Conventions',
|
|
156
|
+
'',
|
|
157
|
+
'| File | Path | Notes |',
|
|
158
|
+
'|------|------|-------|',
|
|
159
|
+
...(conventions.length > 0
|
|
160
|
+
? conventions.map(item => `| ${item.file} | \`${item.path}\` | ${item.notes || ''} |`)
|
|
161
|
+
: [L.noConventions]),
|
|
162
|
+
'',
|
|
163
|
+
'## Resolution Policy',
|
|
164
|
+
'',
|
|
165
|
+
...L.policy.map(rule => `- ${rule}`)
|
|
166
|
+
];
|
|
167
|
+
|
|
168
|
+
return registry.join('\n');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
ensureDir(OUTPUT_DIR);
|
|
172
|
+
const registry = buildRegistry();
|
|
173
|
+
fs.writeFileSync(OUTPUT_FILE, `${registry}\n`, 'utf8');
|
|
174
|
+
console.log(L.updated(OUTPUT_FILE));
|
package/src/ink/app.mjs
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import React, {useMemo} from 'react';
|
|
2
|
+
import {Box, Text, useInput, useStdout} from 'ink';
|
|
3
|
+
|
|
4
|
+
const h = React.createElement;
|
|
5
|
+
|
|
6
|
+
const COLORS = {
|
|
7
|
+
accent: 'cyan',
|
|
8
|
+
success: 'green',
|
|
9
|
+
warning: 'yellow',
|
|
10
|
+
muted: 'gray'
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const truncate = (value, size) => {
|
|
14
|
+
if (!value) return '';
|
|
15
|
+
return value.length > size ? `${value.slice(0, Math.max(0, size - 1))}…` : value;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const TEXT = {
|
|
19
|
+
es: {
|
|
20
|
+
busy: 'Ocupado',
|
|
21
|
+
idle: 'En espera',
|
|
22
|
+
noTask: 'Sin tarea activa',
|
|
23
|
+
ready: 'Listo para trabajar',
|
|
24
|
+
project: 'Proyecto',
|
|
25
|
+
state: 'Estado',
|
|
26
|
+
active: 'Activo',
|
|
27
|
+
busyCount: 'Activos',
|
|
28
|
+
pending: 'Pendientes',
|
|
29
|
+
completed: 'Completadas',
|
|
30
|
+
cost: 'Costo',
|
|
31
|
+
paused: 'Pausado',
|
|
32
|
+
preview: 'Explorando Ink',
|
|
33
|
+
shortcuts: 'Atajos',
|
|
34
|
+
start: 'iniciar/reanudar',
|
|
35
|
+
pause: 'pausar',
|
|
36
|
+
reload: 'recargar QUEUE.md',
|
|
37
|
+
quit: 'salir y matar agentes',
|
|
38
|
+
summary: 'Resumen',
|
|
39
|
+
activeQueue: 'Cola activa',
|
|
40
|
+
emptyQueue: 'No hay tareas pendientes.',
|
|
41
|
+
log: 'Registro'
|
|
42
|
+
},
|
|
43
|
+
en: {
|
|
44
|
+
busy: 'Busy',
|
|
45
|
+
idle: 'Idle',
|
|
46
|
+
noTask: 'No active task',
|
|
47
|
+
ready: 'Ready to work',
|
|
48
|
+
project: 'Project',
|
|
49
|
+
state: 'State',
|
|
50
|
+
active: 'Active',
|
|
51
|
+
busyCount: 'Busy',
|
|
52
|
+
pending: 'Pending',
|
|
53
|
+
completed: 'Completed',
|
|
54
|
+
cost: 'Cost',
|
|
55
|
+
paused: 'Paused',
|
|
56
|
+
preview: 'Exploring Ink',
|
|
57
|
+
shortcuts: 'Shortcuts',
|
|
58
|
+
start: 'start/resume',
|
|
59
|
+
pause: 'pause',
|
|
60
|
+
reload: 'reload QUEUE.md',
|
|
61
|
+
quit: 'quit and stop agents',
|
|
62
|
+
summary: 'Summary',
|
|
63
|
+
activeQueue: 'Active Queue',
|
|
64
|
+
emptyQueue: 'No pending tasks.',
|
|
65
|
+
log: 'Log'
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const Panel = ({title, width, children}) =>
|
|
70
|
+
h(
|
|
71
|
+
Box,
|
|
72
|
+
{
|
|
73
|
+
borderStyle: 'round',
|
|
74
|
+
borderColor: COLORS.accent,
|
|
75
|
+
paddingX: 1,
|
|
76
|
+
paddingY: 0,
|
|
77
|
+
width,
|
|
78
|
+
flexDirection: 'column'
|
|
79
|
+
},
|
|
80
|
+
h(Text, {bold: true, color: COLORS.accent}, title),
|
|
81
|
+
h(Box, {marginTop: 0, flexDirection: 'column'}, children)
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const AgentCard = ({agent, text}) => {
|
|
85
|
+
const statusColor = agent.status === 'busy' ? COLORS.success : COLORS.muted;
|
|
86
|
+
return h(
|
|
87
|
+
Box,
|
|
88
|
+
{
|
|
89
|
+
borderStyle: 'round',
|
|
90
|
+
borderColor: statusColor,
|
|
91
|
+
width: '24%',
|
|
92
|
+
minHeight: 6,
|
|
93
|
+
paddingX: 1,
|
|
94
|
+
flexDirection: 'column'
|
|
95
|
+
},
|
|
96
|
+
h(Text, {bold: true}, agent.name),
|
|
97
|
+
h(Text, {color: statusColor}, agent.status === 'busy' ? text.busy : text.idle),
|
|
98
|
+
h(
|
|
99
|
+
Text,
|
|
100
|
+
{color: COLORS.muted},
|
|
101
|
+
agent.task ? truncate(agent.task, 26) : text.noTask
|
|
102
|
+
),
|
|
103
|
+
h(Text, {color: COLORS.muted}, agent.detail || text.ready)
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export function App({snapshot, paused = false, onAction}) {
|
|
108
|
+
const {stdout} = useStdout();
|
|
109
|
+
const columns = stdout?.columns ?? 120;
|
|
110
|
+
const isCompact = columns < 120;
|
|
111
|
+
const summaryWidth = Math.max(20, Math.floor((isCompact ? columns : columns * 0.28) - 8));
|
|
112
|
+
const queueWidth = Math.max(20, Math.floor((isCompact ? columns : columns * 0.42) - 8));
|
|
113
|
+
const logWidth = Math.max(20, Math.floor((isCompact ? columns : columns * 0.35) - 8));
|
|
114
|
+
const heroWidth = Math.max(20, columns - 8);
|
|
115
|
+
const shortcutWidth = Math.max(20, columns - 4);
|
|
116
|
+
const agentWidth = Math.max(18, Math.floor((isCompact ? columns : columns * 0.24) - 8));
|
|
117
|
+
const text = TEXT[snapshot.workspaceLanguage === 'en' ? 'en' : 'es'];
|
|
118
|
+
|
|
119
|
+
useInput((input, key) => {
|
|
120
|
+
if (key.ctrl && input === 'c') {
|
|
121
|
+
onAction?.('quit');
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const normalized = input.toLowerCase();
|
|
126
|
+
if (normalized === 'r') onAction?.('reload');
|
|
127
|
+
if (normalized === 's') onAction?.('start');
|
|
128
|
+
if (normalized === 'p') onAction?.('pause');
|
|
129
|
+
if (normalized === 'q') onAction?.('quit');
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const liveActiveLabel = snapshot.activeLabel || '0s';
|
|
133
|
+
|
|
134
|
+
const busyCount = snapshot.agents.filter(agent => agent.status === 'busy').length;
|
|
135
|
+
const overview = useMemo(
|
|
136
|
+
() => [
|
|
137
|
+
`${text.project}: ${snapshot.projectName}`,
|
|
138
|
+
`${text.state}: ${snapshot.stateLabel || (paused ? text.paused : text.preview)}`,
|
|
139
|
+
`${text.active}: ${liveActiveLabel}`,
|
|
140
|
+
`${text.busyCount}: ${busyCount}/${snapshot.agents.length}`,
|
|
141
|
+
`${text.pending}: ${snapshot.queue.length}`,
|
|
142
|
+
`${text.completed}: ${snapshot.completed.length}`,
|
|
143
|
+
`${text.cost}: ${snapshot.totalCost}`
|
|
144
|
+
],
|
|
145
|
+
[busyCount, liveActiveLabel, paused, snapshot, text]
|
|
146
|
+
);
|
|
147
|
+
const heroLine = truncate(
|
|
148
|
+
`${snapshot.timestamp} | ${snapshot.stateLabel || (paused ? text.paused : text.preview)} | ${text.active.toLowerCase()} ${liveActiveLabel}`,
|
|
149
|
+
heroWidth
|
|
150
|
+
);
|
|
151
|
+
const shortcutRest = truncate(
|
|
152
|
+
`S ${text.start} P ${text.pause} R ${text.reload} Q ${text.quit}`,
|
|
153
|
+
Math.max(0, shortcutWidth - 8)
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
return h(
|
|
157
|
+
Box,
|
|
158
|
+
{flexDirection: 'column', paddingX: 1, paddingY: 0},
|
|
159
|
+
h(
|
|
160
|
+
Box,
|
|
161
|
+
{
|
|
162
|
+
borderStyle: 'round',
|
|
163
|
+
borderColor: COLORS.accent,
|
|
164
|
+
paddingX: 1,
|
|
165
|
+
paddingY: 0,
|
|
166
|
+
marginBottom: 1,
|
|
167
|
+
flexDirection: 'column'
|
|
168
|
+
},
|
|
169
|
+
h(Text, {bold: true, color: COLORS.accent}, snapshot.projectName),
|
|
170
|
+
h(Text, {color: COLORS.muted}, heroLine)
|
|
171
|
+
),
|
|
172
|
+
h(
|
|
173
|
+
Box,
|
|
174
|
+
{marginBottom: 1},
|
|
175
|
+
h(Text, {color: COLORS.warning}, `${text.shortcuts}: `),
|
|
176
|
+
h(Text, {bold: true}, 'S'),
|
|
177
|
+
h(Text, {color: COLORS.muted}, truncate(` ${text.start} `, Math.max(0, shortcutWidth - 40))),
|
|
178
|
+
h(Text, {bold: true}, 'P'),
|
|
179
|
+
h(Text, {color: COLORS.muted}, truncate(` ${text.pause} `, Math.max(0, shortcutWidth - 55))),
|
|
180
|
+
h(Text, {bold: true}, 'R'),
|
|
181
|
+
h(Text, {color: COLORS.muted}, truncate(` ${text.reload} `, Math.max(0, shortcutWidth - 70))),
|
|
182
|
+
h(Text, {bold: true}, 'Q'),
|
|
183
|
+
h(Text, {color: COLORS.muted}, truncate(` ${text.quit}`, Math.max(0, shortcutWidth - 90)))
|
|
184
|
+
),
|
|
185
|
+
h(
|
|
186
|
+
Box,
|
|
187
|
+
{
|
|
188
|
+
flexDirection: isCompact ? 'column' : 'row',
|
|
189
|
+
gap: 1,
|
|
190
|
+
marginBottom: 1
|
|
191
|
+
},
|
|
192
|
+
h(
|
|
193
|
+
Panel,
|
|
194
|
+
{title: text.summary, width: isCompact ? '100%' : '28%'},
|
|
195
|
+
...overview.map(line => h(Text, {key: line}, truncate(line, summaryWidth)))
|
|
196
|
+
),
|
|
197
|
+
h(
|
|
198
|
+
Panel,
|
|
199
|
+
{title: text.activeQueue, width: isCompact ? '100%' : '42%'},
|
|
200
|
+
...(snapshot.queue.length === 0
|
|
201
|
+
? [h(Text, {color: COLORS.muted, key: 'empty-queue'}, text.emptyQueue)]
|
|
202
|
+
: snapshot.queue.slice(0, 6).map(task =>
|
|
203
|
+
h(
|
|
204
|
+
Text,
|
|
205
|
+
{key: task.id},
|
|
206
|
+
truncate(`${task.id} · ${task.title}`, queueWidth)
|
|
207
|
+
)
|
|
208
|
+
))
|
|
209
|
+
),
|
|
210
|
+
h(
|
|
211
|
+
Panel,
|
|
212
|
+
{title: text.log, width: isCompact ? '100%' : '35%'},
|
|
213
|
+
...snapshot.logs
|
|
214
|
+
.slice(-6)
|
|
215
|
+
.map(entry => h(Text, {key: entry, color: COLORS.muted}, truncate(entry, logWidth)))
|
|
216
|
+
)
|
|
217
|
+
),
|
|
218
|
+
h(
|
|
219
|
+
Box,
|
|
220
|
+
{
|
|
221
|
+
flexDirection: 'row',
|
|
222
|
+
flexWrap: 'wrap',
|
|
223
|
+
columnGap: 1,
|
|
224
|
+
rowGap: 1
|
|
225
|
+
},
|
|
226
|
+
...snapshot.agents.map(agent =>
|
|
227
|
+
h(AgentCard, {
|
|
228
|
+
text,
|
|
229
|
+
key: agent.name,
|
|
230
|
+
agent: {
|
|
231
|
+
...agent,
|
|
232
|
+
name: truncate(agent.name, agentWidth),
|
|
233
|
+
task: agent.task ? truncate(agent.task, agentWidth) : null,
|
|
234
|
+
detail: truncate(agent.detail || text.ready, agentWidth)
|
|
235
|
+
}
|
|
236
|
+
})
|
|
237
|
+
)
|
|
238
|
+
)
|
|
239
|
+
);
|
|
240
|
+
}
|