jfl 0.8.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -4
- package/dist/commands/digest.d.ts +6 -0
- package/dist/commands/digest.d.ts.map +1 -1
- package/dist/commands/digest.js +70 -69
- package/dist/commands/digest.js.map +1 -1
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +30 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/eval.d.ts +40 -0
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +8 -8
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/findings.d.ts +7 -0
- package/dist/commands/findings.d.ts.map +1 -1
- package/dist/commands/findings.js +4 -4
- package/dist/commands/findings.js.map +1 -1
- package/dist/commands/ide.d.ts +2 -1
- package/dist/commands/ide.d.ts.map +1 -1
- package/dist/commands/ide.js +61 -1
- package/dist/commands/ide.js.map +1 -1
- package/dist/commands/init-from-service.d.ts +15 -0
- package/dist/commands/init-from-service.d.ts.map +1 -0
- package/dist/commands/init-from-service.js +541 -0
- package/dist/commands/init-from-service.js.map +1 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +32 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/kanban.d.ts.map +1 -1
- package/dist/commands/kanban.js +13 -4
- package/dist/commands/kanban.js.map +1 -1
- package/dist/commands/linear.d.ts +41 -0
- package/dist/commands/linear.d.ts.map +1 -0
- package/dist/commands/linear.js +715 -0
- package/dist/commands/linear.js.map +1 -0
- package/dist/commands/peter.d.ts.map +1 -1
- package/dist/commands/peter.js +232 -25
- package/dist/commands/peter.js.map +1 -1
- package/dist/commands/portfolio.d.ts +5 -0
- package/dist/commands/portfolio.d.ts.map +1 -1
- package/dist/commands/portfolio.js +193 -203
- package/dist/commands/portfolio.js.map +1 -1
- package/dist/commands/predict.d.ts +19 -0
- package/dist/commands/predict.d.ts.map +1 -1
- package/dist/commands/predict.js +4 -4
- package/dist/commands/predict.js.map +1 -1
- package/dist/commands/services.d.ts.map +1 -1
- package/dist/commands/services.js +146 -0
- package/dist/commands/services.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +279 -20
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/start.d.ts +25 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +191 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/telemetry-monitor.d.ts +11 -0
- package/dist/commands/telemetry-monitor.d.ts.map +1 -0
- package/dist/commands/telemetry-monitor.js +224 -0
- package/dist/commands/telemetry-monitor.js.map +1 -0
- package/dist/commands/telemetry-test.d.ts +11 -0
- package/dist/commands/telemetry-test.d.ts.map +1 -0
- package/dist/commands/telemetry-test.js +67 -0
- package/dist/commands/telemetry-test.js.map +1 -0
- package/dist/commands/tenet-agents.d.ts +13 -0
- package/dist/commands/tenet-agents.d.ts.map +1 -0
- package/dist/commands/tenet-agents.js +191 -0
- package/dist/commands/tenet-agents.js.map +1 -0
- package/dist/commands/tenet-setup.d.ts +20 -0
- package/dist/commands/tenet-setup.d.ts.map +1 -0
- package/dist/commands/tenet-setup.js +135 -0
- package/dist/commands/tenet-setup.js.map +1 -0
- package/dist/commands/train.d.ts +18 -0
- package/dist/commands/train.d.ts.map +1 -1
- package/dist/commands/train.js +182 -0
- package/dist/commands/train.js.map +1 -1
- package/dist/commands/viz.d.ts +33 -0
- package/dist/commands/viz.d.ts.map +1 -1
- package/dist/commands/viz.js +9 -9
- package/dist/commands/viz.js.map +1 -1
- package/dist/commands/whoami.d.ts +2 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +24 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/index.js +230 -30
- package/dist/index.js.map +1 -1
- package/dist/lib/advanced-setup.d.ts +78 -0
- package/dist/lib/advanced-setup.d.ts.map +1 -0
- package/dist/lib/advanced-setup.js +433 -0
- package/dist/lib/advanced-setup.js.map +1 -0
- package/dist/lib/agent-config.d.ts +33 -0
- package/dist/lib/agent-config.d.ts.map +1 -1
- package/dist/lib/agent-config.js +26 -0
- package/dist/lib/agent-config.js.map +1 -1
- package/dist/lib/counterfactual-training-bridge.d.ts +114 -0
- package/dist/lib/counterfactual-training-bridge.d.ts.map +1 -0
- package/dist/lib/counterfactual-training-bridge.js +322 -0
- package/dist/lib/counterfactual-training-bridge.js.map +1 -0
- package/dist/lib/discovery-agent.d.ts +48 -0
- package/dist/lib/discovery-agent.d.ts.map +1 -0
- package/dist/lib/discovery-agent.js +111 -0
- package/dist/lib/discovery-agent.js.map +1 -0
- package/dist/lib/flow-engine.d.ts.map +1 -1
- package/dist/lib/flow-engine.js +46 -8
- package/dist/lib/flow-engine.js.map +1 -1
- package/dist/lib/gtm-generator.d.ts +29 -0
- package/dist/lib/gtm-generator.d.ts.map +1 -0
- package/dist/lib/gtm-generator.js +252 -0
- package/dist/lib/gtm-generator.js.map +1 -0
- package/dist/lib/hub-health.d.ts +40 -0
- package/dist/lib/hub-health.d.ts.map +1 -0
- package/dist/lib/hub-health.js +89 -0
- package/dist/lib/hub-health.js.map +1 -0
- package/dist/lib/invariant-monitor.d.ts +6 -2
- package/dist/lib/invariant-monitor.d.ts.map +1 -1
- package/dist/lib/invariant-monitor.js +89 -2
- package/dist/lib/invariant-monitor.js.map +1 -1
- package/dist/lib/journal-analyzer.d.ts +71 -0
- package/dist/lib/journal-analyzer.d.ts.map +1 -0
- package/dist/lib/journal-analyzer.js +306 -0
- package/dist/lib/journal-analyzer.js.map +1 -0
- package/dist/lib/linear-client.d.ts +73 -0
- package/dist/lib/linear-client.d.ts.map +1 -0
- package/dist/lib/linear-client.js +112 -0
- package/dist/lib/linear-client.js.map +1 -0
- package/dist/lib/linear-id-map.d.ts +20 -0
- package/dist/lib/linear-id-map.d.ts.map +1 -0
- package/dist/lib/linear-id-map.js +59 -0
- package/dist/lib/linear-id-map.js.map +1 -0
- package/dist/lib/linear-kanban.d.ts +66 -0
- package/dist/lib/linear-kanban.d.ts.map +1 -0
- package/dist/lib/linear-kanban.js +175 -0
- package/dist/lib/linear-kanban.js.map +1 -0
- package/dist/lib/onboarding.d.ts +40 -0
- package/dist/lib/onboarding.d.ts.map +1 -0
- package/dist/lib/onboarding.js +213 -0
- package/dist/lib/onboarding.js.map +1 -0
- package/dist/lib/physical-world-model.d.ts +50 -0
- package/dist/lib/physical-world-model.d.ts.map +1 -0
- package/dist/lib/physical-world-model.js +251 -0
- package/dist/lib/physical-world-model.js.map +1 -0
- package/dist/lib/planning-loop.d.ts +157 -0
- package/dist/lib/planning-loop.d.ts.map +1 -0
- package/dist/lib/planning-loop.js +537 -0
- package/dist/lib/planning-loop.js.map +1 -0
- package/dist/lib/policy-head.d.ts +13 -0
- package/dist/lib/policy-head.d.ts.map +1 -1
- package/dist/lib/policy-head.js +168 -2
- package/dist/lib/policy-head.js.map +1 -1
- package/dist/lib/resource-optimizer-middleware.d.ts +39 -0
- package/dist/lib/resource-optimizer-middleware.d.ts.map +1 -0
- package/dist/lib/resource-optimizer-middleware.js +222 -0
- package/dist/lib/resource-optimizer-middleware.js.map +1 -0
- package/dist/lib/resource-optimizer.d.ts +71 -0
- package/dist/lib/resource-optimizer.d.ts.map +1 -0
- package/dist/lib/resource-optimizer.js +228 -0
- package/dist/lib/resource-optimizer.js.map +1 -0
- package/dist/lib/rl-manager.d.ts +74 -0
- package/dist/lib/rl-manager.d.ts.map +1 -0
- package/dist/lib/rl-manager.js +245 -0
- package/dist/lib/rl-manager.js.map +1 -0
- package/dist/lib/service-analyzer.d.ts +76 -0
- package/dist/lib/service-analyzer.d.ts.map +1 -0
- package/dist/lib/service-analyzer.js +704 -0
- package/dist/lib/service-analyzer.js.map +1 -0
- package/dist/lib/service-gtm.js +2 -2
- package/dist/lib/service-gtm.js.map +1 -1
- package/dist/lib/service-questionnaire.d.ts +11 -0
- package/dist/lib/service-questionnaire.d.ts.map +1 -0
- package/dist/lib/service-questionnaire.js +89 -0
- package/dist/lib/service-questionnaire.js.map +1 -0
- package/dist/lib/setup/agent-generator.d.ts +2 -0
- package/dist/lib/setup/agent-generator.d.ts.map +1 -1
- package/dist/lib/setup/agent-generator.js +128 -4
- package/dist/lib/setup/agent-generator.js.map +1 -1
- package/dist/lib/setup/flow-generator.d.ts +10 -0
- package/dist/lib/setup/flow-generator.d.ts.map +1 -0
- package/dist/lib/setup/flow-generator.js +113 -0
- package/dist/lib/setup/flow-generator.js.map +1 -0
- package/dist/lib/setup/invariant-bridge.d.ts +91 -0
- package/dist/lib/setup/invariant-bridge.d.ts.map +1 -0
- package/dist/lib/setup/invariant-bridge.js +384 -0
- package/dist/lib/setup/invariant-bridge.js.map +1 -0
- package/dist/lib/setup/spec-generator.d.ts +41 -5
- package/dist/lib/setup/spec-generator.d.ts.map +1 -1
- package/dist/lib/setup/spec-generator.js +503 -29
- package/dist/lib/setup/spec-generator.js.map +1 -1
- package/dist/lib/setup/starter-intelligence.d.ts +25 -0
- package/dist/lib/setup/starter-intelligence.d.ts.map +1 -0
- package/dist/lib/setup/starter-intelligence.js +309 -0
- package/dist/lib/setup/starter-intelligence.js.map +1 -0
- package/dist/lib/stratus-client.js +1 -1
- package/dist/lib/stratus-client.js.map +1 -1
- package/dist/lib/surface-agent.d.ts +78 -0
- package/dist/lib/surface-agent.d.ts.map +1 -0
- package/dist/lib/surface-agent.js +105 -0
- package/dist/lib/surface-agent.js.map +1 -0
- package/dist/lib/surface-coordination-example.d.ts +30 -0
- package/dist/lib/surface-coordination-example.d.ts.map +1 -0
- package/dist/lib/surface-coordination-example.js +164 -0
- package/dist/lib/surface-coordination-example.js.map +1 -0
- package/dist/lib/telemetry/physical-world-collector.d.ts +15 -0
- package/dist/lib/telemetry/physical-world-collector.d.ts.map +1 -0
- package/dist/lib/telemetry/physical-world-collector.js +177 -0
- package/dist/lib/telemetry/physical-world-collector.js.map +1 -0
- package/dist/lib/telemetry/training-bridge.d.ts +51 -0
- package/dist/lib/telemetry/training-bridge.d.ts.map +1 -0
- package/dist/lib/telemetry/training-bridge.js +185 -0
- package/dist/lib/telemetry/training-bridge.js.map +1 -0
- package/dist/lib/telemetry.d.ts +2 -1
- package/dist/lib/telemetry.d.ts.map +1 -1
- package/dist/lib/telemetry.js +23 -2
- package/dist/lib/telemetry.js.map +1 -1
- package/dist/lib/tenet-board-agent.d.ts +52 -0
- package/dist/lib/tenet-board-agent.d.ts.map +1 -0
- package/dist/lib/tenet-board-agent.js +226 -0
- package/dist/lib/tenet-board-agent.js.map +1 -0
- package/dist/lib/tenet-ide-agent.d.ts +40 -0
- package/dist/lib/tenet-ide-agent.d.ts.map +1 -0
- package/dist/lib/tenet-ide-agent.js +199 -0
- package/dist/lib/tenet-ide-agent.js.map +1 -0
- package/dist/lib/workspace/data-pipeline.d.ts.map +1 -1
- package/dist/lib/workspace/data-pipeline.js +27 -5
- package/dist/lib/workspace/data-pipeline.js.map +1 -1
- package/dist/lib/workspace/sidebar-runner.d.ts +13 -0
- package/dist/lib/workspace/sidebar-runner.d.ts.map +1 -0
- package/dist/lib/workspace/sidebar-runner.js +419 -0
- package/dist/lib/workspace/sidebar-runner.js.map +1 -0
- package/dist/lib/workspace/surface-registry.d.ts.map +1 -1
- package/dist/lib/workspace/surface-registry.js +9 -1
- package/dist/lib/workspace/surface-registry.js.map +1 -1
- package/dist/lib/workspace/surfaces/agent-overview.d.ts +3 -3
- package/dist/lib/workspace/surfaces/agent-overview.d.ts.map +1 -1
- package/dist/lib/workspace/surfaces/agent-overview.js +3 -3
- package/dist/lib/workspace/surfaces/agent-overview.js.map +1 -1
- package/dist/lib/workspace/surfaces/index.d.ts +3 -0
- package/dist/lib/workspace/surfaces/index.d.ts.map +1 -1
- package/dist/lib/workspace/surfaces/index.js +3 -0
- package/dist/lib/workspace/surfaces/index.js.map +1 -1
- package/dist/lib/workspace/surfaces/kanban.d.ts +15 -0
- package/dist/lib/workspace/surfaces/kanban.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/kanban.js +43 -0
- package/dist/lib/workspace/surfaces/kanban.js.map +1 -0
- package/dist/lib/workspace/surfaces/physical-world.d.ts +15 -0
- package/dist/lib/workspace/surfaces/physical-world.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/physical-world.js +37 -0
- package/dist/lib/workspace/surfaces/physical-world.js.map +1 -0
- package/dist/lib/workspace/surfaces/sidebar.d.ts +22 -0
- package/dist/lib/workspace/surfaces/sidebar.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/sidebar.js +94 -0
- package/dist/lib/workspace/surfaces/sidebar.js.map +1 -0
- package/dist/lib/workspace/tmux-adapter.d.ts +8 -5
- package/dist/lib/workspace/tmux-adapter.d.ts.map +1 -1
- package/dist/lib/workspace/tmux-adapter.js +38 -7
- package/dist/lib/workspace/tmux-adapter.js.map +1 -1
- package/dist/lib/workspace/tmux-sidebar.d.ts +14 -0
- package/dist/lib/workspace/tmux-sidebar.d.ts.map +1 -0
- package/dist/lib/workspace/tmux-sidebar.js +230 -0
- package/dist/lib/workspace/tmux-sidebar.js.map +1 -0
- package/dist/types/flows.d.ts +2 -1
- package/dist/types/flows.d.ts.map +1 -1
- package/dist/types/physical-world-model.d.ts +65 -0
- package/dist/types/physical-world-model.d.ts.map +1 -0
- package/dist/types/physical-world-model.js +43 -0
- package/dist/types/physical-world-model.js.map +1 -0
- package/dist/types/telemetry.d.ts +37 -0
- package/dist/types/telemetry.d.ts.map +1 -1
- package/dist/types/world-model.d.ts.map +1 -1
- package/dist/types/world-model.js +14 -7
- package/dist/types/world-model.js.map +1 -1
- package/dist/utils/context-hub-port.d.ts.map +1 -1
- package/dist/utils/context-hub-port.js +6 -1
- package/dist/utils/context-hub-port.js.map +1 -1
- package/dist/utils/jfl-config.d.ts +7 -2
- package/dist/utils/jfl-config.d.ts.map +1 -1
- package/dist/utils/jfl-config.js +14 -4
- package/dist/utils/jfl-config.js.map +1 -1
- package/package.json +3 -2
- package/packages/pi/extensions/context.ts +51 -1
- package/packages/pi/extensions/hub-tools.ts +247 -0
- package/packages/pi/extensions/index.ts +38 -6
- package/packages/pi/extensions/memory-tool.ts +84 -4
- package/packages/pi/extensions/service-skills.ts +214 -0
- package/scripts/telemetry-dashboard.sh +44 -0
- package/scripts/test-planning-loop-e2e.ts +181 -0
- package/scripts/test-server-inference.ts +49 -0
- package/scripts/test-state-sensitivity.ts +32 -0
- package/scripts/train/v2/benchmark.py +661 -0
- package/scripts/train/v2/generate_balanced.py +439 -0
- package/scripts/train/v2/generate_hard_negatives.py +219 -0
- package/scripts/train/v2/infer.py +149 -36
- package/scripts/train/v2/infer_server.py +224 -0
- package/scripts/train/v2/online_train.py +576 -0
- package/scripts/train/v2/precompute.py +24 -6
- package/template/CLAUDE.md +74 -132
package/dist/index.js
CHANGED
|
@@ -28,12 +28,37 @@ async function getTelemetry() {
|
|
|
28
28
|
import("./utils/jfl-migration.js").then(mod => mod.checkAndMigrate({ silent: true })).catch(() => { });
|
|
29
29
|
const program = new Command();
|
|
30
30
|
// Telemetry hooks — auto-track all commands (lazy load telemetry)
|
|
31
|
-
program.hook('preAction', (_thisCommand, actionCommand) => {
|
|
31
|
+
program.hook('preAction', async (_thisCommand, actionCommand) => {
|
|
32
32
|
;
|
|
33
33
|
actionCommand.__telemetryStart = Date.now();
|
|
34
|
+
// ResourceOptimizer: decide() before every command (<5ms)
|
|
35
|
+
try {
|
|
36
|
+
const { resourceOptimizerPreAction, applyGuidance } = await import("./lib/resource-optimizer-middleware.js");
|
|
37
|
+
const guidance = await resourceOptimizerPreAction(actionCommand.name());
|
|
38
|
+
actionCommand.__roGuidance = guidance;
|
|
39
|
+
// Apply guidance (delay if thermal/CPU issue)
|
|
40
|
+
if (guidance.action !== "passthrough" && guidance.action !== "monitor") {
|
|
41
|
+
await applyGuidance(guidance);
|
|
42
|
+
if (guidance.delay_ms > 0) {
|
|
43
|
+
const chalk = (await import("chalk")).default;
|
|
44
|
+
console.log(chalk.yellow(` ⚡ ${guidance.reason}`));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// Never block commands for RO failures
|
|
50
|
+
}
|
|
34
51
|
});
|
|
35
52
|
program.hook('postAction', async (_thisCommand, actionCommand) => {
|
|
36
53
|
const start = actionCommand.__telemetryStart;
|
|
54
|
+
// ResourceOptimizer: record transition after every command
|
|
55
|
+
try {
|
|
56
|
+
const { resourceOptimizerPostAction } = await import("./lib/resource-optimizer-middleware.js");
|
|
57
|
+
await resourceOptimizerPostAction(actionCommand.name(), process.cwd());
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// Non-blocking
|
|
61
|
+
}
|
|
37
62
|
// Lazy load telemetry only when actually tracking
|
|
38
63
|
const telemetry = await getTelemetry();
|
|
39
64
|
telemetry.track({
|
|
@@ -45,7 +70,7 @@ program.hook('postAction', async (_thisCommand, actionCommand) => {
|
|
|
45
70
|
});
|
|
46
71
|
});
|
|
47
72
|
const HELP_GROUPS = {
|
|
48
|
-
"Getting Started": ["init", "status", "hud", "ide", "doctor"],
|
|
73
|
+
"Getting Started": ["init", "status", "whoami", "hud", "ide", "doctor"],
|
|
49
74
|
"Daily Use": ["synopsis", "ask", "improve", "events", "voice", "kanban"],
|
|
50
75
|
"Management": ["services", "portfolio", "flows", "hooks", "scope", "memory", "eval", "findings", "viz", "telemetry", "context-hub", "skills", "ci"],
|
|
51
76
|
"Platform": ["login", "deploy", "wallet", "preferences"],
|
|
@@ -151,6 +176,19 @@ program
|
|
|
151
176
|
// ============================================================================
|
|
152
177
|
// FREE TIER COMMANDS (work offline/standalone)
|
|
153
178
|
// ============================================================================
|
|
179
|
+
program
|
|
180
|
+
.command("start")
|
|
181
|
+
.description("One-command activation: init → setup → launch (zero to intelligence in <2 min)")
|
|
182
|
+
.argument("[name]", "Project name or path")
|
|
183
|
+
.option("--repo <path>", "Analyze existing repo and create GTM workspace")
|
|
184
|
+
.option("--pi", "Launch Pi instead of Claude Code")
|
|
185
|
+
.option("--ci", "Deploy CI workflows (eval + review)")
|
|
186
|
+
.option("-s, --service <path...>", "Service repo paths/URLs to onboard (repeatable)")
|
|
187
|
+
.option("--no-launch", "Don't launch editor after setup")
|
|
188
|
+
.action(async (name, options) => {
|
|
189
|
+
const { startCommand } = await import("./commands/start.js");
|
|
190
|
+
await startCommand(name, options);
|
|
191
|
+
});
|
|
154
192
|
program
|
|
155
193
|
.command("init")
|
|
156
194
|
.description("Initialize a new JFL project")
|
|
@@ -159,6 +197,7 @@ program
|
|
|
159
197
|
.option("-d, --description <desc>", "Project description")
|
|
160
198
|
.option("--product-repo <url>", "Product repo URL (for gtm type)")
|
|
161
199
|
.option("-s, --service <path...>", "Service repo paths/URLs to onboard (repeatable)")
|
|
200
|
+
.option("--from-service", "Deep-analyze current directory and create GTM in sibling directory")
|
|
162
201
|
.option("--ci", "Deploy eval + review CI workflows after init")
|
|
163
202
|
.option("--no-interactive", "Skip all prompts, use defaults")
|
|
164
203
|
.option("--no-search", "Skip search setup")
|
|
@@ -209,9 +248,18 @@ program
|
|
|
209
248
|
const { statusCommand } = await import("./commands/status.js");
|
|
210
249
|
await statusCommand();
|
|
211
250
|
});
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
251
|
+
program
|
|
252
|
+
.command("whoami")
|
|
253
|
+
.description("Print current user and project info")
|
|
254
|
+
.action(async () => {
|
|
255
|
+
const { whoamiCommand } = await import("./commands/whoami.js");
|
|
256
|
+
whoamiCommand();
|
|
257
|
+
});
|
|
258
|
+
// RL learning agents now accessible via: jfl agents rl <action>
|
|
259
|
+
// (integrated into existing agents command)
|
|
260
|
+
// IDE workspace command — uses dynamic imports to avoid linter stripping
|
|
261
|
+
const ide = program.command("ide").description("Launch smart development environment (jfl ide) or manage workspace (jfl ide <command>)");
|
|
262
|
+
ide.command("launch", { isDefault: true }).description("Launch workspace (same as 'jfl ide')").option("--json", "Output as JSON").option("--sidebar", "Include sidebar pane (20% width)").action(async (options) => { const m = await import("./commands/ide.js"); await m.ideLaunchCommand(options); });
|
|
215
263
|
ide.command("add").description("Add a surface to the workspace").argument("[name]", "Surface name (agent, built-in type, or service)").option("--row <n>", "Row index (0-based)").option("--position <n>", "Position within row (0-based)").option("--title <title>", "Custom surface title").option("--cmd <command>", "Custom surface command").action(async (name, options) => { const m = await import("./commands/ide.js"); await m.ideAddCommand(name, options); });
|
|
216
264
|
ide.command("remove").description("Remove a surface from the workspace").argument("<name>", "Surface name or title to remove").action(async (name) => { const m = await import("./commands/ide.js"); await m.ideRemoveCommand(name); });
|
|
217
265
|
ide.command("available").description("List available surface types, agents, and services").action(async () => { const m = await import("./commands/ide.js"); await m.ideAvailableCommand(); });
|
|
@@ -565,13 +613,23 @@ program
|
|
|
565
613
|
});
|
|
566
614
|
program
|
|
567
615
|
.command("agents")
|
|
568
|
-
.description("Manage parallel agents")
|
|
569
|
-
.argument("[action]", "Action: list, create, start, stop, destroy")
|
|
616
|
+
.description("Manage parallel agents and RL learning agents")
|
|
617
|
+
.argument("[action]", "Action: list, create, start, stop, destroy, rl")
|
|
618
|
+
.argument("[subaction]", "For 'rl': status, dashboard, train, tune, feedback, explain")
|
|
570
619
|
.option("-n, --name <name>", "Agent name")
|
|
571
620
|
.option("-t, --task <task>", "Task for agent")
|
|
572
|
-
.
|
|
573
|
-
|
|
574
|
-
|
|
621
|
+
.option("--agent <name>", "Target specific RL agent")
|
|
622
|
+
.option("--insight-id <id>", "Insight ID for RL agent feedback")
|
|
623
|
+
.option("--feedback <type>", "RL agent feedback: helpful, not_helpful, needs_adjustment")
|
|
624
|
+
.action(async (action, subaction, options) => {
|
|
625
|
+
if (action === 'rl') {
|
|
626
|
+
const { tenentAgentsCommand } = await import("./commands/tenet-agents.js");
|
|
627
|
+
await tenentAgentsCommand(subaction, options);
|
|
628
|
+
}
|
|
629
|
+
else {
|
|
630
|
+
const { agentsCommand } = await import("./commands/agents.js");
|
|
631
|
+
await agentsCommand(action, options);
|
|
632
|
+
}
|
|
575
633
|
});
|
|
576
634
|
program
|
|
577
635
|
.command("feedback")
|
|
@@ -1059,24 +1117,73 @@ ci.action(() => {
|
|
|
1059
1117
|
// ============================================================================
|
|
1060
1118
|
// EVAL FRAMEWORK
|
|
1061
1119
|
// ============================================================================
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1120
|
+
// Lazy command registration — modules loaded only when command is invoked
|
|
1121
|
+
// (was: registerXxxCommand eager imports adding ~200ms to startup)
|
|
1122
|
+
// --- eval ---
|
|
1123
|
+
const evalCmd = program.command("eval").description("Eval framework — track agent metrics over time");
|
|
1124
|
+
evalCmd.command("list").description("List recent eval entries").option("--agent <name>", "Filter by agent name").option("--limit <n>", "Max entries to show", "20").action(async (options) => { const m = await import("./commands/eval.js"); await m.listCommand(options); });
|
|
1125
|
+
evalCmd.command("trajectory").description("Show metric trajectory over time").requiredOption("--agent <name>", "Agent name").option("--metric <name>", "Metric to plot (default: composite)").action(async (options) => { const m = await import("./commands/eval.js"); await m.trajectoryCommand(options); });
|
|
1126
|
+
evalCmd.command("log").description("Log an eval entry").requiredOption("--agent <name>", "Agent name").requiredOption("--metrics <json>", "Metrics as JSON object").option("--composite <n>", "Composite score").option("--model-version <v>", "Model version").option("--dataset <ds>", "Dataset name").option("--run-id <id>", "Run ID").option("--notes <text>", "Notes").action(async (options) => { const m = await import("./commands/eval.js"); await m.logCommand(options); });
|
|
1127
|
+
evalCmd.command("compare").description("Compare agents side-by-side").requiredOption("--agents <list>", "Comma-separated agent names").option("--metric <name>", "Metric to compare (default: composite)").action(async (options) => { const m = await import("./commands/eval.js"); await m.compareCommand(options); });
|
|
1128
|
+
evalCmd.command("tuples").description("Extract training tuples from journals").option("--team <name>", "Filter by team").option("--since <date>", "Only tuples after this date").option("--report", "Full markdown report").action(async (options) => { const m = await import("./commands/eval.js"); await m.tuplesCommand(options); });
|
|
1129
|
+
evalCmd.command("buffer").description("View or export RL training buffer (.jfl/training-buffer.jsonl)").option("--export", "Export as JSONL for policy head training").option("--limit <n>", "Max entries to show", "10").action(async (options) => { const m = await import("./commands/eval.js"); await m.bufferCommand(options); });
|
|
1130
|
+
evalCmd.command("mine").description("Mine training tuples from journals, events, telemetry, and eval history").option("--all", "Scan all JFL projects (from ~/.config/jfl/config.json)").option("--telemetry", "Include global telemetry archive (58k+ events)").option("--dry-run", "Show what would be mined without writing").option("--dir <path>", "Specific directory to mine").action(async (options) => { const m = await import("./commands/eval.js"); await m.mineCommand(options); });
|
|
1131
|
+
evalCmd.command("train").description("Train policy head from training buffer (requires STRATUS_API_KEY)").option("--epochs <n>", "Training epochs", "50").option("--lr <rate>", "Learning rate", "0.0001").action(async (options) => { const m = await import("./commands/eval.js"); await m.trainCommand(options); });
|
|
1132
|
+
evalCmd.action(async () => { const m = await import("./commands/eval.js"); await m.listCommand({}); });
|
|
1133
|
+
// --- predict ---
|
|
1134
|
+
const predictCmd = program.command("predict").description("Predict eval score delta before executing changes (Stratus world model)");
|
|
1135
|
+
predictCmd.command("run").description("Generate a prediction for a proposed change").requiredOption("--proposal <text>", "Description of the proposed change").requiredOption("--goal <text>", "Goal expression (e.g. 'test_pass_rate > 0.9')").option("--score <n>", "Current composite score", "0").option("--type <type>", "Change type: fix, refactor, feature, config", "fix").option("--scope <scope>", "Change scope: small, medium, large", "medium").option("--files <list>", "Comma-separated affected files").option("--failing-evals <list>", "Comma-separated failing eval names").action(async (options) => { const m = await import("./commands/predict.js"); await m.predictCommand(options); });
|
|
1136
|
+
predictCmd.command("resolve").description("Resolve a prediction with actual results").requiredOption("--id <prediction_id>", "Prediction ID to resolve").requiredOption("--actual-delta <n>", "Actual score delta").requiredOption("--actual-score <n>", "Actual final score").requiredOption("--eval-run <id>", "Eval run ID").action(async (options) => { const m = await import("./commands/predict.js"); await m.resolveCommand({ resolve: options.id, actualDelta: options.actualDelta, actualScore: options.actualScore, evalRun: options.evalRun }); });
|
|
1137
|
+
predictCmd.command("accuracy").description("Show prediction accuracy statistics").action(async () => { const m = await import("./commands/predict.js"); await m.accuracyCommand(); });
|
|
1138
|
+
predictCmd.command("history").description("Show recent predictions").option("--limit <n>", "Max entries to show", "20").action(async (options) => { const m = await import("./commands/predict.js"); await m.historyCommand(options); });
|
|
1139
|
+
predictCmd.action(async () => { console.log(chalk.bold("\n Stratus Prediction Engine\n")); console.log(chalk.gray(" Commands:")); console.log(chalk.gray(' jfl predict run --proposal "..." --goal "..." Generate prediction')); console.log(chalk.gray(" jfl predict resolve --id <id> ... Resolve with actuals")); console.log(chalk.gray(" jfl predict accuracy Show accuracy stats")); console.log(chalk.gray(" jfl predict history Recent predictions")); console.log(); });
|
|
1140
|
+
// --- portfolio ---
|
|
1141
|
+
const portfolioCmd = program.command("portfolio").description("Manage portfolio of GTM workspaces");
|
|
1142
|
+
portfolioCmd.command("register <path>").description("Register a GTM workspace in this portfolio").action(async (gtmPath) => { const m = await import("./commands/portfolio.js"); await m.portfolioRegisterCommand(gtmPath); });
|
|
1143
|
+
portfolioCmd.command("list").description("List registered GTM workspaces").action(async () => { const m = await import("./commands/portfolio.js"); await m.portfolioListCommand(); });
|
|
1144
|
+
portfolioCmd.command("unregister <name>").description("Remove a GTM workspace from this portfolio").action(async (name) => { const m = await import("./commands/portfolio.js"); await m.portfolioUnregisterCommand(name); });
|
|
1145
|
+
portfolioCmd.command("status").description("Portfolio health and eval summary").action(async () => { const m = await import("./commands/portfolio.js"); await m.portfolioStatusCommand(); });
|
|
1146
|
+
portfolioCmd.command("phone-home").description("Sync this GTM's journals and activity to its portfolio parent").action(async () => { const m = await import("./commands/portfolio.js"); await m.portfolioPhoneHomeCommand(); });
|
|
1147
|
+
// --- viz ---
|
|
1148
|
+
const vizCmd = program.command("viz").description("Terminal visualizations — headless dashboard data via Context Hub");
|
|
1149
|
+
vizCmd.command("experiments").description("Show experiment runs with dot plot, sparklines, and score table").option("--agent <name>", "Filter to a specific agent").option("--json", "Output as JSON").action(async (options) => { const m = await import("./commands/viz.js"); await m.experimentsCommand(options); });
|
|
1150
|
+
vizCmd.command("leaderboard").description("Ranked agent leaderboard with sparklines and bar chart").option("--json", "Output as JSON").action(async (options) => { const m = await import("./commands/viz.js"); await m.leaderboardCommand(options); });
|
|
1151
|
+
vizCmd.command("flows").description("Flow definitions and pending executions").option("--pending", "Show only pending approval executions").option("--json", "Output as JSON").action(async (options) => { const m = await import("./commands/viz.js"); await m.flowsVizCommand(options); });
|
|
1152
|
+
vizCmd.command("events").description("Recent event stream with type coloring").option("--pattern <pattern>", "Filter events by type pattern").option("--limit <n>", "Max events to show", "20").option("--json", "Output as JSON").action(async (options) => { const m = await import("./commands/viz.js"); await m.eventsCommand(options); });
|
|
1153
|
+
vizCmd.command("status").description("Hub health, children, sources, item count").option("--json", "Output as JSON").action(async (options) => { const m = await import("./commands/viz.js"); await m.statusCommand(options); });
|
|
1154
|
+
vizCmd.command("dash").description("Composite dashboard — leaderboard, pending flows, events, status").option("--json", "Output as JSON").action(async (options) => { const m = await import("./commands/viz.js"); await m.dashCommand(options); });
|
|
1155
|
+
vizCmd.command("loop").description("Self-driving loop pipeline — detect, propose, eval, merge, learn").option("--days <n>", "Lookback period in days", "7").option("--json", "Output as JSON").action(async (options) => { const m = await import("./commands/viz.js"); await m.loopCommand(options); });
|
|
1156
|
+
vizCmd.command("learning").description("Policy head learning curve — tuples, accuracy, action rewards").option("--json", "Output as JSON").action(async (options) => { const m = await import("./commands/viz.js"); await m.learningCommand(options); });
|
|
1157
|
+
vizCmd.command("fleet").description("VM fleet status — parallel agent waves and tuple collection").option("--wave <id>", "Filter to a specific wave ID").option("--json", "Output as JSON").action(async (options) => { const m = await import("./commands/viz.js"); await m.fleetCommand(options); });
|
|
1158
|
+
vizCmd.action(async () => { const m = await import("./commands/viz.js"); await m.dashCommand({}); });
|
|
1159
|
+
// --- findings ---
|
|
1160
|
+
const findingsCmd = program.command("findings").description("Surface and fix problems automatically");
|
|
1161
|
+
findingsCmd.command("list", { isDefault: true }).description("List current findings").option("--refresh", "Re-analyze before listing").option("--all", "Include dismissed findings").action(async (options) => { const m = await import("./commands/findings.js"); await m.listCommand(options); });
|
|
1162
|
+
findingsCmd.command("fix <n>").description("Spawn an agent to fix finding #n").action(async (n) => { const m = await import("./commands/findings.js"); await m.fixCommand(n); });
|
|
1163
|
+
findingsCmd.command("dismiss <n>").description("Dismiss finding #n").action(async (n) => { const m = await import("./commands/findings.js"); await m.dismissCommand(n); });
|
|
1164
|
+
findingsCmd.command("analyze").description("Force re-analyze the project").action(async () => { const m = await import("./commands/findings.js"); await m.analyzeCommand(); });
|
|
1165
|
+
findingsCmd.action(async () => { const m = await import("./commands/findings.js"); await m.listCommand({}); });
|
|
1166
|
+
// --- verify ---
|
|
1167
|
+
program.command("verify").description("Run TLA+ model checking on system specs")
|
|
1168
|
+
.option("-s, --spec <name>", "Check a specific spec (default: all)")
|
|
1169
|
+
.option("-t, --timeout <seconds>", "TLC timeout in seconds", "120")
|
|
1170
|
+
.option("--apalache", "Use Apalache (symbolic bounded) instead of TLC")
|
|
1171
|
+
.option("-v, --verbose", "Show full TLC output")
|
|
1172
|
+
.option("--json", "Output results as JSON (pipe-friendly)")
|
|
1173
|
+
.action(async (options) => { const m = await import("./commands/verify.js"); await m.verifyCommand({ ...options, timeout: parseInt(options.timeout) }); });
|
|
1068
1174
|
// ============================================================================
|
|
1069
1175
|
// TELEMETRY
|
|
1070
1176
|
// ============================================================================
|
|
1071
1177
|
const telemetryCmd = program.command("telemetry").description("Manage anonymous usage telemetry");
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1178
|
+
// Digest command registered lazily (was: registerDigestCommand)
|
|
1179
|
+
telemetryCmd
|
|
1180
|
+
.command('digest')
|
|
1181
|
+
.description('Analyze telemetry events: costs, stats, and suggestions')
|
|
1182
|
+
.option('--hours <hours>', 'Analysis period in hours', '24')
|
|
1183
|
+
.option('--format <format>', 'Output format: text or json', 'text')
|
|
1184
|
+
.option('--plots', 'Render terminal charts for key metrics')
|
|
1185
|
+
.option('--platform', 'Include platform-side data (requires network)')
|
|
1186
|
+
.action(async (options) => { const m = await import("./commands/digest.js"); await m.digestCommand(options); });
|
|
1080
1187
|
telemetryCmd
|
|
1081
1188
|
.command("status")
|
|
1082
1189
|
.description("Show telemetry status")
|
|
@@ -1145,6 +1252,27 @@ telemetryCmd
|
|
|
1145
1252
|
});
|
|
1146
1253
|
await telemetry.flush();
|
|
1147
1254
|
});
|
|
1255
|
+
telemetryCmd
|
|
1256
|
+
.command("monitor")
|
|
1257
|
+
.description("Monitor physical-world telemetry data in real-time")
|
|
1258
|
+
.option("--live", "Live monitoring with auto-refresh")
|
|
1259
|
+
.option("--compact", "Compact display mode")
|
|
1260
|
+
.option("--interval <seconds>", "Update interval in seconds (default: 5)", "5")
|
|
1261
|
+
.option("--filter <pattern>", "Filter events by category, event name, or content")
|
|
1262
|
+
.action(async (options) => {
|
|
1263
|
+
const { telemetryMonitorCommand } = await import("./commands/telemetry-monitor.js");
|
|
1264
|
+
await telemetryMonitorCommand(options);
|
|
1265
|
+
});
|
|
1266
|
+
telemetryCmd
|
|
1267
|
+
.command("test")
|
|
1268
|
+
.description("Generate test physical-world telemetry data (for testing)")
|
|
1269
|
+
.option("--count <n>", "Number of events to generate (default: 10)", "10")
|
|
1270
|
+
.option("--interval <ms>", "Interval between events in ms (default: 1000)", "1000")
|
|
1271
|
+
.option("--categories <list>", "Comma-separated event categories (default: command,performance,session)")
|
|
1272
|
+
.action(async (options) => {
|
|
1273
|
+
const { telemetryTestCommand } = await import("./commands/telemetry-test.js");
|
|
1274
|
+
await telemetryTestCommand(options);
|
|
1275
|
+
});
|
|
1148
1276
|
// Default telemetry action
|
|
1149
1277
|
telemetryCmd.action(async () => {
|
|
1150
1278
|
// Show status by default
|
|
@@ -1157,10 +1285,11 @@ telemetryCmd.action(async () => {
|
|
|
1157
1285
|
console.log(chalk.gray(" Install ID: ") + chalk.cyan(installId));
|
|
1158
1286
|
}
|
|
1159
1287
|
console.log(chalk.gray("\n Commands:"));
|
|
1160
|
-
console.log(" jfl telemetry status
|
|
1161
|
-
console.log(" jfl telemetry show
|
|
1162
|
-
console.log(" jfl telemetry digest
|
|
1163
|
-
console.log(" jfl telemetry
|
|
1288
|
+
console.log(" jfl telemetry status Show detailed status");
|
|
1289
|
+
console.log(" jfl telemetry show Show queued events");
|
|
1290
|
+
console.log(" jfl telemetry digest Cost and health analysis");
|
|
1291
|
+
console.log(" jfl telemetry monitor Monitor physical-world data");
|
|
1292
|
+
console.log(" jfl telemetry reset Reset install ID");
|
|
1164
1293
|
console.log();
|
|
1165
1294
|
});
|
|
1166
1295
|
// ============================================================================
|
|
@@ -1183,9 +1312,10 @@ program
|
|
|
1183
1312
|
.command("doctor")
|
|
1184
1313
|
.description("Check project health and auto-repair")
|
|
1185
1314
|
.option("--fix", "Auto-repair fixable issues")
|
|
1315
|
+
.option("--json", "Output structured JSON (machine-readable)")
|
|
1186
1316
|
.action(async (options) => {
|
|
1187
1317
|
const { doctorCommand } = await import("./commands/doctor.js");
|
|
1188
|
-
await doctorCommand({ fix: options.fix });
|
|
1318
|
+
await doctorCommand({ fix: options.fix, json: options.json });
|
|
1189
1319
|
});
|
|
1190
1320
|
// ============================================================================
|
|
1191
1321
|
// TRAIN (policy head training pipeline)
|
|
@@ -1297,7 +1427,7 @@ agent.action(async () => {
|
|
|
1297
1427
|
// ============================================================================
|
|
1298
1428
|
program
|
|
1299
1429
|
.command("setup")
|
|
1300
|
-
.description("
|
|
1430
|
+
.description("Progressive intelligent setup - personalized RL agents based on your development patterns")
|
|
1301
1431
|
.option("--dry-run", "Show recommendations without writing files")
|
|
1302
1432
|
.option("-f, --force", "Proceed even if readiness check fails")
|
|
1303
1433
|
.option("--from-violations", "Generate agents from TLC invariant violations")
|
|
@@ -1455,6 +1585,76 @@ kanban
|
|
|
1455
1585
|
const { kanbanBootstrap } = await import("./commands/kanban.js");
|
|
1456
1586
|
await kanbanBootstrap(process.cwd(), options);
|
|
1457
1587
|
});
|
|
1588
|
+
// ============================================================================
|
|
1589
|
+
// Linear
|
|
1590
|
+
// ============================================================================
|
|
1591
|
+
const linear = program
|
|
1592
|
+
.command("linear")
|
|
1593
|
+
.description("Sync with Linear — bidirectional issue sync (GitHub ↔ Linear)");
|
|
1594
|
+
linear
|
|
1595
|
+
.command("link")
|
|
1596
|
+
.description("Link a Linear project to this workspace")
|
|
1597
|
+
.action(async () => {
|
|
1598
|
+
const { findProjectRoot: fpr } = await import("./utils/jfl-config.js");
|
|
1599
|
+
const root = fpr(process.cwd());
|
|
1600
|
+
if (!root) {
|
|
1601
|
+
console.error(chalk.red("Not in a JFL project. Run jfl init first."));
|
|
1602
|
+
process.exit(1);
|
|
1603
|
+
}
|
|
1604
|
+
const { linearLink } = await import("./commands/linear.js");
|
|
1605
|
+
await linearLink(root);
|
|
1606
|
+
});
|
|
1607
|
+
linear
|
|
1608
|
+
.command("unlink")
|
|
1609
|
+
.description("Unlink the Linear project")
|
|
1610
|
+
.action(async () => {
|
|
1611
|
+
const { findProjectRoot: fpr } = await import("./utils/jfl-config.js");
|
|
1612
|
+
const root = fpr(process.cwd());
|
|
1613
|
+
if (!root) {
|
|
1614
|
+
console.error(chalk.red("Not in a JFL project."));
|
|
1615
|
+
process.exit(1);
|
|
1616
|
+
}
|
|
1617
|
+
const { linearUnlink } = await import("./commands/linear.js");
|
|
1618
|
+
await linearUnlink(root);
|
|
1619
|
+
});
|
|
1620
|
+
linear
|
|
1621
|
+
.command("status")
|
|
1622
|
+
.description("Show Linear sync state and mapped issues")
|
|
1623
|
+
.action(async () => {
|
|
1624
|
+
const { findProjectRoot: fpr } = await import("./utils/jfl-config.js");
|
|
1625
|
+
const root = fpr(process.cwd()) ?? process.cwd();
|
|
1626
|
+
const { linearStatus } = await import("./commands/linear.js");
|
|
1627
|
+
await linearStatus(root);
|
|
1628
|
+
});
|
|
1629
|
+
linear
|
|
1630
|
+
.command("sync")
|
|
1631
|
+
.description("Bidirectional sync: GitHub Issues ↔ Linear")
|
|
1632
|
+
.option("--direction <dir>", "Sync direction: github, linear, or both (default: both)", "both")
|
|
1633
|
+
.option("--dry-run", "Preview changes without applying them")
|
|
1634
|
+
.option("--json", "Output structured JSON (for CI and agents)")
|
|
1635
|
+
.action(async (options) => {
|
|
1636
|
+
const { findProjectRoot: fpr } = await import("./utils/jfl-config.js");
|
|
1637
|
+
const root = fpr(process.cwd());
|
|
1638
|
+
if (!root) {
|
|
1639
|
+
console.error(chalk.red("Not in a JFL project."));
|
|
1640
|
+
process.exit(1);
|
|
1641
|
+
}
|
|
1642
|
+
const { linearSync } = await import("./commands/linear.js");
|
|
1643
|
+
await linearSync(root, { direction: options.direction, dryRun: options.dryRun, json: options.json });
|
|
1644
|
+
});
|
|
1645
|
+
linear
|
|
1646
|
+
.command("bootstrap")
|
|
1647
|
+
.description("Deploy GitHub Actions sync workflow + set secrets (one-time setup)")
|
|
1648
|
+
.action(async () => {
|
|
1649
|
+
const { findProjectRoot: fpr } = await import("./utils/jfl-config.js");
|
|
1650
|
+
const root = fpr(process.cwd());
|
|
1651
|
+
if (!root) {
|
|
1652
|
+
console.error(chalk.red("Not in a JFL project."));
|
|
1653
|
+
process.exit(1);
|
|
1654
|
+
}
|
|
1655
|
+
const { linearBootstrap } = await import("./commands/linear.js");
|
|
1656
|
+
await linearBootstrap(root);
|
|
1657
|
+
});
|
|
1458
1658
|
// Parse and run
|
|
1459
1659
|
program.parse();
|
|
1460
1660
|
//# sourceMappingURL=index.js.map
|