@jaimevalasek/aioson 1.4.0 → 1.6.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/CHANGELOG.md +31 -1
- package/LICENSE +661 -21
- package/README.md +9 -1
- package/docs/design-previews/aurora-command-ui-website.html +884 -0
- package/docs/design-previews/aurora-command-ui.html +682 -0
- package/docs/design-previews/bold-editorial-ui-website.html +658 -0
- package/docs/design-previews/bold-editorial-ui.html +717 -0
- package/docs/design-previews/clean-saas-ui-website.html +1202 -0
- package/docs/design-previews/clean-saas-ui.html +549 -0
- package/docs/design-previews/cognitive-core-ui-website.html +1009 -0
- package/docs/design-previews/cognitive-core-ui.html +463 -0
- package/docs/design-previews/glassmorphism-ui-website.html +572 -0
- package/docs/design-previews/glassmorphism-ui.html +886 -0
- package/docs/design-previews/index.html +699 -0
- package/docs/design-previews/interface-design-website.html +1187 -0
- package/docs/design-previews/interface-design.html +513 -0
- package/docs/design-previews/neo-brutalist-ui-website.html +621 -0
- package/docs/design-previews/neo-brutalist-ui.html +797 -0
- package/docs/design-previews/premium-command-center-ui-website.html +1217 -0
- package/docs/design-previews/premium-command-center-ui.html +552 -0
- package/docs/design-previews/warm-craft-ui-website.html +684 -0
- package/docs/design-previews/warm-craft-ui.html +739 -0
- package/docs/en/cli-reference.md +20 -9
- package/docs/en/squad-dashboard.md +372 -0
- package/docs/openclaw-bridge.md +308 -0
- package/docs/pt/README.md +7 -0
- package/docs/pt/agent-sharding.md +132 -0
- package/docs/pt/agentes.md +131 -11
- package/docs/pt/busca-de-contexto.md +129 -0
- package/docs/pt/cache-de-contexto.md +156 -0
- package/docs/pt/cenarios.md +46 -2
- package/docs/pt/comandos-cli.md +88 -1
- package/docs/pt/design-hybrid-forge.md +107 -0
- package/docs/pt/inicio-rapido.md +72 -5
- package/docs/pt/inteligencia-adaptativa.md +324 -0
- package/docs/pt/monitor-de-contexto.md +104 -0
- package/docs/pt/recuperacao-de-sessao.md +125 -0
- package/docs/pt/sandbox.md +125 -0
- package/docs/pt/skills.md +98 -6
- package/docs/pt/squad-dashboard.md +373 -0
- package/docs/testing/genome-2.0-matrix.md +5 -5
- package/docs/testing/genome-2.0-rollout.md +9 -9
- package/package.json +2 -2
- package/src/agent-loader.js +280 -0
- package/src/backup-local.js +74 -0
- package/src/cli.js +192 -0
- package/src/commands/agent-loader.js +85 -0
- package/src/commands/backup-local-cmd.js +25 -0
- package/src/commands/context-cache.js +90 -0
- package/src/commands/context-monitor.js +92 -0
- package/src/commands/context-search.js +66 -0
- package/src/commands/design-hybrid-options.js +385 -0
- package/src/commands/health.js +214 -0
- package/src/commands/init.js +54 -13
- package/src/commands/install.js +52 -13
- package/src/commands/learning-evolve.js +355 -0
- package/src/commands/live.js +34 -0
- package/src/commands/recovery.js +43 -0
- package/src/commands/runtime.js +242 -0
- package/src/commands/sandbox.js +37 -0
- package/src/commands/setup-context.js +29 -4
- package/src/commands/setup.js +178 -0
- package/src/commands/skill.js +79 -32
- package/src/commands/squad-daemon.js +209 -0
- package/src/commands/squad-dashboard.js +39 -0
- package/src/commands/squad-deploy.js +64 -0
- package/src/commands/squad-doctor.js +52 -0
- package/src/commands/squad-mcp.js +270 -0
- package/src/commands/squad-processes.js +56 -0
- package/src/commands/squad-recovery.js +42 -0
- package/src/commands/squad-roi.js +291 -0
- package/src/commands/squad-score.js +250 -0
- package/src/commands/squad-status.js +37 -1
- package/src/commands/squad-validate.js +62 -1
- package/src/commands/squad-webhook.js +160 -0
- package/src/commands/squad-worker.js +191 -0
- package/src/commands/squad-worktrees.js +75 -0
- package/src/commands/tool-registry-cmd.js +232 -0
- package/src/commands/update.js +7 -0
- package/src/commands/web-map.js +70 -0
- package/src/commands/web-scrape.js +71 -0
- package/src/constants.js +17 -0
- package/src/context-cache.js +159 -0
- package/src/context-search.js +326 -0
- package/src/context-writer.js +45 -1
- package/src/design-variation-catalog.js +503 -0
- package/src/i18n/messages/en.js +159 -3
- package/src/i18n/messages/es.js +147 -2
- package/src/i18n/messages/fr.js +147 -2
- package/src/i18n/messages/pt-BR.js +158 -3
- package/src/install-animation.js +260 -0
- package/src/install-profile.js +143 -0
- package/src/install-wizard.js +474 -0
- package/src/installer.js +38 -10
- package/src/lib/webhook-server.js +328 -0
- package/src/mcp-connectors/registry.js +602 -0
- package/src/parser.js +7 -1
- package/src/recovery-context-session.js +154 -0
- package/src/runtime-store.js +355 -2
- package/src/sandbox.js +177 -0
- package/src/squad/external-session.js +180 -0
- package/src/squad/inter-squad.js +74 -0
- package/src/squad/recovery-context.js +201 -0
- package/src/squad/worktree-manager.js +114 -0
- package/src/squad-daemon.js +490 -0
- package/src/squad-dashboard/api.js +223 -0
- package/src/squad-dashboard/attachment-handler.js +93 -0
- package/src/squad-dashboard/context-monitor.js +157 -0
- package/src/squad-dashboard/execution-logs.js +115 -0
- package/src/squad-dashboard/hunk-review.js +209 -0
- package/src/squad-dashboard/metrics.js +133 -0
- package/src/squad-dashboard/process-monitor.js +125 -0
- package/src/squad-dashboard/renderer.js +858 -0
- package/src/squad-dashboard/server.js +232 -0
- package/src/squad-dashboard/styles.js +525 -0
- package/src/squad-dashboard/token-tracker.js +99 -0
- package/src/tool-executor.js +94 -0
- package/src/updater.js +11 -3
- package/src/web.js +284 -0
- package/src/worker-runner.js +339 -0
- package/template/.aioson/agents/analyst.md +62 -3
- package/template/.aioson/agents/architect.md +42 -0
- package/template/.aioson/agents/design-hybrid-forge.md +127 -0
- package/template/.aioson/agents/dev.md +223 -11
- package/template/.aioson/agents/deyvin.md +65 -0
- package/template/.aioson/agents/neo.md +152 -0
- package/template/.aioson/agents/orache.md +17 -0
- package/template/.aioson/agents/orchestrator.md +26 -0
- package/template/.aioson/agents/pm.md +58 -0
- package/template/.aioson/agents/product.md +88 -12
- package/template/.aioson/agents/qa.md +80 -0
- package/template/.aioson/agents/setup.md +128 -22
- package/template/.aioson/agents/sheldon.md +704 -0
- package/template/.aioson/agents/squad.md +191 -0
- package/template/.aioson/agents/tester.md +410 -0
- package/template/.aioson/agents/ux-ui.md +12 -0
- package/template/.aioson/config.md +21 -0
- package/template/.aioson/context/forensics/.gitkeep +0 -0
- package/template/.aioson/context/seeds/seed-example.md +27 -0
- package/template/.aioson/context/user-profile.md +42 -0
- package/template/.aioson/locales/en/agents/analyst.md +8 -0
- package/template/.aioson/locales/en/agents/architect.md +8 -0
- package/template/.aioson/locales/en/agents/dev.md +66 -7
- package/template/.aioson/locales/en/agents/deyvin.md +8 -0
- package/template/.aioson/locales/en/agents/neo.md +8 -0
- package/template/.aioson/locales/en/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/en/agents/qa.md +49 -0
- package/template/.aioson/locales/en/agents/setup.md +35 -2
- package/template/.aioson/locales/en/agents/sheldon.md +340 -0
- package/template/.aioson/locales/en/agents/ux-ui.md +8 -0
- package/template/.aioson/locales/es/agents/analyst.md +8 -0
- package/template/.aioson/locales/es/agents/architect.md +8 -0
- package/template/.aioson/locales/es/agents/dev.md +66 -7
- package/template/.aioson/locales/es/agents/deyvin.md +8 -0
- package/template/.aioson/locales/es/agents/neo.md +48 -0
- package/template/.aioson/locales/es/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/es/agents/qa.md +26 -0
- package/template/.aioson/locales/es/agents/setup.md +35 -2
- package/template/.aioson/locales/es/agents/sheldon.md +192 -0
- package/template/.aioson/locales/es/agents/squad.md +63 -0
- package/template/.aioson/locales/es/agents/ux-ui.md +8 -0
- package/template/.aioson/locales/fr/agents/analyst.md +8 -0
- package/template/.aioson/locales/fr/agents/architect.md +8 -0
- package/template/.aioson/locales/fr/agents/dev.md +66 -7
- package/template/.aioson/locales/fr/agents/deyvin.md +8 -0
- package/template/.aioson/locales/fr/agents/neo.md +48 -0
- package/template/.aioson/locales/fr/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/fr/agents/qa.md +26 -0
- package/template/.aioson/locales/fr/agents/setup.md +35 -2
- package/template/.aioson/locales/fr/agents/sheldon.md +192 -0
- package/template/.aioson/locales/fr/agents/squad.md +63 -0
- package/template/.aioson/locales/fr/agents/ux-ui.md +8 -0
- package/template/.aioson/locales/pt-BR/agents/analyst.md +19 -0
- package/template/.aioson/locales/pt-BR/agents/architect.md +19 -0
- package/template/.aioson/locales/pt-BR/agents/dev.md +75 -12
- package/template/.aioson/locales/pt-BR/agents/deyvin.md +8 -0
- package/template/.aioson/locales/pt-BR/agents/neo.md +147 -0
- package/template/.aioson/locales/pt-BR/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/pt-BR/agents/product.md +8 -3
- package/template/.aioson/locales/pt-BR/agents/qa.md +60 -0
- package/template/.aioson/locales/pt-BR/agents/setup.md +35 -2
- package/template/.aioson/locales/pt-BR/agents/sheldon.md +192 -0
- package/template/.aioson/locales/pt-BR/agents/squad.md +105 -0
- package/template/.aioson/locales/pt-BR/agents/ux-ui.md +8 -0
- package/template/.aioson/schemas/squad-blueprint.schema.json +21 -0
- package/template/.aioson/schemas/squad-manifest.schema.json +178 -1
- package/template/.aioson/skills/design/aurora-command-ui/SKILL.md +243 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/art-direction.md +293 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/components.md +827 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/dashboards.md +250 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/design-tokens.md +585 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/motion.md +365 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/patterns.md +482 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/websites.md +387 -0
- package/template/.aioson/skills/design/bold-editorial-ui/SKILL.md +205 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/art-direction.md +338 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/components.md +977 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/dashboards.md +218 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/design-tokens.md +326 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/motion.md +461 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/patterns.md +293 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/websites.md +352 -0
- package/template/.aioson/skills/design/clean-saas-ui/SKILL.md +210 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/art-direction.md +319 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/components.md +365 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/dashboards.md +196 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/design-tokens.md +244 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/motion.md +235 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/patterns.md +215 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/websites.md +295 -0
- package/template/.aioson/skills/design/cognitive-core-ui/SKILL.md +55 -9
- package/template/.aioson/skills/design/cognitive-core-ui/references/art-direction.md +339 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/components.md +1 -1
- package/template/.aioson/skills/design/cognitive-core-ui/references/dashboards.md +100 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/design-tokens.md +43 -9
- package/template/.aioson/skills/design/cognitive-core-ui/references/motion.md +40 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/patterns.md +1 -1
- package/template/.aioson/skills/design/cognitive-core-ui/references/websites.md +99 -12
- package/template/.aioson/skills/design/glassmorphism-ui/SKILL.md +222 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/art-direction.md +159 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/components.md +498 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/dashboards.md +236 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/design-tokens.md +274 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/motion.md +355 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/patterns.md +198 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/websites.md +307 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/SKILL.md +213 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/art-direction.md +228 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/components.md +855 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/dashboards.md +334 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/design-tokens.md +342 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/motion.md +286 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/patterns.md +458 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/websites.md +723 -0
- package/template/.aioson/skills/design/warm-craft-ui/SKILL.md +209 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/art-direction.md +324 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/components.md +508 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/dashboards.md +223 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/design-tokens.md +374 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/motion.md +356 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/patterns.md +288 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/websites.md +289 -0
- package/template/.aioson/skills/premium-visual-design/SKILL.md +83 -0
- package/template/.aioson/skills/premium-visual-design/components/agent-badge.md +92 -0
- package/template/.aioson/skills/premium-visual-design/components/dependency-node.md +102 -0
- package/template/.aioson/skills/premium-visual-design/components/mention-autocomplete.md +136 -0
- package/template/.aioson/skills/premium-visual-design/components/notification-center.md +136 -0
- package/template/.aioson/skills/premium-visual-design/components/review-action-bar.md +188 -0
- package/template/.aioson/skills/premium-visual-design/components/team-switcher.md +131 -0
- package/template/.aioson/skills/premium-visual-design/patterns/agent-message-thread.md +198 -0
- package/template/.aioson/skills/premium-visual-design/patterns/notification-panel.md +275 -0
- package/template/.aioson/skills/premium-visual-design/patterns/review-workflow-ui.md +234 -0
- package/template/.aioson/skills/premium-visual-design/patterns/task-dependency-graph.md +147 -0
- package/template/.aioson/skills/premium-visual-design/tokens/status-extended.md +142 -0
- package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +45 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +109 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/artifact-map.md +44 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/classification-map.md +37 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/hardening-lane.md +49 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/maintenance-and-state.md +66 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/ui-language.md +75 -0
- package/template/.aioson/skills/process/design-hybrid-forge/SKILL.md +144 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/crossover-protocol.md +221 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/naming-registry.md +88 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/output-contract.md +291 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/pair-compatibility.md +117 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/quality-gates.md +188 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/variation-library.md +125 -0
- package/template/.aioson/skills/squad/formats/catalog.json +15 -0
- package/template/.aioson/skills/squad/formats/content/blog-post.md +47 -0
- package/template/.aioson/skills/squad/formats/content/newsletter.md +47 -0
- package/template/.aioson/skills/squad/formats/creative/podcast-script.md +43 -0
- package/template/.aioson/skills/squad/formats/creative/video-script.md +41 -0
- package/template/.aioson/skills/squad/formats/social/instagram-feed.md +42 -0
- package/template/.aioson/skills/squad/formats/social/linkedin-post.md +42 -0
- package/template/.aioson/skills/squad/formats/social/tiktok.md +39 -0
- package/template/.aioson/skills/squad/formats/social/twitter-thread.md +39 -0
- package/template/.aioson/skills/squad/formats/social/youtube-long.md +47 -0
- package/template/.aioson/skills/squad/formats/social/youtube-shorts.md +39 -0
- package/template/.aioson/skills/squad/patterns/multi-platform-pattern.md +108 -0
- package/template/.aioson/skills/squad/patterns/persona-based-pattern.md +98 -0
- package/template/.aioson/skills/squad/patterns/pipeline-pattern.md +106 -0
- package/template/.aioson/skills/squad/patterns/review-loop-pattern.md +81 -0
- package/template/.aioson/skills/squad/references/checklist-templates.md +122 -0
- package/template/.aioson/skills/squad/references/executor-archetypes.md +123 -0
- package/template/.aioson/skills/squad/references/workflow-templates.md +169 -0
- package/template/.aioson/skills/static/debugging-protocol.md +42 -0
- package/template/.aioson/skills/static/git-worktrees.md +36 -0
- package/template/.aioson/tasks/implementation-plan.md +19 -0
- package/template/.aioson/tasks/squad-design.md +28 -0
- package/template/.aioson/tasks/squad-profile.md +48 -0
- package/template/.aioson/tasks/squad-review.md +61 -0
- package/template/.aioson/tasks/squad-task-decompose.md +66 -0
- package/template/.claude/commands/aioson/agent/neo.md +5 -0
- package/template/.claude/commands/aioson/agent/tester.md +5 -0
- package/template/.gemini/GEMINI.md +1 -0
- package/template/.gemini/commands/aios-neo.toml +4 -0
- package/template/.gemini/commands/aios-tester.toml +6 -0
- package/template/AGENTS.md +26 -1
- package/template/CLAUDE.md +6 -2
- package/template/OPENCODE.md +2 -0
package/src/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ const { parseArgv } = require('./parser');
|
|
|
5
5
|
const { createTranslator, normalizeLocale } = require('./i18n');
|
|
6
6
|
const { runInit } = require('./commands/init');
|
|
7
7
|
const { runInstall } = require('./commands/install');
|
|
8
|
+
const { runSetup } = require('./commands/setup');
|
|
8
9
|
const { runUpdate } = require('./commands/update');
|
|
9
10
|
const { runInfo } = require('./commands/info');
|
|
10
11
|
const { runDoctorCommand } = require('./commands/doctor');
|
|
@@ -32,6 +33,8 @@ const { runQaInit } = require('./commands/qa-init');
|
|
|
32
33
|
const { runQaRun } = require('./commands/qa-run');
|
|
33
34
|
const { runQaScan } = require('./commands/qa-scan');
|
|
34
35
|
const { runQaReport } = require('./commands/qa-report');
|
|
36
|
+
const { runWebMap } = require('./commands/web-map');
|
|
37
|
+
const { runWebScrape } = require('./commands/web-scrape');
|
|
35
38
|
const { runScanProject } = require('./commands/scan-project');
|
|
36
39
|
const { runConfig } = require('./commands/config');
|
|
37
40
|
const { runGenomeDoctor } = require('./commands/genome-doctor');
|
|
@@ -48,6 +51,17 @@ const { runImplementationPlan } = require('./commands/implementation-plan');
|
|
|
48
51
|
const { runSquadPlan } = require('./commands/squad-plan');
|
|
49
52
|
const { runSquadLearning } = require('./commands/squad-learning');
|
|
50
53
|
const { runLearning } = require('./commands/learning');
|
|
54
|
+
const { runSquadDashboard } = require('./commands/squad-dashboard');
|
|
55
|
+
const { runSquadWorker } = require('./commands/squad-worker');
|
|
56
|
+
const { runSquadDaemon } = require('./commands/squad-daemon');
|
|
57
|
+
const { runSquadMcp } = require('./commands/squad-mcp');
|
|
58
|
+
const { runSquadRoi } = require('./commands/squad-roi');
|
|
59
|
+
const { runSquadScore } = require('./commands/squad-score');
|
|
60
|
+
const { runSquadProcesses } = require('./commands/squad-processes');
|
|
61
|
+
const { runSquadWorktrees, runSquadMerge } = require('./commands/squad-worktrees');
|
|
62
|
+
const { runSquadRecovery } = require('./commands/squad-recovery');
|
|
63
|
+
const { runSquadDeploy } = require('./commands/squad-deploy');
|
|
64
|
+
const { runSquadWebhook } = require('./commands/squad-webhook');
|
|
51
65
|
const {
|
|
52
66
|
runRuntimeInit,
|
|
53
67
|
runRuntimeIngest,
|
|
@@ -60,6 +74,8 @@ const {
|
|
|
60
74
|
runRuntimeFail,
|
|
61
75
|
runRuntimeStatus,
|
|
62
76
|
runRuntimeLog,
|
|
77
|
+
runAgentDone,
|
|
78
|
+
runAgentRecover,
|
|
63
79
|
runRuntimeSessionStart,
|
|
64
80
|
runRuntimeSessionLog,
|
|
65
81
|
runRuntimeSessionFinish,
|
|
@@ -93,10 +109,22 @@ const {
|
|
|
93
109
|
runSkillList,
|
|
94
110
|
runSkillRemove
|
|
95
111
|
} = require('./commands/skill');
|
|
112
|
+
const { runDesignHybridOptions } = require('./commands/design-hybrid-options');
|
|
113
|
+
const { runBackupLocal } = require('./commands/backup-local-cmd');
|
|
114
|
+
const { runRecoveryGenerate, runRecoveryShow } = require('./commands/recovery');
|
|
115
|
+
const { runContextMonitor } = require('./commands/context-monitor');
|
|
116
|
+
const { runContextSearch, runContextSearchIndex } = require('./commands/context-search');
|
|
117
|
+
const { runContextCacheList, runContextCacheSave, runContextCacheRestore, runContextCacheCleanup } = require('./commands/context-cache');
|
|
118
|
+
const { runSandboxExec } = require('./commands/sandbox');
|
|
119
|
+
const { runAgentLoad, runAgentShardIndex } = require('./commands/agent-loader');
|
|
120
|
+
const { runLearningEvolve, runLearningApply } = require('./commands/learning-evolve');
|
|
121
|
+
const { runToolRegistry } = require('./commands/tool-registry-cmd');
|
|
122
|
+
const { runHealth } = require('./commands/health');
|
|
96
123
|
|
|
97
124
|
const JSON_SUPPORTED_COMMANDS = new Set([
|
|
98
125
|
'init',
|
|
99
126
|
'install',
|
|
127
|
+
'setup',
|
|
100
128
|
'update',
|
|
101
129
|
'i18n:add',
|
|
102
130
|
'i18n-add',
|
|
@@ -159,6 +187,10 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
159
187
|
'qa-scan',
|
|
160
188
|
'qa:report',
|
|
161
189
|
'qa-report',
|
|
190
|
+
'web:map',
|
|
191
|
+
'web-map',
|
|
192
|
+
'web:scrape',
|
|
193
|
+
'web-scrape',
|
|
162
194
|
'scan:project',
|
|
163
195
|
'scan-project',
|
|
164
196
|
'config',
|
|
@@ -182,6 +214,31 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
182
214
|
'squad-agent-create',
|
|
183
215
|
'squad:investigate',
|
|
184
216
|
'squad-investigate',
|
|
217
|
+
'squad:dashboard',
|
|
218
|
+
'squad-dashboard',
|
|
219
|
+
'squad:worker',
|
|
220
|
+
'squad-worker',
|
|
221
|
+
'squad:daemon',
|
|
222
|
+
'squad-daemon',
|
|
223
|
+
'squad:mcp',
|
|
224
|
+
'squad-mcp',
|
|
225
|
+
'squad:mcp:call',
|
|
226
|
+
'squad:roi',
|
|
227
|
+
'squad-roi',
|
|
228
|
+
'squad:score',
|
|
229
|
+
'squad-score',
|
|
230
|
+
'squad:processes',
|
|
231
|
+
'squad-processes',
|
|
232
|
+
'squad:worktrees',
|
|
233
|
+
'squad-worktrees',
|
|
234
|
+
'squad:merge',
|
|
235
|
+
'squad-merge',
|
|
236
|
+
'squad:recovery',
|
|
237
|
+
'squad-recovery',
|
|
238
|
+
'squad:deploy',
|
|
239
|
+
'squad-deploy',
|
|
240
|
+
'squad:webhook',
|
|
241
|
+
'squad-webhook',
|
|
185
242
|
'plan:show',
|
|
186
243
|
'plan:status',
|
|
187
244
|
'plan:checkpoint',
|
|
@@ -196,6 +253,21 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
196
253
|
'learning:list',
|
|
197
254
|
'learning:stats',
|
|
198
255
|
'learning:promote',
|
|
256
|
+
'learning:evolve',
|
|
257
|
+
'learning-evolve',
|
|
258
|
+
'learning:apply',
|
|
259
|
+
'learning-apply',
|
|
260
|
+
'tool:register',
|
|
261
|
+
'tool-register',
|
|
262
|
+
'tool:list',
|
|
263
|
+
'tool-list',
|
|
264
|
+
'tool:call',
|
|
265
|
+
'tool-call',
|
|
266
|
+
'tool:unregister',
|
|
267
|
+
'tool-unregister',
|
|
268
|
+
'tool:show',
|
|
269
|
+
'tool-show',
|
|
270
|
+
'health',
|
|
199
271
|
'runtime:init',
|
|
200
272
|
'runtime-init',
|
|
201
273
|
'runtime:ingest',
|
|
@@ -218,6 +290,10 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
218
290
|
'runtime-status',
|
|
219
291
|
'runtime:log',
|
|
220
292
|
'runtime-log',
|
|
293
|
+
'agent:done',
|
|
294
|
+
'agent-done',
|
|
295
|
+
'agent:recover',
|
|
296
|
+
'agent-recover',
|
|
221
297
|
'runtime:session:start',
|
|
222
298
|
'runtime-session-start',
|
|
223
299
|
'runtime:session:log',
|
|
@@ -259,6 +335,32 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
259
335
|
'skill-list',
|
|
260
336
|
'skill:remove',
|
|
261
337
|
'skill-remove',
|
|
338
|
+
'design-hybrid:options',
|
|
339
|
+
'design-hybrid-options',
|
|
340
|
+
'recovery:generate',
|
|
341
|
+
'recovery-generate',
|
|
342
|
+
'recovery:show',
|
|
343
|
+
'recovery-show',
|
|
344
|
+
'context:monitor',
|
|
345
|
+
'context-monitor',
|
|
346
|
+
'context:search',
|
|
347
|
+
'context-search',
|
|
348
|
+
'context:search:index',
|
|
349
|
+
'context-search-index',
|
|
350
|
+
'context:cache',
|
|
351
|
+
'context-cache',
|
|
352
|
+
'context:cache:save',
|
|
353
|
+
'context-cache-save',
|
|
354
|
+
'context:cache:restore',
|
|
355
|
+
'context-cache-restore',
|
|
356
|
+
'context:cache:cleanup',
|
|
357
|
+
'context-cache-cleanup',
|
|
358
|
+
'sandbox:exec',
|
|
359
|
+
'sandbox-exec',
|
|
360
|
+
'agent:load',
|
|
361
|
+
'agent-load',
|
|
362
|
+
'agent:shard:index',
|
|
363
|
+
'agent-shard-index',
|
|
262
364
|
'version',
|
|
263
365
|
'--version',
|
|
264
366
|
'-v'
|
|
@@ -305,6 +407,7 @@ function printHelp(t, logger) {
|
|
|
305
407
|
logger.log(t('cli.usage'));
|
|
306
408
|
logHelpLine(t, logger, 'cli.help_init');
|
|
307
409
|
logHelpLine(t, logger, 'cli.help_install');
|
|
410
|
+
logHelpLine(t, logger, 'cli.help_setup');
|
|
308
411
|
logHelpLine(t, logger, 'cli.help_update');
|
|
309
412
|
logHelpLine(t, logger, 'cli.help_info');
|
|
310
413
|
logHelpLine(t, logger, 'cli.help_doctor');
|
|
@@ -333,6 +436,8 @@ function printHelp(t, logger) {
|
|
|
333
436
|
logHelpLine(t, logger, 'cli.help_qa_run');
|
|
334
437
|
logHelpLine(t, logger, 'cli.help_qa_scan');
|
|
335
438
|
logHelpLine(t, logger, 'cli.help_qa_report');
|
|
439
|
+
logHelpLine(t, logger, 'cli.help_web_map');
|
|
440
|
+
logHelpLine(t, logger, 'cli.help_web_scrape');
|
|
336
441
|
logHelpLine(t, logger, 'cli.help_scan_project');
|
|
337
442
|
logHelpLine(t, logger, 'cli.help_config');
|
|
338
443
|
logHelpLine(t, logger, 'cli.help_genome_doctor');
|
|
@@ -345,6 +450,12 @@ function printHelp(t, logger) {
|
|
|
345
450
|
logHelpLine(t, logger, 'cli.help_squad_pipeline');
|
|
346
451
|
logHelpLine(t, logger, 'cli.help_squad_agent_create');
|
|
347
452
|
logHelpLine(t, logger, 'cli.help_squad_investigate');
|
|
453
|
+
logHelpLine(t, logger, 'cli.help_squad_dashboard');
|
|
454
|
+
logHelpLine(t, logger, 'cli.help_squad_worker');
|
|
455
|
+
logHelpLine(t, logger, 'cli.help_squad_daemon');
|
|
456
|
+
logHelpLine(t, logger, 'cli.help_squad_mcp');
|
|
457
|
+
logHelpLine(t, logger, 'cli.help_squad_roi');
|
|
458
|
+
logHelpLine(t, logger, 'cli.help_squad_score');
|
|
348
459
|
logHelpLine(t, logger, 'cli.help_squad_learning');
|
|
349
460
|
logHelpLine(t, logger, 'cli.help_learning');
|
|
350
461
|
logHelpLine(t, logger, 'cli.help_runtime_init');
|
|
@@ -371,6 +482,7 @@ function printHelp(t, logger) {
|
|
|
371
482
|
logHelpLine(t, logger, 'cli.help_skill_install');
|
|
372
483
|
logHelpLine(t, logger, 'cli.help_skill_list');
|
|
373
484
|
logHelpLine(t, logger, 'cli.help_skill_remove');
|
|
485
|
+
logHelpLine(t, logger, 'cli.help_design_hybrid_options');
|
|
374
486
|
logHelpLine(t, logger, 'cli.help_cloud_import_squad');
|
|
375
487
|
logHelpLine(t, logger, 'cli.help_cloud_import_genome');
|
|
376
488
|
logHelpLine(t, logger, 'cli.help_cloud_publish_squad');
|
|
@@ -434,6 +546,10 @@ async function main() {
|
|
|
434
546
|
result = await runInit({ args, options, logger: commandLogger, t });
|
|
435
547
|
} else if (command === 'install') {
|
|
436
548
|
result = await runInstall({ args, options, logger: commandLogger, t });
|
|
549
|
+
} else if (command === 'setup') {
|
|
550
|
+
result = await runSetup({ args, options, logger: commandLogger, t });
|
|
551
|
+
} else if (command === 'install') {
|
|
552
|
+
result = await runInstall({ args, options, logger: commandLogger, t });
|
|
437
553
|
} else if (command === 'update') {
|
|
438
554
|
result = await runUpdate({ args, options, logger: commandLogger, t });
|
|
439
555
|
} else if (command === 'info') {
|
|
@@ -523,6 +639,10 @@ async function main() {
|
|
|
523
639
|
result = await runQaScan({ args, options, logger: commandLogger, t });
|
|
524
640
|
} else if (command === 'qa:report' || command === 'qa-report') {
|
|
525
641
|
result = await runQaReport({ args, options, logger: commandLogger, t });
|
|
642
|
+
} else if (command === 'web:map' || command === 'web-map') {
|
|
643
|
+
result = await runWebMap({ args, options, logger: commandLogger, t });
|
|
644
|
+
} else if (command === 'web:scrape' || command === 'web-scrape') {
|
|
645
|
+
result = await runWebScrape({ args, options, logger: commandLogger, t });
|
|
526
646
|
} else if (command === 'scan:project' || command === 'scan-project') {
|
|
527
647
|
result = await runScanProject({ args, options, logger: commandLogger, t });
|
|
528
648
|
} else if (command === 'config') {
|
|
@@ -547,11 +667,46 @@ async function main() {
|
|
|
547
667
|
result = await runSquadAgentCreate({ args, options, logger: commandLogger, t });
|
|
548
668
|
} else if (command === 'squad:investigate' || command === 'squad-investigate') {
|
|
549
669
|
result = await runSquadInvestigate({ args, options, logger: commandLogger, t });
|
|
670
|
+
} else if (command === 'squad:dashboard' || command === 'squad-dashboard') {
|
|
671
|
+
result = await runSquadDashboard({ args, options, logger: commandLogger, t });
|
|
672
|
+
} else if (command === 'squad:worker' || command === 'squad-worker') {
|
|
673
|
+
const sub = options.sub || 'list';
|
|
674
|
+
result = await runSquadWorker({ args, options: { ...options, sub }, logger: commandLogger, t });
|
|
675
|
+
} else if (command === 'squad:daemon' || command === 'squad-daemon') {
|
|
676
|
+
const sub = options.sub || 'status';
|
|
677
|
+
result = await runSquadDaemon({ args, options: { ...options, sub }, logger: commandLogger, t });
|
|
678
|
+
} else if (command === 'squad:mcp:call') {
|
|
679
|
+
result = await runSquadMcp({ args, options: { ...options, sub: 'call' }, logger: commandLogger, t });
|
|
680
|
+
} else if (command === 'squad:mcp' || command === 'squad-mcp') {
|
|
681
|
+
const sub = options.sub || 'status';
|
|
682
|
+
result = await runSquadMcp({ args, options: { ...options, sub }, logger: commandLogger, t });
|
|
683
|
+
} else if (command === 'squad:roi' || command === 'squad-roi') {
|
|
684
|
+
const sub = options.sub || 'report';
|
|
685
|
+
result = await runSquadRoi({ args, options: { ...options, sub }, logger: commandLogger, t });
|
|
686
|
+
} else if (command === 'squad:score' || command === 'squad-score') {
|
|
687
|
+
result = await runSquadScore({ args, options, logger: commandLogger, translator: t });
|
|
688
|
+
} else if (command === 'squad:processes' || command === 'squad-processes') {
|
|
689
|
+
result = await runSquadProcesses({ args, options, logger: commandLogger, t });
|
|
690
|
+
} else if (command === 'squad:worktrees' || command === 'squad-worktrees') {
|
|
691
|
+
result = await runSquadWorktrees({ args, options, logger: commandLogger, t });
|
|
692
|
+
} else if (command === 'squad:merge' || command === 'squad-merge') {
|
|
693
|
+
result = await runSquadMerge({ args, options, logger: commandLogger, t });
|
|
694
|
+
} else if (command === 'squad:recovery' || command === 'squad-recovery') {
|
|
695
|
+
result = await runSquadRecovery({ args, options, logger: commandLogger, t });
|
|
696
|
+
} else if (command === 'squad:deploy' || command === 'squad-deploy') {
|
|
697
|
+
result = await runSquadDeploy({ args, options, logger: commandLogger, t });
|
|
698
|
+
} else if (command === 'squad:webhook' || command === 'squad-webhook') {
|
|
699
|
+
const sub = options.sub || 'start';
|
|
700
|
+
result = await runSquadWebhook({ args, options: { ...options, sub }, logger: commandLogger, t });
|
|
550
701
|
} else if (command === 'squad:plan' || command === 'squad-plan') {
|
|
551
702
|
result = await runSquadPlan({ args, options, logger: commandLogger, t });
|
|
552
703
|
} else if (command === 'squad:learning' || command === 'squad-learning') {
|
|
553
704
|
const sub = args[1] || 'list';
|
|
554
705
|
result = await runSquadLearning({ args, options: { ...options, sub }, logger: commandLogger, t });
|
|
706
|
+
} else if (command === 'learning:evolve' || command === 'learning-evolve') {
|
|
707
|
+
result = await runLearningEvolve({ args, options, logger: commandLogger, t });
|
|
708
|
+
} else if (command === 'learning:apply' || command === 'learning-apply') {
|
|
709
|
+
result = await runLearningApply({ args, options, logger: commandLogger, t });
|
|
555
710
|
} else if (command.startsWith('learning:') || command === 'learning') {
|
|
556
711
|
const sub = command === 'learning' ? (args[1] || 'list') : command.split(':')[1];
|
|
557
712
|
result = await runLearning({ args, options: { ...options, sub }, logger: commandLogger, t });
|
|
@@ -580,6 +735,10 @@ async function main() {
|
|
|
580
735
|
result = await runRuntimeStatus({ args, options, logger: commandLogger, t });
|
|
581
736
|
} else if (command === 'runtime:log' || command === 'runtime-log') {
|
|
582
737
|
result = await runRuntimeLog({ args, options, logger: commandLogger, t });
|
|
738
|
+
} else if (command === 'agent:done' || command === 'agent-done') {
|
|
739
|
+
result = await runAgentDone({ args, options, logger: commandLogger, t });
|
|
740
|
+
} else if (command === 'agent:recover' || command === 'agent-recover') {
|
|
741
|
+
result = await runAgentRecover({ args, options, logger: commandLogger, t });
|
|
583
742
|
} else if (command === 'runtime:session:start' || command === 'runtime-session-start') {
|
|
584
743
|
result = await runRuntimeSessionStart({ args, options, logger: commandLogger, t });
|
|
585
744
|
} else if (command === 'runtime:session:log' || command === 'runtime-session-log') {
|
|
@@ -614,12 +773,16 @@ async function main() {
|
|
|
614
773
|
result = await runRuntimeBackup({ args, options, logger: commandLogger, t });
|
|
615
774
|
} else if (command === 'runtime:restore' || command === 'runtime-restore') {
|
|
616
775
|
result = await runRuntimeRestore({ args, options, logger: commandLogger, t });
|
|
776
|
+
} else if (command === 'backup:local' || command === 'backup-local') {
|
|
777
|
+
result = await runBackupLocal({ args, options, logger: commandLogger, t });
|
|
617
778
|
} else if (command === 'skill:install' || command === 'skill-install') {
|
|
618
779
|
result = await runSkillInstall({ args, options, logger: commandLogger, t });
|
|
619
780
|
} else if (command === 'skill:list' || command === 'skill-list') {
|
|
620
781
|
result = await runSkillList({ args, options, logger: commandLogger, t });
|
|
621
782
|
} else if (command === 'skill:remove' || command === 'skill-remove') {
|
|
622
783
|
result = await runSkillRemove({ args, options, logger: commandLogger, t });
|
|
784
|
+
} else if (command === 'design-hybrid:options' || command === 'design-hybrid-options') {
|
|
785
|
+
result = await runDesignHybridOptions({ args, options, logger: commandLogger, t });
|
|
623
786
|
} else if (command === 'cloud:import:squad' || command === 'cloud-import-squad') {
|
|
624
787
|
result = await runCloudImportSquad({ args, options, logger: commandLogger, t });
|
|
625
788
|
} else if (command === 'cloud:import:genome' || command === 'cloud-import-genome') {
|
|
@@ -628,6 +791,35 @@ async function main() {
|
|
|
628
791
|
result = await runCloudPublishSquad({ args, options, logger: commandLogger, t });
|
|
629
792
|
} else if (command === 'cloud:publish:genome' || command === 'cloud-publish-genome') {
|
|
630
793
|
result = await runCloudPublishGenome({ args, options, logger: commandLogger, t });
|
|
794
|
+
} else if (command === 'recovery:generate' || command === 'recovery-generate') {
|
|
795
|
+
result = await runRecoveryGenerate({ args, options, logger: commandLogger, t });
|
|
796
|
+
} else if (command === 'recovery:show' || command === 'recovery-show') {
|
|
797
|
+
result = await runRecoveryShow({ args, options, logger: commandLogger, t });
|
|
798
|
+
} else if (command === 'context:monitor' || command === 'context-monitor') {
|
|
799
|
+
result = await runContextMonitor({ args, options, logger: commandLogger, t });
|
|
800
|
+
} else if (command === 'context:search' || command === 'context-search') {
|
|
801
|
+
result = await runContextSearch({ args, options, logger: commandLogger, t });
|
|
802
|
+
} else if (command === 'context:search:index' || command === 'context-search-index') {
|
|
803
|
+
result = await runContextSearchIndex({ args, options, logger: commandLogger, t });
|
|
804
|
+
} else if (command === 'context:cache' || command === 'context-cache') {
|
|
805
|
+
result = await runContextCacheList({ args, options, logger: commandLogger, t });
|
|
806
|
+
} else if (command === 'context:cache:save' || command === 'context-cache-save') {
|
|
807
|
+
result = await runContextCacheSave({ args, options, logger: commandLogger, t });
|
|
808
|
+
} else if (command === 'context:cache:restore' || command === 'context-cache-restore') {
|
|
809
|
+
result = await runContextCacheRestore({ args, options, logger: commandLogger, t });
|
|
810
|
+
} else if (command === 'context:cache:cleanup' || command === 'context-cache-cleanup') {
|
|
811
|
+
result = await runContextCacheCleanup({ args, options, logger: commandLogger, t });
|
|
812
|
+
} else if (command === 'sandbox:exec' || command === 'sandbox-exec') {
|
|
813
|
+
result = await runSandboxExec({ args, options, logger: commandLogger, t });
|
|
814
|
+
} else if (command === 'agent:load' || command === 'agent-load') {
|
|
815
|
+
result = await runAgentLoad({ args, options, logger: commandLogger, t });
|
|
816
|
+
} else if (command === 'agent:shard:index' || command === 'agent-shard-index') {
|
|
817
|
+
result = await runAgentShardIndex({ args, options, logger: commandLogger, t });
|
|
818
|
+
} else if (command.startsWith('tool:') || command.startsWith('tool-')) {
|
|
819
|
+
const sub = command.replace(/^tool[:-]/, '');
|
|
820
|
+
result = await runToolRegistry({ args, options: { ...options, sub }, logger: commandLogger, t });
|
|
821
|
+
} else if (command === 'health') {
|
|
822
|
+
result = await runHealth({ args, options, logger: commandLogger, t });
|
|
631
823
|
} else {
|
|
632
824
|
const message = t('cli.unknown_command', { command });
|
|
633
825
|
if (jsonMode) {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const { AgentLoader } = require('../agent-loader');
|
|
5
|
+
|
|
6
|
+
async function runAgentLoad({ args, options, logger }) {
|
|
7
|
+
const agentId = args[0] || options.agent || '';
|
|
8
|
+
const goal = options.goal || '';
|
|
9
|
+
const cwd = path.resolve(process.cwd(), options.cwd || '.');
|
|
10
|
+
const agentsDir = path.join(cwd, options['agents-dir'] || '.aioson/agents');
|
|
11
|
+
const maxShards = Number(options['max-shards']) || 3;
|
|
12
|
+
const maxTokens = Number(options['max-tokens']) || 2000;
|
|
13
|
+
|
|
14
|
+
if (!agentId) {
|
|
15
|
+
logger.error('Usage: aioson agent:load <agent-id> --goal="..." [--cwd=.]');
|
|
16
|
+
return { ok: false, error: 'missing_agent' };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const loader = new AgentLoader();
|
|
20
|
+
await loader.open();
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
// Index agents dir if needed
|
|
24
|
+
await loader.indexAgentsDir(agentsDir, { force: Boolean(options.force) });
|
|
25
|
+
|
|
26
|
+
// Load relevant shards
|
|
27
|
+
const result = await loader.loadRelevantShards(agentId, goal, { maxShards, maxTokens });
|
|
28
|
+
|
|
29
|
+
if (result.shards.length === 0) {
|
|
30
|
+
logger.log(`No shards found for agent: ${agentId}`);
|
|
31
|
+
logger.log(`Make sure the agents directory exists: ${agentsDir}`);
|
|
32
|
+
return { ok: true, agentId, shards: [], tokens: 0 };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (options.json) {
|
|
36
|
+
return { ok: true, ...result };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
logger.log(`\n Agent: ${agentId} (${result.shards.length}/${result.totalShards} shards, ${result.tokens} tokens)\n`);
|
|
40
|
+
for (const shard of result.shards) {
|
|
41
|
+
logger.log(` ## ${shard.heading} (${shard.tokens} tokens)`);
|
|
42
|
+
}
|
|
43
|
+
logger.log('');
|
|
44
|
+
|
|
45
|
+
if (options.print) {
|
|
46
|
+
logger.log('\n---\n');
|
|
47
|
+
logger.log(AgentLoader.buildContext(result.shards));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return { ok: true, ...result };
|
|
51
|
+
} finally {
|
|
52
|
+
loader.close();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function runAgentShardIndex({ args, options, logger }) {
|
|
57
|
+
const cwd = path.resolve(process.cwd(), args[0] || '.');
|
|
58
|
+
const agentsDir = path.join(cwd, options['agents-dir'] || '.aioson/agents');
|
|
59
|
+
const force = Boolean(options.force);
|
|
60
|
+
|
|
61
|
+
logger.log(`Indexing agent shards from: ${agentsDir}`);
|
|
62
|
+
|
|
63
|
+
const loader = new AgentLoader();
|
|
64
|
+
await loader.open();
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
const result = await loader.indexAgentsDir(agentsDir, { force });
|
|
68
|
+
const stats = loader.stats();
|
|
69
|
+
|
|
70
|
+
if (options.json) {
|
|
71
|
+
return { ok: true, ...result, stats };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
logger.log(` Agents indexed: ${result.agents}`);
|
|
75
|
+
logger.log(` Total shards: ${result.totalShards}`);
|
|
76
|
+
logger.log(` Index total docs: ${stats.totalDocs}`);
|
|
77
|
+
logger.log('');
|
|
78
|
+
|
|
79
|
+
return { ok: true, ...result, stats };
|
|
80
|
+
} finally {
|
|
81
|
+
loader.close();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
module.exports = { runAgentLoad, runAgentShardIndex };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const { backupAiosonDocs } = require('../backup-local');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* aioson backup:local [.]
|
|
8
|
+
*
|
|
9
|
+
* Manually backs up all .md files from .aioson/context/ and .aioson/plans/
|
|
10
|
+
* to ~/.aioson/backups/{project}/{timestamp}/
|
|
11
|
+
*/
|
|
12
|
+
async function runBackupLocal({ args, options, logger }) {
|
|
13
|
+
const targetDir = path.resolve(process.cwd(), args[0] || '.');
|
|
14
|
+
const result = await backupAiosonDocs(targetDir);
|
|
15
|
+
|
|
16
|
+
if (result.count === 0) {
|
|
17
|
+
logger.log('backup:local — nothing to back up (no .md files found in .aioson/context/ or .aioson/plans/)');
|
|
18
|
+
return { ok: true, count: 0, backupPath: null };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
logger.log(`backup:local — ${result.count} file(s) backed up → ${result.backupPath}`);
|
|
22
|
+
return { ok: true, count: result.count, backupPath: result.backupPath };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = { runBackupLocal };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const { saveContextShadow, listSessions, restoreContext, cleanup } = require('../context-cache');
|
|
5
|
+
|
|
6
|
+
async function runContextCacheList({ args, options, logger }) {
|
|
7
|
+
const cacheDir = options.cacheDir || undefined;
|
|
8
|
+
const sessions = await listSessions({ cacheDir });
|
|
9
|
+
|
|
10
|
+
if (options.json) {
|
|
11
|
+
return { ok: true, sessions };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (sessions.length === 0) {
|
|
15
|
+
logger.log('No cached sessions found.');
|
|
16
|
+
return { ok: true, sessions: [] };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
logger.log('\n Cached Context Sessions\n');
|
|
20
|
+
for (const s of sessions) {
|
|
21
|
+
const kb = Math.round(s.size / 1024);
|
|
22
|
+
const goal = s.metadata.goal ? ` — ${s.metadata.goal.slice(0, 50)}` : '';
|
|
23
|
+
logger.log(` ${s.sessionId} ${s.createdAt.slice(0, 16)} ${kb}KB${goal}`);
|
|
24
|
+
}
|
|
25
|
+
logger.log('');
|
|
26
|
+
|
|
27
|
+
return { ok: true, sessions };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function runContextCacheSave({ args, options, logger }) {
|
|
31
|
+
const cwd = path.resolve(process.cwd(), args[0] || '.');
|
|
32
|
+
const content = options.content || '';
|
|
33
|
+
|
|
34
|
+
if (!content) {
|
|
35
|
+
logger.error('--content is required. Example: aioson context:cache:save . --content="..." --goal="..."');
|
|
36
|
+
return { ok: false, error: 'missing_content' };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const result = await saveContextShadow(content, {
|
|
40
|
+
goal: options.goal || '',
|
|
41
|
+
agent: options.agent || '',
|
|
42
|
+
projectDir: cwd
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if (options.json) return result;
|
|
46
|
+
|
|
47
|
+
logger.log(`Context saved. Session ID: ${result.sessionId}`);
|
|
48
|
+
logger.log(`Path: ${result.path}`);
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function runContextCacheRestore({ args, options, logger }) {
|
|
53
|
+
const sessionId = options.session || args[0] || '';
|
|
54
|
+
const cacheDir = options.cacheDir || undefined;
|
|
55
|
+
|
|
56
|
+
if (!sessionId) {
|
|
57
|
+
logger.error('--session=<id> is required.');
|
|
58
|
+
return { ok: false, error: 'missing_session' };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const result = await restoreContext(sessionId, {
|
|
62
|
+
cacheDir,
|
|
63
|
+
query: options.query || undefined
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (!result.ok) {
|
|
67
|
+
logger.error(`Restore failed: ${result.error}`);
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (options.json) return result;
|
|
72
|
+
|
|
73
|
+
logger.log(result.content);
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function runContextCacheCleanup({ args, options, logger }) {
|
|
78
|
+
const cacheDir = options.cacheDir || undefined;
|
|
79
|
+
const maxAgeHours = Number(options['max-age']) || 24;
|
|
80
|
+
const maxAge = maxAgeHours * 60 * 60 * 1000;
|
|
81
|
+
|
|
82
|
+
const result = await cleanup({ cacheDir, maxAge });
|
|
83
|
+
|
|
84
|
+
if (options.json) return { ok: true, ...result };
|
|
85
|
+
|
|
86
|
+
logger.log(`Removed ${result.removed} expired session(s).`);
|
|
87
|
+
return { ok: true, ...result };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
module.exports = { runContextCacheList, runContextCacheSave, runContextCacheRestore, runContextCacheCleanup };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const {
|
|
5
|
+
getContextUsage,
|
|
6
|
+
computeWarningLevel,
|
|
7
|
+
THRESHOLDS
|
|
8
|
+
} = require('../squad-dashboard/context-monitor');
|
|
9
|
+
|
|
10
|
+
const BAR_WIDTH = 20;
|
|
11
|
+
const LEVEL_ICONS = { normal: ' ', warning: '⚠', critical: '!', overflow: 'X', unknown: '?' };
|
|
12
|
+
|
|
13
|
+
function renderBar(ratio, width) {
|
|
14
|
+
const clamped = Math.max(0, Math.min(1, ratio));
|
|
15
|
+
const filled = Math.round(clamped * width);
|
|
16
|
+
const bar = '█'.repeat(filled) + '░'.repeat(width - filled);
|
|
17
|
+
return `[${bar}] ${Math.round(clamped * 100)}%`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function formatTokens(n) {
|
|
21
|
+
if (typeof n !== 'number') return '?';
|
|
22
|
+
return n.toLocaleString();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function renderAgent(slug, agent) {
|
|
26
|
+
const used = agent.totalUsed || 0;
|
|
27
|
+
const win = agent.windowSize || 0;
|
|
28
|
+
const ratio = win > 0 ? used / win : 0;
|
|
29
|
+
const level = agent.warningLevel || computeWarningLevel(used, win);
|
|
30
|
+
const icon = LEVEL_ICONS[level] || '?';
|
|
31
|
+
const bar = renderBar(ratio, BAR_WIDTH);
|
|
32
|
+
const line = ` ${icon} ${slug.padEnd(16)} ${bar} ${formatTokens(used)}/${formatTokens(win)}`;
|
|
33
|
+
if (level === 'warning' || level === 'critical' || level === 'overflow') {
|
|
34
|
+
return `${line} [${level.toUpperCase()}]`;
|
|
35
|
+
}
|
|
36
|
+
return line;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function runContextMonitor({ args, options, logger }) {
|
|
40
|
+
const cwd = path.resolve(process.cwd(), args[0] || '.');
|
|
41
|
+
const squadSlug = options.squad || null;
|
|
42
|
+
const agentSlug = options.agent || null;
|
|
43
|
+
|
|
44
|
+
if (!squadSlug) {
|
|
45
|
+
logger.log('\n Context Monitor\n');
|
|
46
|
+
logger.log(' No squad specified. Use --squad=<slug> to monitor a squad.');
|
|
47
|
+
logger.log(' Example: aioson context:monitor . --squad=my-squad');
|
|
48
|
+
logger.log('');
|
|
49
|
+
return { ok: true, squads: [] };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const data = await getContextUsage(cwd, squadSlug, agentSlug || null);
|
|
53
|
+
|
|
54
|
+
if (!data) {
|
|
55
|
+
logger.log(`\n No context data found for squad: ${squadSlug}`);
|
|
56
|
+
logger.log(' The squad may not have started yet or context-monitor.json is missing.');
|
|
57
|
+
logger.log('');
|
|
58
|
+
return { ok: true, squadSlug, agents: {} };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (options.json) {
|
|
62
|
+
return { ok: true, ...data };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
logger.log(`\n Context Monitor — ${squadSlug}\n`);
|
|
66
|
+
|
|
67
|
+
if (agentSlug) {
|
|
68
|
+
// Single agent
|
|
69
|
+
const agent = data;
|
|
70
|
+
logger.log(renderAgent(agentSlug, agent));
|
|
71
|
+
} else {
|
|
72
|
+
const agents = data.agents || {};
|
|
73
|
+
if (Object.keys(agents).length === 0) {
|
|
74
|
+
logger.log(' No agents tracked yet.');
|
|
75
|
+
} else {
|
|
76
|
+
for (const [slug, agent] of Object.entries(agents)) {
|
|
77
|
+
logger.log(renderAgent(slug, agent));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
logger.log('');
|
|
83
|
+
logger.log(` Thresholds: warning=${Math.round(THRESHOLDS.warning * 100)}% critical=${Math.round(THRESHOLDS.critical * 100)}%`);
|
|
84
|
+
if (data.updatedAt) {
|
|
85
|
+
logger.log(` Updated: ${data.updatedAt}`);
|
|
86
|
+
}
|
|
87
|
+
logger.log('');
|
|
88
|
+
|
|
89
|
+
return { ok: true, ...data };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
module.exports = { runContextMonitor };
|