jfl 0.4.4 → 0.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/dist/commands/context-hub.d.ts +1 -0
- package/dist/commands/context-hub.d.ts.map +1 -1
- package/dist/commands/context-hub.js +1064 -41
- package/dist/commands/context-hub.js.map +1 -1
- package/dist/commands/eval.d.ts +1 -1
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +192 -1
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/findings.d.ts +6 -0
- package/dist/commands/findings.d.ts.map +1 -0
- package/dist/commands/findings.js +203 -0
- package/dist/commands/findings.js.map +1 -0
- package/dist/commands/hud.d.ts.map +1 -1
- package/dist/commands/hud.js +47 -9
- package/dist/commands/hud.js.map +1 -1
- package/dist/commands/ide.d.ts +27 -0
- package/dist/commands/ide.d.ts.map +1 -0
- package/dist/commands/ide.js +546 -0
- package/dist/commands/ide.js.map +1 -0
- package/dist/commands/onboard.d.ts.map +1 -1
- package/dist/commands/onboard.js +212 -2
- package/dist/commands/onboard.js.map +1 -1
- package/dist/commands/openclaw.d.ts +3 -0
- package/dist/commands/openclaw.d.ts.map +1 -1
- package/dist/commands/openclaw.js +76 -2
- package/dist/commands/openclaw.js.map +1 -1
- package/dist/commands/peter.d.ts +3 -0
- package/dist/commands/peter.d.ts.map +1 -1
- package/dist/commands/peter.js +1168 -58
- package/dist/commands/peter.js.map +1 -1
- package/dist/commands/pi-fleet.d.ts +18 -0
- package/dist/commands/pi-fleet.d.ts.map +1 -0
- package/dist/commands/pi-fleet.js +382 -0
- package/dist/commands/pi-fleet.js.map +1 -0
- package/dist/commands/pi.d.ts.map +1 -1
- package/dist/commands/pi.js +18 -3
- package/dist/commands/pi.js.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +90 -1
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/services.d.ts.map +1 -1
- package/dist/commands/services.js +18 -0
- package/dist/commands/services.js.map +1 -1
- package/dist/commands/setup.d.ts +12 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +322 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +22 -4
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/train.d.ts +33 -0
- package/dist/commands/train.d.ts.map +1 -0
- package/dist/commands/train.js +510 -0
- package/dist/commands/train.js.map +1 -0
- package/dist/commands/verify.d.ts +14 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +276 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/commands/viz.d.ts.map +1 -1
- package/dist/commands/viz.js +417 -0
- package/dist/commands/viz.js.map +1 -1
- package/dist/dashboard-static/assets/index-CW9ZxqX8.css +1 -0
- package/dist/dashboard-static/assets/index-DNN__p4K.js +121 -0
- package/dist/dashboard-static/index.html +2 -2
- package/dist/index.js +324 -64
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-config.d.ts +52 -0
- package/dist/lib/agent-config.d.ts.map +1 -0
- package/dist/lib/agent-config.js +231 -0
- package/dist/lib/agent-config.js.map +1 -0
- package/dist/lib/agent-generator.d.ts +10 -0
- package/dist/lib/agent-generator.d.ts.map +1 -1
- package/dist/lib/agent-generator.js +64 -10
- package/dist/lib/agent-generator.js.map +1 -1
- package/dist/lib/agent-session.d.ts +104 -0
- package/dist/lib/agent-session.d.ts.map +1 -0
- package/dist/lib/agent-session.js +635 -0
- package/dist/lib/agent-session.js.map +1 -0
- package/dist/lib/eval-snapshot.d.ts +47 -0
- package/dist/lib/eval-snapshot.d.ts.map +1 -0
- package/dist/lib/eval-snapshot.js +315 -0
- package/dist/lib/eval-snapshot.js.map +1 -0
- package/dist/lib/eval-store.d.ts +5 -0
- package/dist/lib/eval-store.d.ts.map +1 -1
- package/dist/lib/eval-store.js +33 -3
- package/dist/lib/eval-store.js.map +1 -1
- package/dist/lib/findings-engine.d.ts +51 -0
- package/dist/lib/findings-engine.d.ts.map +1 -0
- package/dist/lib/findings-engine.js +338 -0
- package/dist/lib/findings-engine.js.map +1 -0
- package/dist/lib/flow-engine.d.ts +8 -0
- package/dist/lib/flow-engine.d.ts.map +1 -1
- package/dist/lib/flow-engine.js +84 -2
- package/dist/lib/flow-engine.js.map +1 -1
- package/dist/lib/hub-client.d.ts +1 -0
- package/dist/lib/hub-client.d.ts.map +1 -1
- package/dist/lib/hub-client.js +33 -6
- package/dist/lib/hub-client.js.map +1 -1
- package/dist/lib/ide-panes.d.ts +58 -0
- package/dist/lib/ide-panes.d.ts.map +1 -0
- package/dist/lib/ide-panes.js +508 -0
- package/dist/lib/ide-panes.js.map +1 -0
- package/dist/lib/memory-db.js +4 -4
- package/dist/lib/memory-db.js.map +1 -1
- package/dist/lib/memory-indexer.d.ts.map +1 -1
- package/dist/lib/memory-indexer.js +3 -0
- package/dist/lib/memory-indexer.js.map +1 -1
- package/dist/lib/memory-search.d.ts +148 -4
- package/dist/lib/memory-search.d.ts.map +1 -1
- package/dist/lib/memory-search.js +496 -58
- package/dist/lib/memory-search.js.map +1 -1
- package/dist/lib/meta-orchestrator.d.ts +104 -0
- package/dist/lib/meta-orchestrator.d.ts.map +1 -0
- package/dist/lib/meta-orchestrator.js +373 -0
- package/dist/lib/meta-orchestrator.js.map +1 -0
- package/dist/lib/peer-agent-generator.d.ts.map +1 -1
- package/dist/lib/peer-agent-generator.js +43 -19
- package/dist/lib/peer-agent-generator.js.map +1 -1
- package/dist/lib/pi-sky/bridge.d.ts +55 -0
- package/dist/lib/pi-sky/bridge.d.ts.map +1 -0
- package/dist/lib/pi-sky/bridge.js +264 -0
- package/dist/lib/pi-sky/bridge.js.map +1 -0
- package/dist/lib/pi-sky/cost-monitor.d.ts +21 -0
- package/dist/lib/pi-sky/cost-monitor.d.ts.map +1 -0
- package/dist/lib/pi-sky/cost-monitor.js +126 -0
- package/dist/lib/pi-sky/cost-monitor.js.map +1 -0
- package/dist/lib/pi-sky/eval-sweep.d.ts +27 -0
- package/dist/lib/pi-sky/eval-sweep.d.ts.map +1 -0
- package/dist/lib/pi-sky/eval-sweep.js +141 -0
- package/dist/lib/pi-sky/eval-sweep.js.map +1 -0
- package/dist/lib/pi-sky/event-router.d.ts +32 -0
- package/dist/lib/pi-sky/event-router.d.ts.map +1 -0
- package/dist/lib/pi-sky/event-router.js +176 -0
- package/dist/lib/pi-sky/event-router.js.map +1 -0
- package/dist/lib/pi-sky/experiment.d.ts +9 -0
- package/dist/lib/pi-sky/experiment.d.ts.map +1 -0
- package/dist/lib/pi-sky/experiment.js +83 -0
- package/dist/lib/pi-sky/experiment.js.map +1 -0
- package/dist/lib/pi-sky/index.d.ts +16 -0
- package/dist/lib/pi-sky/index.d.ts.map +1 -0
- package/dist/lib/pi-sky/index.js +16 -0
- package/dist/lib/pi-sky/index.js.map +1 -0
- package/dist/lib/pi-sky/stratus-gate.d.ts +28 -0
- package/dist/lib/pi-sky/stratus-gate.d.ts.map +1 -0
- package/dist/lib/pi-sky/stratus-gate.js +61 -0
- package/dist/lib/pi-sky/stratus-gate.js.map +1 -0
- package/dist/lib/pi-sky/swarm.d.ts +28 -0
- package/dist/lib/pi-sky/swarm.d.ts.map +1 -0
- package/dist/lib/pi-sky/swarm.js +208 -0
- package/dist/lib/pi-sky/swarm.js.map +1 -0
- package/dist/lib/pi-sky/types.d.ts +139 -0
- package/dist/lib/pi-sky/types.d.ts.map +1 -0
- package/dist/lib/pi-sky/types.js +2 -0
- package/dist/lib/pi-sky/types.js.map +1 -0
- package/dist/lib/pi-sky/voice-bridge.d.ts +20 -0
- package/dist/lib/pi-sky/voice-bridge.d.ts.map +1 -0
- package/dist/lib/pi-sky/voice-bridge.js +91 -0
- package/dist/lib/pi-sky/voice-bridge.js.map +1 -0
- package/dist/lib/policy-head.d.ts +40 -0
- package/dist/lib/policy-head.d.ts.map +1 -0
- package/dist/lib/policy-head.js +234 -0
- package/dist/lib/policy-head.js.map +1 -0
- package/dist/lib/predictor.d.ts +10 -0
- package/dist/lib/predictor.d.ts.map +1 -1
- package/dist/lib/predictor.js +46 -7
- package/dist/lib/predictor.js.map +1 -1
- package/dist/lib/replay-buffer.d.ts +93 -0
- package/dist/lib/replay-buffer.d.ts.map +1 -0
- package/dist/lib/replay-buffer.js +302 -0
- package/dist/lib/replay-buffer.js.map +1 -0
- package/dist/lib/sentinel-rl.d.ts +97 -0
- package/dist/lib/sentinel-rl.d.ts.map +1 -0
- package/dist/lib/sentinel-rl.js +430 -0
- package/dist/lib/sentinel-rl.js.map +1 -0
- package/dist/lib/session-lock.d.ts +61 -0
- package/dist/lib/session-lock.d.ts.map +1 -0
- package/dist/lib/session-lock.js +438 -0
- package/dist/lib/session-lock.js.map +1 -0
- package/dist/lib/setup/agent-generator.d.ts +18 -0
- package/dist/lib/setup/agent-generator.d.ts.map +1 -0
- package/dist/lib/setup/agent-generator.js +114 -0
- package/dist/lib/setup/agent-generator.js.map +1 -0
- package/dist/lib/setup/context-analyzer.d.ts +16 -0
- package/dist/lib/setup/context-analyzer.d.ts.map +1 -0
- package/dist/lib/setup/context-analyzer.js +112 -0
- package/dist/lib/setup/context-analyzer.js.map +1 -0
- package/dist/lib/setup/doc-auditor.d.ts +54 -0
- package/dist/lib/setup/doc-auditor.d.ts.map +1 -0
- package/dist/lib/setup/doc-auditor.js +629 -0
- package/dist/lib/setup/doc-auditor.js.map +1 -0
- package/dist/lib/setup/domain-generator.d.ts +7 -0
- package/dist/lib/setup/domain-generator.d.ts.map +1 -0
- package/dist/lib/setup/domain-generator.js +58 -0
- package/dist/lib/setup/domain-generator.js.map +1 -0
- package/dist/lib/setup/smart-eval-generator.d.ts +38 -0
- package/dist/lib/setup/smart-eval-generator.d.ts.map +1 -0
- package/dist/lib/setup/smart-eval-generator.js +378 -0
- package/dist/lib/setup/smart-eval-generator.js.map +1 -0
- package/dist/lib/setup/smart-recommender.d.ts +63 -0
- package/dist/lib/setup/smart-recommender.d.ts.map +1 -0
- package/dist/lib/setup/smart-recommender.js +329 -0
- package/dist/lib/setup/smart-recommender.js.map +1 -0
- package/dist/lib/setup/spec-generator.d.ts +63 -0
- package/dist/lib/setup/spec-generator.d.ts.map +1 -0
- package/dist/lib/setup/spec-generator.js +310 -0
- package/dist/lib/setup/spec-generator.js.map +1 -0
- package/dist/lib/setup/violation-agent-generator.d.ts +32 -0
- package/dist/lib/setup/violation-agent-generator.d.ts.map +1 -0
- package/dist/lib/setup/violation-agent-generator.js +255 -0
- package/dist/lib/setup/violation-agent-generator.js.map +1 -0
- package/dist/lib/stratus-client.d.ts +1 -0
- package/dist/lib/stratus-client.d.ts.map +1 -1
- package/dist/lib/stratus-client.js +24 -2
- package/dist/lib/stratus-client.js.map +1 -1
- package/dist/lib/telemetry-agent-v2.d.ts +128 -0
- package/dist/lib/telemetry-agent-v2.d.ts.map +1 -0
- package/dist/lib/telemetry-agent-v2.js +1042 -0
- package/dist/lib/telemetry-agent-v2.js.map +1 -0
- package/dist/lib/telemetry-agent.d.ts.map +1 -1
- package/dist/lib/telemetry-agent.js +27 -6
- package/dist/lib/telemetry-agent.js.map +1 -1
- package/dist/lib/telemetry-digest.d.ts.map +1 -1
- package/dist/lib/telemetry-digest.js +27 -5
- package/dist/lib/telemetry-digest.js.map +1 -1
- package/dist/lib/telemetry.d.ts.map +1 -1
- package/dist/lib/telemetry.js +29 -4
- package/dist/lib/telemetry.js.map +1 -1
- package/dist/lib/text-preprocessing.d.ts +83 -0
- package/dist/lib/text-preprocessing.d.ts.map +1 -0
- package/dist/lib/text-preprocessing.js +261 -0
- package/dist/lib/text-preprocessing.js.map +1 -0
- package/dist/lib/training-buffer.d.ts +86 -0
- package/dist/lib/training-buffer.d.ts.map +1 -0
- package/dist/lib/training-buffer.js +139 -0
- package/dist/lib/training-buffer.js.map +1 -0
- package/dist/lib/tuple-miner.d.ts +30 -0
- package/dist/lib/tuple-miner.d.ts.map +1 -0
- package/dist/lib/tuple-miner.js +427 -0
- package/dist/lib/tuple-miner.js.map +1 -0
- package/dist/lib/vm-backend.d.ts +72 -0
- package/dist/lib/vm-backend.d.ts.map +1 -0
- package/dist/lib/vm-backend.js +175 -0
- package/dist/lib/vm-backend.js.map +1 -0
- package/dist/lib/workspace/backend.d.ts +53 -0
- package/dist/lib/workspace/backend.d.ts.map +1 -0
- package/dist/lib/workspace/backend.js +37 -0
- package/dist/lib/workspace/backend.js.map +1 -0
- package/dist/lib/workspace/cmux-adapter.d.ts +46 -0
- package/dist/lib/workspace/cmux-adapter.d.ts.map +1 -0
- package/dist/lib/workspace/cmux-adapter.js +261 -0
- package/dist/lib/workspace/cmux-adapter.js.map +1 -0
- package/dist/lib/workspace/data-pipeline.d.ts +35 -0
- package/dist/lib/workspace/data-pipeline.d.ts.map +1 -0
- package/dist/lib/workspace/data-pipeline.js +463 -0
- package/dist/lib/workspace/data-pipeline.js.map +1 -0
- package/dist/lib/workspace/engine.d.ts +64 -0
- package/dist/lib/workspace/engine.d.ts.map +1 -0
- package/dist/lib/workspace/engine.js +397 -0
- package/dist/lib/workspace/engine.js.map +1 -0
- package/dist/lib/workspace/notifications.d.ts +14 -0
- package/dist/lib/workspace/notifications.d.ts.map +1 -0
- package/dist/lib/workspace/notifications.js +41 -0
- package/dist/lib/workspace/notifications.js.map +1 -0
- package/dist/lib/workspace/surface-registry.d.ts +49 -0
- package/dist/lib/workspace/surface-registry.d.ts.map +1 -0
- package/dist/lib/workspace/surface-registry.js +217 -0
- package/dist/lib/workspace/surface-registry.js.map +1 -0
- package/dist/lib/workspace/surface-type.d.ts +153 -0
- package/dist/lib/workspace/surface-type.d.ts.map +1 -0
- package/dist/lib/workspace/surface-type.js +9 -0
- package/dist/lib/workspace/surface-type.js.map +1 -0
- package/dist/lib/workspace/surfaces/agent-overview.d.ts +16 -0
- package/dist/lib/workspace/surfaces/agent-overview.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/agent-overview.js +116 -0
- package/dist/lib/workspace/surfaces/agent-overview.js.map +1 -0
- package/dist/lib/workspace/surfaces/agent.d.ts +16 -0
- package/dist/lib/workspace/surfaces/agent.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/agent.js +112 -0
- package/dist/lib/workspace/surfaces/agent.js.map +1 -0
- package/dist/lib/workspace/surfaces/claude.d.ts +15 -0
- package/dist/lib/workspace/surfaces/claude.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/claude.js +23 -0
- package/dist/lib/workspace/surfaces/claude.js.map +1 -0
- package/dist/lib/workspace/surfaces/dashboard.d.ts +21 -0
- package/dist/lib/workspace/surfaces/dashboard.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/dashboard.js +32 -0
- package/dist/lib/workspace/surfaces/dashboard.js.map +1 -0
- package/dist/lib/workspace/surfaces/eval.d.ts +15 -0
- package/dist/lib/workspace/surfaces/eval.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/eval.js +42 -0
- package/dist/lib/workspace/surfaces/eval.js.map +1 -0
- package/dist/lib/workspace/surfaces/event-stream.d.ts +16 -0
- package/dist/lib/workspace/surfaces/event-stream.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/event-stream.js +40 -0
- package/dist/lib/workspace/surfaces/event-stream.js.map +1 -0
- package/dist/lib/workspace/surfaces/flow.d.ts +16 -0
- package/dist/lib/workspace/surfaces/flow.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/flow.js +49 -0
- package/dist/lib/workspace/surfaces/flow.js.map +1 -0
- package/dist/lib/workspace/surfaces/index.d.ts +16 -0
- package/dist/lib/workspace/surfaces/index.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/index.js +16 -0
- package/dist/lib/workspace/surfaces/index.js.map +1 -0
- package/dist/lib/workspace/surfaces/portfolio.d.ts +16 -0
- package/dist/lib/workspace/surfaces/portfolio.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/portfolio.js +102 -0
- package/dist/lib/workspace/surfaces/portfolio.js.map +1 -0
- package/dist/lib/workspace/surfaces/service.d.ts +16 -0
- package/dist/lib/workspace/surfaces/service.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/service.js +45 -0
- package/dist/lib/workspace/surfaces/service.js.map +1 -0
- package/dist/lib/workspace/surfaces/shell.d.ts +15 -0
- package/dist/lib/workspace/surfaces/shell.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/shell.js +19 -0
- package/dist/lib/workspace/surfaces/shell.js.map +1 -0
- package/dist/lib/workspace/surfaces/telemetry.d.ts +16 -0
- package/dist/lib/workspace/surfaces/telemetry.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/telemetry.js +48 -0
- package/dist/lib/workspace/surfaces/telemetry.js.map +1 -0
- package/dist/lib/workspace/surfaces/topology.d.ts +15 -0
- package/dist/lib/workspace/surfaces/topology.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/topology.js +19 -0
- package/dist/lib/workspace/surfaces/topology.js.map +1 -0
- package/dist/lib/workspace/surfaces/training.d.ts +16 -0
- package/dist/lib/workspace/surfaces/training.d.ts.map +1 -0
- package/dist/lib/workspace/surfaces/training.js +22 -0
- package/dist/lib/workspace/surfaces/training.js.map +1 -0
- package/dist/lib/workspace/tmux-adapter.d.ts +27 -0
- package/dist/lib/workspace/tmux-adapter.d.ts.map +1 -0
- package/dist/lib/workspace/tmux-adapter.js +106 -0
- package/dist/lib/workspace/tmux-adapter.js.map +1 -0
- package/dist/mcp/context-hub-mcp.js +7 -24
- package/dist/mcp/context-hub-mcp.js.map +1 -1
- package/dist/types/flows.d.ts +2 -0
- package/dist/types/flows.d.ts.map +1 -1
- package/dist/types/ide.d.ts +49 -0
- package/dist/types/ide.d.ts.map +1 -0
- package/dist/types/ide.js +5 -0
- package/dist/types/ide.js.map +1 -0
- package/dist/types/platform-digest.d.ts +228 -0
- package/dist/types/platform-digest.d.ts.map +1 -0
- package/dist/types/platform-digest.js +5 -0
- package/dist/types/platform-digest.js.map +1 -0
- package/dist/types/telemetry-digest.d.ts +2 -0
- package/dist/types/telemetry-digest.d.ts.map +1 -1
- package/dist/utils/ensure-project.d.ts +1 -0
- package/dist/utils/ensure-project.d.ts.map +1 -1
- package/dist/utils/ensure-project.js +19 -7
- package/dist/utils/ensure-project.js.map +1 -1
- package/dist/utils/jfl-config.d.ts +1 -0
- package/dist/utils/jfl-config.d.ts.map +1 -1
- package/dist/utils/jfl-config.js +19 -1
- package/dist/utils/jfl-config.js.map +1 -1
- package/dist/utils/jfl-paths.d.ts +5 -0
- package/dist/utils/jfl-paths.d.ts.map +1 -1
- package/dist/utils/jfl-paths.js +25 -3
- package/dist/utils/jfl-paths.js.map +1 -1
- package/package.json +3 -2
- package/packages/pi/AGENTS.md +112 -0
- package/packages/pi/extensions/agent-grid.ts +191 -0
- package/packages/pi/extensions/agent-names.ts +178 -0
- package/packages/pi/extensions/autoresearch.ts +427 -0
- package/packages/pi/extensions/bookmarks.ts +85 -0
- package/packages/pi/extensions/context.ts +184 -0
- package/packages/pi/extensions/crm-tool.ts +61 -0
- package/packages/pi/extensions/eval-tool.ts +224 -0
- package/packages/pi/extensions/eval.ts +60 -0
- package/packages/pi/extensions/footer.ts +239 -0
- package/packages/pi/extensions/hub-resolver.ts +63 -0
- package/packages/pi/extensions/hud-tool.ts +145 -0
- package/packages/pi/extensions/index.ts +405 -0
- package/packages/pi/extensions/journal.ts +224 -0
- package/packages/pi/extensions/map-bridge.ts +178 -0
- package/packages/pi/extensions/memory-tool.ts +73 -0
- package/packages/pi/extensions/notifications.ts +73 -0
- package/packages/pi/extensions/peter-parker.ts +202 -0
- package/packages/pi/extensions/policy-head-tool.ts +276 -0
- package/packages/pi/extensions/portfolio-bridge.ts +90 -0
- package/packages/pi/extensions/session.ts +142 -0
- package/packages/pi/extensions/shortcuts.ts +259 -0
- package/packages/pi/extensions/stratus-bridge.ts +115 -0
- package/packages/pi/extensions/synopsis-tool.ts +83 -0
- package/packages/pi/extensions/tool-renderers.ts +353 -0
- package/packages/pi/extensions/training-buffer-tool.ts +368 -0
- package/packages/pi/extensions/types.ts +163 -0
- package/packages/pi/package-lock.json +346 -0
- package/packages/pi/package.json +44 -0
- package/packages/pi/skills/agent-browser/SKILL.md +116 -0
- package/packages/pi/skills/brand-architect/SKILL.md +240 -0
- package/packages/pi/skills/brand-architect/config.yaml +137 -0
- package/packages/pi/skills/campaign-hud/config.yaml +112 -0
- package/packages/pi/skills/content-creator/SKILL.md +294 -0
- package/packages/pi/skills/context/SKILL.md +65 -0
- package/packages/pi/skills/debug/MULTI_AGENT.md +360 -0
- package/packages/pi/skills/debug/SKILL.md +554 -0
- package/packages/pi/skills/end/SKILL.md +1782 -0
- package/packages/pi/skills/eval/SKILL.md +75 -0
- package/packages/pi/skills/fly-deploy/SKILL.md +676 -0
- package/packages/pi/skills/founder-video/SKILL.md +467 -0
- package/packages/pi/skills/hud/SKILL.md +160 -0
- package/packages/pi/skills/orchestrate/SKILL.md +74 -0
- package/packages/pi/skills/pi-agents/SKILL.md +78 -0
- package/packages/pi/skills/react-best-practices/AGENTS.md +2249 -0
- package/packages/pi/skills/react-best-practices/README.md +123 -0
- package/packages/pi/skills/react-best-practices/SKILL.md +125 -0
- package/packages/pi/skills/react-best-practices/metadata.json +15 -0
- package/packages/pi/skills/react-best-practices/rules/_sections.md +46 -0
- package/packages/pi/skills/react-best-practices/rules/_template.md +28 -0
- package/packages/pi/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/packages/pi/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
- package/packages/pi/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/packages/pi/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/packages/pi/skills/react-best-practices/rules/async-dependencies.md +36 -0
- package/packages/pi/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/packages/pi/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/packages/pi/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/packages/pi/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/packages/pi/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/packages/pi/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/packages/pi/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/packages/pi/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/packages/pi/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/packages/pi/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/packages/pi/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/packages/pi/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/packages/pi/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/packages/pi/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/packages/pi/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/packages/pi/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/packages/pi/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/packages/pi/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/packages/pi/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/packages/pi/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/packages/pi/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/packages/pi/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/packages/pi/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/packages/pi/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/packages/pi/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/packages/pi/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/packages/pi/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/packages/pi/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/packages/pi/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/packages/pi/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/packages/pi/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/packages/pi/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/packages/pi/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/packages/pi/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/packages/pi/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/packages/pi/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/packages/pi/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/packages/pi/skills/react-best-practices/rules/server-cache-react.md +26 -0
- package/packages/pi/skills/react-best-practices/rules/server-parallel-fetching.md +79 -0
- package/packages/pi/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/packages/pi/skills/remotion-best-practices/SKILL.md +43 -0
- package/packages/pi/skills/remotion-best-practices/rules/3d.md +86 -0
- package/packages/pi/skills/remotion-best-practices/rules/animations.md +29 -0
- package/packages/pi/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/packages/pi/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/packages/pi/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/packages/pi/skills/remotion-best-practices/rules/assets.md +78 -0
- package/packages/pi/skills/remotion-best-practices/rules/audio.md +172 -0
- package/packages/pi/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/packages/pi/skills/remotion-best-practices/rules/can-decode.md +75 -0
- package/packages/pi/skills/remotion-best-practices/rules/charts.md +58 -0
- package/packages/pi/skills/remotion-best-practices/rules/compositions.md +146 -0
- package/packages/pi/skills/remotion-best-practices/rules/display-captions.md +126 -0
- package/packages/pi/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/packages/pi/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/packages/pi/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/packages/pi/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/packages/pi/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/packages/pi/skills/remotion-best-practices/rules/gifs.md +138 -0
- package/packages/pi/skills/remotion-best-practices/rules/images.md +130 -0
- package/packages/pi/skills/remotion-best-practices/rules/import-srt-captions.md +67 -0
- package/packages/pi/skills/remotion-best-practices/rules/lottie.md +68 -0
- package/packages/pi/skills/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
- package/packages/pi/skills/remotion-best-practices/rules/measuring-text.md +143 -0
- package/packages/pi/skills/remotion-best-practices/rules/sequencing.md +106 -0
- package/packages/pi/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/packages/pi/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/packages/pi/skills/remotion-best-practices/rules/timing.md +179 -0
- package/packages/pi/skills/remotion-best-practices/rules/transcribe-captions.md +19 -0
- package/packages/pi/skills/remotion-best-practices/rules/transitions.md +122 -0
- package/packages/pi/skills/remotion-best-practices/rules/trimming.md +53 -0
- package/packages/pi/skills/remotion-best-practices/rules/videos.md +171 -0
- package/packages/pi/skills/search/SKILL.md +220 -0
- package/packages/pi/skills/spec/SKILL.md +377 -0
- package/packages/pi/skills/startup/SKILL.md +315 -0
- package/packages/pi/skills/web-architect/SKILL.md +309 -0
- package/packages/pi/skills/x-algorithm/SKILL.md +305 -0
- package/packages/pi/teams/dev-team.yaml +63 -0
- package/packages/pi/teams/gtm-team.yaml +79 -0
- package/packages/pi/themes/jfl.theme.json +76 -0
- package/packages/pi/tsconfig.json +21 -0
- package/scripts/collect-tuples.sh +124 -0
- package/scripts/destroy-fleet.sh +37 -0
- package/scripts/jfl-ide.sh +48 -0
- package/scripts/session/session-cleanup.sh +4 -11
- package/scripts/session/session-init.sh +6 -0
- package/scripts/session/session-sync.sh +25 -0
- package/scripts/setup-branch-protection.sh +106 -0
- package/scripts/spawn-fleet.sh +144 -0
- package/scripts/train/requirements.txt +5 -0
- package/scripts/train/train-policy-head.py +477 -0
- package/scripts/train/v2/dataset.py +81 -0
- package/scripts/train/v2/domain.json +18 -0
- package/scripts/train/v2/eval.py +196 -0
- package/scripts/train/v2/generate_data.py +219 -0
- package/scripts/train/v2/infer.py +188 -0
- package/scripts/train/v2/model.py +112 -0
- package/scripts/train/v2/precompute.py +132 -0
- package/scripts/train/v2/train.py +302 -0
- package/scripts/train/v2/transform_buffer.py +227 -0
- package/scripts/train/v2/validate_data.py +115 -0
- package/scripts/train-policy-head.py +434 -0
- package/scripts/vm-swarm/README.md +301 -0
- package/scripts/vm-swarm/collect-tuples.sh +331 -0
- package/scripts/vm-swarm/create-base-template.sh +339 -0
- package/scripts/vm-swarm/kill-fleet.sh +204 -0
- package/scripts/vm-swarm/monitor-fleet.sh +346 -0
- package/scripts/vm-swarm/spawn-fleet.sh +304 -0
- package/template/.claude/settings.json +2 -15
- package/template/.github/workflows/jfl-eval.yml +6 -1
- package/template/.github/workflows/jfl-review.yml +4 -0
- package/template/scripts/session/session-cleanup.sh +2 -11
- package/template/scripts/session/session-end-hub.sh +72 -0
- package/template/scripts/session/session-end.sh +69 -6
- package/template/scripts/session/session-init.sh +55 -30
- package/template/scripts/session/session-lock.sh +464 -0
- package/template/scripts/session/session-start-hub.sh +105 -0
- package/template/templates/service-agent/workflows/jfl-eval.yml +19 -0
- package/dist/dashboard-static/assets/index-B6kRK9Rq.js +0 -116
- package/dist/dashboard-static/assets/index-BpdKJPLu.css +0 -1
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Renderers
|
|
3
|
+
*
|
|
4
|
+
* Custom renderCall/renderResult for all JFL tools.
|
|
5
|
+
* Transforms plain text output into themed, collapsible TUI components
|
|
6
|
+
* with icons, borders, color-coded sections, and smart truncation.
|
|
7
|
+
*
|
|
8
|
+
* @purpose Beautiful TUI rendering for jfl_hud, jfl_context, jfl_crm, jfl_memory_search, jfl_synopsis, jfl_eval_status, jfl_eval_compare, jfl_policy_score, jfl_policy_rank, jfl_training_buffer, jfl_mine_tuples
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { PiTheme } from "./types.js"
|
|
12
|
+
|
|
13
|
+
// ─── Shared helpers ──────────────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
function truncLine(text: string, maxW: number): string {
|
|
16
|
+
const stripped = text.replace(/\x1b\[[0-9;]*m/g, "")
|
|
17
|
+
if (stripped.length <= maxW) return text
|
|
18
|
+
return text.slice(0, maxW - 1) + "…"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function wrapText(text: string, width: number): string[] {
|
|
22
|
+
const lines: string[] = []
|
|
23
|
+
for (const raw of text.split("\n")) {
|
|
24
|
+
if (raw.length <= width) { lines.push(raw); continue }
|
|
25
|
+
let pos = 0
|
|
26
|
+
while (pos < raw.length) {
|
|
27
|
+
lines.push(raw.slice(pos, pos + width))
|
|
28
|
+
pos += width
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return lines
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function sectionBorder(theme: PiTheme, label: string, width: number): string {
|
|
35
|
+
const labelStr = ` ${label} `
|
|
36
|
+
const rest = Math.max(0, width - labelStr.length - 4)
|
|
37
|
+
return theme.fg("border", "──") + theme.fg("accent", labelStr) + theme.fg("border", "─".repeat(rest))
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// ─── HUD Tool ───────────────────────────────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
export function hudRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
43
|
+
const label = theme.fg("accent", "◆") + " " + theme.fg("toolTitle", theme.bold("HUD"))
|
|
44
|
+
return { render: () => [label], invalidate() {} }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function hudRenderResult(result: any, opts: { expanded: boolean }, theme: PiTheme): any {
|
|
48
|
+
const raw = extractText(result)
|
|
49
|
+
const lines = raw.split("\n").filter(Boolean)
|
|
50
|
+
|
|
51
|
+
if (!opts.expanded && lines.length > 5) {
|
|
52
|
+
const display = lines.slice(0, 5).map(l => theme.fg("toolOutput", l))
|
|
53
|
+
display.push(theme.fg("dim", `... ${lines.length - 5} more lines (Ctrl+O)`))
|
|
54
|
+
return { render: () => display, invalidate() {} }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const themed = lines.map(line => {
|
|
58
|
+
if (line.startsWith("◆")) return theme.fg("accent", line)
|
|
59
|
+
if (line.includes("Phase:")) return theme.fg("warning", line)
|
|
60
|
+
if (/^\s*(Pipeline|Deal|Stage)/i.test(line)) return theme.fg("accent", line)
|
|
61
|
+
return theme.fg("toolOutput", line)
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
return { render: () => themed, invalidate() {} }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ─── Context Tool ───────────────────────────────────────────────────────────
|
|
68
|
+
|
|
69
|
+
export function contextRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
70
|
+
const query = args.query ?? ""
|
|
71
|
+
const label = theme.fg("toolTitle", theme.bold("context ")) + theme.fg("accent", `"${query}"`)
|
|
72
|
+
return { render: () => [label], invalidate() {} }
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function contextRenderResult(result: any, opts: { expanded: boolean }, theme: PiTheme): any {
|
|
76
|
+
const MAX_W = 140
|
|
77
|
+
const raw = extractText(result)
|
|
78
|
+
if (raw === "No relevant context found." || raw === "No context available.") {
|
|
79
|
+
return { render: () => [theme.fg("dim", "No relevant context found")], invalidate() {} }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const sections = raw.split(/---\n/).filter(Boolean)
|
|
83
|
+
const lines: string[] = []
|
|
84
|
+
|
|
85
|
+
const max = opts.expanded ? sections.length : Math.min(sections.length, 3)
|
|
86
|
+
for (let i = 0; i < max; i++) {
|
|
87
|
+
const section = sections[i].trim()
|
|
88
|
+
const firstLine = section.split("\n")[0] ?? ""
|
|
89
|
+
|
|
90
|
+
if (firstLine.startsWith("[")) {
|
|
91
|
+
const typeMatch = firstLine.match(/^\[(\w+)\]\s*(.*)/)
|
|
92
|
+
if (typeMatch) {
|
|
93
|
+
const typeColor = typeMatch[1] === "decision" ? "warning" : typeMatch[1] === "feature" ? "success" : "muted"
|
|
94
|
+
lines.push(truncLine(`${theme.fg(typeColor, `[${typeMatch[1]}]`)} ${theme.fg("text", typeMatch[2])}`, MAX_W))
|
|
95
|
+
} else {
|
|
96
|
+
lines.push(truncLine(theme.fg("text", firstLine), MAX_W))
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
lines.push(truncLine(theme.fg("text", firstLine), MAX_W))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (opts.expanded) {
|
|
103
|
+
const rest = section.split("\n").slice(1)
|
|
104
|
+
for (const l of rest) lines.push(truncLine(theme.fg("muted", l), MAX_W))
|
|
105
|
+
lines.push("")
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (!opts.expanded && sections.length > 3) {
|
|
110
|
+
lines.push(theme.fg("dim", `... ${sections.length - 3} more results (Ctrl+O)`))
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return { render: () => lines, invalidate() {} }
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ─── CRM Tool ───────────────────────────────────────────────────────────────
|
|
117
|
+
|
|
118
|
+
export function crmRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
119
|
+
const cmd = args.command ?? "list"
|
|
120
|
+
const extra = args.args ? ` ${args.args}` : ""
|
|
121
|
+
const label = theme.fg("toolTitle", theme.bold("crm ")) + theme.fg("accent", cmd) + theme.fg("dim", extra)
|
|
122
|
+
return { render: () => [label], invalidate() {} }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function crmRenderResult(result: any, opts: { expanded: boolean }, theme: PiTheme): any {
|
|
126
|
+
const raw = extractText(result)
|
|
127
|
+
if (raw.startsWith("Error")) {
|
|
128
|
+
return { render: () => [theme.fg("error", raw)], invalidate() {} }
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const lines = raw.split("\n").filter(Boolean)
|
|
132
|
+
const themed = lines.map(line => {
|
|
133
|
+
if (/active|open|hot/i.test(line)) return theme.fg("success", line)
|
|
134
|
+
if (/stale|cold|lost/i.test(line)) return theme.fg("error", line)
|
|
135
|
+
if (/pipeline|deal|stage/i.test(line)) return theme.fg("accent", line)
|
|
136
|
+
if (line.startsWith("─") || line.startsWith("│") || line.startsWith("┌")) return theme.fg("border", line)
|
|
137
|
+
return theme.fg("toolOutput", line)
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
if (!opts.expanded && themed.length > 8) {
|
|
141
|
+
const display = themed.slice(0, 8)
|
|
142
|
+
display.push(theme.fg("dim", `... ${themed.length - 8} more (Ctrl+O)`))
|
|
143
|
+
return { render: () => display, invalidate() {} }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return { render: () => themed, invalidate() {} }
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// ─── Memory Search Tool ─────────────────────────────────────────────────────
|
|
150
|
+
|
|
151
|
+
export function memoryRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
152
|
+
const query = args.query ?? ""
|
|
153
|
+
const type = args.type && args.type !== "all" ? ` [${args.type}]` : ""
|
|
154
|
+
const label = theme.fg("toolTitle", theme.bold("memory ")) + theme.fg("accent", `"${query}"`) + theme.fg("muted", type)
|
|
155
|
+
return { render: () => [label], invalidate() {} }
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function memoryRenderResult(result: any, opts: { expanded: boolean }, theme: PiTheme): any {
|
|
159
|
+
const raw = extractText(result)
|
|
160
|
+
if (raw.includes("unavailable") || raw.includes("No memories")) {
|
|
161
|
+
return { render: () => [theme.fg("dim", raw)], invalidate() {} }
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const entries = raw.split(/\n\n---\n\n/).filter(Boolean)
|
|
165
|
+
const lines: string[] = []
|
|
166
|
+
|
|
167
|
+
const max = opts.expanded ? entries.length : Math.min(entries.length, 4)
|
|
168
|
+
for (let i = 0; i < max; i++) {
|
|
169
|
+
const entry = entries[i].trim()
|
|
170
|
+
const [header, ...body] = entry.split("\n")
|
|
171
|
+
if (header) lines.push(theme.fg("accent", header))
|
|
172
|
+
if (opts.expanded) {
|
|
173
|
+
for (const l of body) lines.push(theme.fg("muted", l))
|
|
174
|
+
lines.push("")
|
|
175
|
+
} else if (body.length > 0) {
|
|
176
|
+
lines.push(theme.fg("dim", body[0].slice(0, 80) + (body[0].length > 80 ? "…" : "")))
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (!opts.expanded && entries.length > 4) {
|
|
181
|
+
lines.push(theme.fg("dim", `... ${entries.length - 4} more (Ctrl+O)`))
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return { render: () => lines, invalidate() {} }
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// ─── Synopsis Tool ──────────────────────────────────────────────────────────
|
|
188
|
+
|
|
189
|
+
export function synopsisRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
190
|
+
const hours = args.hours ?? 24
|
|
191
|
+
const author = args.author ? ` by ${args.author}` : ""
|
|
192
|
+
const label = theme.fg("toolTitle", theme.bold("synopsis ")) + theme.fg("accent", `${hours}h`) + theme.fg("muted", author)
|
|
193
|
+
return { render: () => [label], invalidate() {} }
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function synopsisRenderResult(result: any, opts: { expanded: boolean }, theme: PiTheme): any {
|
|
197
|
+
const raw = extractText(result)
|
|
198
|
+
const lines = raw.split("\n")
|
|
199
|
+
const themed: string[] = []
|
|
200
|
+
|
|
201
|
+
for (const line of lines) {
|
|
202
|
+
if (/^#+\s/.test(line)) themed.push(theme.fg("accent", theme.bold(line)))
|
|
203
|
+
else if (/^-\s/.test(line)) themed.push(theme.fg("muted", " ") + theme.fg("text", line.slice(2)))
|
|
204
|
+
else if (/feature|feat/i.test(line)) themed.push(theme.fg("success", line))
|
|
205
|
+
else if (/fix|bug/i.test(line)) themed.push(theme.fg("error", line))
|
|
206
|
+
else if (/decision/i.test(line)) themed.push(theme.fg("warning", line))
|
|
207
|
+
else if (/time|hours|minutes/i.test(line)) themed.push(theme.fg("dim", line))
|
|
208
|
+
else themed.push(theme.fg("toolOutput", line))
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (!opts.expanded && themed.length > 15) {
|
|
212
|
+
const display = themed.slice(0, 15)
|
|
213
|
+
display.push(theme.fg("dim", `... ${themed.length - 15} more lines (Ctrl+O)`))
|
|
214
|
+
return { render: () => display, invalidate() {} }
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return { render: () => themed, invalidate() {} }
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// ─── Eval Status Tool ───────────────────────────────────────────────────────
|
|
221
|
+
|
|
222
|
+
export function evalStatusRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
223
|
+
const label = theme.fg("toolTitle", theme.bold("eval")) + " " + theme.fg("accent", "status")
|
|
224
|
+
return { render: () => [label], invalidate() {} }
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export function evalStatusRenderResult(result: any, opts: { expanded: boolean }, theme: PiTheme): any {
|
|
228
|
+
const raw = extractText(result)
|
|
229
|
+
const lines = raw.split("\n").filter(Boolean)
|
|
230
|
+
const themed = lines.map(line => {
|
|
231
|
+
const scoreMatch = line.match(/([\d.]+)/)
|
|
232
|
+
if (scoreMatch) {
|
|
233
|
+
const score = parseFloat(scoreMatch[1])
|
|
234
|
+
if (score >= 0.8) return theme.fg("success", line)
|
|
235
|
+
if (score >= 0.5) return theme.fg("warning", line)
|
|
236
|
+
return theme.fg("error", line)
|
|
237
|
+
}
|
|
238
|
+
if (/trend|delta|improved/i.test(line)) return theme.fg("accent", line)
|
|
239
|
+
return theme.fg("toolOutput", line)
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
return { render: () => themed, invalidate() {} }
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// ─── Eval Compare Tool ──────────────────────────────────────────────────────
|
|
246
|
+
|
|
247
|
+
export function evalCompareRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
248
|
+
const a = args.a ?? "-2"
|
|
249
|
+
const b = args.b ?? "-1"
|
|
250
|
+
const label = theme.fg("toolTitle", theme.bold("eval")) + " " + theme.fg("accent", `compare ${a} ↔ ${b}`)
|
|
251
|
+
return { render: () => [label], invalidate() {} }
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export function evalCompareRenderResult(result: any, _opts: { expanded: boolean }, theme: PiTheme): any {
|
|
255
|
+
const raw = extractText(result)
|
|
256
|
+
const lines = raw.split("\n").filter(Boolean).map(line => {
|
|
257
|
+
if (/improved|↑|better/i.test(line)) return theme.fg("success", line)
|
|
258
|
+
if (/regressed|↓|worse/i.test(line)) return theme.fg("error", line)
|
|
259
|
+
if (/unchanged|same/i.test(line)) return theme.fg("dim", line)
|
|
260
|
+
return theme.fg("toolOutput", line)
|
|
261
|
+
})
|
|
262
|
+
return { render: () => lines, invalidate() {} }
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// ─── Policy Score Tool ──────────────────────────────────────────────────────
|
|
266
|
+
|
|
267
|
+
export function policyScoreRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
268
|
+
const action = args.action_type ?? "?"
|
|
269
|
+
const scope = args.scope ? `[${args.scope}]` : ""
|
|
270
|
+
const label = theme.fg("toolTitle", theme.bold("policy ")) + theme.fg("accent", action) + " " + theme.fg("dim", scope)
|
|
271
|
+
return { render: () => [label], invalidate() {} }
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export function policyScoreRenderResult(result: any, _opts: { expanded: boolean }, theme: PiTheme): any {
|
|
275
|
+
const raw = extractText(result)
|
|
276
|
+
const lines = raw.split("\n").filter(Boolean).map(line => {
|
|
277
|
+
if (/positive|recommend|high/i.test(line)) return theme.fg("success", line)
|
|
278
|
+
if (/negative|avoid|low/i.test(line)) return theme.fg("error", line)
|
|
279
|
+
if (/delta|score|predict/i.test(line)) return theme.fg("accent", line)
|
|
280
|
+
return theme.fg("toolOutput", line)
|
|
281
|
+
})
|
|
282
|
+
return { render: () => lines, invalidate() {} }
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// ─── Policy Rank Tool ───────────────────────────────────────────────────────
|
|
286
|
+
|
|
287
|
+
export function policyRankRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
288
|
+
let count = 0
|
|
289
|
+
try { count = JSON.parse(args.actions ?? "[]").length } catch {}
|
|
290
|
+
const label = theme.fg("toolTitle", theme.bold("policy ")) + theme.fg("accent", `rank ${count} actions`)
|
|
291
|
+
return { render: () => [label], invalidate() {} }
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export function policyRankRenderResult(result: any, _opts: { expanded: boolean }, theme: PiTheme): any {
|
|
295
|
+
const raw = extractText(result)
|
|
296
|
+
const lines = raw.split("\n").filter(Boolean)
|
|
297
|
+
const themed = lines.map((line, i) => {
|
|
298
|
+
const medal = i === 0 ? theme.fg("warning", "🥇") : i === 1 ? theme.fg("muted", "🥈") : i === 2 ? theme.fg("muted", "🥉") : theme.fg("dim", ` ${i + 1}.`)
|
|
299
|
+
if (/delta|score/i.test(line)) return `${medal} ${theme.fg("accent", line)}`
|
|
300
|
+
return `${medal} ${theme.fg("toolOutput", line)}`
|
|
301
|
+
})
|
|
302
|
+
return { render: () => themed, invalidate() {} }
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// ─── Training Buffer Tool ───────────────────────────────────────────────────
|
|
306
|
+
|
|
307
|
+
export function trainingBufferRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
308
|
+
const action = args.action_type ?? "?"
|
|
309
|
+
const outcome = args.outcome ?? ""
|
|
310
|
+
const icon = outcome === "improved" ? theme.fg("success", "↑") : outcome === "regressed" ? theme.fg("error", "↓") : theme.fg("dim", "→")
|
|
311
|
+
const label = theme.fg("toolTitle", theme.bold("train ")) + `${icon} ${theme.fg("accent", action)}`
|
|
312
|
+
return { render: () => [label], invalidate() {} }
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export function trainingBufferRenderResult(result: any, _opts: { expanded: boolean }, theme: PiTheme): any {
|
|
316
|
+
const raw = extractText(result)
|
|
317
|
+
const line = raw.includes("recorded") || raw.includes("saved")
|
|
318
|
+
? theme.fg("success", "✓ ") + theme.fg("muted", raw)
|
|
319
|
+
: theme.fg("toolOutput", raw)
|
|
320
|
+
return { render: () => [line], invalidate() {} }
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// ─── Mine Tuples Tool ───────────────────────────────────────────────────────
|
|
324
|
+
|
|
325
|
+
export function mineTuplesRenderCall(args: Record<string, any>, theme: PiTheme): any {
|
|
326
|
+
const source = args.source ?? "all"
|
|
327
|
+
const write = args.write === "yes" ? theme.fg("warning", " (write)") : ""
|
|
328
|
+
const label = theme.fg("toolTitle", theme.bold("mine ")) + theme.fg("accent", source) + write
|
|
329
|
+
return { render: () => [label], invalidate() {} }
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export function mineTuplesRenderResult(result: any, _opts: { expanded: boolean }, theme: PiTheme): any {
|
|
333
|
+
const raw = extractText(result)
|
|
334
|
+
const lines = raw.split("\n").filter(Boolean).map(line => {
|
|
335
|
+
if (/mined|extracted|found/i.test(line)) return theme.fg("success", line)
|
|
336
|
+
if (/error|failed/i.test(line)) return theme.fg("error", line)
|
|
337
|
+
return theme.fg("toolOutput", line)
|
|
338
|
+
})
|
|
339
|
+
return { render: () => lines, invalidate() {} }
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// ─── Extract text helper ────────────────────────────────────────────────────
|
|
343
|
+
|
|
344
|
+
function extractText(result: any): string {
|
|
345
|
+
if (typeof result === "string") return result
|
|
346
|
+
if (result?.details?.raw) return String(result.details.raw)
|
|
347
|
+
if (result?.content) {
|
|
348
|
+
for (const c of result.content) {
|
|
349
|
+
if (c?.type === "text") return c.text
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return String(result ?? "")
|
|
353
|
+
}
|