autonomous-flow-daemon 1.6.0 → 1.9.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 +85 -85
- package/LICENSE +21 -21
- package/README-ko.md +282 -0
- package/README.md +282 -266
- package/mcp-config.json +10 -10
- package/package.json +4 -2
- package/src/adapters/index.ts +370 -370
- package/src/cli.ts +162 -127
- package/src/commands/benchmark.ts +187 -187
- package/src/commands/correlate.ts +180 -0
- package/src/commands/dashboard.ts +404 -0
- package/src/commands/evolution.ts +84 -1
- package/src/commands/fix.ts +158 -158
- package/src/commands/lang.ts +41 -41
- package/src/commands/plugin.ts +110 -0
- package/src/commands/restart.ts +14 -14
- package/src/commands/score.ts +276 -276
- package/src/commands/start.ts +155 -155
- package/src/commands/status.ts +157 -157
- package/src/commands/stop.ts +68 -68
- package/src/commands/suggest.ts +211 -0
- package/src/commands/sync.ts +329 -16
- package/src/constants.ts +32 -32
- package/src/core/boast.ts +280 -280
- package/src/core/config.ts +49 -49
- package/src/core/correlation-engine.ts +265 -0
- package/src/core/db.ts +145 -117
- package/src/core/discovery.ts +65 -65
- package/src/core/federation.ts +129 -0
- package/src/core/hologram/engine.ts +71 -71
- package/src/core/hologram/fallback.ts +11 -11
- package/src/core/hologram/go-extractor.ts +203 -0
- package/src/core/hologram/incremental.ts +227 -227
- package/src/core/hologram/py-extractor.ts +132 -132
- package/src/core/hologram/rust-extractor.ts +244 -0
- package/src/core/hologram/ts-extractor.ts +406 -320
- package/src/core/hologram/types.ts +27 -25
- package/src/core/hologram.ts +73 -71
- package/src/core/i18n/messages.ts +309 -309
- package/src/core/locale.ts +88 -88
- package/src/core/log-rotate.ts +33 -33
- package/src/core/log-utils.ts +38 -38
- package/src/core/lru-map.ts +61 -61
- package/src/core/notify.ts +74 -74
- package/src/core/plugin-manager.ts +225 -0
- package/src/core/rule-suggestion.ts +127 -0
- package/src/core/validator-generator.ts +224 -0
- package/src/core/workspace.ts +28 -28
- package/src/daemon/client.ts +78 -65
- package/src/daemon/event-batcher.ts +108 -108
- package/src/daemon/guards.ts +13 -13
- package/src/daemon/http-routes.ts +376 -293
- package/src/daemon/mcp-handler.ts +575 -270
- package/src/daemon/mcp-subscriptions.ts +81 -0
- package/src/daemon/mesh.ts +51 -0
- package/src/daemon/server.ts +655 -590
- package/src/daemon/types.ts +121 -100
- package/src/daemon/workspace-map.ts +104 -92
- package/src/platform.ts +60 -60
- package/src/version.ts +15 -15
- package/README.ko.md +0 -266
package/src/cli.ts
CHANGED
|
@@ -1,127 +1,162 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
import { Command } from "commander";
|
|
3
|
-
import { startCommand } from "./commands/start";
|
|
4
|
-
import { stopCommand } from "./commands/stop";
|
|
5
|
-
import { restartCommand } from "./commands/restart";
|
|
6
|
-
import { statusCommand } from "./commands/status";
|
|
7
|
-
import { scoreCommand } from "./commands/score";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
program
|
|
35
|
-
.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
.
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
.
|
|
53
|
-
.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.
|
|
58
|
-
.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.
|
|
63
|
-
.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.
|
|
68
|
-
.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.
|
|
77
|
-
.
|
|
78
|
-
.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.
|
|
82
|
-
.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
.
|
|
94
|
-
.
|
|
95
|
-
.action(
|
|
96
|
-
|
|
97
|
-
program
|
|
98
|
-
.command("
|
|
99
|
-
.description("
|
|
100
|
-
.action(
|
|
101
|
-
|
|
102
|
-
program
|
|
103
|
-
.command("
|
|
104
|
-
.description("
|
|
105
|
-
.option("--
|
|
106
|
-
.action(
|
|
107
|
-
|
|
108
|
-
program
|
|
109
|
-
.command("
|
|
110
|
-
.description("
|
|
111
|
-
.option("--days <n>", "
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
.
|
|
121
|
-
.
|
|
122
|
-
.option("--
|
|
123
|
-
.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { startCommand } from "./commands/start";
|
|
4
|
+
import { stopCommand } from "./commands/stop";
|
|
5
|
+
import { restartCommand } from "./commands/restart";
|
|
6
|
+
import { statusCommand } from "./commands/status";
|
|
7
|
+
import { scoreCommand } from "./commands/score";
|
|
8
|
+
import { dashboardCommand } from "./commands/dashboard";
|
|
9
|
+
import { fixCommand } from "./commands/fix";
|
|
10
|
+
import { syncCommand } from "./commands/sync";
|
|
11
|
+
import { diagnoseCommand } from "./commands/diagnose";
|
|
12
|
+
import { doctorCommand } from "./commands/doctor";
|
|
13
|
+
|
|
14
|
+
import { vaccineCommand } from "./commands/vaccine";
|
|
15
|
+
import { langCommand } from "./commands/lang";
|
|
16
|
+
import { evolutionCommand } from "./commands/evolution";
|
|
17
|
+
import { mcpCommand } from "./commands/mcp";
|
|
18
|
+
import { statsCommand } from "./commands/stats";
|
|
19
|
+
import { hooksCommand } from "./commands/hooks";
|
|
20
|
+
import { benchmarkCommand } from "./commands/benchmark";
|
|
21
|
+
import { suggestCommand } from "./commands/suggest";
|
|
22
|
+
import { correlateCommand } from "./commands/correlate";
|
|
23
|
+
import { pluginCommand } from "./commands/plugin";
|
|
24
|
+
import { APP_VERSION } from "./version";
|
|
25
|
+
import { trackCliCommand } from "./core/telemetry";
|
|
26
|
+
|
|
27
|
+
const program = new Command();
|
|
28
|
+
|
|
29
|
+
program
|
|
30
|
+
.name("afd")
|
|
31
|
+
.description("Autonomous Flow Daemon - The Immune System for AI Workflows")
|
|
32
|
+
.version(APP_VERSION);
|
|
33
|
+
|
|
34
|
+
program.hook("preAction", (thisCommand) => {
|
|
35
|
+
trackCliCommand(thisCommand.name());
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
program
|
|
39
|
+
.command("start")
|
|
40
|
+
.description("Start the afd daemon (background file watcher)")
|
|
41
|
+
.option("--mcp", "Run in MCP stdio mode (for Claude Code tool integration)")
|
|
42
|
+
.action(startCommand);
|
|
43
|
+
|
|
44
|
+
program
|
|
45
|
+
.command("stop")
|
|
46
|
+
.description("Stop the afd daemon")
|
|
47
|
+
.option("--clean", "Remove all injected hooks and MCP registrations")
|
|
48
|
+
.action(stopCommand);
|
|
49
|
+
|
|
50
|
+
program
|
|
51
|
+
.command("restart")
|
|
52
|
+
.description("Restart the afd daemon (stop + start)")
|
|
53
|
+
.action(restartCommand);
|
|
54
|
+
|
|
55
|
+
program
|
|
56
|
+
.command("status")
|
|
57
|
+
.description("Quick health check — daemon, hooks, defenses, quarantine")
|
|
58
|
+
.action(statusCommand);
|
|
59
|
+
|
|
60
|
+
program
|
|
61
|
+
.command("score")
|
|
62
|
+
.description("Show current diagnostic stats from the daemon")
|
|
63
|
+
.action(scoreCommand);
|
|
64
|
+
|
|
65
|
+
program
|
|
66
|
+
.command("dashboard")
|
|
67
|
+
.description("Live token savings dashboard — real-time TUI (Ctrl+C to exit)")
|
|
68
|
+
.action(dashboardCommand);
|
|
69
|
+
|
|
70
|
+
program
|
|
71
|
+
.command("fix")
|
|
72
|
+
.description("Auto-fix detected issues in AI workflow config")
|
|
73
|
+
.action(fixCommand);
|
|
74
|
+
|
|
75
|
+
program
|
|
76
|
+
.command("sync")
|
|
77
|
+
.description("Synchronize AI agent configs across team")
|
|
78
|
+
.option("--push", "Push local antibodies to team vaccine store")
|
|
79
|
+
.option("--pull", "Pull antibodies from team vaccine store")
|
|
80
|
+
.option("--remote <url>", "Remote vaccine store URL for push/pull")
|
|
81
|
+
.option("--local-mesh", "Bidirectional sync with all live mesh peers (monorepo)")
|
|
82
|
+
.action(syncCommand);
|
|
83
|
+
|
|
84
|
+
program
|
|
85
|
+
.command("doctor")
|
|
86
|
+
.description("Deep health analysis with recommendations and auto-fix")
|
|
87
|
+
.option("--fix", "Auto-fix detected issues")
|
|
88
|
+
.action(doctorCommand);
|
|
89
|
+
|
|
90
|
+
program
|
|
91
|
+
.command("diagnose")
|
|
92
|
+
.description("Run headless diagnosis (used by auto-heal hooks)")
|
|
93
|
+
.option("--format <type>", "Output format: a2a or human", "human")
|
|
94
|
+
.option("--auto-heal", "Auto-apply patches for known antibodies")
|
|
95
|
+
.action(diagnoseCommand);
|
|
96
|
+
|
|
97
|
+
program
|
|
98
|
+
.command("vaccine [subcommand] [arg]")
|
|
99
|
+
.description("Vaccine registry: list, search, install, publish")
|
|
100
|
+
.action(vaccineCommand);
|
|
101
|
+
|
|
102
|
+
program
|
|
103
|
+
.command("evolution")
|
|
104
|
+
.description("Self-Evolution: analyze quarantined failures and generate lessons for AI agents")
|
|
105
|
+
.option("--generate", "Auto-generate validators from all quarantine patterns")
|
|
106
|
+
.action(evolutionCommand);
|
|
107
|
+
|
|
108
|
+
program
|
|
109
|
+
.command("suggest")
|
|
110
|
+
.description("Suggest validators based on recurring failure patterns in mistake history")
|
|
111
|
+
.option("--days <n>", "Analysis window in days", "30")
|
|
112
|
+
.option("--min <n>", "Minimum frequency threshold", "3")
|
|
113
|
+
.option("--apply", "Auto-generate validators for uncovered patterns")
|
|
114
|
+
.option("--cross", "Annotate suggestions matching cross-project hotspots as Community Verified")
|
|
115
|
+
.action(suggestCommand);
|
|
116
|
+
|
|
117
|
+
program
|
|
118
|
+
.command("correlate")
|
|
119
|
+
.description("Cross-project pattern correlation — surface Global Hotspot patterns across federated scopes")
|
|
120
|
+
.option("--min-scopes <n>", "Minimum distinct scopes to qualify as a global hotspot", "2")
|
|
121
|
+
.option("--apply", "Auto-generate global validators for uncovered hotspots")
|
|
122
|
+
.option("--include-local", "Include local-scope antibodies in the analysis")
|
|
123
|
+
.action(correlateCommand);
|
|
124
|
+
|
|
125
|
+
program
|
|
126
|
+
.command("mcp [subcommand]")
|
|
127
|
+
.description("MCP server management (install)")
|
|
128
|
+
.action(mcpCommand);
|
|
129
|
+
|
|
130
|
+
program
|
|
131
|
+
.command("lang [language]")
|
|
132
|
+
.description("Show or change display language (en, ko)")
|
|
133
|
+
.option("--list", "Show all supported languages")
|
|
134
|
+
.action(langCommand);
|
|
135
|
+
|
|
136
|
+
program
|
|
137
|
+
.command("stats")
|
|
138
|
+
.description("Feature usage telemetry dashboard (developer-only)")
|
|
139
|
+
.option("--days <n>", "Number of days to aggregate", "7")
|
|
140
|
+
.action(statsCommand);
|
|
141
|
+
|
|
142
|
+
program
|
|
143
|
+
.command("hooks [subcommand]")
|
|
144
|
+
.description("Hook Manager: inspect and sync hook ordering (afd → omc → user)")
|
|
145
|
+
.action(hooksCommand);
|
|
146
|
+
|
|
147
|
+
program
|
|
148
|
+
.command("benchmark")
|
|
149
|
+
.description("Hologram AST compression benchmark across all source files")
|
|
150
|
+
.option("--sort <key>", "Sort by: savings (default), size, name")
|
|
151
|
+
.option("--top <n>", "Show only top N files")
|
|
152
|
+
.option("--json", "Output raw JSON for programmatic use")
|
|
153
|
+
.action(benchmarkCommand);
|
|
154
|
+
|
|
155
|
+
program
|
|
156
|
+
.command("plugin")
|
|
157
|
+
.description("Manage third-party validator plugins (install, list, remove)")
|
|
158
|
+
.argument("[subcommand]", "install | list | remove")
|
|
159
|
+
.argument("[arg]", "npm package name or plugin name")
|
|
160
|
+
.action(pluginCommand);
|
|
161
|
+
|
|
162
|
+
program.parse();
|