@phuetz/code-buddy 1.6.1 → 2.1.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/LICENSE +90 -21
- package/README.fr.md +56 -0
- package/README.md +183 -330
- package/codebuddy-runtime.json +24 -0
- package/dist/advanced/session-replay.js +3 -2
- package/dist/agent/agent-state.d.ts +4 -1
- package/dist/agent/agent-state.js +9 -3
- package/dist/agent/architect-mode.js +1 -1
- package/dist/agent/autonomous/agentic-coding-contract.d.ts +28 -28
- package/dist/agent/autonomous/agentic-coding-runner.d.ts +14 -4
- package/dist/agent/autonomous/agentic-coding-runner.js +176 -27
- package/dist/agent/autonomous/checkpoint-manager.js +3 -12
- package/dist/agent/autonomous/codex-autonomy-directive.d.ts +10 -0
- package/dist/agent/autonomous/codex-autonomy-directive.js +25 -0
- package/dist/agent/autonomous/edit-proposal-producer.js +2 -2
- package/dist/agent/autonomous/fleet-task-types.d.ts +2 -2
- package/dist/agent/autonomous/fleet-task-types.js +2 -2
- package/dist/agent/autonomous/fleet-tick-handler.d.ts +3 -3
- package/dist/agent/autonomous/fleet-tick-handler.js +14 -8
- package/dist/agent/autonomous/recursive-improvement.d.ts +23 -0
- package/dist/agent/autonomous/recursive-improvement.js +114 -0
- package/dist/agent/autonomous/verification-loop.js +4 -2
- package/dist/agent/codebuddy-agent.d.ts +111 -6
- package/dist/agent/codebuddy-agent.js +491 -60
- package/dist/agent/council-lesson-proposer.d.ts +80 -13
- package/dist/agent/council-lesson-proposer.js +201 -43
- package/dist/agent/deep-research-ckg.d.ts +176 -0
- package/dist/agent/deep-research-ckg.js +250 -0
- package/dist/agent/deep-research-storm.d.ts +222 -0
- package/dist/agent/deep-research-storm.js +689 -0
- package/dist/agent/deep-research.d.ts +329 -0
- package/dist/agent/deep-research.js +994 -0
- package/dist/agent/delegation/thread-delegation.d.ts +80 -0
- package/dist/agent/delegation/thread-delegation.js +472 -0
- package/dist/agent/delegation/thread-task-runner.d.ts +37 -0
- package/dist/agent/delegation/thread-task-runner.js +89 -0
- package/dist/agent/dev-loop/dev-loop.d.ts +120 -0
- package/dist/agent/dev-loop/dev-loop.js +404 -0
- package/dist/agent/dev-loop/structural-gate.d.ts +32 -0
- package/dist/agent/dev-loop/structural-gate.js +120 -0
- package/dist/agent/execution/agent-executor.d.ts +52 -40
- package/dist/agent/execution/agent-executor.js +1669 -543
- package/dist/agent/execution/context-pipeline.d.ts +63 -6
- package/dist/agent/execution/context-pipeline.js +347 -88
- package/dist/agent/execution/incremental-token-counter.d.ts +15 -0
- package/dist/agent/execution/incremental-token-counter.js +36 -0
- package/dist/agent/execution/ordered-tool-executor.d.ts +14 -0
- package/dist/agent/execution/ordered-tool-executor.js +54 -0
- package/dist/agent/execution/post-tool-handlers.d.ts +1 -1
- package/dist/agent/execution/post-tool-handlers.js +2 -2
- package/dist/agent/execution/query-classifier.d.ts +2 -0
- package/dist/agent/execution/query-classifier.js +2 -0
- package/dist/agent/execution/tool-dependency-graph.js +7 -0
- package/dist/agent/execution/tool-loop-guard.d.ts +76 -0
- package/dist/agent/execution/tool-loop-guard.js +165 -0
- package/dist/agent/execution/tool-selection-strategy.d.ts +20 -0
- package/dist/agent/execution/tool-selection-strategy.js +162 -23
- package/dist/agent/facades/message-history-manager.d.ts +1 -1
- package/dist/agent/facades/message-history-manager.js +1 -1
- package/dist/agent/facades/model-routing-facade.d.ts +31 -1
- package/dist/agent/facades/model-routing-facade.js +86 -2
- package/dist/agent/facades/session-facade.d.ts +10 -8
- package/dist/agent/facades/session-facade.js +58 -45
- package/dist/agent/film/film-producer.d.ts +98 -0
- package/dist/agent/film/film-producer.js +289 -0
- package/dist/agent/film/scene-planner.d.ts +38 -0
- package/dist/agent/film/scene-planner.js +93 -0
- package/dist/agent/film/trailer-planner.d.ts +23 -0
- package/dist/agent/film/trailer-planner.js +242 -0
- package/dist/agent/film/video-studio.d.ts +72 -0
- package/dist/agent/film/video-studio.js +249 -0
- package/dist/agent/flow/planning-flow.d.ts +3 -0
- package/dist/agent/flow/planning-flow.js +70 -8
- package/dist/agent/hermes-claw-migrate.d.ts +62 -21
- package/dist/agent/hermes-claw-migrate.js +196 -17
- package/dist/agent/hermes-memory-providers.js +3 -3
- package/dist/agent/hermes-parity-manifest.js +69 -15
- package/dist/agent/hermes-protocol-gateways.js +8 -1
- package/dist/agent/infrastructure/agent-infrastructure.d.ts +1 -0
- package/dist/agent/infrastructure/agent-infrastructure.js +1 -1
- package/dist/agent/isolation/agent-workspace.js +5 -2
- package/dist/agent/learning/skill-background-writes.js +9 -4
- package/dist/agent/learning-agent.js +4 -4
- package/dist/agent/learning-background-writes.js +9 -5
- package/dist/agent/lesson-candidate-queue.d.ts +4 -0
- package/dist/agent/lesson-candidate-queue.js +9 -3
- package/dist/agent/lesson-provenance.js +9 -3
- package/dist/agent/lessons-tracker.d.ts +68 -1
- package/dist/agent/lessons-tracker.js +218 -36
- package/dist/agent/loop-detection-service.d.ts +56 -0
- package/dist/agent/loop-detection-service.js +207 -0
- package/dist/agent/middleware/auto-observation.d.ts +2 -0
- package/dist/agent/middleware/auto-observation.js +4 -2
- package/dist/agent/middleware/auto-repair-middleware.d.ts +2 -0
- package/dist/agent/middleware/auto-repair-middleware.js +27 -4
- package/dist/agent/middleware/changed-files.d.ts +19 -0
- package/dist/agent/middleware/changed-files.js +113 -0
- package/dist/agent/middleware/cost-limit.d.ts +0 -2
- package/dist/agent/middleware/cost-limit.js +0 -3
- package/dist/agent/middleware/index.d.ts +2 -0
- package/dist/agent/middleware/index.js +1 -0
- package/dist/agent/middleware/pipeline.d.ts +9 -0
- package/dist/agent/middleware/pipeline.js +18 -0
- package/dist/agent/middleware/plan-completion-audit.d.ts +76 -0
- package/dist/agent/middleware/plan-completion-audit.js +157 -0
- package/dist/agent/middleware/quality-gate-middleware.d.ts +43 -1
- package/dist/agent/middleware/quality-gate-middleware.js +198 -40
- package/dist/agent/middleware/types.d.ts +6 -0
- package/dist/agent/middleware/verification-enforcement.d.ts +10 -3
- package/dist/agent/middleware/verification-enforcement.js +43 -13
- package/dist/agent/middleware/workflow-guard.js +7 -0
- package/dist/agent/model-benchmark.js +11 -17
- package/dist/agent/model-tier.d.ts +2 -2
- package/dist/agent/model-tier.js +10 -7
- package/dist/agent/multi-agent/agent-memory-integration.js +3 -2
- package/dist/agent/multi-agent/base-agent.d.ts +12 -1
- package/dist/agent/multi-agent/base-agent.js +58 -10
- package/dist/agent/multi-agent/enhanced-coordination.js +1 -0
- package/dist/agent/multi-agent/metrics-persistence.js +28 -14
- package/dist/agent/multi-agent/multi-agent-system.d.ts +5 -0
- package/dist/agent/multi-agent/multi-agent-system.js +81 -4
- package/dist/agent/multi-agent/session-fleet-bridge.js +2 -1
- package/dist/agent/multi-agent/session-registry.js +9 -3
- package/dist/agent/multi-agent/team-manager.d.ts +11 -0
- package/dist/agent/multi-agent/team-manager.js +94 -5
- package/dist/agent/multi-agent/types.d.ts +10 -1
- package/dist/agent/multi-agent/workflow-multi-persistence.js +16 -8
- package/dist/agent/multi-agent/workflow-persistence.js +9 -6
- package/dist/agent/observer/trigger-registry.js +3 -5
- package/dist/agent/operating-modes.d.ts +3 -0
- package/dist/agent/operating-modes.js +15 -22
- package/dist/agent/pipelines.d.ts +2 -4
- package/dist/agent/pipelines.js +1 -1
- package/dist/agent/plan-mode.js +1 -1
- package/dist/agent/prompt-suggestions.js +2 -1
- package/dist/agent/prompt-tool-observation.d.ts +55 -0
- package/dist/agent/prompt-tool-observation.js +165 -0
- package/dist/agent/reasoning/tree-of-thought.js +1 -1
- package/dist/agent/repair/repair-engine.js +1 -1
- package/dist/agent/repo-profiler.d.ts +12 -1
- package/dist/agent/repo-profiler.js +37 -18
- package/dist/agent/repo-profiling/cache.js +6 -9
- package/dist/agent/research-worker-provider.d.ts +38 -0
- package/dist/agent/research-worker-provider.js +30 -0
- package/dist/agent/science/experiment-decision.d.ts +48 -0
- package/dist/agent/science/experiment-decision.js +65 -0
- package/dist/agent/science/experiment-empirical-gate.d.ts +83 -0
- package/dist/agent/science/experiment-empirical-gate.js +156 -0
- package/dist/agent/science/experiment-fitness.d.ts +112 -0
- package/dist/agent/science/experiment-fitness.js +188 -0
- package/dist/agent/science/experiment-loop.d.ts +196 -0
- package/dist/agent/science/experiment-loop.js +765 -0
- package/dist/agent/science/experiment-orchestrator.d.ts +203 -0
- package/dist/agent/science/experiment-orchestrator.js +454 -0
- package/dist/agent/science/experiment-sandbox-backends.d.ts +56 -0
- package/dist/agent/science/experiment-sandbox-backends.js +201 -0
- package/dist/agent/science/experiment-sandbox.d.ts +105 -0
- package/dist/agent/science/experiment-sandbox.js +196 -0
- package/dist/agent/science/experiment-variant-store.d.ts +108 -0
- package/dist/agent/science/experiment-variant-store.js +156 -0
- package/dist/agent/science/human-gate.d.ts +31 -0
- package/dist/agent/science/human-gate.js +32 -0
- package/dist/agent/self-improvement/authored-artifact-gate.js +28 -3
- package/dist/agent/self-improvement/authored-tool-runtime.d.ts +4 -2
- package/dist/agent/self-improvement/authored-tool-runtime.js +16 -3
- package/dist/agent/self-improvement/authored-tool-store.js +3 -2
- package/dist/agent/self-improvement/capability-benchmark.js +89 -2
- package/dist/agent/self-improvement/continuous-benchmark.d.ts +105 -0
- package/dist/agent/self-improvement/continuous-benchmark.js +355 -0
- package/dist/agent/self-improvement/delegation-facts.d.ts +105 -0
- package/dist/agent/self-improvement/delegation-facts.js +483 -0
- package/dist/agent/self-improvement/digest-sources.d.ts +56 -0
- package/dist/agent/self-improvement/digest-sources.js +294 -0
- package/dist/agent/self-improvement/digest.d.ts +169 -0
- package/dist/agent/self-improvement/digest.js +543 -0
- package/dist/agent/self-improvement/engine.d.ts +11 -6
- package/dist/agent/self-improvement/engine.js +13 -7
- package/dist/agent/self-improvement/evolution/ast-novelty.d.ts +25 -0
- package/dist/agent/self-improvement/evolution/ast-novelty.js +116 -0
- package/dist/agent/self-improvement/evolution/code-variant-store.d.ts +104 -0
- package/dist/agent/self-improvement/evolution/code-variant-store.js +229 -0
- package/dist/agent/self-improvement/evolution/evolution-engine.d.ts +199 -0
- package/dist/agent/self-improvement/evolution/evolution-engine.js +505 -0
- package/dist/agent/self-improvement/evolution/feature-map.d.ts +24 -0
- package/dist/agent/self-improvement/evolution/feature-map.js +88 -0
- package/dist/agent/self-improvement/evolution/model-bandit.d.ts +57 -0
- package/dist/agent/self-improvement/evolution/model-bandit.js +98 -0
- package/dist/agent/self-improvement/evolution/protected-paths.d.ts +31 -0
- package/dist/agent/self-improvement/evolution/protected-paths.js +111 -0
- package/dist/agent/self-improvement/evolution/research-weakness-source.d.ts +56 -0
- package/dist/agent/self-improvement/evolution/research-weakness-source.js +161 -0
- package/dist/agent/self-improvement/evolution/scrub-env.d.ts +22 -0
- package/dist/agent/self-improvement/evolution/scrub-env.js +40 -0
- package/dist/agent/self-improvement/evolution/variant-fitness.d.ts +97 -0
- package/dist/agent/self-improvement/evolution/variant-fitness.js +343 -0
- package/dist/agent/self-improvement/evolution/variant-planner.d.ts +41 -0
- package/dist/agent/self-improvement/evolution/variant-planner.js +156 -0
- package/dist/agent/self-improvement/evolution/weakness-selector.d.ts +38 -0
- package/dist/agent/self-improvement/evolution/weakness-selector.js +108 -0
- package/dist/agent/self-improvement/evolution/worktree-scorer.d.ts +46 -0
- package/dist/agent/self-improvement/evolution/worktree-scorer.js +114 -0
- package/dist/agent/self-improvement/evolutionary-archive.d.ts +2 -1
- package/dist/agent/self-improvement/evolutionary-archive.js +37 -7
- package/dist/agent/self-improvement/experience-source.d.ts +60 -7
- package/dist/agent/self-improvement/experience-source.js +78 -8
- package/dist/agent/self-improvement/index.d.ts +1 -0
- package/dist/agent/self-improvement/index.js +6 -3
- package/dist/agent/self-improvement/learning-store.d.ts +16 -0
- package/dist/agent/self-improvement/learning-store.js +83 -3
- package/dist/agent/self-improvement/llm-drafter.d.ts +3 -1
- package/dist/agent/self-improvement/llm-drafter.js +20 -2
- package/dist/agent/self-improvement/llm-tool-proposer.js +1 -1
- package/dist/agent/self-improvement/proposal-store.d.ts +47 -0
- package/dist/agent/self-improvement/proposal-store.js +149 -0
- package/dist/agent/self-improvement/proposer.d.ts +1 -1
- package/dist/agent/self-improvement/proposer.js +94 -2
- package/dist/agent/self-improvement/rule-store.js +5 -4
- package/dist/agent/self-improvement/sandbox-scorer.d.ts +1 -1
- package/dist/agent/self-improvement/sandbox-scorer.js +8 -4
- package/dist/agent/self-improvement/self-knowledge.d.ts +1 -1
- package/dist/agent/self-improvement/self-knowledge.js +8 -8
- package/dist/agent/self-improvement/skill-apply-journal.d.ts +44 -0
- package/dist/agent/self-improvement/skill-apply-journal.js +178 -0
- package/dist/agent/self-improvement/skill-behavior-benchmark.d.ts +3 -0
- package/dist/agent/self-improvement/skill-behavior-benchmark.js +19 -0
- package/dist/agent/self-improvement/skill-behavior-gate.d.ts +34 -0
- package/dist/agent/self-improvement/skill-behavior-gate.js +96 -0
- package/dist/agent/self-improvement/skill-benchmark.js +27 -0
- package/dist/agent/self-improvement/skill-consolidator.js +16 -0
- package/dist/agent/self-improvement/skill-engine.d.ts +29 -0
- package/dist/agent/self-improvement/skill-engine.js +428 -30
- package/dist/agent/self-improvement/skill-gate.d.ts +6 -4
- package/dist/agent/self-improvement/skill-gate.js +55 -22
- package/dist/agent/self-improvement/skill-mutator.d.ts +26 -2
- package/dist/agent/self-improvement/skill-mutator.js +185 -30
- package/dist/agent/self-improvement/skill-proposer.js +2 -1
- package/dist/agent/self-improvement/skill-types.d.ts +6 -1
- package/dist/agent/self-improvement/strategy-engine.d.ts +54 -0
- package/dist/agent/self-improvement/strategy-engine.js +104 -0
- package/dist/agent/self-improvement/strategy-gate.d.ts +49 -0
- package/dist/agent/self-improvement/strategy-gate.js +243 -0
- package/dist/agent/self-improvement/strategy-live.d.ts +39 -0
- package/dist/agent/self-improvement/strategy-live.js +114 -0
- package/dist/agent/self-improvement/strategy-proposer.d.ts +30 -0
- package/dist/agent/self-improvement/strategy-proposer.js +114 -0
- package/dist/agent/self-improvement/strategy-replay.d.ts +40 -0
- package/dist/agent/self-improvement/strategy-replay.js +150 -0
- package/dist/agent/self-improvement/strategy-runtime.d.ts +43 -0
- package/dist/agent/self-improvement/strategy-runtime.js +56 -0
- package/dist/agent/self-improvement/strategy-store.d.ts +38 -0
- package/dist/agent/self-improvement/strategy-store.js +139 -0
- package/dist/agent/self-improvement/strategy-types.d.ts +229 -0
- package/dist/agent/self-improvement/strategy-types.js +90 -0
- package/dist/agent/self-improvement/tool-benchmark.js +164 -8
- package/dist/agent/self-improvement/tool-engine.d.ts +12 -3
- package/dist/agent/self-improvement/tool-engine.js +59 -31
- package/dist/agent/self-improvement/tool-gate.d.ts +2 -0
- package/dist/agent/self-improvement/tool-gate.js +26 -0
- package/dist/agent/self-improvement/tool-skill-mutator.d.ts +1 -1
- package/dist/agent/self-improvement/tool-skill-mutator.js +20 -2
- package/dist/agent/self-improvement/tool-types.d.ts +5 -3
- package/dist/agent/self-improvement/types.d.ts +18 -3
- package/dist/agent/session-end-flush.js +2 -1
- package/dist/agent/specialized/agent-registry.d.ts +1 -0
- package/dist/agent/specialized/agent-registry.js +118 -0
- package/dist/agent/specialized/excel-agent.js +15 -1
- package/dist/agent/specialized/index.d.ts +1 -0
- package/dist/agent/specialized/index.js +2 -0
- package/dist/agent/specialized/pdf-agent.js +4 -2
- package/dist/agent/specialized/swe-agent-adapter.js +8 -0
- package/dist/agent/specialized/swe-agent.d.ts +16 -1
- package/dist/agent/specialized/swe-agent.js +75 -7
- package/dist/agent/specialized/types.d.ts +31 -1
- package/dist/agent/specialized/types.js +26 -0
- package/dist/agent/specialized/verifier-agent.d.ts +53 -0
- package/dist/agent/specialized/verifier-agent.js +342 -0
- package/dist/agent/streaming/message-reducer.js +73 -19
- package/dist/agent/streaming/streaming-handler.d.ts +24 -0
- package/dist/agent/streaming/streaming-handler.js +136 -1
- package/dist/agent/subagents.d.ts +10 -4
- package/dist/agent/subagents.js +39 -6
- package/dist/agent/thinking/extended-thinking.js +1 -1
- package/dist/agent/todo-tracker.js +5 -4
- package/dist/agent/tool-executor.d.ts +10 -1
- package/dist/agent/tool-executor.js +29 -0
- package/dist/agent/tool-handler.d.ts +50 -3
- package/dist/agent/tool-handler.js +758 -182
- package/dist/agent/types.d.ts +3 -5
- package/dist/agent/wide-research-checkpoint.d.ts +77 -0
- package/dist/agent/wide-research-checkpoint.js +361 -0
- package/dist/agent/wide-research-files.d.ts +11 -0
- package/dist/agent/wide-research-files.js +189 -0
- package/dist/agent/wide-research.d.ts +148 -3
- package/dist/agent/wide-research.js +833 -56
- package/dist/analytics/code-evolution.js +20 -15
- package/dist/analytics/complexity-analyzer.js +2 -2
- package/dist/analytics/cost-report.d.ts +71 -0
- package/dist/analytics/cost-report.js +724 -0
- package/dist/analytics/dashboard.js +8 -7
- package/dist/analytics/index.d.ts +2 -0
- package/dist/analytics/index.js +2 -0
- package/dist/analytics/repo-explainer-collector.d.ts +13 -0
- package/dist/analytics/repo-explainer-collector.js +351 -0
- package/dist/analytics/repo-explainer.d.ts +224 -0
- package/dist/analytics/repo-explainer.js +605 -0
- package/dist/analytics/roi-tracker.js +11 -9
- package/dist/api/webhooks.js +9 -14
- package/dist/app/application-factory.d.ts +1 -1
- package/dist/app/application-factory.js +6 -5
- package/dist/auth/profile-manager.js +9 -5
- package/dist/avatar/avatar-event-bus.d.ts +16 -0
- package/dist/avatar/avatar-event-bus.js +53 -0
- package/dist/avatar/avatar-gateway-bridge.d.ts +26 -0
- package/dist/avatar/avatar-gateway-bridge.js +54 -0
- package/dist/avatar/avatar-protocol.d.ts +133 -0
- package/dist/avatar/avatar-protocol.js +241 -0
- package/dist/avatar/avatar-renderer-registry.d.ts +56 -0
- package/dist/avatar/avatar-renderer-registry.js +191 -0
- package/dist/avatar/avatar-renderer-simulator.d.ts +31 -0
- package/dist/avatar/avatar-renderer-simulator.js +160 -0
- package/dist/browser-automation/browser-manager.d.ts +15 -1
- package/dist/browser-automation/browser-manager.js +101 -0
- package/dist/browser-automation/browser-operator-executor.d.ts +89 -7
- package/dist/browser-automation/browser-operator-executor.js +1280 -58
- package/dist/browser-automation/browser-operator-runtime.d.ts +87 -0
- package/dist/browser-automation/browser-operator-runtime.js +441 -0
- package/dist/browser-automation/browser-operator-session.js +4 -3
- package/dist/browser-automation/browser-tool.d.ts +17 -2
- package/dist/browser-automation/browser-tool.js +101 -39
- package/dist/browser-automation/internet-scout-plan.d.ts +1 -0
- package/dist/browser-automation/internet-scout-plan.js +17 -0
- package/dist/browser-automation/profile-manager.js +5 -3
- package/dist/browser-automation/types.d.ts +25 -0
- package/dist/cache/advanced-lru-cache.js +4 -4
- package/dist/cache/cache-manager.js +9 -10
- package/dist/cache/embedding-cache.js +6 -5
- package/dist/cache/llm-response-cache.js +3 -4
- package/dist/capture/screen-recorder.d.ts +2 -0
- package/dist/capture/screen-recorder.js +6 -4
- package/dist/capture/screen-watcher.d.ts +6 -3
- package/dist/capture/screen-watcher.js +86 -9
- package/dist/channels/channel-cognitive-port.d.ts +46 -0
- package/dist/channels/channel-cognitive-port.js +182 -0
- package/dist/channels/channel-model-override.d.ts +47 -0
- package/dist/channels/channel-model-override.js +62 -0
- package/dist/channels/companion-channel-profile.d.ts +68 -0
- package/dist/channels/companion-channel-profile.js +142 -0
- package/dist/channels/companion-channel-turn.d.ts +79 -0
- package/dist/channels/companion-channel-turn.js +240 -0
- package/dist/channels/core.d.ts +37 -3
- package/dist/channels/core.js +63 -6
- package/dist/channels/discord/client.js +34 -14
- package/dist/channels/dm-pairing.d.ts +18 -4
- package/dist/channels/dm-pairing.js +199 -33
- package/dist/channels/gateway-lifecycle.d.ts +2 -0
- package/dist/channels/gateway-lifecycle.js +1 -0
- package/dist/channels/identity-links.d.ts +19 -1
- package/dist/channels/identity-links.js +68 -12
- package/dist/channels/matrix/index.js +6 -2
- package/dist/channels/pro/pro-features.js +17 -0
- package/dist/channels/pro/run-tracker.js +9 -4
- package/dist/channels/pro/scoped-auth.js +10 -8
- package/dist/channels/provider-failure-speech.d.ts +28 -0
- package/dist/channels/provider-failure-speech.js +128 -0
- package/dist/channels/reconnection-manager.d.ts +2 -0
- package/dist/channels/reconnection-manager.js +7 -2
- package/dist/channels/resolve-channel-secret.d.ts +43 -0
- package/dist/channels/resolve-channel-secret.js +82 -0
- package/dist/channels/slack/block-builder.d.ts +12 -0
- package/dist/channels/slack/block-builder.js +70 -2
- package/dist/channels/slack/client.js +62 -15
- package/dist/channels/slack/types.d.ts +20 -1
- package/dist/channels/slash-parity.d.ts +4 -6
- package/dist/channels/slash-parity.js +9 -44
- package/dist/channels/telegram/client.d.ts +36 -3
- package/dist/channels/telegram/client.js +438 -84
- package/dist/channels/telegram/types.d.ts +2 -0
- package/dist/channels/webhook-server.js +8 -1
- package/dist/channels/whatsapp/index.js +2 -1
- package/dist/checkpoints/ghost-snapshot.js +15 -9
- package/dist/checkpoints/persistent-checkpoint-manager.js +15 -8
- package/dist/cli/command-routing.d.ts +22 -0
- package/dist/cli/command-routing.js +54 -0
- package/dist/cli/first-run.d.ts +17 -0
- package/dist/cli/first-run.js +40 -0
- package/dist/cli/headless-options.d.ts +22 -0
- package/dist/cli/headless-options.js +112 -0
- package/dist/cli/headless-prompt-progress.d.ts +22 -0
- package/dist/cli/headless-prompt-progress.js +35 -0
- package/dist/cli/headless.js +2 -2
- package/dist/cli/listen-port.d.ts +8 -0
- package/dist/cli/listen-port.js +20 -0
- package/dist/cli/permission-mode-option.d.ts +14 -0
- package/dist/cli/permission-mode-option.js +64 -0
- package/dist/cli/requested-profile.d.ts +15 -0
- package/dist/cli/requested-profile.js +27 -0
- package/dist/cli/session-commands.d.ts +9 -0
- package/dist/cli/session-commands.js +45 -5
- package/dist/cli/session-picker.d.ts +43 -0
- package/dist/cli/session-picker.js +128 -0
- package/dist/cli/unknown-option-hint.d.ts +16 -0
- package/dist/cli/unknown-option-hint.js +116 -0
- package/dist/cli/voice-command.d.ts +32 -0
- package/dist/cli/voice-command.js +96 -0
- package/dist/codebuddy/a2a-call-tool-defs.d.ts +26 -0
- package/dist/codebuddy/a2a-call-tool-defs.js +12 -0
- package/dist/codebuddy/abort-signal.d.ts +7 -0
- package/dist/codebuddy/abort-signal.js +31 -0
- package/dist/codebuddy/client.d.ts +68 -0
- package/dist/codebuddy/client.js +460 -11
- package/dist/codebuddy/fleet-tool-defs.d.ts +1 -0
- package/dist/codebuddy/fleet-tool-defs.js +29 -0
- package/dist/codebuddy/llm-retry.d.ts +24 -0
- package/dist/codebuddy/llm-retry.js +124 -0
- package/dist/codebuddy/provider-error-classifier.d.ts +86 -0
- package/dist/codebuddy/provider-error-classifier.js +410 -0
- package/dist/codebuddy/provider-failover-error.d.ts +16 -0
- package/dist/codebuddy/provider-failover-error.js +50 -0
- package/dist/codebuddy/provider-failover-kind.d.ts +15 -0
- package/dist/codebuddy/provider-failover-kind.js +172 -0
- package/dist/codebuddy/provider-handoff.d.ts +35 -0
- package/dist/codebuddy/provider-handoff.js +294 -0
- package/dist/codebuddy/providers/chatgpt-headers.d.ts +18 -0
- package/dist/codebuddy/providers/chatgpt-headers.js +37 -0
- package/dist/codebuddy/providers/ollama-native-transport.d.ts +130 -0
- package/dist/codebuddy/providers/ollama-native-transport.js +387 -0
- package/dist/codebuddy/providers/provider-agy-cli.d.ts +29 -0
- package/dist/codebuddy/providers/provider-agy-cli.js +264 -0
- package/dist/codebuddy/providers/provider-chatgpt-responses.d.ts +61 -8
- package/dist/codebuddy/providers/provider-chatgpt-responses.js +526 -184
- package/dist/codebuddy/providers/provider-gemini-cli.js +95 -13
- package/dist/codebuddy/providers/provider-gemini-native.d.ts +2 -0
- package/dist/codebuddy/providers/provider-gemini-native.js +199 -86
- package/dist/codebuddy/providers/provider-openai-compat.d.ts +82 -0
- package/dist/codebuddy/providers/provider-openai-compat.js +469 -45
- package/dist/codebuddy/ragchat-tool-defs.d.ts +31 -0
- package/dist/codebuddy/ragchat-tool-defs.js +19 -0
- package/dist/codebuddy/resource-catalog-tool-defs.d.ts +28 -0
- package/dist/codebuddy/resource-catalog-tool-defs.js +18 -0
- package/dist/codebuddy/stream-retry.d.ts +21 -8
- package/dist/codebuddy/stream-retry.js +44 -40
- package/dist/codebuddy/tool-definitions/advanced-tools.d.ts +4 -0
- package/dist/codebuddy/tool-definitions/advanced-tools.js +188 -0
- package/dist/codebuddy/tool-definitions/agent-tools.d.ts +5 -0
- package/dist/codebuddy/tool-definitions/agent-tools.js +197 -9
- package/dist/codebuddy/tool-definitions/browser-tools.d.ts +1 -0
- package/dist/codebuddy/tool-definitions/browser-tools.js +65 -1
- package/dist/codebuddy/tool-definitions/code-exec-tools.d.ts +8 -0
- package/dist/codebuddy/tool-definitions/code-exec-tools.js +33 -0
- package/dist/codebuddy/tool-definitions/code-explorer-tools.js +4 -0
- package/dist/codebuddy/tool-definitions/comfy-recipe-tools.d.ts +3 -0
- package/dist/codebuddy/tool-definitions/comfy-recipe-tools.js +37 -0
- package/dist/codebuddy/tool-definitions/core-tools.d.ts +2 -0
- package/dist/codebuddy/tool-definitions/core-tools.js +58 -2
- package/dist/codebuddy/tool-definitions/cron-tools.js +6 -0
- package/dist/codebuddy/tool-definitions/delegate-agent-tools.d.ts +11 -0
- package/dist/codebuddy/tool-definitions/delegate-agent-tools.js +50 -0
- package/dist/codebuddy/tool-definitions/design-tools.d.ts +6 -0
- package/dist/codebuddy/tool-definitions/design-tools.js +35 -0
- package/dist/codebuddy/tool-definitions/exit-plan-mode-tools.d.ts +1 -0
- package/dist/codebuddy/tool-definitions/exit-plan-mode-tools.js +23 -1
- package/dist/codebuddy/tool-definitions/index.d.ts +16 -7
- package/dist/codebuddy/tool-definitions/index.js +27 -8
- package/dist/codebuddy/tool-definitions/lsp-tools.d.ts +7 -1
- package/dist/codebuddy/tool-definitions/lsp-tools.js +104 -1
- package/dist/codebuddy/tool-definitions/meeting-tools.d.ts +4 -0
- package/dist/codebuddy/tool-definitions/meeting-tools.js +32 -0
- package/dist/codebuddy/tool-definitions/moa-tools.js +7 -2
- package/dist/codebuddy/tool-definitions/multimodal-tools.d.ts +14 -0
- package/dist/codebuddy/tool-definitions/multimodal-tools.js +615 -3
- package/dist/codebuddy/tool-definitions/research-tools.d.ts +20 -0
- package/dist/codebuddy/tool-definitions/research-tools.js +98 -0
- package/dist/codebuddy/tool-definitions/self-describe-tools.d.ts +4 -0
- package/dist/codebuddy/tool-definitions/self-describe-tools.js +33 -0
- package/dist/codebuddy/tool-definitions/self-evolution-tools.d.ts +4 -0
- package/dist/codebuddy/tool-definitions/self-evolution-tools.js +31 -0
- package/dist/codebuddy/tool-definitions/verify-tools.d.ts +14 -0
- package/dist/codebuddy/tool-definitions/verify-tools.js +36 -0
- package/dist/codebuddy/tool-definitions/web-tools.d.ts +4 -0
- package/dist/codebuddy/tool-definitions/web-tools.js +135 -0
- package/dist/codebuddy/tool-definitions/workspace-tools.d.ts +4 -0
- package/dist/codebuddy/tool-definitions/workspace-tools.js +43 -0
- package/dist/codebuddy/tools.d.ts +15 -23
- package/dist/codebuddy/tools.js +259 -57
- package/dist/cognition/budget-reservations.d.ts +27 -0
- package/dist/cognition/budget-reservations.js +70 -0
- package/dist/cognition/cognitive-bus-client.d.ts +94 -0
- package/dist/cognition/cognitive-bus-client.js +724 -0
- package/dist/cognition/cognitive-hub.d.ts +93 -0
- package/dist/cognition/cognitive-hub.js +366 -0
- package/dist/cognition/cognitive-mesh.d.ts +38 -0
- package/dist/cognition/cognitive-mesh.js +263 -0
- package/dist/cognition/cognitive-port.d.ts +35 -0
- package/dist/cognition/cognitive-port.js +80 -0
- package/dist/cognition/cognitive-wire-contract.d.ts +1542 -0
- package/dist/cognition/cognitive-wire-contract.js +164 -0
- package/dist/cognition/context-renderer.d.ts +52 -0
- package/dist/cognition/context-renderer.js +227 -0
- package/dist/cognition/global-workspace.d.ts +39 -0
- package/dist/cognition/global-workspace.js +181 -0
- package/dist/cognition/index.d.ts +9 -0
- package/dist/cognition/index.js +10 -0
- package/dist/cognition/llm-specialist.d.ts +40 -0
- package/dist/cognition/llm-specialist.js +93 -0
- package/dist/cognition/sensory-workspace.d.ts +57 -0
- package/dist/cognition/sensory-workspace.js +346 -0
- package/dist/cognition/types.d.ts +93 -0
- package/dist/cognition/types.js +7 -0
- package/dist/cognition/voice-specialists.d.ts +21 -0
- package/dist/cognition/voice-specialists.js +89 -0
- package/dist/cognition/world-model.d.ts +95 -0
- package/dist/cognition/world-model.js +228 -0
- package/dist/collaboration/ai-colab-manager.js +12 -13
- package/dist/collaboration/team-session.js +25 -11
- package/dist/commands/apply-permission-mode.d.ts +27 -0
- package/dist/commands/apply-permission-mode.js +35 -0
- package/dist/commands/assistant.d.ts +3 -0
- package/dist/commands/assistant.js +1022 -0
- package/dist/commands/campaign.d.ts +6 -0
- package/dist/commands/campaign.js +140 -0
- package/dist/commands/capsule.d.ts +2 -0
- package/dist/commands/capsule.js +104 -0
- package/dist/commands/changelog.d.ts +29 -0
- package/dist/commands/changelog.js +283 -0
- package/dist/commands/cli/acp-command.js +4 -1
- package/dist/commands/cli/backup-command.d.ts +9 -0
- package/dist/commands/cli/backup-command.js +47 -0
- package/dist/commands/cli/daemon-commands.js +3 -1
- package/dist/commands/cli/evolve-command.d.ts +26 -0
- package/dist/commands/cli/evolve-command.js +275 -0
- package/dist/commands/cli/fleet-collaboration-commands.d.ts +2 -0
- package/dist/commands/cli/fleet-collaboration-commands.js +57 -0
- package/dist/commands/cli/fleet-commands.js +134 -0
- package/dist/commands/cli/fleet-mission-commands.d.ts +3 -0
- package/dist/commands/cli/fleet-mission-commands.js +72 -0
- package/dist/commands/cli/fleet-rooms-commands.d.ts +10 -0
- package/dist/commands/cli/fleet-rooms-commands.js +289 -0
- package/dist/commands/cli/improve-command.d.ts +2 -1
- package/dist/commands/cli/improve-command.js +309 -20
- package/dist/commands/cli/native-engine-commands.js +405 -28
- package/dist/commands/cli/sensory-command.d.ts +8 -0
- package/dist/commands/cli/sensory-command.js +27 -0
- package/dist/commands/cli/speak-command.js +87 -24
- package/dist/commands/cli/tools-commands.js +69 -36
- package/dist/commands/cli/triage-command.d.ts +8 -0
- package/dist/commands/cli/triage-command.js +72 -0
- package/dist/commands/cli/utility-commands.js +59 -10
- package/dist/commands/client-dispatcher.d.ts +8 -0
- package/dist/commands/client-dispatcher.js +113 -42
- package/dist/commands/compress.js +3 -0
- package/dist/commands/cost.d.ts +33 -0
- package/dist/commands/cost.js +342 -0
- package/dist/commands/council-scoreboard.d.ts +8 -0
- package/dist/commands/council-scoreboard.js +68 -0
- package/dist/commands/council.d.ts +16 -24
- package/dist/commands/council.js +247 -255
- package/dist/commands/cron-cli/index.d.ts +3 -1
- package/dist/commands/cron-cli/index.js +25 -0
- package/dist/commands/curator-cli.d.ts +14 -0
- package/dist/commands/curator-cli.js +57 -0
- package/dist/commands/delegate.js +82 -25
- package/dist/commands/dev/golden-path.d.ts +71 -0
- package/dist/commands/dev/golden-path.js +317 -0
- package/dist/commands/dev/index.d.ts +3 -0
- package/dist/commands/dev/index.js +151 -119
- package/dist/commands/dev/issue-pipeline.js +7 -7
- package/dist/commands/dev/workflows.d.ts +2 -0
- package/dist/commands/dev/workflows.js +39 -6
- package/dist/commands/device-auth.d.ts +10 -0
- package/dist/commands/device-auth.js +91 -0
- package/dist/commands/enhanced-command-handler.d.ts +12 -0
- package/dist/commands/enhanced-command-handler.js +57 -18
- package/dist/commands/exchange.d.ts +2 -0
- package/dist/commands/exchange.js +193 -0
- package/dist/commands/explain.d.ts +12 -0
- package/dist/commands/explain.js +135 -0
- package/dist/commands/film.d.ts +18 -0
- package/dist/commands/film.js +239 -0
- package/dist/commands/flow.js +15 -5
- package/dist/commands/forge.d.ts +2 -0
- package/dist/commands/forge.js +102 -0
- package/dist/commands/goal-cli.d.ts +3 -0
- package/dist/commands/goal-cli.js +9 -4
- package/dist/commands/gpu-worker.d.ts +14 -0
- package/dist/commands/gpu-worker.js +135 -0
- package/dist/commands/handlers/agent-handlers.d.ts +1 -1
- package/dist/commands/handlers/agent-handlers.js +4 -4
- package/dist/commands/handlers/agents-handler.d.ts +11 -2
- package/dist/commands/handlers/agents-handler.js +79 -13
- package/dist/commands/handlers/auth-handlers.js +12 -5
- package/dist/commands/handlers/backup-handlers.d.ts +40 -0
- package/dist/commands/handlers/backup-handlers.js +784 -57
- package/dist/commands/handlers/batch-handlers.d.ts +72 -2
- package/dist/commands/handlers/batch-handlers.js +443 -37
- package/dist/commands/handlers/branch-handlers.d.ts +1 -0
- package/dist/commands/handlers/channel-handlers.d.ts +7 -2
- package/dist/commands/handlers/channel-handlers.js +1716 -111
- package/dist/commands/handlers/companion-handler.js +130 -9
- package/dist/commands/handlers/daily-reset-handler.d.ts +1 -1
- package/dist/commands/handlers/daily-reset-handler.js +1 -1
- package/dist/commands/handlers/deepthink-handler.d.ts +2 -0
- package/dist/commands/handlers/deepthink-handler.js +49 -0
- package/dist/commands/handlers/export-handlers.d.ts +3 -2
- package/dist/commands/handlers/export-handlers.js +55 -28
- package/dist/commands/handlers/extra-handlers.js +28 -25
- package/dist/commands/handlers/fleet-handler.d.ts +3 -4
- package/dist/commands/handlers/fleet-handler.js +82 -35
- package/dist/commands/handlers/goal-handler.d.ts +13 -0
- package/dist/commands/handlers/goal-handler.js +26 -7
- package/dist/commands/handlers/grill-me-handler.d.ts +2 -0
- package/dist/commands/handlers/grill-me-handler.js +49 -0
- package/dist/commands/handlers/heartbeat-handler.d.ts +2 -2
- package/dist/commands/handlers/heartbeat-handler.js +2 -2
- package/dist/commands/handlers/index.d.ts +3 -2
- package/dist/commands/handlers/index.js +4 -2
- package/dist/commands/handlers/memory-handlers.d.ts +6 -2
- package/dist/commands/handlers/memory-handlers.js +75 -15
- package/dist/commands/handlers/missing-handlers.d.ts +2 -2
- package/dist/commands/handlers/missing-handlers.js +4 -4
- package/dist/commands/handlers/permissions-handlers.js +3 -2
- package/dist/commands/handlers/pr-handlers.js +15 -17
- package/dist/commands/handlers/resources-handler.d.ts +12 -0
- package/dist/commands/handlers/resources-handler.js +52 -0
- package/dist/commands/handlers/security-handlers.d.ts +1 -1
- package/dist/commands/handlers/security-handlers.js +3 -3
- package/dist/commands/handlers/slash-session-handlers.d.ts +9 -0
- package/dist/commands/handlers/slash-session-handlers.js +134 -0
- package/dist/commands/handlers/starter-handlers.d.ts +1 -1
- package/dist/commands/handlers/starter-handlers.js +32 -2
- package/dist/commands/handlers/swarm-handler.js +41 -2
- package/dist/commands/handlers/switch-handler.d.ts +1 -1
- package/dist/commands/handlers/switch-handler.js +15 -0
- package/dist/commands/handlers/team-handlers.d.ts +28 -1
- package/dist/commands/handlers/team-handlers.js +243 -2
- package/dist/commands/handlers/test-handlers.js +4 -86
- package/dist/commands/handlers/think-handlers.js +2 -1
- package/dist/commands/handlers/ui-handlers.js +11 -5
- package/dist/commands/handlers/vibe-handlers.js +8 -1
- package/dist/commands/handlers/worktree-handlers.js +23 -12
- package/dist/commands/headless-slash.d.ts +9 -0
- package/dist/commands/headless-slash.js +41 -3
- package/dist/commands/import.d.ts +34 -0
- package/dist/commands/import.js +478 -0
- package/dist/commands/index.d.ts +0 -1
- package/dist/commands/index.js +0 -1
- package/dist/commands/influencer.d.ts +2 -0
- package/dist/commands/influencer.js +87 -0
- package/dist/commands/intent.d.ts +6 -0
- package/dist/commands/intent.js +131 -0
- package/dist/commands/intents.d.ts +10 -0
- package/dist/commands/intents.js +163 -0
- package/dist/commands/lessons.js +91 -0
- package/dist/commands/llm-provider-resolution.d.ts +20 -0
- package/dist/commands/llm-provider-resolution.js +74 -13
- package/dist/commands/login-chatgpt.d.ts +8 -0
- package/dist/commands/login-chatgpt.js +17 -0
- package/dist/commands/login-prerequisites.d.ts +11 -0
- package/dist/commands/login-prerequisites.js +23 -0
- package/dist/commands/loop-cli.d.ts +31 -0
- package/dist/commands/loop-cli.js +189 -0
- package/dist/commands/lora.d.ts +6 -0
- package/dist/commands/lora.js +445 -0
- package/dist/commands/maison-food.d.ts +10 -0
- package/dist/commands/maison-food.js +485 -0
- package/dist/commands/maison.d.ts +17 -0
- package/dist/commands/maison.js +236 -0
- package/dist/commands/mcp-import.d.ts +11 -0
- package/dist/commands/mcp-import.js +67 -0
- package/dist/commands/mcp-invoke.d.ts +2 -0
- package/dist/commands/mcp-invoke.js +68 -0
- package/dist/commands/mcp.d.ts +6 -0
- package/dist/commands/mcp.js +240 -7
- package/dist/commands/meeting.d.ts +8 -0
- package/dist/commands/meeting.js +31 -0
- package/dist/commands/pairing.js +7 -8
- package/dist/commands/papers/ask.d.ts +47 -0
- package/dist/commands/papers/ask.js +105 -0
- package/dist/commands/papers/index.d.ts +19 -0
- package/dist/commands/papers/index.js +54 -0
- package/dist/commands/pipeline.d.ts +7 -1
- package/dist/commands/pipeline.js +104 -7
- package/dist/commands/provider.d.ts +9 -0
- package/dist/commands/provider.js +178 -10
- package/dist/commands/replay.d.ts +11 -0
- package/dist/commands/replay.js +131 -0
- package/dist/commands/research/deep.d.ts +66 -0
- package/dist/commands/research/deep.js +236 -0
- package/dist/commands/research/discover-searxng.d.ts +25 -0
- package/dist/commands/research/discover-searxng.js +62 -0
- package/dist/commands/research/index.d.ts +24 -2
- package/dist/commands/research/index.js +456 -79
- package/dist/commands/research/knowledge-ingest.d.ts +170 -0
- package/dist/commands/research/knowledge-ingest.js +449 -0
- package/dist/commands/research/wire-research-worker.d.ts +9 -0
- package/dist/commands/research/wire-research-worker.js +18 -0
- package/dist/commands/resources.d.ts +2 -0
- package/dist/commands/resources.js +64 -0
- package/dist/commands/run-cli/index.d.ts +3 -1
- package/dist/commands/run-cli/index.js +53 -2
- package/dist/commands/science/deps.d.ts +95 -0
- package/dist/commands/science/deps.js +343 -0
- package/dist/commands/science/index.d.ts +31 -0
- package/dist/commands/science/index.js +285 -0
- package/dist/commands/science/loop-option.d.ts +40 -0
- package/dist/commands/science/loop-option.js +91 -0
- package/dist/commands/science/sandbox-option.d.ts +44 -0
- package/dist/commands/science/sandbox-option.js +42 -0
- package/dist/commands/scrape.d.ts +18 -0
- package/dist/commands/scrape.js +159 -0
- package/dist/commands/self.d.ts +9 -0
- package/dist/commands/self.js +56 -0
- package/dist/commands/shadow.d.ts +3 -0
- package/dist/commands/shadow.js +72 -0
- package/dist/commands/share.d.ts +13 -0
- package/dist/commands/share.js +71 -0
- package/dist/commands/shell-prefix.d.ts +4 -22
- package/dist/commands/shell-prefix.js +11 -73
- package/dist/commands/skills-cli/index.d.ts +2 -0
- package/dist/commands/skills-cli/index.js +224 -26
- package/dist/commands/slash/builtin-commands.js +57 -24
- package/dist/commands/slash/index.d.ts +3 -1
- package/dist/commands/slash/index.js +2 -0
- package/dist/commands/slash/surfaces.d.ts +53 -0
- package/dist/commands/slash/surfaces.js +177 -0
- package/dist/commands/slash/types.d.ts +17 -0
- package/dist/commands/slash-commands.js +4 -1
- package/dist/commands/token.d.ts +80 -0
- package/dist/commands/token.js +319 -0
- package/dist/commands/try.d.ts +72 -0
- package/dist/commands/try.js +357 -0
- package/dist/commands/update.d.ts +14 -1
- package/dist/commands/update.js +97 -15
- package/dist/commands/vision-train.d.ts +15 -0
- package/dist/commands/vision-train.js +214 -0
- package/dist/commands/whoami-status.d.ts +17 -0
- package/dist/commands/whoami-status.js +34 -0
- package/dist/commands/widgets.d.ts +2 -0
- package/dist/commands/widgets.js +179 -0
- package/dist/commands/ws.d.ts +7 -0
- package/dist/commands/ws.js +100 -0
- package/dist/companion/assistant-config.d.ts +79 -0
- package/dist/companion/assistant-config.js +1148 -0
- package/dist/companion/attached-image-grounding.d.ts +29 -0
- package/dist/companion/attached-image-grounding.js +285 -0
- package/dist/companion/away-mode.d.ts +80 -0
- package/dist/companion/away-mode.js +269 -0
- package/dist/companion/camera-share.d.ts +65 -0
- package/dist/companion/camera-share.js +321 -0
- package/dist/companion/camera.d.ts +8 -0
- package/dist/companion/camera.js +57 -31
- package/dist/companion/cards.js +7 -10
- package/dist/companion/check-in.js +23 -8
- package/dist/companion/companion-doctor.d.ts +58 -0
- package/dist/companion/companion-doctor.js +194 -0
- package/dist/companion/companion-history.d.ts +23 -0
- package/dist/companion/companion-history.js +22 -0
- package/dist/companion/companion-identity.d.ts +43 -0
- package/dist/companion/companion-identity.js +136 -0
- package/dist/companion/companion-mode.d.ts +77 -1
- package/dist/companion/companion-mode.js +916 -6
- package/dist/companion/companion-photo-intake.d.ts +40 -0
- package/dist/companion/companion-photo-intake.js +112 -0
- package/dist/companion/companion-photo.d.ts +144 -0
- package/dist/companion/companion-photo.js +318 -0
- package/dist/companion/companion-toolset.d.ts +66 -0
- package/dist/companion/companion-toolset.js +368 -0
- package/dist/companion/companion-turn.d.ts +96 -0
- package/dist/companion/companion-turn.js +260 -0
- package/dist/companion/companion-voice-character.d.ts +62 -0
- package/dist/companion/companion-voice-character.js +148 -0
- package/dist/companion/competitive-radar.js +14 -13
- package/dist/companion/continuity.d.ts +62 -0
- package/dist/companion/continuity.js +284 -0
- package/dist/companion/conversation-improvement-loop.d.ts +61 -0
- package/dist/companion/conversation-improvement-loop.js +317 -0
- package/dist/companion/conversation-quality-insights.d.ts +56 -0
- package/dist/companion/conversation-quality-insights.js +161 -0
- package/dist/companion/cooking-timer-runner.d.ts +20 -0
- package/dist/companion/cooking-timer-runner.js +98 -0
- package/dist/companion/core-adapter.d.ts +60 -0
- package/dist/companion/core-adapter.js +111 -0
- package/dist/companion/crisis-safety.d.ts +52 -0
- package/dist/companion/crisis-safety.js +150 -0
- package/dist/companion/daily-interaction-budget.d.ts +34 -0
- package/dist/companion/daily-interaction-budget.js +260 -0
- package/dist/companion/dialogue-percepts.d.ts +16 -0
- package/dist/companion/dialogue-percepts.js +50 -0
- package/dist/companion/event-followups.d.ts +58 -0
- package/dist/companion/event-followups.js +213 -0
- package/dist/companion/fashion-scene-catalog.d.ts +29 -0
- package/dist/companion/fashion-scene-catalog.js +141 -0
- package/dist/companion/gateway-inbox.js +25 -13
- package/dist/companion/gateway.d.ts +1 -0
- package/dist/companion/gateway.js +37 -17
- package/dist/companion/home-interaction-policy.d.ts +31 -0
- package/dist/companion/home-interaction-policy.js +89 -0
- package/dist/companion/household-time.d.ts +9 -0
- package/dist/companion/household-time.js +15 -0
- package/dist/companion/idle-loop.d.ts +53 -0
- package/dist/companion/idle-loop.js +254 -0
- package/dist/companion/impulses.js +148 -23
- package/dist/companion/inner-life.d.ts +60 -0
- package/dist/companion/inner-life.js +112 -0
- package/dist/companion/jokes.d.ts +21 -0
- package/dist/companion/jokes.js +175 -0
- package/dist/companion/lisa-selfie-cache.d.ts +36 -0
- package/dist/companion/lisa-selfie-cache.js +123 -0
- package/dist/companion/lisa-selfie-ingest.d.ts +36 -0
- package/dist/companion/lisa-selfie-ingest.js +205 -0
- package/dist/companion/lisa-selfie-refill.d.ts +32 -0
- package/dist/companion/lisa-selfie-refill.js +121 -0
- package/dist/companion/lisa-selfie-router.d.ts +40 -0
- package/dist/companion/lisa-selfie-router.js +156 -0
- package/dist/companion/lisa-selfie.d.ts +97 -0
- package/dist/companion/lisa-selfie.js +542 -0
- package/dist/companion/maison-voice-actions.d.ts +34 -0
- package/dist/companion/maison-voice-actions.js +192 -0
- package/dist/companion/migration.d.ts +63 -0
- package/dist/companion/migration.js +270 -0
- package/dist/companion/mission-board.js +7 -10
- package/dist/companion/mission-runner.js +2 -3
- package/dist/companion/mobile-conversation-log.d.ts +19 -0
- package/dist/companion/mobile-conversation-log.js +157 -0
- package/dist/companion/mobile-history.d.ts +34 -0
- package/dist/companion/mobile-history.js +123 -0
- package/dist/companion/mysoulmate-image-prompts.d.ts +26 -0
- package/dist/companion/mysoulmate-image-prompts.js +278 -0
- package/dist/companion/orchestrator.d.ts +32 -0
- package/dist/companion/orchestrator.js +49 -0
- package/dist/companion/percepts.d.ts +70 -0
- package/dist/companion/percepts.js +251 -18
- package/dist/companion/personas/copine.d.ts +8 -0
- package/dist/companion/personas/copine.js +195 -0
- package/dist/companion/personas/index.d.ts +19 -0
- package/dist/companion/personas/index.js +33 -0
- package/dist/companion/personas/types.d.ts +34 -0
- package/dist/companion/personas/types.js +8 -0
- package/dist/companion/photo-memory-fr.d.ts +36 -0
- package/dist/companion/photo-memory-fr.js +291 -0
- package/dist/companion/prefetch-config.d.ts +38 -0
- package/dist/companion/prefetch-config.js +119 -0
- package/dist/companion/prefetch-engine.d.ts +87 -0
- package/dist/companion/prefetch-engine.js +513 -0
- package/dist/companion/presence-loop.d.ts +85 -0
- package/dist/companion/presence-loop.js +297 -0
- package/dist/companion/privacy.js +3 -2
- package/dist/companion/proactive-engine.d.ts +97 -0
- package/dist/companion/proactive-engine.js +447 -0
- package/dist/companion/recent-said.d.ts +30 -0
- package/dist/companion/recent-said.js +98 -0
- package/dist/companion/relational-benchmark-scenarios.d.ts +191 -0
- package/dist/companion/relational-benchmark-scenarios.js +227 -0
- package/dist/companion/relational-context.d.ts +71 -0
- package/dist/companion/relational-context.js +302 -0
- package/dist/companion/relational-episode-evaluator.d.ts +117 -0
- package/dist/companion/relational-episode-evaluator.js +453 -0
- package/dist/companion/relationship-evolution.d.ts +2 -0
- package/dist/companion/relationship-evolution.js +30 -0
- package/dist/companion/relationship-state.d.ts +106 -0
- package/dist/companion/relationship-state.js +293 -0
- package/dist/companion/reminder-runner.d.ts +33 -0
- package/dist/companion/reminder-runner.js +183 -0
- package/dist/companion/reminders.d.ts +228 -0
- package/dist/companion/reminders.js +906 -0
- package/dist/companion/reply-augment.d.ts +87 -0
- package/dist/companion/reply-augment.js +464 -0
- package/dist/companion/safety-ledger.js +19 -12
- package/dist/companion/self-evaluation.js +22 -23
- package/dist/companion/shared-photo-memory.d.ts +65 -0
- package/dist/companion/shared-photo-memory.js +145 -0
- package/dist/companion/shared-photos.d.ts +88 -0
- package/dist/companion/shared-photos.js +321 -0
- package/dist/companion/signature-locations.d.ts +16 -0
- package/dist/companion/signature-locations.js +108 -0
- package/dist/companion/skill-curator.d.ts +9 -0
- package/dist/companion/skill-curator.js +147 -58
- package/dist/companion/untrusted-text.d.ts +22 -0
- package/dist/companion/untrusted-text.js +47 -0
- package/dist/companion/user-name.d.ts +18 -0
- package/dist/companion/user-name.js +22 -0
- package/dist/companion/visual-consent.d.ts +40 -0
- package/dist/companion/visual-consent.js +98 -0
- package/dist/companion/visual-grounding.d.ts +83 -0
- package/dist/companion/visual-grounding.js +474 -0
- package/dist/companion/voice-callbacks.d.ts +9 -0
- package/dist/companion/voice-callbacks.js +84 -0
- package/dist/companion/voice-guidance.d.ts +23 -0
- package/dist/companion/voice-guidance.js +85 -0
- package/dist/companion/voice-improvement-loop.d.ts +53 -0
- package/dist/companion/voice-improvement-loop.js +279 -0
- package/dist/companion/voice-incident-repair.d.ts +41 -0
- package/dist/companion/voice-incident-repair.js +214 -0
- package/dist/config/code-exec-policy.d.ts +25 -0
- package/dist/config/code-exec-policy.js +39 -0
- package/dist/config/constants.d.ts +41 -0
- package/dist/config/constants.js +14 -0
- package/dist/config/env-schema.d.ts +2 -0
- package/dist/config/env-schema.js +714 -5
- package/dist/config/feature-flags.js +8 -12
- package/dist/config/feature-surface.d.ts +12 -0
- package/dist/config/feature-surface.js +86 -0
- package/dist/config/headless-local-prompt.d.ts +9 -0
- package/dist/config/headless-local-prompt.js +39 -0
- package/dist/config/local-runtime-context.d.ts +41 -0
- package/dist/config/local-runtime-context.js +430 -0
- package/dist/config/model-registry.js +4 -0
- package/dist/config/model-strengths.d.ts +14 -0
- package/dist/config/model-strengths.js +15 -0
- package/dist/config/model-tools.d.ts +65 -0
- package/dist/config/model-tools.js +823 -21
- package/dist/config/secret-ref.d.ts +22 -3
- package/dist/config/secret-ref.js +103 -41
- package/dist/config/toml-config.d.ts +20 -4
- package/dist/config/toml-config.js +40 -2
- package/dist/context/auto-compact-threshold.d.ts +1 -1
- package/dist/context/auto-compact-threshold.js +1 -1
- package/dist/context/codebase-map.js +9 -4
- package/dist/context/codebase-rag/codebase-rag.js +7 -6
- package/dist/context/codebase-rag/hnsw-store.js +9 -4
- package/dist/context/codebase-rag/vector-store.js +4 -4
- package/dist/context/compaction/parallel-summarizer.js +1 -0
- package/dist/context/compression.js +25 -29
- package/dist/context/context-manager-v2.d.ts +95 -7
- package/dist/context/context-manager-v2.js +444 -91
- package/dist/context/context-manager-v3.d.ts +4 -0
- package/dist/context/context-manager-v3.js +68 -9
- package/dist/context/cross-encoder-reranker.js +8 -3
- package/dist/context/default-context-engine.js +1 -1
- package/dist/context/enhanced-compression.d.ts +26 -2
- package/dist/context/enhanced-compression.js +81 -30
- package/dist/context/file-mentions.d.ts +46 -0
- package/dist/context/file-mentions.js +245 -0
- package/dist/context/importance-scorer.js +4 -3
- package/dist/context/jit-context.d.ts +7 -0
- package/dist/context/jit-context.js +22 -4
- package/dist/context/lm-resizer-compressor.d.ts +102 -0
- package/dist/context/lm-resizer-compressor.js +594 -0
- package/dist/context/lm-resizer-diagnostics.d.ts +9 -0
- package/dist/context/lm-resizer-diagnostics.js +30 -0
- package/dist/context/precompaction-flush.js +1 -1
- package/dist/context/restorable-compression.d.ts +59 -14
- package/dist/context/restorable-compression.js +310 -60
- package/dist/context/segment-archive.d.ts +36 -0
- package/dist/context/segment-archive.js +220 -0
- package/dist/context/smart-compaction.d.ts +7 -0
- package/dist/context/smart-compaction.js +84 -15
- package/dist/context/token-counter.d.ts +6 -0
- package/dist/context/token-counter.js +41 -0
- package/dist/context/token-juice.d.ts +72 -0
- package/dist/context/token-juice.js +220 -0
- package/dist/context/tool-observation-optimizer.d.ts +90 -0
- package/dist/context/tool-observation-optimizer.js +231 -0
- package/dist/context/tool-output-masking.js +3 -4
- package/dist/context/tool-pair-preserver.d.ts +1 -1
- package/dist/context/tool-pair-preserver.js +1 -1
- package/dist/context/transcript-repair.d.ts +16 -3
- package/dist/context/transcript-repair.js +72 -35
- package/dist/context/types.d.ts +2 -0
- package/dist/conversation/argument-obligations.d.ts +65 -0
- package/dist/conversation/argument-obligations.js +157 -0
- package/dist/conversation/companion-model-routing.d.ts +121 -0
- package/dist/conversation/companion-model-routing.js +810 -0
- package/dist/conversation/conversation-benchmark.d.ts +143 -0
- package/dist/conversation/conversation-benchmark.js +766 -0
- package/dist/conversation/conversation-blind-comparison.d.ts +135 -0
- package/dist/conversation/conversation-blind-comparison.js +451 -0
- package/dist/conversation/conversation-evaluator.d.ts +56 -0
- package/dist/conversation/conversation-evaluator.js +335 -0
- package/dist/conversation/conversation-orchestrator.d.ts +32 -0
- package/dist/conversation/conversation-orchestrator.js +59 -0
- package/dist/conversation/conversation-pilot-corpus.d.ts +33 -0
- package/dist/conversation/conversation-pilot-corpus.js +313 -0
- package/dist/conversation/conversation-quality.d.ts +31 -0
- package/dist/conversation/conversation-quality.js +280 -0
- package/dist/conversation/conversation-state.d.ts +23 -0
- package/dist/conversation/conversation-state.js +117 -0
- package/dist/conversation/cross-channel-bridge.d.ts +127 -0
- package/dist/conversation/cross-channel-bridge.js +785 -0
- package/dist/conversation/deliberation-thread.d.ts +18 -0
- package/dist/conversation/deliberation-thread.js +303 -0
- package/dist/conversation/dialogue-act.d.ts +11 -0
- package/dist/conversation/dialogue-act.js +132 -0
- package/dist/conversation/discourse-planner.d.ts +3 -0
- package/dist/conversation/discourse-planner.js +141 -0
- package/dist/conversation/fresh-context.d.ts +54 -0
- package/dist/conversation/fresh-context.js +258 -0
- package/dist/conversation/prefetched-turn-context.d.ts +45 -0
- package/dist/conversation/prefetched-turn-context.js +209 -0
- package/dist/conversation/relationship-safety.d.ts +37 -0
- package/dist/conversation/relationship-safety.js +407 -0
- package/dist/conversation/semantic-response-gate.d.ts +262 -0
- package/dist/conversation/semantic-response-gate.js +656 -0
- package/dist/conversation/semantic-response-runtime.d.ts +79 -0
- package/dist/conversation/semantic-response-runtime.js +419 -0
- package/dist/conversation/shared-relationship-state.d.ts +60 -0
- package/dist/conversation/shared-relationship-state.js +262 -0
- package/dist/conversation/types.d.ts +77 -0
- package/dist/conversation/types.js +3 -0
- package/dist/conversation/voice-continuity.d.ts +13 -0
- package/dist/conversation/voice-continuity.js +48 -0
- package/dist/council/conductor.d.ts +26 -0
- package/dist/council/conductor.js +292 -0
- package/dist/council/council-engine.d.ts +29 -0
- package/dist/council/council-engine.js +458 -0
- package/dist/council/deliberation-health.d.ts +58 -0
- package/dist/council/deliberation-health.js +108 -0
- package/dist/council/judge.d.ts +69 -0
- package/dist/council/judge.js +183 -0
- package/dist/council/peers.d.ts +19 -0
- package/dist/council/peers.js +47 -0
- package/dist/council/signals.d.ts +26 -0
- package/dist/council/signals.js +156 -0
- package/dist/council/task-types.d.ts +16 -0
- package/dist/council/task-types.js +58 -0
- package/dist/council/triage.d.ts +48 -0
- package/dist/council/triage.js +228 -0
- package/dist/council/types.d.ts +292 -0
- package/dist/council/types.js +20 -0
- package/dist/council/with-timeout.d.ts +10 -0
- package/dist/council/with-timeout.js +29 -0
- package/dist/curator/curator.d.ts +85 -0
- package/dist/curator/curator.js +367 -0
- package/dist/daemon/agent-task-executor.js +51 -0
- package/dist/daemon/autonomous-daemon.d.ts +2 -0
- package/dist/daemon/autonomous-daemon.js +4 -1
- package/dist/daemon/autonomous-loop.d.ts +9 -0
- package/dist/daemon/autonomous-loop.js +57 -1
- package/dist/daemon/autonomy-bench-candidates.d.ts +33 -0
- package/dist/daemon/autonomy-bench-candidates.js +68 -0
- package/dist/daemon/autonomy-briefing.d.ts +112 -0
- package/dist/daemon/autonomy-briefing.js +359 -0
- package/dist/daemon/autonomy-run-journal.d.ts +20 -0
- package/dist/daemon/autonomy-run-journal.js +41 -0
- package/dist/daemon/cron-agent-bridge.d.ts +6 -0
- package/dist/daemon/cron-agent-bridge.js +31 -4
- package/dist/daemon/daily-reset.d.ts +2 -2
- package/dist/daemon/daily-reset.js +16 -15
- package/dist/daemon/ollama-task-executor.js +9 -1
- package/dist/database/database-manager.d.ts +1 -1
- package/dist/database/database-manager.js +6 -4
- package/dist/database/optional-sqlite.d.ts +20 -0
- package/dist/database/optional-sqlite.js +101 -0
- package/dist/design/design-system-registry.d.ts +21 -0
- package/dist/design/design-system-registry.js +106 -0
- package/dist/desktop/codebuddy-engine-adapter.d.ts +34 -0
- package/dist/desktop/codebuddy-engine-adapter.js +306 -21
- package/dist/desktop/electron-launch-args.d.ts +7 -0
- package/dist/desktop/electron-launch-args.js +13 -0
- package/dist/desktop/engine-adapter.d.ts +6 -0
- package/dist/desktop/launcher.js +2 -1
- package/dist/desktop/permission-bridge.d.ts +12 -1
- package/dist/desktop/permission-bridge.js +12 -5
- package/dist/desktop-automation/omniparser-runner.d.ts +1 -0
- package/dist/desktop-automation/omniparser-runner.js +12 -1
- package/dist/desktop-automation/smart-snapshot.js +7 -0
- package/dist/desktop-automation/windows-native-provider.js +1 -1
- package/dist/doctor/assistant-runtime.d.ts +90 -0
- package/dist/doctor/assistant-runtime.js +472 -0
- package/dist/doctor/env-sanity.d.ts +17 -0
- package/dist/doctor/env-sanity.js +74 -0
- package/dist/doctor/index.d.ts +47 -1
- package/dist/doctor/index.js +464 -49
- package/dist/doctor/integrations.d.ts +179 -0
- package/dist/doctor/integrations.js +227 -0
- package/dist/doctor/llm-key-check.d.ts +17 -0
- package/dist/doctor/llm-key-check.js +100 -0
- package/dist/doctor/ollama-model-selection.d.ts +16 -0
- package/dist/doctor/ollama-model-selection.js +55 -0
- package/dist/doctor/triage.d.ts +108 -0
- package/dist/doctor/triage.js +304 -0
- package/dist/embeddings/embedding-provider.d.ts +1 -0
- package/dist/embeddings/embedding-provider.js +21 -9
- package/dist/errors/crash-recovery.js +6 -4
- package/dist/events/index.d.ts +1 -1
- package/dist/events/types.d.ts +44 -0
- package/dist/export/repo-explanation.d.ts +10 -0
- package/dist/export/repo-explanation.js +334 -0
- package/dist/export/session-share.d.ts +34 -0
- package/dist/export/session-share.js +687 -0
- package/dist/fleet/autonomous-tick-broadcaster.d.ts +1 -1
- package/dist/fleet/capability-registry.d.ts +9 -0
- package/dist/fleet/capability-registry.js +268 -56
- package/dist/fleet/colab-store.d.ts +3 -4
- package/dist/fleet/colab-store.js +6 -26
- package/dist/fleet/collaboration.d.ts +44 -0
- package/dist/fleet/collaboration.js +170 -0
- package/dist/fleet/compatible-model.d.ts +39 -0
- package/dist/fleet/compatible-model.js +148 -0
- package/dist/fleet/consolidation/collecte.d.ts +31 -0
- package/dist/fleet/consolidation/collecte.js +86 -0
- package/dist/fleet/consolidation/digest-texte.d.ts +11 -0
- package/dist/fleet/consolidation/digest-texte.js +52 -0
- package/dist/fleet/consolidation/thalamus.d.ts +35 -0
- package/dist/fleet/consolidation/thalamus.js +151 -0
- package/dist/fleet/consolidation/types.d.ts +66 -0
- package/dist/fleet/consolidation/types.js +22 -0
- package/dist/fleet/cost-tracker.d.ts +11 -0
- package/dist/fleet/cost-tracker.js +64 -17
- package/dist/fleet/fleet-cost-cap.d.ts +36 -0
- package/dist/fleet/fleet-cost-cap.js +175 -0
- package/dist/fleet/fleet-http-surface.d.ts +24 -0
- package/dist/fleet/fleet-http-surface.js +72 -0
- package/dist/fleet/fleet-listener.d.ts +2 -1
- package/dist/fleet/fleet-listener.js +91 -46
- package/dist/fleet/fleet-registry.d.ts +2 -0
- package/dist/fleet/model-capability-heuristics.d.ts +31 -0
- package/dist/fleet/model-capability-heuristics.js +49 -0
- package/dist/fleet/model-inventory.d.ts +46 -0
- package/dist/fleet/model-inventory.js +242 -0
- package/dist/fleet/model-scoreboard.d.ts +118 -13
- package/dist/fleet/model-scoreboard.js +339 -27
- package/dist/fleet/model-selector.d.ts +83 -0
- package/dist/fleet/model-selector.js +218 -0
- package/dist/fleet/peer-chat-bridge.d.ts +9 -2
- package/dist/fleet/peer-chat-bridge.js +133 -19
- package/dist/fleet/peer-chat-client-factory.d.ts +28 -2
- package/dist/fleet/peer-chat-client-factory.js +195 -22
- package/dist/fleet/peer-ckg-bridge.d.ts +67 -0
- package/dist/fleet/peer-ckg-bridge.js +467 -0
- package/dist/fleet/peer-mission-exchange-bridge.d.ts +8 -0
- package/dist/fleet/peer-mission-exchange-bridge.js +127 -0
- package/dist/fleet/peer-session-bridge.d.ts +7 -1
- package/dist/fleet/peer-session-bridge.js +98 -17
- package/dist/fleet/peer-session-store.d.ts +2 -0
- package/dist/fleet/peer-session-store.js +6 -5
- package/dist/fleet/peer-text-sanitizer.d.ts +59 -0
- package/dist/fleet/peer-text-sanitizer.js +99 -0
- package/dist/fleet/peer-tool-bridge.js +38 -10
- package/dist/fleet/privacy-lint.js +80 -8
- package/dist/fleet/resource-catalog.d.ts +245 -0
- package/dist/fleet/resource-catalog.js +211 -0
- package/dist/fleet/rooms/room-access.d.ts +138 -0
- package/dist/fleet/rooms/room-access.js +196 -0
- package/dist/fleet/rooms/room-client.d.ts +158 -0
- package/dist/fleet/rooms/room-client.js +685 -0
- package/dist/fleet/rooms/room-event.d.ts +139 -0
- package/dist/fleet/rooms/room-event.js +330 -0
- package/dist/fleet/rooms/room-filter.d.ts +48 -0
- package/dist/fleet/rooms/room-filter.js +152 -0
- package/dist/fleet/rooms/room-hub.d.ts +154 -0
- package/dist/fleet/rooms/room-hub.js +363 -0
- package/dist/fleet/rooms/room-identity.d.ts +26 -0
- package/dist/fleet/rooms/room-identity.js +82 -0
- package/dist/fleet/rooms/room-lock.d.ts +34 -0
- package/dist/fleet/rooms/room-lock.js +180 -0
- package/dist/fleet/rooms/room-observations.d.ts +7 -0
- package/dist/fleet/rooms/room-observations.js +61 -0
- package/dist/fleet/rooms/room-server.d.ts +28 -0
- package/dist/fleet/rooms/room-server.js +75 -0
- package/dist/fleet/rooms/room-store.d.ts +119 -0
- package/dist/fleet/rooms/room-store.js +448 -0
- package/dist/fleet/rooms/room-ws-bridge.d.ts +27 -0
- package/dist/fleet/rooms/room-ws-bridge.js +137 -0
- package/dist/fleet/saga-store.d.ts +25 -1
- package/dist/fleet/saga-store.js +34 -6
- package/dist/fleet/sensory-mission-bridge.d.ts +42 -0
- package/dist/fleet/sensory-mission-bridge.js +136 -0
- package/dist/fleet/task-router.d.ts +17 -1
- package/dist/fleet/task-router.js +65 -20
- package/dist/fleet/types.d.ts +9 -5
- package/dist/gateway/device-pairing.js +5 -11
- package/dist/gateway/ws-transport.d.ts +1 -5
- package/dist/gateway/ws-transport.js +2 -22
- package/dist/git/changelog.d.ts +36 -0
- package/dist/git/changelog.js +109 -0
- package/dist/git/worktree-sessions.js +2 -1
- package/dist/goals/counterfactual-forge.d.ts +70 -0
- package/dist/goals/counterfactual-forge.js +184 -0
- package/dist/goals/criterion-progress.d.ts +24 -0
- package/dist/goals/criterion-progress.js +59 -0
- package/dist/goals/evidence-artifact.d.ts +18 -0
- package/dist/goals/evidence-artifact.js +76 -0
- package/dist/goals/goal-decomposer.d.ts +15 -0
- package/dist/goals/goal-decomposer.js +89 -4
- package/dist/goals/goal-loop.d.ts +29 -0
- package/dist/goals/goal-loop.js +92 -6
- package/dist/goals/goal-manager.d.ts +1 -0
- package/dist/goals/goal-manager.js +4 -1
- package/dist/goals/goal-state.d.ts +10 -0
- package/dist/goals/goal-state.js +21 -1
- package/dist/goals/goal-store.js +4 -6
- package/dist/goals/index.d.ts +11 -0
- package/dist/goals/index.js +11 -0
- package/dist/goals/intent-graph.d.ts +40 -0
- package/dist/goals/intent-graph.js +133 -0
- package/dist/goals/mission-constitution.d.ts +59 -0
- package/dist/goals/mission-constitution.js +132 -0
- package/dist/goals/mission-exchange.d.ts +86 -0
- package/dist/goals/mission-exchange.js +216 -0
- package/dist/goals/outcome-capsule.d.ts +80 -0
- package/dist/goals/outcome-capsule.js +186 -0
- package/dist/goals/proof-ledger.d.ts +79 -0
- package/dist/goals/proof-ledger.js +181 -0
- package/dist/goals/proven-outcome-lessons.d.ts +11 -0
- package/dist/goals/proven-outcome-lessons.js +30 -0
- package/dist/goals/proven-outcome-memory.d.ts +55 -0
- package/dist/goals/proven-outcome-memory.js +125 -0
- package/dist/goals/shadow-twin.d.ts +57 -0
- package/dist/goals/shadow-twin.js +110 -0
- package/dist/gpu-worker/gpu-media-worker-server.d.ts +49 -0
- package/dist/gpu-worker/gpu-media-worker-server.js +637 -0
- package/dist/harness/contract.d.ts +88 -88
- package/dist/harness/fleet-supervisor.d.ts +16 -0
- package/dist/harness/fleet-supervisor.js +64 -0
- package/dist/harness/index.d.ts +4 -0
- package/dist/harness/index.js +4 -0
- package/dist/harness/mission-runner.d.ts +3 -0
- package/dist/harness/mission-runner.js +53 -0
- package/dist/harness/mission-store.d.ts +93 -0
- package/dist/harness/mission-store.js +297 -0
- package/dist/harness/tool-harness.d.ts +56 -0
- package/dist/harness/tool-harness.js +153 -0
- package/dist/hooks/advanced-hooks.js +6 -4
- package/dist/hooks/env-persistence.js +5 -6
- package/dist/hooks/hook-manager.js +8 -7
- package/dist/hooks/hook-system.js +6 -4
- package/dist/hooks/lifecycle-hooks.js +6 -3
- package/dist/hooks/moltbot/moltbot-hooks-manager.js +8 -3
- package/dist/hooks/moltbot/session-persistence-manager.js +15 -7
- package/dist/hooks/moltbot/setup-utilities.js +6 -4
- package/dist/hooks/smart-hooks.js +6 -4
- package/dist/hooks/use-enhanced-input.js +48 -4
- package/dist/hooks/use-input-handler.d.ts +1 -0
- package/dist/hooks/use-input-handler.js +90 -84
- package/dist/hooks/use-input-history.js +1 -0
- package/dist/hooks/user-hooks.d.ts +10 -1
- package/dist/hooks/user-hooks.js +77 -1
- package/dist/identity/companion-identity.d.ts +4 -1
- package/dist/identity/companion-identity.js +134 -4
- package/dist/identity/identity-manager.d.ts +1 -1
- package/dist/identity/identity-manager.js +7 -6
- package/dist/identity/lisa-introspection.d.ts +36 -0
- package/dist/identity/lisa-introspection.js +414 -0
- package/dist/identity/operational-self-model.d.ts +145 -0
- package/dist/identity/operational-self-model.js +978 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1039 -229
- package/dist/input/context-mentions.d.ts +7 -1
- package/dist/input/context-mentions.js +18 -20
- package/dist/input/text-to-speech.d.ts +3 -0
- package/dist/input/text-to-speech.js +70 -27
- package/dist/input/voice-control.d.ts +1 -0
- package/dist/input/voice-control.js +24 -18
- package/dist/input/voice-input-enhanced.d.ts +1 -0
- package/dist/input/voice-input-enhanced.js +31 -16
- package/dist/integrations/ci-autofix-pipeline.js +15 -20
- package/dist/integrations/ide/server.js +3 -2
- package/dist/integrations/json-rpc/server.js +4 -2
- package/dist/integrations/mcp/mcp-server.js +4 -2
- package/dist/integrations/opentelemetry-integration.js +6 -4
- package/dist/integrations/pubcommander-bridge.d.ts +5 -0
- package/dist/integrations/pubcommander-bridge.js +61 -0
- package/dist/integrations/sentry-integration.js +9 -3
- package/dist/intelligence/semantic-search.js +9 -12
- package/dist/intelligence/user-preferences.js +8 -11
- package/dist/intents/intent-checker.d.ts +34 -0
- package/dist/intents/intent-checker.js +175 -0
- package/dist/intents/intent-generator.d.ts +12 -0
- package/dist/intents/intent-generator.js +86 -0
- package/dist/intents/intent-store.d.ts +62 -0
- package/dist/intents/intent-store.js +263 -0
- package/dist/interpreter/computer/skills.js +3 -2
- package/dist/interpreter/interpreter-service.js +18 -9
- package/dist/kanban/kanban-board-registry.js +6 -4
- package/dist/kanban/kanban-store.js +5 -7
- package/dist/knowledge/code-graph-persistence.js +8 -16
- package/dist/knowledge/graph-drift.js +14 -11
- package/dist/knowledge/knowledge-manager.js +2 -1
- package/dist/knowledge/scanners/index.d.ts +3 -0
- package/dist/knowledge/scanners/index.js +57 -29
- package/dist/knowledge/workspace-indexer.js +22 -15
- package/dist/life-rhythm/cooking-timer-store.d.ts +50 -0
- package/dist/life-rhythm/cooking-timer-store.js +240 -0
- package/dist/life-rhythm/day-context.d.ts +30 -0
- package/dist/life-rhythm/day-context.js +198 -0
- package/dist/life-rhythm/etalab-holiday-provider.d.ts +40 -0
- package/dist/life-rhythm/etalab-holiday-provider.js +318 -0
- package/dist/life-rhythm/home-mode-store.d.ts +32 -0
- package/dist/life-rhythm/home-mode-store.js +184 -0
- package/dist/life-rhythm/index.d.ts +6 -0
- package/dist/life-rhythm/index.js +7 -0
- package/dist/life-rhythm/types.d.ts +88 -0
- package/dist/life-rhythm/types.js +33 -0
- package/dist/life-rhythm/zoned-minute.d.ts +24 -0
- package/dist/life-rhythm/zoned-minute.js +113 -0
- package/dist/location/index.d.ts +2 -12
- package/dist/location/index.js +129 -56
- package/dist/logging/interaction-logger.js +29 -46
- package/dist/lora/dataset-v3-plan.d.ts +27 -0
- package/dist/lora/dataset-v3-plan.js +121 -0
- package/dist/lora/dataset.d.ts +26 -0
- package/dist/lora/dataset.js +165 -0
- package/dist/lora/fal-krea-trainer.d.ts +54 -0
- package/dist/lora/fal-krea-trainer.js +197 -0
- package/dist/lora/generate-training-set.d.ts +61 -0
- package/dist/lora/generate-training-set.js +190 -0
- package/dist/lora/identity-dataset-gate.d.ts +104 -0
- package/dist/lora/identity-dataset-gate.js +204 -0
- package/dist/lora/identity-dataset-promotion.d.ts +32 -0
- package/dist/lora/identity-dataset-promotion.js +269 -0
- package/dist/lora/index.d.ts +11 -0
- package/dist/lora/index.js +12 -0
- package/dist/lora/install-comfy.d.ts +14 -0
- package/dist/lora/install-comfy.js +63 -0
- package/dist/lora/lisa-avatar-bible.d.ts +85 -0
- package/dist/lora/lisa-avatar-bible.js +275 -0
- package/dist/lora/local-plan.d.ts +10 -0
- package/dist/lora/local-plan.js +205 -0
- package/dist/lora/pack-dataset.d.ts +7 -0
- package/dist/lora/pack-dataset.js +39 -0
- package/dist/lora/quality-gate.d.ts +31 -0
- package/dist/lora/quality-gate.js +90 -0
- package/dist/lora/types.d.ts +66 -0
- package/dist/lora/types.js +5 -0
- package/dist/lsp/lsp-client.d.ts +12 -0
- package/dist/lsp/lsp-client.js +45 -9
- package/dist/lsp/server.js +1 -1
- package/dist/mcp/approval-elicitation.d.ts +1 -0
- package/dist/mcp/approval-elicitation.js +2 -0
- package/dist/mcp/client.d.ts +15 -1
- package/dist/mcp/client.js +116 -24
- package/dist/mcp/config.d.ts +32 -1
- package/dist/mcp/config.js +175 -19
- package/dist/mcp/import-normalize.d.ts +12 -0
- package/dist/mcp/import-normalize.js +114 -0
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/mcp-agent-tools.d.ts +1 -1
- package/dist/mcp/mcp-agent-tools.js +76 -73
- package/dist/mcp/mcp-ckg-tools.d.ts +31 -0
- package/dist/mcp/mcp-ckg-tools.js +121 -0
- package/dist/mcp/mcp-client.js +8 -5
- package/dist/mcp/mcp-desktop-tools.d.ts +1 -1
- package/dist/mcp/mcp-desktop-tools.js +105 -99
- package/dist/mcp/mcp-memory-tools.d.ts +1 -1
- package/dist/mcp/mcp-memory-tools.js +63 -61
- package/dist/mcp/mcp-oauth.js +5 -2
- package/dist/mcp/mcp-server.d.ts +48 -79
- package/dist/mcp/mcp-server.js +445 -478
- package/dist/mcp/mcp-session-tools.d.ts +1 -1
- package/dist/mcp/mcp-session-tools.js +95 -92
- package/dist/mcp/profiles.d.ts +18 -0
- package/dist/mcp/profiles.js +65 -0
- package/dist/mcp/prompt-footprint.d.ts +21 -0
- package/dist/mcp/prompt-footprint.js +39 -0
- package/dist/mcp/transports.d.ts +10 -5
- package/dist/mcp/transports.js +61 -99
- package/dist/mcp/types.d.ts +5 -0
- package/dist/meals/allergens.d.ts +19 -0
- package/dist/meals/allergens.js +122 -0
- package/dist/meals/compatibility.d.ts +6 -0
- package/dist/meals/compatibility.js +109 -0
- package/dist/meals/food-inventory-store.d.ts +51 -0
- package/dist/meals/food-inventory-store.js +257 -0
- package/dist/meals/index.d.ts +10 -0
- package/dist/meals/index.js +11 -0
- package/dist/meals/meal-engine.d.ts +7 -0
- package/dist/meals/meal-engine.js +206 -0
- package/dist/meals/meal-plan-store.d.ts +73 -0
- package/dist/meals/meal-plan-store.js +271 -0
- package/dist/meals/private-json-store.d.ts +9 -0
- package/dist/meals/private-json-store.js +92 -0
- package/dist/meals/profile-store.d.ts +49 -0
- package/dist/meals/profile-store.js +296 -0
- package/dist/meals/profile-validator.d.ts +7 -0
- package/dist/meals/profile-validator.js +124 -0
- package/dist/meals/recipe-normalizer.d.ts +7 -0
- package/dist/meals/recipe-normalizer.js +162 -0
- package/dist/meals/store-validation.d.ts +21 -0
- package/dist/meals/store-validation.js +101 -0
- package/dist/meals/types.d.ts +170 -0
- package/dist/meals/types.js +12 -0
- package/dist/media/comfy-health-supervisor.d.ts +142 -0
- package/dist/media/comfy-health-supervisor.js +608 -0
- package/dist/media/comfyui-recipe-contract.d.ts +696 -0
- package/dist/media/comfyui-recipe-contract.js +580 -0
- package/dist/media/comfyui-recipe-engine.d.ts +3 -0
- package/dist/media/comfyui-recipe-engine.js +4 -0
- package/dist/media/comfyui-recipe-registry.d.ts +35 -0
- package/dist/media/comfyui-recipe-registry.js +385 -0
- package/dist/media/comfyui-recipe-runtime.d.ts +135 -0
- package/dist/media/comfyui-recipe-runtime.js +942 -0
- package/dist/media/content-tier.d.ts +25 -0
- package/dist/media/content-tier.js +29 -0
- package/dist/meeting/analyzer.d.ts +24 -0
- package/dist/meeting/analyzer.js +402 -0
- package/dist/meeting/index.d.ts +13 -0
- package/dist/meeting/index.js +48 -0
- package/dist/meeting/markdown.d.ts +3 -0
- package/dist/meeting/markdown.js +51 -0
- package/dist/meeting/output.d.ts +13 -0
- package/dist/meeting/output.js +155 -0
- package/dist/meeting/transcript.d.ts +25 -0
- package/dist/meeting/transcript.js +292 -0
- package/dist/meeting/types.d.ts +112 -0
- package/dist/meeting/types.js +9 -0
- package/dist/memory/adapters/network-memory-adapters.d.ts +19 -4
- package/dist/memory/adapters/network-memory-adapters.js +4 -4
- package/dist/memory/auto-memory.js +5 -2
- package/dist/memory/background-extractor.d.ts +43 -0
- package/dist/memory/background-extractor.js +368 -0
- package/dist/memory/buddy-memory-client.d.ts +40 -0
- package/dist/memory/buddy-memory-client.js +198 -0
- package/dist/memory/ckg-engine-policy.d.ts +19 -0
- package/dist/memory/ckg-engine-policy.js +45 -0
- package/dist/memory/ckg-fact-reconciliation.d.ts +81 -0
- package/dist/memory/ckg-fact-reconciliation.js +155 -0
- package/dist/memory/ckg-redaction.d.ts +2 -0
- package/dist/memory/ckg-redaction.js +25 -0
- package/dist/memory/coding-style-analyzer.js +2 -2
- package/dist/memory/collective-knowledge-graph.d.ts +380 -0
- package/dist/memory/collective-knowledge-graph.js +1228 -0
- package/dist/memory/enhanced-memory.d.ts +29 -0
- package/dist/memory/enhanced-memory.js +153 -63
- package/dist/memory/facts-memory.d.ts +20 -5
- package/dist/memory/facts-memory.js +68 -12
- package/dist/memory/hybrid-mmr.d.ts +71 -0
- package/dist/memory/hybrid-mmr.js +127 -0
- package/dist/memory/hybrid-search.js +4 -1
- package/dist/memory/knowledge-graph.d.ts +23 -2
- package/dist/memory/knowledge-graph.js +62 -47
- package/dist/memory/memory-candidate-queue.d.ts +2 -2
- package/dist/memory/memory-candidate-queue.js +15 -10
- package/dist/memory/memory-consolidation.d.ts +8 -0
- package/dist/memory/memory-consolidation.js +66 -17
- package/dist/memory/memory-forgetting.d.ts +57 -0
- package/dist/memory/memory-forgetting.js +87 -0
- package/dist/memory/ocr-memory-pipeline.js +16 -10
- package/dist/memory/persistent-memory.d.ts +111 -8
- package/dist/memory/persistent-memory.js +788 -149
- package/dist/memory/presence-injector.d.ts +1 -1
- package/dist/memory/presence-injector.js +9 -4
- package/dist/memory/semantic-memory-search.js +12 -9
- package/dist/memory/subagent-memory.js +8 -8
- package/dist/memory/user-model.js +9 -4
- package/dist/metrics/metrics-collector.d.ts +1 -0
- package/dist/metrics/metrics-collector.js +11 -2
- package/dist/nodes/device-node.d.ts +5 -2
- package/dist/nodes/device-node.js +61 -19
- package/dist/nodes/index.d.ts +32 -2
- package/dist/nodes/index.js +208 -7
- package/dist/nodes/transports/adb-transport.d.ts +2 -6
- package/dist/nodes/transports/adb-transport.js +29 -13
- package/dist/nodes/transports/base-transport.d.ts +10 -0
- package/dist/observability/mobile-supervision-gateway-contract.js +20 -7
- package/dist/observability/run-event-writer.d.ts +21 -0
- package/dist/observability/run-event-writer.js +81 -0
- package/dist/observability/run-store.d.ts +11 -1
- package/dist/observability/run-store.js +107 -35
- package/dist/observability/run-trajectory-load.d.ts +16 -0
- package/dist/observability/run-trajectory-load.js +266 -0
- package/dist/observability/run-trajectory.d.ts +168 -0
- package/dist/observability/run-trajectory.js +468 -0
- package/dist/observability/run-viewer.d.ts +5 -1
- package/dist/observability/run-viewer.js +83 -9
- package/dist/observability/turn-metrics.d.ts +86 -0
- package/dist/observability/turn-metrics.js +201 -0
- package/dist/offline/offline-mode.js +10 -9
- package/dist/openclaw/gateway-bridge.js +3 -2
- package/dist/optimization/latency-optimizer.d.ts +2 -1
- package/dist/optimization/latency-optimizer.js +2 -2
- package/dist/optimization/model-routing.d.ts +3 -0
- package/dist/optimization/prompt-cache.d.ts +19 -2
- package/dist/optimization/prompt-cache.js +41 -6
- package/dist/orchestration/orchestrator.d.ts +21 -0
- package/dist/orchestration/orchestrator.js +126 -16
- package/dist/orchestration/types.d.ts +2 -0
- package/dist/performance/lazy-loader.js +2 -1
- package/dist/performance/tool-cache.d.ts +4 -0
- package/dist/performance/tool-cache.js +4 -2
- package/dist/persistence/conversation-branches.js +9 -2
- package/dist/persistence/session-content.d.ts +8 -0
- package/dist/persistence/session-content.js +76 -0
- package/dist/persistence/session-handoff.d.ts +64 -0
- package/dist/persistence/session-handoff.js +80 -0
- package/dist/persistence/session-history.d.ts +4 -0
- package/dist/persistence/session-history.js +38 -0
- package/dist/persistence/session-store.d.ts +35 -0
- package/dist/persistence/session-store.js +104 -37
- package/dist/personas/persona-manager.d.ts +39 -1
- package/dist/personas/persona-manager.js +292 -38
- package/dist/plugins/bundled/groq-provider.js +10 -7
- package/dist/plugins/bundled/openrouter-provider.js +2 -1
- package/dist/plugins/code-explorer/CodeExplorerManager.d.ts +62 -8
- package/dist/plugins/code-explorer/CodeExplorerManager.js +255 -32
- package/dist/plugins/code-explorer/code-explorer-client.d.ts +36 -0
- package/dist/plugins/code-explorer/code-explorer-client.js +86 -0
- package/dist/plugins/code-explorer/index.d.ts +1 -3
- package/dist/plugins/code-explorer/index.js +0 -1
- package/dist/plugins/git-pinned-marketplace.js +3 -2
- package/dist/plugins/plugin-manager.js +16 -10
- package/dist/plugins/sandbox-worker.js +1 -1
- package/dist/prompts/prompt-manager.js +11 -4
- package/dist/prompts/system-base.js +33 -5
- package/dist/protocols/a2a/codebuddy-executor.d.ts +20 -2
- package/dist/protocols/a2a/codebuddy-executor.js +34 -14
- package/dist/protocols/a2a/index.d.ts +7 -1
- package/dist/protocols/a2a/index.js +32 -3
- package/dist/protocols/a2a/jsonrpc-v1.d.ts +41 -0
- package/dist/protocols/a2a/jsonrpc-v1.js +145 -0
- package/dist/protocols/a2a/peer-config.d.ts +20 -0
- package/dist/protocols/a2a/peer-config.js +55 -0
- package/dist/protocols/acp/acp-agentic-runner.d.ts +6 -2
- package/dist/protocols/acp/acp-agentic-runner.js +91 -15
- package/dist/protocols/acp/acp-session-store.js +28 -5
- package/dist/protocols/acp/acp-stdio-server.d.ts +13 -0
- package/dist/protocols/acp/acp-stdio-server.js +30 -3
- package/dist/providers/active-llm-model-pool.d.ts +45 -0
- package/dist/providers/active-llm-model-pool.js +139 -0
- package/dist/providers/active-llm-registry.js +48 -8
- package/dist/providers/auxiliary-provider.d.ts +1 -1
- package/dist/providers/auxiliary-provider.js +23 -10
- package/dist/providers/chatgpt-models.d.ts +71 -0
- package/dist/providers/chatgpt-models.js +302 -0
- package/dist/providers/codex-oauth.d.ts +8 -0
- package/dist/providers/codex-oauth.js +75 -43
- package/dist/providers/gemini-oauth.js +7 -6
- package/dist/providers/grok-provider.js +1 -1
- package/dist/providers/index.d.ts +3 -0
- package/dist/providers/index.js +3 -0
- package/dist/providers/local-model-resolver.d.ts +66 -0
- package/dist/providers/local-model-resolver.js +128 -0
- package/dist/providers/model-egress.d.ts +8 -0
- package/dist/providers/model-egress.js +62 -0
- package/dist/providers/model-provider-compat.d.ts +13 -0
- package/dist/providers/model-provider-compat.js +49 -0
- package/dist/providers/provider-catalog.d.ts +4 -1
- package/dist/providers/provider-catalog.js +494 -28
- package/dist/providers/provider-failover-notify.d.ts +15 -0
- package/dist/providers/provider-failover-notify.js +93 -0
- package/dist/providers/provider-failover-policy.d.ts +28 -0
- package/dist/providers/provider-failover-policy.js +188 -0
- package/dist/providers/provider-failover-user-notice.d.ts +13 -0
- package/dist/providers/provider-failover-user-notice.js +49 -0
- package/dist/providers/provider-fallback.d.ts +1 -0
- package/dist/providers/provider-fallback.js +1 -1
- package/dist/providers/provider-health.d.ts +46 -0
- package/dist/providers/provider-health.js +249 -0
- package/dist/providers/turboquant-provider.d.ts +1 -1
- package/dist/providers/xai-oauth.js +7 -34
- package/dist/queue/persistent-queue.js +9 -6
- package/dist/renderers/charts/special-charts.d.ts +7 -1
- package/dist/renderers/charts/special-charts.js +5 -0
- package/dist/renderers/weather-conditions.d.ts +20 -0
- package/dist/renderers/weather-conditions.js +74 -0
- package/dist/renderers/weather-renderer.js +4 -18
- package/dist/rendering/ansi.d.ts +4 -0
- package/dist/rendering/ansi.js +149 -0
- package/dist/rendering/index.d.ts +19 -0
- package/dist/rendering/index.js +18 -0
- package/dist/rendering/plain.d.ts +2 -0
- package/dist/rendering/plain.js +91 -0
- package/dist/rendering/telegram-html.d.ts +7 -0
- package/dist/rendering/telegram-html.js +76 -16
- package/dist/research/auto-ingest.d.ts +45 -0
- package/dist/research/auto-ingest.js +85 -0
- package/dist/research/code-explorer-source.d.ts +29 -0
- package/dist/research/code-explorer-source.js +76 -0
- package/dist/research/connector-source.d.ts +25 -0
- package/dist/research/connector-source.js +314 -0
- package/dist/research/paper-qa/answer.d.ts +72 -0
- package/dist/research/paper-qa/answer.js +227 -0
- package/dist/research/paper-qa/corpus.d.ts +36 -0
- package/dist/research/paper-qa/corpus.js +102 -0
- package/dist/research/paper-qa/disk-embedding-cache.d.ts +28 -0
- package/dist/research/paper-qa/disk-embedding-cache.js +193 -0
- package/dist/research/paper-qa/index.d.ts +31 -0
- package/dist/research/paper-qa/index.js +24 -0
- package/dist/research/paper-qa/paper-qa-pipeline.d.ts +107 -0
- package/dist/research/paper-qa/paper-qa-pipeline.js +163 -0
- package/dist/research/paper-qa/passage-index.d.ts +203 -0
- package/dist/research/paper-qa/passage-index.js +405 -0
- package/dist/research/paper-qa/pdf-structure.d.ts +37 -0
- package/dist/research/paper-qa/pdf-structure.js +377 -0
- package/dist/research/paper-qa/persistent-corpus-index.d.ts +23 -0
- package/dist/research/paper-qa/persistent-corpus-index.js +122 -0
- package/dist/research/paper-qa/prose-chunker.d.ts +19 -0
- package/dist/research/paper-qa/prose-chunker.js +201 -0
- package/dist/research/paper-qa/provenance.d.ts +24 -0
- package/dist/research/paper-qa/provenance.js +40 -0
- package/dist/research/paper-qa/rcs.d.ts +78 -0
- package/dist/research/paper-qa/rcs.js +200 -0
- package/dist/research/paper-qa/types.d.ts +124 -0
- package/dist/research/paper-qa/types.js +13 -0
- package/dist/research/publication-sources.d.ts +34 -0
- package/dist/research/publication-sources.js +131 -0
- package/dist/research/relation-classifier.d.ts +13 -0
- package/dist/research/relation-classifier.js +58 -0
- package/dist/research/research-topics.d.ts +13 -0
- package/dist/research/research-topics.js +81 -0
- package/dist/review/apply-transaction.d.ts +40 -0
- package/dist/review/apply-transaction.js +112 -0
- package/dist/review/diff-model.d.ts +39 -0
- package/dist/review/diff-model.js +124 -0
- package/dist/review/llm-client.d.ts +30 -0
- package/dist/review/llm-client.js +98 -0
- package/dist/review/llm-reviewer.d.ts +16 -0
- package/dist/review/llm-reviewer.js +122 -0
- package/dist/review/review-engine.d.ts +54 -0
- package/dist/review/review-engine.js +0 -0
- package/dist/review/revision-loop.d.ts +67 -0
- package/dist/review/revision-loop.js +160 -0
- package/dist/review/static-gate.d.ts +13 -0
- package/dist/review/static-gate.js +110 -0
- package/dist/review/types.d.ts +122 -0
- package/dist/review/types.js +24 -0
- package/dist/review/write-gate.d.ts +55 -0
- package/dist/review/write-gate.js +121 -0
- package/dist/sandbox/auto-sandbox.d.ts +4 -2
- package/dist/sandbox/auto-sandbox.js +14 -1
- package/dist/sandbox/docker-sandbox.d.ts +39 -0
- package/dist/sandbox/docker-sandbox.js +292 -14
- package/dist/sandbox/execpolicy.d.ts +36 -1
- package/dist/sandbox/execpolicy.js +375 -40
- package/dist/sandbox/os-sandbox.d.ts +54 -1
- package/dist/sandbox/os-sandbox.js +315 -70
- package/dist/sandbox/sandbox-backend.d.ts +2 -0
- package/dist/scheduler/cron-scheduler.d.ts +16 -2
- package/dist/scheduler/cron-scheduler.js +177 -45
- package/dist/scheduler/job-notepad.d.ts +69 -0
- package/dist/scheduler/job-notepad.js +339 -0
- package/dist/scripting/codebuddy-bindings.js +2 -1
- package/dist/search/bm25.js +5 -2
- package/dist/search/usearch-index.js +7 -5
- package/dist/security/audit-logger.d.ts +1 -1
- package/dist/security/audit-logger.js +14 -7
- package/dist/security/bash-allowlist/allowlist-store.d.ts +8 -2
- package/dist/security/bash-allowlist/allowlist-store.js +52 -12
- package/dist/security/bash-allowlist/approval-flow.d.ts +1 -1
- package/dist/security/bash-allowlist/approval-flow.js +10 -8
- package/dist/security/bash-allowlist/deny-guard.d.ts +14 -0
- package/dist/security/bash-allowlist/deny-guard.js +61 -0
- package/dist/security/bash-allowlist/types.d.ts +5 -0
- package/dist/security/bash-parser.d.ts +32 -0
- package/dist/security/bash-parser.js +129 -14
- package/dist/security/compute-confinement.d.ts +4 -0
- package/dist/security/compute-confinement.js +89 -0
- package/dist/security/dangerous-patterns.js +18 -3
- package/dist/security/declarative-rules.d.ts +1 -1
- package/dist/security/declarative-rules.js +242 -65
- package/dist/security/dependency-vuln-scanner.js +4 -4
- package/dist/security/dev-origins.d.ts +40 -0
- package/dist/security/dev-origins.js +111 -0
- package/dist/security/docker-sandbox/manager.js +1 -1
- package/dist/security/env-blocklist.d.ts +7 -0
- package/dist/security/env-blocklist.js +22 -2
- package/dist/security/guardian-agent.d.ts +0 -5
- package/dist/security/guardian-agent.js +17 -6
- package/dist/security/index.d.ts +3 -0
- package/dist/security/index.js +2 -0
- package/dist/security/native-sandbox.d.ts +80 -0
- package/dist/security/native-sandbox.js +455 -0
- package/dist/security/pack-contents-policy.d.ts +49 -0
- package/dist/security/pack-contents-policy.js +139 -0
- package/dist/security/permission-config.js +2 -5
- package/dist/security/permission-modes.d.ts +11 -0
- package/dist/security/permission-modes.js +71 -7
- package/dist/security/policy-amendments.js +40 -22
- package/dist/security/policy-engine.js +39 -12
- package/dist/security/powershell-parser.d.ts +40 -0
- package/dist/security/powershell-parser.js +198 -0
- package/dist/security/remote-approval.d.ts +0 -1
- package/dist/security/remote-approval.js +3 -2
- package/dist/security/safe-binaries.d.ts +13 -1
- package/dist/security/safe-binaries.js +240 -32
- package/dist/security/safe-fetch.d.ts +7 -0
- package/dist/security/safe-fetch.js +101 -0
- package/dist/security/sandbox.js +2 -2
- package/dist/security/secret-patterns.d.ts +18 -0
- package/dist/security/secret-patterns.js +232 -0
- package/dist/security/secret-scrubber.d.ts +31 -0
- package/dist/security/secret-scrubber.js +170 -0
- package/dist/security/secrets-detector.d.ts +3 -1
- package/dist/security/secrets-detector.js +3 -106
- package/dist/security/security-modes.js +2 -1
- package/dist/security/session-encryption.d.ts +11 -2
- package/dist/security/session-encryption.js +59 -7
- package/dist/security/shell-env-policy.js +11 -2
- package/dist/security/skill-scanner.d.ts +2 -2
- package/dist/security/skill-scanner.js +237 -11
- package/dist/security/ssrf-guard.d.ts +13 -0
- package/dist/security/ssrf-guard.js +27 -0
- package/dist/security/text-deobfuscation.d.ts +41 -0
- package/dist/security/text-deobfuscation.js +256 -0
- package/dist/security/tool-permissions.js +2 -3
- package/dist/security/tool-policy/approval-scope.d.ts +11 -0
- package/dist/security/tool-policy/approval-scope.js +67 -0
- package/dist/security/tool-policy/policy-manager.d.ts +9 -0
- package/dist/security/tool-policy/policy-manager.js +28 -1
- package/dist/security/tool-policy/profiles.js +24 -0
- package/dist/security/tool-policy/tool-groups.js +26 -3
- package/dist/security/tool-policy/types.d.ts +3 -1
- package/dist/security/tool-policy/types.js +2 -0
- package/dist/security/trust-folders.js +3 -2
- package/dist/security/write-policy.d.ts +8 -0
- package/dist/security/write-policy.js +63 -1
- package/dist/self-model/evolution-notes.d.ts +51 -0
- package/dist/self-model/evolution-notes.js +324 -0
- package/dist/sensory/agent-reply.d.ts +136 -0
- package/dist/sensory/agent-reply.js +682 -0
- package/dist/sensory/alert.d.ts +18 -0
- package/dist/sensory/alert.js +105 -0
- package/dist/sensory/arrival-opener.d.ts +102 -0
- package/dist/sensory/arrival-opener.js +292 -0
- package/dist/sensory/audio-scene.d.ts +24 -0
- package/dist/sensory/audio-scene.js +74 -0
- package/dist/sensory/camera-keyframe-policy.d.ts +11 -0
- package/dist/sensory/camera-keyframe-policy.js +43 -0
- package/dist/sensory/conversation-cues.d.ts +55 -0
- package/dist/sensory/conversation-cues.js +140 -0
- package/dist/sensory/domain-event-bridge.d.ts +7 -0
- package/dist/sensory/domain-event-bridge.js +134 -0
- package/dist/sensory/dreaming.d.ts +17 -0
- package/dist/sensory/dreaming.js +52 -2
- package/dist/sensory/elevenlabs-library.d.ts +91 -0
- package/dist/sensory/elevenlabs-library.js +303 -0
- package/dist/sensory/episodic-journal.d.ts +69 -0
- package/dist/sensory/episodic-journal.js +240 -0
- package/dist/sensory/error-watch-reaction.d.ts +41 -0
- package/dist/sensory/error-watch-reaction.js +312 -0
- package/dist/sensory/heartbeat-fallback.d.ts +46 -0
- package/dist/sensory/heartbeat-fallback.js +171 -0
- package/dist/sensory/heartbeat-scheduler.d.ts +6 -0
- package/dist/sensory/heartbeat-scheduler.js +27 -7
- package/dist/sensory/hybrid-reply.d.ts +132 -0
- package/dist/sensory/hybrid-reply.js +1217 -0
- package/dist/sensory/reactions.d.ts +6 -0
- package/dist/sensory/reactions.js +10 -1
- package/dist/sensory/respond-decider.d.ts +124 -0
- package/dist/sensory/respond-decider.js +608 -0
- package/dist/sensory/rule-templates.d.ts +30 -0
- package/dist/sensory/rule-templates.js +100 -0
- package/dist/sensory/schedule-emitter.d.ts +24 -0
- package/dist/sensory/schedule-emitter.js +57 -0
- package/dist/sensory/screen-reaction.js +15 -1
- package/dist/sensory/semantic-vision-reaction.d.ts +36 -0
- package/dist/sensory/semantic-vision-reaction.js +342 -0
- package/dist/sensory/sensory-action-executor.d.ts +98 -0
- package/dist/sensory/sensory-action-executor.js +473 -0
- package/dist/sensory/sensory-bridge.d.ts +11 -1
- package/dist/sensory/sensory-bridge.js +59 -7
- package/dist/sensory/sensory-rules-engine.d.ts +81 -0
- package/dist/sensory/sensory-rules-engine.js +434 -0
- package/dist/sensory/sensory-status.d.ts +102 -0
- package/dist/sensory/sensory-status.js +291 -0
- package/dist/sensory/speech-engine-config.d.ts +68 -0
- package/dist/sensory/speech-engine-config.js +157 -0
- package/dist/sensory/speech-reaction.d.ts +183 -7
- package/dist/sensory/speech-reaction.js +2141 -35
- package/dist/sensory/speech-sanitizer.d.ts +12 -0
- package/dist/sensory/speech-sanitizer.js +143 -0
- package/dist/sensory/system-vitals-emitter.d.ts +130 -0
- package/dist/sensory/system-vitals-emitter.js +514 -0
- package/dist/sensory/tts-cache.d.ts +76 -0
- package/dist/sensory/tts-cache.js +0 -0
- package/dist/sensory/turn-detector.d.ts +28 -0
- package/dist/sensory/turn-detector.js +57 -0
- package/dist/sensory/vision-description-safety.d.ts +4 -0
- package/dist/sensory/vision-description-safety.js +25 -0
- package/dist/sensory/vision-reaction.d.ts +21 -7
- package/dist/sensory/vision-reaction.js +209 -18
- package/dist/sensory/voice-activity.d.ts +69 -0
- package/dist/sensory/voice-activity.js +271 -0
- package/dist/sensory/voice-clock.d.ts +19 -0
- package/dist/sensory/voice-clock.js +111 -0
- package/dist/sensory/voice-entrainment.d.ts +62 -0
- package/dist/sensory/voice-entrainment.js +176 -0
- package/dist/sensory/voice-interactions.d.ts +13 -0
- package/dist/sensory/voice-interactions.js +258 -0
- package/dist/sensory/voice-loop.d.ts +635 -0
- package/dist/sensory/voice-loop.js +3638 -0
- package/dist/sensory/voice-replay-lab.d.ts +32 -0
- package/dist/sensory/voice-replay-lab.js +109 -0
- package/dist/sensory/voice-stream.d.ts +121 -0
- package/dist/sensory/voice-stream.js +598 -0
- package/dist/sensory/voice-turn-coordinator.d.ts +88 -0
- package/dist/sensory/voice-turn-coordinator.js +258 -0
- package/dist/sensory/voice-turn-taking.d.ts +26 -0
- package/dist/sensory/voice-turn-taking.js +59 -0
- package/dist/server/agent-adapter.d.ts +49 -3
- package/dist/server/agent-adapter.js +26 -4
- package/dist/server/auth/device-session-context.d.ts +9 -0
- package/dist/server/auth/device-session-context.js +13 -0
- package/dist/server/auth/device-store.d.ts +89 -0
- package/dist/server/auth/device-store.js +261 -0
- package/dist/server/auth/device-token.d.ts +3 -0
- package/dist/server/auth/device-token.js +6 -0
- package/dist/server/auth/jwt.js +4 -0
- package/dist/server/channel-a2a-bridge.js +1 -1
- package/dist/server/exposure-diagnostic.d.ts +25 -0
- package/dist/server/exposure-diagnostic.js +51 -0
- package/dist/server/heartbeat-monitor.d.ts +13 -0
- package/dist/server/heartbeat-monitor.js +8 -3
- package/dist/server/http-agent-sessions.d.ts +32 -0
- package/dist/server/http-agent-sessions.js +245 -0
- package/dist/server/index.d.ts +3 -10
- package/dist/server/index.js +941 -46
- package/dist/server/mcp/approval-elicitation.d.ts +144 -0
- package/dist/server/mcp/approval-elicitation.js +377 -0
- package/dist/server/middleware/auth.d.ts +11 -0
- package/dist/server/middleware/auth.js +57 -2
- package/dist/server/middleware/error-handler.d.ts +5 -0
- package/dist/server/middleware/error-handler.js +30 -4
- package/dist/server/middleware/index.d.ts +1 -1
- package/dist/server/middleware/index.js +1 -1
- package/dist/server/mobile/album.d.ts +46 -0
- package/dist/server/mobile/album.js +144 -0
- package/dist/server/mobile/assets/app.js +3036 -0
- package/dist/server/mobile/assets/emoji-data.js +508 -0
- package/dist/server/mobile/assets/icon-192.png +0 -0
- package/dist/server/mobile/assets/icon-512.png +0 -0
- package/dist/server/mobile/assets/icon-96.png +0 -0
- package/dist/server/mobile/assets/icon.svg +12 -0
- package/dist/server/mobile/assets/index.html +261 -0
- package/dist/server/mobile/assets/manifest.webmanifest +37 -0
- package/dist/server/mobile/assets/styles.css +831 -0
- package/dist/server/mobile/assets/sw.js +149 -0
- package/dist/server/mobile/chat-extras.d.ts +9 -0
- package/dist/server/mobile/chat-extras.js +24 -0
- package/dist/server/mobile/index.d.ts +22 -0
- package/dist/server/mobile/index.js +287 -0
- package/dist/server/mobile/link-preview.d.ts +24 -0
- package/dist/server/mobile/link-preview.js +139 -0
- package/dist/server/mobile/push.d.ts +38 -0
- package/dist/server/mobile/push.js +190 -0
- package/dist/server/mobile/status.d.ts +23 -0
- package/dist/server/mobile/status.js +107 -0
- package/dist/server/mobile/telegram-forward.d.ts +14 -0
- package/dist/server/mobile/telegram-forward.js +32 -0
- package/dist/server/mobile/voice-note.d.ts +54 -0
- package/dist/server/mobile/voice-note.js +305 -0
- package/dist/server/origin-check.d.ts +4 -5
- package/dist/server/origin-check.js +43 -8
- package/dist/server/routes/a2a-jsonrpc.d.ts +9 -0
- package/dist/server/routes/a2a-jsonrpc.js +66 -0
- package/dist/server/routes/a2a-protocol.d.ts +12 -0
- package/dist/server/routes/a2a-protocol.js +1 -1
- package/dist/server/routes/canvas.d.ts +7 -1
- package/dist/server/routes/canvas.js +138 -24
- package/dist/server/routes/chat.js +340 -203
- package/dist/server/routes/cognition.d.ts +3 -0
- package/dist/server/routes/cognition.js +75 -0
- package/dist/server/routes/device-auth.d.ts +4 -0
- package/dist/server/routes/device-auth.js +40 -0
- package/dist/server/routes/health.js +93 -81
- package/dist/server/routes/index.d.ts +5 -1
- package/dist/server/routes/index.js +5 -1
- package/dist/server/routes/lessons.d.ts +13 -0
- package/dist/server/routes/lessons.js +111 -0
- package/dist/server/routes/memory.d.ts +12 -0
- package/dist/server/routes/memory.js +191 -131
- package/dist/server/routes/runs.d.ts +9 -0
- package/dist/server/routes/runs.js +50 -0
- package/dist/server/routes/sessions.js +8 -1
- package/dist/server/routes/tools.js +93 -74
- package/dist/server/routes/webhooks.js +56 -46
- package/dist/server/tunnel-manager.js +21 -1
- package/dist/server/types.d.ts +29 -1
- package/dist/server/webhook-agent-queue.d.ts +12 -0
- package/dist/server/webhook-agent-queue.js +58 -0
- package/dist/server/websocket/cognition-bridge.d.ts +13 -0
- package/dist/server/websocket/cognition-bridge.js +334 -0
- package/dist/server/websocket/confirmation-bridge.d.ts +22 -0
- package/dist/server/websocket/confirmation-bridge.js +178 -0
- package/dist/server/websocket/desktop-handler.d.ts +17 -0
- package/dist/server/websocket/desktop-handler.js +177 -16
- package/dist/server/websocket/handler.d.ts +136 -1
- package/dist/server/websocket/handler.js +942 -72
- package/dist/server/websocket/index.d.ts +2 -1
- package/dist/server/websocket/index.js +2 -1
- package/dist/server/websocket/peer-rpc.d.ts +1 -1
- package/dist/server/websocket/peer-rpc.js +25 -3
- package/dist/services/prompt-builder.d.ts +49 -2
- package/dist/services/prompt-builder.js +318 -99
- package/dist/services/runtime-settings-context.d.ts +73 -0
- package/dist/services/runtime-settings-context.js +69 -0
- package/dist/sessions/timeline-snapshot.d.ts +35 -0
- package/dist/sessions/timeline-snapshot.js +144 -0
- package/dist/sessions/timeline.d.ts +33 -0
- package/dist/sessions/timeline.js +85 -0
- package/dist/shared/context-optimization-metadata.d.ts +29 -0
- package/dist/shared/context-optimization-metadata.js +73 -0
- package/dist/shared/engine-types.d.ts +26 -0
- package/dist/skills/bash-injection.d.ts +2 -2
- package/dist/skills/bash-injection.js +9 -2
- package/dist/skills/bundled/code-explorer.skill.md +50 -0
- package/dist/skills/bundled/file-edit.skill.md +62 -0
- package/dist/skills/bundled/git-commit.skill.md +66 -0
- package/dist/skills/bundled/pubcommander-control/SKILL.md +33 -0
- package/dist/skills/bundled/pubcommander-control/agents/openai.yaml +4 -0
- package/dist/skills/bundled/typescript-expert.skill.md +21 -0
- package/dist/skills/bundled/weather.skill.md +48 -0
- package/dist/skills/bundled/web-app-testing.skill.md +71 -0
- package/dist/skills/bundled/web-search.skill.md +56 -0
- package/dist/skills/executor.js +2 -0
- package/dist/skills/hub.js +68 -44
- package/dist/skills/index.d.ts +6 -3
- package/dist/skills/index.js +19 -4
- package/dist/skills/local-inventory.d.ts +21 -0
- package/dist/skills/local-inventory.js +72 -0
- package/dist/skills/parser.js +2 -0
- package/dist/skills/registry.d.ts +52 -0
- package/dist/skills/registry.js +291 -14
- package/dist/skills/skill-exchange.d.ts +61 -0
- package/dist/skills/skill-exchange.js +523 -0
- package/dist/skills/skill-importer.d.ts +2 -2
- package/dist/skills/skill-importer.js +76 -17
- package/dist/skills/skill-loader.js +2 -2
- package/dist/skills/skill-registry.js +3 -2
- package/dist/skills/skill-signing.d.ts +20 -0
- package/dist/skills/skill-signing.js +106 -0
- package/dist/skills/skill-sources.d.ts +3 -2
- package/dist/skills/skill-sources.js +5 -4
- package/dist/skills/skill-usage-store.d.ts +49 -0
- package/dist/skills/skill-usage-store.js +121 -0
- package/dist/skills/types.d.ts +4 -0
- package/dist/spec/spec-store.js +7 -6
- package/dist/speculative/shadow-workspace.d.ts +79 -0
- package/dist/speculative/shadow-workspace.js +500 -0
- package/dist/talk-mode/index.d.ts +4 -4
- package/dist/talk-mode/index.js +3 -3
- package/dist/talk-mode/providers/elevenlabs-client.d.ts +48 -0
- package/dist/talk-mode/providers/elevenlabs-client.js +117 -0
- package/dist/talk-mode/providers/elevenlabs.js +12 -23
- package/dist/talk-mode/providers/index.d.ts +3 -1
- package/dist/talk-mode/providers/index.js +2 -0
- package/dist/talk-mode/providers/pocket-tts.d.ts +88 -0
- package/dist/talk-mode/providers/pocket-tts.js +334 -0
- package/dist/talk-mode/providers/voicebox-tts.d.ts +24 -0
- package/dist/talk-mode/providers/voicebox-tts.js +120 -0
- package/dist/talk-mode/types.d.ts +39 -1
- package/dist/tasks/background-tasks.js +22 -5
- package/dist/telemetry/otel-tracer.js +5 -2
- package/dist/templates/design-system-apply.d.ts +23 -0
- package/dist/templates/design-system-apply.js +100 -0
- package/dist/templates/project-scaffolding.d.ts +2 -0
- package/dist/templates/project-scaffolding.js +616 -1
- package/dist/testing/ai-integration-tests.js +8 -5
- package/dist/themes/theme-manager.d.ts +12 -0
- package/dist/themes/theme-manager.js +38 -6
- package/dist/themes/theme-schema.d.ts +42 -42
- package/dist/tools/a2a-call-tool.d.ts +34 -0
- package/dist/tools/a2a-call-tool.js +75 -0
- package/dist/tools/advanced/multi-file-editor.js +3 -1
- package/dist/tools/advanced/operation-history.js +2 -1
- package/dist/tools/app-server-tool.d.ts +66 -0
- package/dist/tools/app-server-tool.js +423 -0
- package/dist/tools/apply-patch.d.ts +31 -1
- package/dist/tools/apply-patch.js +214 -19
- package/dist/tools/authored-tools-manifest-2.d.ts +17 -0
- package/dist/tools/authored-tools-manifest-2.js +133 -0
- package/dist/tools/authored-tools-manifest.d.ts +15 -0
- package/dist/tools/authored-tools-manifest.js +13 -0
- package/dist/tools/bash/bash-tool.d.ts +36 -3
- package/dist/tools/bash/bash-tool.js +240 -100
- package/dist/tools/bash/command-validator.d.ts +1 -1
- package/dist/tools/bash/command-validator.js +115 -40
- package/dist/tools/bash/execution-policy.d.ts +42 -0
- package/dist/tools/bash/execution-policy.js +278 -0
- package/dist/tools/bash/security-patterns.js +43 -5
- package/dist/tools/bash/streaming-executor.d.ts +2 -1
- package/dist/tools/bash/streaming-executor.js +172 -78
- package/dist/tools/build-project-tool.d.ts +25 -0
- package/dist/tools/build-project-tool.js +30 -0
- package/dist/tools/bundle-analyze-tool.d.ts +28 -0
- package/dist/tools/bundle-analyze-tool.js +39 -0
- package/dist/tools/code-exec-preflight-runner.d.ts +41 -0
- package/dist/tools/code-exec-preflight-runner.js +254 -0
- package/dist/tools/code-exec-preflight.d.ts +44 -0
- package/dist/tools/code-exec-preflight.js +501 -0
- package/dist/tools/code-exec-tool.d.ts +102 -23
- package/dist/tools/code-exec-tool.js +741 -110
- package/dist/tools/code-explorer-tool.d.ts +1 -1
- package/dist/tools/code-explorer-tool.js +25 -1
- package/dist/tools/code-review.js +5 -0
- package/dist/tools/code-stats-tool.d.ts +43 -0
- package/dist/tools/code-stats-tool.js +70 -0
- package/dist/tools/codebase-replace-tool.js +2 -2
- package/dist/tools/comfy-recipe-tool.d.ts +37 -0
- package/dist/tools/comfy-recipe-tool.js +693 -0
- package/dist/tools/comment-watcher.js +29 -12
- package/dist/tools/community-search.d.ts +93 -0
- package/dist/tools/community-search.js +334 -0
- package/dist/tools/computer-control-harness.js +5 -2
- package/dist/tools/computer-control-tool.d.ts +8 -0
- package/dist/tools/computer-control-tool.js +71 -26
- package/dist/tools/context-expand-tool.d.ts +19 -0
- package/dist/tools/context-expand-tool.js +132 -0
- package/dist/tools/core-code-inspection.d.ts +56 -0
- package/dist/tools/core-code-inspection.js +86 -0
- package/dist/tools/create-skill-tool.d.ts +2 -3
- package/dist/tools/create-skill-tool.js +16 -75
- package/dist/tools/cronjob-tool.d.ts +1 -0
- package/dist/tools/cronjob-tool.js +1 -0
- package/dist/tools/csv/csv-parse.d.ts +19 -0
- package/dist/tools/csv/csv-parse.js +132 -0
- package/dist/tools/csv/csv-wiring.d.ts +8 -0
- package/dist/tools/csv/csv-wiring.js +9 -0
- package/dist/tools/csv-analyze-tool.d.ts +11 -0
- package/dist/tools/csv-analyze-tool.js +114 -0
- package/dist/tools/csv-preview-tool.d.ts +34 -0
- package/dist/tools/csv-preview-tool.js +69 -0
- package/dist/tools/db-migration.js +11 -3
- package/dist/tools/deep-research-tool.d.ts +68 -0
- package/dist/tools/deep-research-tool.js +257 -0
- package/dist/tools/deferred-schema-state.d.ts +19 -0
- package/dist/tools/deferred-schema-state.js +33 -0
- package/dist/tools/dep-inspect-tool.d.ts +32 -0
- package/dist/tools/dep-inspect-tool.js +74 -0
- package/dist/tools/design-system-tool.d.ts +10 -0
- package/dist/tools/design-system-tool.js +95 -0
- package/dist/tools/device-tool.d.ts +2 -1
- package/dist/tools/device-tool.js +21 -0
- package/dist/tools/diagram-tool.js +8 -2
- package/dist/tools/diff-files-tool.d.ts +28 -0
- package/dist/tools/diff-files-tool.js +49 -0
- package/dist/tools/enhanced-search.js +32 -16
- package/dist/tools/env-doctor-tool.d.ts +32 -0
- package/dist/tools/env-doctor-tool.js +55 -0
- package/dist/tools/execute-code-rpc-invoker.d.ts +1 -1
- package/dist/tools/execute-code-rpc-invoker.js +36 -20
- package/dist/tools/execute-code-runner.d.ts +23 -0
- package/dist/tools/execute-code-runner.js +169 -25
- package/dist/tools/extension-forge-tool.d.ts +29 -0
- package/dist/tools/extension-forge-tool.js +288 -0
- package/dist/tools/fetch-tool.js +7 -3
- package/dist/tools/file-search-tool.d.ts +41 -0
- package/dist/tools/file-search-tool.js +99 -0
- package/dist/tools/fleet-room-tool.d.ts +104 -0
- package/dist/tools/fleet-room-tool.js +124 -0
- package/dist/tools/format-project-tool.d.ts +28 -0
- package/dist/tools/format-project-tool.js +45 -0
- package/dist/tools/git-summary-tool.d.ts +36 -0
- package/dist/tools/git-summary-tool.js +65 -0
- package/dist/tools/git-tool.js +16 -4
- package/dist/tools/gpu-avatar-delivery.d.ts +16 -0
- package/dist/tools/gpu-avatar-delivery.js +67 -0
- package/dist/tools/gpu-media-worker.d.ts +96 -0
- package/dist/tools/gpu-media-worker.js +363 -0
- package/dist/tools/gui-tool.js +92 -13
- package/dist/tools/http-probe-tool.d.ts +25 -0
- package/dist/tools/http-probe-tool.js +40 -0
- package/dist/tools/image-tool.js +29 -16
- package/dist/tools/index.d.ts +6 -1
- package/dist/tools/index.js +5 -0
- package/dist/tools/integration-tool-hints.d.ts +4 -0
- package/dist/tools/integration-tool-hints.js +19 -0
- package/dist/tools/interactive-bash.d.ts +29 -1
- package/dist/tools/interactive-bash.js +141 -21
- package/dist/tools/json-query-tool.d.ts +30 -0
- package/dist/tools/json-query-tool.js +49 -0
- package/dist/tools/license-check-tool.d.ts +22 -0
- package/dist/tools/license-check-tool.js +43 -0
- package/dist/tools/lint-project-tool.d.ts +52 -0
- package/dist/tools/lint-project-tool.js +143 -0
- package/dist/tools/list-peers-tool.d.ts +3 -0
- package/dist/tools/list-peers-tool.js +11 -4
- package/dist/tools/local-binary-launch.d.ts +14 -0
- package/dist/tools/local-binary-launch.js +63 -0
- package/dist/tools/lsp-navigation-tools.d.ts +87 -0
- package/dist/tools/lsp-navigation-tools.js +470 -0
- package/dist/tools/markdown-convert.d.ts +51 -0
- package/dist/tools/markdown-convert.js +159 -0
- package/dist/tools/media-generation-tool.d.ts +105 -1
- package/dist/tools/media-generation-tool.js +1892 -18
- package/dist/tools/meeting-notes-tool.d.ts +25 -0
- package/dist/tools/meeting-notes-tool.js +240 -0
- package/dist/tools/merge-conflict-tool.js +54 -26
- package/dist/tools/metadata.d.ts +3 -1
- package/dist/tools/metadata.js +819 -16
- package/dist/tools/mixture-of-agents-tool.d.ts +7 -0
- package/dist/tools/mixture-of-agents-tool.js +230 -31
- package/dist/tools/multi-edit.js +42 -18
- package/dist/tools/ocr-tool.d.ts +43 -0
- package/dist/tools/ocr-tool.js +24 -18
- package/dist/tools/omission-placeholder-detector.js +12 -6
- package/dist/tools/paper-qa-tool.d.ts +73 -0
- package/dist/tools/paper-qa-tool.js +313 -0
- package/dist/tools/peer-chain-tool.js +4 -1
- package/dist/tools/peer-delegate-tool.d.ts +2 -0
- package/dist/tools/peer-delegate-tool.js +11 -1
- package/dist/tools/port-check-tool.d.ts +31 -0
- package/dist/tools/port-check-tool.js +25 -0
- package/dist/tools/project-map-tool.d.ts +39 -0
- package/dist/tools/project-map-tool.js +128 -0
- package/dist/tools/ragchat-tool.d.ts +39 -0
- package/dist/tools/ragchat-tool.js +105 -0
- package/dist/tools/register-tool-handler.d.ts +2 -2
- package/dist/tools/register-tool-handler.js +7 -4
- package/dist/tools/registry/advanced-tools.js +1 -1
- package/dist/tools/registry/attention-tools.d.ts +3 -3
- package/dist/tools/registry/attention-tools.js +14 -10
- package/dist/tools/registry/authored-extra-tools.d.ts +20 -0
- package/dist/tools/registry/authored-extra-tools.js +147 -0
- package/dist/tools/registry/bash-tools.d.ts +2 -2
- package/dist/tools/registry/bash-tools.js +7 -3
- package/dist/tools/registry/browser-operator-tools.d.ts +1 -1
- package/dist/tools/registry/browser-operator-tools.js +17 -3
- package/dist/tools/registry/browser-tools.d.ts +1 -1
- package/dist/tools/registry/browser-tools.js +38 -33
- package/dist/tools/registry/code-explorer-tools.js +6 -1
- package/dist/tools/registry/comfy-recipe-tools.d.ts +2 -0
- package/dist/tools/registry/comfy-recipe-tools.js +5 -0
- package/dist/tools/registry/context-expand-tools.d.ts +3 -0
- package/dist/tools/registry/context-expand-tools.js +6 -0
- package/dist/tools/registry/csv-tools.d.ts +12 -0
- package/dist/tools/registry/csv-tools.js +62 -0
- package/dist/tools/registry/delegate-agent-tools.d.ts +64 -0
- package/dist/tools/registry/delegate-agent-tools.js +206 -0
- package/dist/tools/registry/design-tools.d.ts +12 -0
- package/dist/tools/registry/design-tools.js +80 -0
- package/dist/tools/registry/fleet-tools.d.ts +9 -0
- package/dist/tools/registry/fleet-tools.js +28 -1
- package/dist/tools/registry/index.d.ts +25 -5
- package/dist/tools/registry/index.js +80 -6
- package/dist/tools/registry/interactive-adapters.d.ts +37 -0
- package/dist/tools/registry/interactive-adapters.js +116 -0
- package/dist/tools/registry/knowledge-tools.d.ts +2 -2
- package/dist/tools/registry/knowledge-tools.js +2 -2
- package/dist/tools/registry/lessons-tools.d.ts +7 -0
- package/dist/tools/registry/lessons-tools.js +43 -3
- package/dist/tools/registry/lsp-tools.d.ts +3 -3
- package/dist/tools/registry/lsp-tools.js +9 -3
- package/dist/tools/registry/meeting-tools.d.ts +3 -0
- package/dist/tools/registry/meeting-tools.js +6 -0
- package/dist/tools/registry/memory-tools.d.ts +1 -1
- package/dist/tools/registry/memory-tools.js +40 -28
- package/dist/tools/registry/misc-tools.d.ts +1 -1
- package/dist/tools/registry/misc-tools.js +7 -4
- package/dist/tools/registry/moa-tools.js +13 -0
- package/dist/tools/registry/multimodal-tools.d.ts +73 -1
- package/dist/tools/registry/multimodal-tools.js +581 -4
- package/dist/tools/registry/process-tools.d.ts +16 -0
- package/dist/tools/registry/process-tools.js +136 -1
- package/dist/tools/registry/remind-tools.d.ts +23 -0
- package/dist/tools/registry/remind-tools.js +120 -0
- package/dist/tools/registry/research-tools.d.ts +18 -0
- package/dist/tools/registry/research-tools.js +12 -0
- package/dist/tools/registry/search-tools.d.ts +6 -6
- package/dist/tools/registry/search-tools.js +30 -17
- package/dist/tools/registry/secrets-tools.d.ts +33 -0
- package/dist/tools/registry/secrets-tools.js +71 -0
- package/dist/tools/registry/self-describe-tools.d.ts +23 -0
- package/dist/tools/registry/self-describe-tools.js +169 -0
- package/dist/tools/registry/self-evolution-tools.d.ts +13 -0
- package/dist/tools/registry/self-evolution-tools.js +97 -0
- package/dist/tools/registry/text-editor-tools.d.ts +26 -4
- package/dist/tools/registry/text-editor-tools.js +102 -6
- package/dist/tools/registry/tool-alias-map.d.ts +8 -0
- package/dist/tools/registry/tool-alias-map.js +47 -0
- package/dist/tools/registry/tool-aliases.d.ts +3 -4
- package/dist/tools/registry/tool-aliases.js +12 -48
- package/dist/tools/registry/types.d.ts +5 -0
- package/dist/tools/registry/verify-tools.d.ts +50 -0
- package/dist/tools/registry/verify-tools.js +136 -0
- package/dist/tools/registry/video-studio-tools.d.ts +13 -0
- package/dist/tools/registry/video-studio-tools.js +21 -0
- package/dist/tools/registry/vision-tools.d.ts +15 -1
- package/dist/tools/registry/vision-tools.js +252 -27
- package/dist/tools/registry/web-test-tool.d.ts +66 -0
- package/dist/tools/registry/web-test-tool.js +321 -0
- package/dist/tools/registry/web-tools.d.ts +43 -0
- package/dist/tools/registry/web-tools.js +281 -1
- package/dist/tools/resource-catalog-tool.d.ts +38 -0
- package/dist/tools/resource-catalog-tool.js +46 -0
- package/dist/tools/review-gate-helper.d.ts +44 -0
- package/dist/tools/review-gate-helper.js +110 -0
- package/dist/tools/route-peer-tool.js +62 -11
- package/dist/tools/sbom-generate-tool.d.ts +22 -0
- package/dist/tools/sbom-generate-tool.js +41 -0
- package/dist/tools/scaffold-app-tool.d.ts +48 -0
- package/dist/tools/scaffold-app-tool.js +144 -0
- package/dist/tools/screenshot-tool.js +5 -2
- package/dist/tools/search.d.ts +17 -0
- package/dist/tools/search.js +31 -8
- package/dist/tools/self-describe.d.ts +73 -0
- package/dist/tools/self-describe.js +298 -0
- package/dist/tools/skills-inspection-tool.js +30 -1
- package/dist/tools/stock-quote.d.ts +67 -0
- package/dist/tools/stock-quote.js +645 -0
- package/dist/tools/stream-tool-output.d.ts +3 -0
- package/dist/tools/stream-tool-output.js +33 -0
- package/dist/tools/submit-plan-tool.js +1 -1
- package/dist/tools/test-runner-tool.d.ts +38 -0
- package/dist/tools/test-runner-tool.js +96 -0
- package/dist/tools/text-editor.js +91 -8
- package/dist/tools/text-to-speech-tool.d.ts +1 -1
- package/dist/tools/text-to-speech-tool.js +48 -2
- package/dist/tools/todo-scan-tool.d.ts +39 -0
- package/dist/tools/todo-scan-tool.js +53 -0
- package/dist/tools/tool-call-scheduler.d.ts +10 -0
- package/dist/tools/tool-call-scheduler.js +58 -0
- package/dist/tools/tool-effect.d.ts +5 -0
- package/dist/tools/tool-effect.js +26 -0
- package/dist/tools/tool-manager.js +8 -0
- package/dist/tools/tool-search.d.ts +12 -11
- package/dist/tools/tool-search.js +77 -28
- package/dist/tools/tool-selector.d.ts +7 -0
- package/dist/tools/tool-selector.js +27 -13
- package/dist/tools/tools-md-generator.js +2 -2
- package/dist/tools/types.d.ts +22 -0
- package/dist/tools/types.js +5 -1
- package/dist/tools/video/approved-media-source.d.ts +8 -0
- package/dist/tools/video/approved-media-source.js +59 -0
- package/dist/tools/video/book-manuscript-source.d.ts +49 -0
- package/dist/tools/video/book-manuscript-source.js +263 -0
- package/dist/tools/video/character-in-location.d.ts +42 -0
- package/dist/tools/video/character-in-location.js +161 -0
- package/dist/tools/video/cinematic-trailer-plan.d.ts +203 -0
- package/dist/tools/video/cinematic-trailer-plan.js +498 -0
- package/dist/tools/video/cloud-understand.d.ts +91 -0
- package/dist/tools/video/cloud-understand.js +214 -0
- package/dist/tools/video/comfy-client.d.ts +38 -0
- package/dist/tools/video/comfy-client.js +227 -0
- package/dist/tools/video/comfy-workflow-template.d.ts +70 -0
- package/dist/tools/video/comfy-workflow-template.js +194 -0
- package/dist/tools/video/describe-frame.d.ts +36 -0
- package/dist/tools/video/describe-frame.js +68 -0
- package/dist/tools/video/film-assemble.d.ts +234 -0
- package/dist/tools/video/film-assemble.js +959 -0
- package/dist/tools/video/film-project.d.ts +152 -0
- package/dist/tools/video/film-project.js +312 -0
- package/dist/tools/video/frame-dedup.d.ts +46 -0
- package/dist/tools/video/frame-dedup.js +110 -0
- package/dist/tools/video/frame-sample.d.ts +72 -0
- package/dist/tools/video/frame-sample.js +238 -0
- package/dist/tools/video/google-flow-driver.d.ts +131 -0
- package/dist/tools/video/google-flow-driver.js +312 -0
- package/dist/tools/video/google-flow-handoff.d.ts +75 -0
- package/dist/tools/video/google-flow-handoff.js +121 -0
- package/dist/tools/video/google-flow-plan-export.d.ts +21 -0
- package/dist/tools/video/google-flow-plan-export.js +123 -0
- package/dist/tools/video/google-flow-result-import.d.ts +92 -0
- package/dist/tools/video/google-flow-result-import.js +297 -0
- package/dist/tools/video/hybrid-video-router.d.ts +34 -0
- package/dist/tools/video/hybrid-video-router.js +113 -0
- package/dist/tools/video/localized-media.d.ts +50 -0
- package/dist/tools/video/localized-media.js +128 -0
- package/dist/tools/video/long-form-plan.d.ts +37 -0
- package/dist/tools/video/long-form-plan.js +83 -0
- package/dist/tools/video/long-form-production.d.ts +49 -0
- package/dist/tools/video/long-form-production.js +168 -0
- package/dist/tools/video/long-transcribe.d.ts +94 -0
- package/dist/tools/video/long-transcribe.js +206 -0
- package/dist/tools/video/media-fetch.d.ts +94 -0
- package/dist/tools/video/media-fetch.js +311 -0
- package/dist/tools/video/mermaid-render.d.ts +34 -0
- package/dist/tools/video/mermaid-render.js +127 -0
- package/dist/tools/video/narration.d.ts +96 -0
- package/dist/tools/video/narration.js +505 -0
- package/dist/tools/video/native-fashion-defects.d.ts +27 -0
- package/dist/tools/video/native-fashion-defects.js +80 -0
- package/dist/tools/video/scene-render.d.ts +108 -0
- package/dist/tools/video/scene-render.js +418 -0
- package/dist/tools/video/subtitles.d.ts +49 -0
- package/dist/tools/video/subtitles.js +116 -0
- package/dist/tools/video/video-ckg.d.ts +123 -0
- package/dist/tools/video/video-ckg.js +188 -0
- package/dist/tools/video/video-research-card.d.ts +58 -0
- package/dist/tools/video/video-research-card.js +468 -0
- package/dist/tools/video/video-understanding.d.ts +159 -0
- package/dist/tools/video/video-understanding.js +534 -0
- package/dist/tools/video/visual-gate-report.d.ts +139 -0
- package/dist/tools/video/visual-gate-report.js +379 -0
- package/dist/tools/video/voice-rights-registry.d.ts +13 -0
- package/dist/tools/video/voice-rights-registry.js +142 -0
- package/dist/tools/video/youtube-captions.d.ts +51 -0
- package/dist/tools/video/youtube-captions.js +102 -0
- package/dist/tools/video/youtube-master-quality.d.ts +163 -0
- package/dist/tools/video/youtube-master-quality.js +379 -0
- package/dist/tools/video/youtube-storyboard.d.ts +43 -0
- package/dist/tools/video/youtube-storyboard.js +194 -0
- package/dist/tools/video-flow-handoff-tool.d.ts +181 -0
- package/dist/tools/video-flow-handoff-tool.js +261 -0
- package/dist/tools/video-long-form-plan-tool.d.ts +31 -0
- package/dist/tools/video-long-form-plan-tool.js +87 -0
- package/dist/tools/video-quality-gate-tool.d.ts +97 -0
- package/dist/tools/video-quality-gate-tool.js +189 -0
- package/dist/tools/video-route-tool.d.ts +128 -0
- package/dist/tools/video-route-tool.js +126 -0
- package/dist/tools/video-studio-tool-helpers.d.ts +22 -0
- package/dist/tools/video-studio-tool-helpers.js +128 -0
- package/dist/tools/video-trailer-plan-tool.d.ts +60 -0
- package/dist/tools/video-trailer-plan-tool.js +103 -0
- package/dist/tools/vision/blender-render.d.ts +76 -0
- package/dist/tools/vision/blender-render.js +121 -0
- package/dist/tools/vision/image-processor.d.ts +1 -0
- package/dist/tools/vision/image-processor.js +8 -1
- package/dist/tools/vision/load-sharp.d.ts +53 -0
- package/dist/tools/vision/load-sharp.js +48 -0
- package/dist/tools/vision/mean-luma.d.ts +4 -0
- package/dist/tools/vision/mean-luma.js +189 -0
- package/dist/tools/vision/object-detection.d.ts +90 -0
- package/dist/tools/vision/object-detection.js +403 -0
- package/dist/tools/vision/vision-analysis.js +2 -1
- package/dist/tools/weather.d.ts +33 -0
- package/dist/tools/weather.js +183 -0
- package/dist/tools/web-scrape-tool.d.ts +63 -0
- package/dist/tools/web-scrape-tool.js +318 -0
- package/dist/tools/web-search.d.ts +67 -6
- package/dist/tools/web-search.js +231 -68
- package/dist/tools/workspace-tools.d.ts +39 -0
- package/dist/tools/workspace-tools.js +347 -0
- package/dist/tracks/track-manager.js +9 -8
- package/dist/triggers/webhook-trigger.js +10 -18
- package/dist/ui/components/ChatHistory.d.ts +1 -1
- package/dist/ui/components/ChatHistory.js +14 -2
- package/dist/ui/components/ChatInput.d.ts +2 -1
- package/dist/ui/components/ChatInput.js +42 -88
- package/dist/ui/components/ChatInterface.d.ts +4 -2
- package/dist/ui/components/ChatInterface.js +32 -64
- package/dist/ui/components/CommandSuggestions.d.ts +0 -1
- package/dist/ui/components/CommandSuggestions.js +4 -6
- package/dist/ui/components/FileAutocomplete.d.ts +6 -1
- package/dist/ui/components/FileAutocomplete.js +137 -77
- package/dist/ui/components/FuzzyPicker.d.ts +5 -0
- package/dist/ui/components/FuzzyPicker.js +1 -1
- package/dist/ui/components/KeyboardHelp.js +8 -6
- package/dist/ui/components/ModelSelection.js +6 -5
- package/dist/ui/components/StatusBar.d.ts +2 -1
- package/dist/ui/components/StatusBar.js +8 -7
- package/dist/ui/context/theme-context.js +3 -2
- package/dist/ui/http-server/server.js +2 -2
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui/utils/markdown-renderer.js +4 -13
- package/dist/undo/checkpoint-manager.d.ts +3 -0
- package/dist/undo/checkpoint-manager.js +6 -1
- package/dist/utils/approval-pattern-tracker.js +5 -13
- package/dist/utils/ascii-banner.d.ts +1 -1
- package/dist/utils/ascii-banner.js +1 -1
- package/dist/utils/atomic-write.d.ts +99 -0
- package/dist/utils/atomic-write.js +559 -0
- package/dist/utils/audio-player.d.ts +1 -0
- package/dist/utils/audio-player.js +7 -3
- package/dist/utils/autonomy-manager.js +12 -3
- package/dist/utils/bounded-output.d.ts +16 -0
- package/dist/utils/bounded-output.js +63 -0
- package/dist/utils/command-exists.d.ts +14 -0
- package/dist/utils/command-exists.js +43 -0
- package/dist/utils/config-validation/schema.d.ts +13 -13
- package/dist/utils/config-validation/schema.js +33 -1
- package/dist/utils/confirmation-service.d.ts +60 -1
- package/dist/utils/confirmation-service.js +204 -41
- package/dist/utils/cost-tracker.d.ts +66 -1
- package/dist/utils/cost-tracker.js +100 -17
- package/dist/utils/device-store-file.d.ts +4 -0
- package/dist/utils/device-store-file.js +40 -0
- package/dist/utils/export-manager.d.ts +9 -0
- package/dist/utils/export-manager.js +19 -0
- package/dist/utils/first-use-hints.d.ts +25 -0
- package/dist/utils/first-use-hints.js +58 -0
- package/dist/utils/history-manager.js +7 -8
- package/dist/utils/init-project.js +17 -13
- package/dist/utils/input-validation/index.d.ts +16 -16
- package/dist/utils/installation-id.js +7 -22
- package/dist/utils/interactive-setup.js +7 -12
- package/dist/utils/json-salvage.d.ts +22 -0
- package/dist/utils/json-salvage.js +91 -0
- package/dist/utils/llm-retry.js +3 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.js +16 -5
- package/dist/utils/model-router.js +8 -12
- package/dist/utils/model-utils.js +14 -0
- package/dist/utils/output-sanitizer.d.ts +4 -8
- package/dist/utils/output-sanitizer.js +10 -10
- package/dist/utils/output-schema-validator.d.ts +7 -0
- package/dist/utils/output-schema-validator.js +25 -1
- package/dist/utils/response-cache.js +11 -22
- package/dist/utils/ripgrep-path.d.ts +11 -0
- package/dist/utils/ripgrep-path.js +60 -0
- package/dist/utils/semantic-cache.js +4 -7
- package/dist/utils/settings-manager.d.ts +27 -4
- package/dist/utils/settings-manager.js +51 -39
- package/dist/utils/shell-completions.js +25 -34
- package/dist/utils/shell-configuration.d.ts +39 -0
- package/dist/utils/shell-configuration.js +106 -0
- package/dist/utils/stream-stall-guard.d.ts +39 -0
- package/dist/utils/stream-stall-guard.js +123 -0
- package/dist/utils/subprocess-env.d.ts +15 -0
- package/dist/utils/subprocess-env.js +112 -0
- package/dist/utils/telegram-api-base.d.ts +9 -0
- package/dist/utils/telegram-api-base.js +15 -0
- package/dist/utils/telemetry-config.js +16 -13
- package/dist/utils/update-notifier.js +20 -27
- package/dist/utils/validators.js +1 -2
- package/dist/versioning/config-migrator.js +3 -2
- package/dist/versioning/migration-manager.js +5 -4
- package/dist/versioning/version-detector.js +2 -1
- package/dist/vision-train/assets.d.ts +37 -0
- package/dist/vision-train/assets.js +97 -0
- package/dist/vision-train/ckg-publish.d.ts +26 -0
- package/dist/vision-train/ckg-publish.js +36 -0
- package/dist/vision-train/coco-to-labels.d.ts +63 -0
- package/dist/vision-train/coco-to-labels.js +63 -0
- package/dist/vision-train/curriculum.d.ts +29 -0
- package/dist/vision-train/curriculum.js +49 -0
- package/dist/vision-train/engine.d.ts +56 -0
- package/dist/vision-train/engine.js +55 -0
- package/dist/vision-train/report.d.ts +15 -0
- package/dist/vision-train/report.js +72 -0
- package/dist/vision-train/scorer.d.ts +67 -0
- package/dist/vision-train/scorer.js +114 -0
- package/dist/vision-train/yolo-labels.d.ts +13 -0
- package/dist/vision-train/yolo-labels.js +66 -0
- package/dist/voice/elevenlabs-voice.d.ts +53 -0
- package/dist/voice/elevenlabs-voice.js +412 -0
- package/dist/voice/kyutai-local-voice.d.ts +33 -0
- package/dist/voice/kyutai-local-voice.js +198 -0
- package/dist/voice/local-tts.d.ts +106 -3
- package/dist/voice/local-tts.js +672 -35
- package/dist/voice/local-whisper.d.ts +11 -0
- package/dist/voice/local-whisper.js +18 -2
- package/dist/voice/pcm-edges.d.ts +43 -0
- package/dist/voice/pcm-edges.js +210 -0
- package/dist/voice/perceived-latency-benchmark.d.ts +56 -0
- package/dist/voice/perceived-latency-benchmark.js +218 -0
- package/dist/voice/tts-bank.d.ts +72 -0
- package/dist/voice/tts-bank.js +172 -0
- package/dist/voice/tts-latency-benchmark.d.ts +36 -0
- package/dist/voice/tts-latency-benchmark.js +76 -0
- package/dist/voice/tts-volume.d.ts +86 -0
- package/dist/voice/tts-volume.js +378 -0
- package/dist/voice/two-speed-voice.d.ts +19 -0
- package/dist/voice/two-speed-voice.js +40 -0
- package/dist/voice/voice-to-code.js +1 -1
- package/dist/voice/voicebox-tts.d.ts +150 -0
- package/dist/voice/voicebox-tts.js +669 -0
- package/dist/voice/wake-word.d.ts +2 -0
- package/dist/voice/wake-word.js +30 -10
- package/dist/webhooks/webhook-manager.js +10 -18
- package/dist/widgets/auto-widget.d.ts +27 -0
- package/dist/widgets/auto-widget.js +111 -0
- package/dist/widgets/canvas-publish.d.ts +15 -0
- package/dist/widgets/canvas-publish.js +39 -0
- package/dist/widgets/curated/news.d.ts +2 -0
- package/dist/widgets/curated/news.js +46 -0
- package/dist/widgets/curated/stock.d.ts +1 -0
- package/dist/widgets/curated/stock.js +87 -0
- package/dist/widgets/curated/weather.d.ts +2 -0
- package/dist/widgets/curated/weather.js +93 -0
- package/dist/widgets/template-engine.d.ts +19 -0
- package/dist/widgets/template-engine.js +134 -0
- package/dist/widgets/widget-engine.d.ts +24 -0
- package/dist/widgets/widget-engine.js +153 -0
- package/dist/widgets/widget-gate.d.ts +19 -0
- package/dist/widgets/widget-gate.js +144 -0
- package/dist/widgets/widget-image-renderer.d.ts +4 -0
- package/dist/widgets/widget-image-renderer.js +164 -0
- package/dist/widgets/widget-matcher.d.ts +48 -0
- package/dist/widgets/widget-matcher.js +109 -0
- package/dist/widgets/widget-proposer.d.ts +17 -0
- package/dist/widgets/widget-proposer.js +75 -0
- package/dist/widgets/widget-registry.d.ts +36 -0
- package/dist/widgets/widget-registry.js +231 -0
- package/dist/widgets/widget-types.d.ts +100 -0
- package/dist/widgets/widget-types.js +17 -0
- package/dist/wizard/environment-detection.d.ts +71 -0
- package/dist/wizard/environment-detection.js +252 -0
- package/dist/wizard/onboarding.d.ts +26 -2
- package/dist/wizard/onboarding.js +284 -49
- package/dist/wizard/provider-onboarding.d.ts +2 -0
- package/dist/wizard/provider-onboarding.js +55 -17
- package/dist/workflows/state-manager.js +8 -2
- package/dist/workspace/workspace-config.d.ts +37 -0
- package/dist/workspace/workspace-config.js +199 -0
- package/dist/workspace/workspace-isolation.d.ts +19 -0
- package/dist/workspace/workspace-isolation.js +124 -39
- package/dist/workspace/workspace-manager.js +19 -14
- package/examples/claude_desktop_config.json +8 -0
- package/package.json +80 -32
- package/.codebuddy/README.md +0 -65
- package/dist/agent/middleware/learning-first-middleware.d.ts +0 -79
- package/dist/agent/middleware/learning-first-middleware.js +0 -271
- package/dist/agent/middleware/tool-filter-middleware.d.ts +0 -45
- package/dist/agent/middleware/tool-filter-middleware.js +0 -122
- package/dist/codebuddy/tool-definitions/batch-tools.d.ts +0 -10
- package/dist/codebuddy/tool-definitions/batch-tools.js +0 -46
- package/dist/codebuddy/tool-definitions/graph-tools.d.ts +0 -13
- package/dist/codebuddy/tool-definitions/graph-tools.js +0 -78
- package/dist/plugins/code-explorer/CodeExplorerMCPClient.d.ts +0 -129
- package/dist/plugins/code-explorer/CodeExplorerMCPClient.js +0 -143
- package/dist/tools/registry/batch-tools.d.ts +0 -36
- package/dist/tools/registry/batch-tools.js +0 -135
- package/dist/tools/registry/graph-tools.d.ts +0 -45
- package/dist/tools/registry/graph-tools.js +0 -283
package/dist/index.js
CHANGED
|
@@ -10,8 +10,19 @@ import { join, dirname } from "path";
|
|
|
10
10
|
import { globalAgent as httpGlobalAgent } from 'node:http';
|
|
11
11
|
import { globalAgent as httpsGlobalAgent } from 'node:https';
|
|
12
12
|
import { fileURLToPath } from 'url';
|
|
13
|
-
import {
|
|
13
|
+
import { addLazyCommandGroup, getNonInteractiveUnknownCommand, removeCommands, } from './cli/command-routing.js';
|
|
14
|
+
import { attachUnknownOptionHint } from './cli/unknown-option-hint.js';
|
|
15
|
+
import { parseListenPort } from './cli/listen-port.js';
|
|
16
|
+
import { hoistPermissionModeOption, installPermissionModeActionHook, parseCliPermissionMode, } from './cli/permission-mode-option.js';
|
|
17
|
+
import { getRequestedProfile } from './cli/requested-profile.js';
|
|
18
|
+
import { findUnexecutedProseToolCall, formatEmptyHeadlessResponseError, isHeadlessFinalResponseEmpty, resolveHeadlessOutputFormat, resolveHeadlessTurnExitCode, } from './cli/headless-options.js';
|
|
19
|
+
import { validateOutputText } from './utils/output-schema-validator.js';
|
|
14
20
|
import { resolveCliModelList } from './cli/model-listing.js';
|
|
21
|
+
import { registerBackupCommand } from './commands/cli/backup-command.js';
|
|
22
|
+
import { registerSensoryCommand } from './commands/cli/sensory-command.js';
|
|
23
|
+
import { NO_PROVIDER_GUIDANCE, recoverFirstRunWithChatGpt, } from './cli/first-run.js';
|
|
24
|
+
import { getConfigManager } from './config/toml-config.js';
|
|
25
|
+
import { getHiddenCliCommands } from './config/feature-surface.js';
|
|
15
26
|
// Read version from package.json
|
|
16
27
|
const __filename = fileURLToPath(import.meta.url);
|
|
17
28
|
const __dirname = dirname(__filename);
|
|
@@ -22,6 +33,7 @@ process.env.CODEBUDDY_CLI = '1';
|
|
|
22
33
|
process.env.CODEBUDDY_CLI_VERSION = packageJson.version;
|
|
23
34
|
// Import logger statically since it's used throughout the file synchronously
|
|
24
35
|
import { logger } from "./utils/logger.js";
|
|
36
|
+
import { writeFileAtomic } from './utils/atomic-write.js';
|
|
25
37
|
// Import graceful shutdown for clean application termination
|
|
26
38
|
import { initializeGracefulShutdown, getShutdownManager, } from "./utils/graceful-shutdown.js";
|
|
27
39
|
import { sweepStaleCodebuddyTemp } from "./utils/disk-guard.js";
|
|
@@ -290,7 +302,7 @@ function _detectProviderFromEnvLegacy() {
|
|
|
290
302
|
provider: 'chatgpt',
|
|
291
303
|
apiKey: 'oauth-chatgpt', // sentinel consumed by CodeBuddyClient
|
|
292
304
|
baseURL: 'https://chatgpt.com/backend-api/codex',
|
|
293
|
-
defaultModel: process.env.CHATGPT_MODEL || 'gpt-5.
|
|
305
|
+
defaultModel: process.env.CHATGPT_MODEL || 'gpt-5.6-sol',
|
|
294
306
|
};
|
|
295
307
|
}
|
|
296
308
|
}
|
|
@@ -441,7 +453,7 @@ async function detectOnboardedLocalProvider() {
|
|
|
441
453
|
source: 'environment',
|
|
442
454
|
};
|
|
443
455
|
}
|
|
444
|
-
catch {
|
|
456
|
+
catch (_error) {
|
|
445
457
|
return null;
|
|
446
458
|
}
|
|
447
459
|
}
|
|
@@ -508,23 +520,9 @@ async function saveCommandLineSettings(apiKey, baseURL) {
|
|
|
508
520
|
cli.warn(`⚠️ Could not save settings to file: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
509
521
|
}
|
|
510
522
|
}
|
|
511
|
-
/**
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
* slug 404s on xAI. We only enforce this for the two providers with a known
|
|
515
|
-
* hard incompatibility (grok ↔ chatgpt); other providers are left untouched so
|
|
516
|
-
* local/OpenAI/Anthropic model names pass through as before.
|
|
517
|
-
*/
|
|
518
|
-
function isModelCompatibleWithProvider(model, provider) {
|
|
519
|
-
if (!provider)
|
|
520
|
-
return true;
|
|
521
|
-
const looksGrok = /grok/i.test(model);
|
|
522
|
-
if (provider === 'grok')
|
|
523
|
-
return looksGrok;
|
|
524
|
-
if (provider === 'chatgpt')
|
|
525
|
-
return /^(gpt-|o[1-9]|codex)/i.test(model) && !looksGrok;
|
|
526
|
-
return true;
|
|
527
|
-
}
|
|
523
|
+
/** Providers served by a local OpenAI-compatible runtime (no cloud model catalog). */
|
|
524
|
+
import { isModelCompatibleWithProvider } from './providers/model-provider-compat.js';
|
|
525
|
+
export { isModelCompatibleWithProvider };
|
|
528
526
|
// Load model from detected provider or user settings
|
|
529
527
|
async function loadModel() {
|
|
530
528
|
await ensureEnvLoaded();
|
|
@@ -532,41 +530,84 @@ async function loadModel() {
|
|
|
532
530
|
if (process.env.GROK_MODEL)
|
|
533
531
|
return process.env.GROK_MODEL;
|
|
534
532
|
const detected = await getDetectedProvider();
|
|
535
|
-
//
|
|
536
|
-
//
|
|
537
|
-
|
|
538
|
-
// `grok-code-fast-1` default 404s against the ChatGPT/Codex backend (which
|
|
539
|
-
// then falls back to another unsupported slug and crashes). In either
|
|
540
|
-
// mismatch, prefer the detected provider's own default model.
|
|
533
|
+
// Read the saved model once (reused by both the settings path and the
|
|
534
|
+
// local-runtime path below).
|
|
535
|
+
let settingsModel;
|
|
541
536
|
try {
|
|
542
537
|
const getSettingsManager = await lazyImport.settingsManager();
|
|
543
|
-
|
|
544
|
-
if (settingsModel && isModelCompatibleWithProvider(settingsModel, detected?.provider)) {
|
|
545
|
-
return settingsModel;
|
|
546
|
-
}
|
|
538
|
+
settingsModel = getSettingsManager().getCurrentModel() || undefined;
|
|
547
539
|
}
|
|
548
540
|
catch (_err) {
|
|
549
541
|
logger.debug('Failed to load model from settings manager', { error: _err });
|
|
550
542
|
}
|
|
551
|
-
//
|
|
543
|
+
// 2. Local runtime (Ollama): resolve to a model that is ACTUALLY installed,
|
|
544
|
+
// never a stale cloud slug. Detection sets `defaultModel` to the advertised
|
|
545
|
+
// onboarding tag (e.g. `qwen2.5-coder:7b`), but a fresh box rarely has that
|
|
546
|
+
// exact tag pulled — sending it (or a leftover `grok-code-fast-1` from
|
|
547
|
+
// settings) yields a cryptic `404 model not found`. Probe the server's tags
|
|
548
|
+
// and pick a real one; if none is installed / the server is down, fail with
|
|
549
|
+
// a clear `ollama pull …` hint. This is the "$0 local" onboarding path, so
|
|
550
|
+
// it must never dead-end on a Grok 404. Only triggers for local runtimes,
|
|
551
|
+
// so cloud/no-provider behavior stays byte-identical.
|
|
552
|
+
if (detected && detected.provider === 'ollama') {
|
|
553
|
+
const { resolveInstalledOllamaModel, buildOllamaPullHint } = await import('./providers/local-model-resolver.js');
|
|
554
|
+
const requested = process.env.OLLAMA_MODEL ||
|
|
555
|
+
(settingsModel && isModelCompatibleWithProvider(settingsModel, 'ollama')
|
|
556
|
+
? settingsModel
|
|
557
|
+
: undefined) ||
|
|
558
|
+
detected.defaultModel;
|
|
559
|
+
const resolution = await resolveInstalledOllamaModel({
|
|
560
|
+
baseURL: detected.baseURL,
|
|
561
|
+
requested,
|
|
562
|
+
});
|
|
563
|
+
if (resolution.model)
|
|
564
|
+
return resolution.model;
|
|
565
|
+
const hint = buildOllamaPullHint({
|
|
566
|
+
baseURL: detected.baseURL,
|
|
567
|
+
reachable: resolution.reachable,
|
|
568
|
+
requested,
|
|
569
|
+
});
|
|
570
|
+
const { shouldBypassUnreachableLocalPreflight } = await import('./providers/provider-failover-policy.js');
|
|
571
|
+
if (shouldBypassUnreachableLocalPreflight()) {
|
|
572
|
+
cli.warn(`${hint}\nDeclared provider failover is enabled; continuing so chat() can try the backup chain.`);
|
|
573
|
+
return requested || detected.defaultModel;
|
|
574
|
+
}
|
|
575
|
+
cli.error(hint);
|
|
576
|
+
process.exit(1);
|
|
577
|
+
}
|
|
578
|
+
// 3. Project/user settings override auto-detection — UNLESS the saved model is
|
|
579
|
+
// incompatible with the detected provider. A `gpt-5.5` left in settings.json
|
|
580
|
+
// would 404 against xAI after `buddy login xai`; symmetrically, a stale
|
|
581
|
+
// `grok-code-fast-1` default 404s against the ChatGPT/Codex backend (which
|
|
582
|
+
// then falls back to another unsupported slug and crashes). In either
|
|
583
|
+
// mismatch, prefer the detected provider's own default model.
|
|
584
|
+
if (settingsModel && isModelCompatibleWithProvider(settingsModel, detected?.provider)) {
|
|
585
|
+
return settingsModel;
|
|
586
|
+
}
|
|
587
|
+
// 4. Fallback to auto-detected provider's default model
|
|
552
588
|
if (detected)
|
|
553
589
|
return detected.defaultModel;
|
|
554
590
|
return undefined;
|
|
555
591
|
}
|
|
556
592
|
/**
|
|
557
|
-
* Active-LLM auto-failover.
|
|
558
|
-
*
|
|
559
|
-
*
|
|
560
|
-
*
|
|
561
|
-
* local last). OFF by default → single-provider behavior is unchanged.
|
|
593
|
+
* Active-LLM auto-failover. `CODEBUDDY_LLM_FAILOVER` is a deprecated alias of
|
|
594
|
+
* `CODEBUDDY_PROVIDER_FALLBACK` — both take the declared client path. When no
|
|
595
|
+
* `CODEBUDDY_FALLBACK_CHAIN` is set, the authenticated registry is injected as
|
|
596
|
+
* the candidate list (resilience order by default).
|
|
562
597
|
*/
|
|
563
598
|
async function applyActiveLlmFailover(agent) {
|
|
564
599
|
try {
|
|
565
600
|
const { getConfigManager } = await import('./config/toml-config.js');
|
|
601
|
+
const { isDeclaredProviderFallbackEnabled, warnLegacyLlmFailoverAlias } = await import('./providers/provider-failover-policy.js');
|
|
566
602
|
const llmCfg = getConfigManager().getConfig().llm;
|
|
567
|
-
|
|
603
|
+
warnLegacyLlmFailoverAlias();
|
|
604
|
+
const enabled = isDeclaredProviderFallbackEnabled() || Boolean(llmCfg?.enabled);
|
|
568
605
|
if (!enabled)
|
|
569
606
|
return;
|
|
607
|
+
if (process.env.CODEBUDDY_FALLBACK_CHAIN) {
|
|
608
|
+
logger.info('Active-LLM failover: CODEBUDDY_FALLBACK_CHAIN wins over the registry list');
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
570
611
|
const primary = await getDetectedProvider();
|
|
571
612
|
const { buildActiveLlmRegistry } = await import('./providers/active-llm-registry.js');
|
|
572
613
|
const orderEnv = process.env.CODEBUDDY_LLM_ORDER;
|
|
@@ -636,7 +677,7 @@ ${diffResult.output || "No staged changes shown"}
|
|
|
636
677
|
Follow conventional commit format (feat:, fix:, docs:, etc.) and keep it under 72 characters.
|
|
637
678
|
Respond with ONLY the commit message, no additional text.`;
|
|
638
679
|
cli.info("🤖 Generating commit message...");
|
|
639
|
-
const commitMessageEntries = await agent.processUserMessage(commitPrompt);
|
|
680
|
+
const commitMessageEntries = await agent.processUserMessage(commitPrompt, { surface: 'cli' });
|
|
640
681
|
let commitMessage = "";
|
|
641
682
|
// Extract the commit message from the AI response
|
|
642
683
|
for (const entry of commitMessageEntries) {
|
|
@@ -839,9 +880,15 @@ async function applyCustomAgentToolFilter(agentConfig) {
|
|
|
839
880
|
setToolFilter(buildCustomAgentToolFilter(agentConfig, getToolFilter(), getBuiltinToolNames()));
|
|
840
881
|
}
|
|
841
882
|
// Headless mode processing function
|
|
842
|
-
async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRounds, selfHealEnabled = true, outputFormat = 'json', outputSchemaPath, agentName) {
|
|
883
|
+
async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRounds, selfHealEnabled = true, outputFormat = 'json', outputLastMessagePath, outputSchemaPath, agentName) {
|
|
843
884
|
const previousDisableMCP = process.env.CODEBUDDY_DISABLE_MCP;
|
|
844
885
|
const previousHeadless = process.env.CODEBUDDY_HEADLESS;
|
|
886
|
+
const startedAt = Date.now();
|
|
887
|
+
let agent;
|
|
888
|
+
let interactionLogger = null;
|
|
889
|
+
let runStore;
|
|
890
|
+
let runId;
|
|
891
|
+
let runStatus = 'failed';
|
|
845
892
|
// Headless defaults MCP OFF (startup cost / determinism), but respect an
|
|
846
893
|
// explicit opt-in so `CODEBUDDY_DISABLE_MCP=false buddy -p …` can use MCP
|
|
847
894
|
// servers (e.g. the Code Explorer / code-explorer bridge, or the benchmark's
|
|
@@ -852,8 +899,50 @@ async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRoun
|
|
|
852
899
|
const customAgentConfig = await loadCustomAgentForCli(agentName, false);
|
|
853
900
|
const modelToUse = customAgentConfig?.model ?? model;
|
|
854
901
|
const CodeBuddyAgent = await lazyImport.CodeBuddyAgent();
|
|
855
|
-
|
|
902
|
+
// Evolved execution strategy (opt-in CODEBUDDY_SELF_IMPROVE_STRATEGIES): fills only what
|
|
903
|
+
// the user left unset — an explicit --max-tool-rounds always wins. Off ⇒ empty overlay.
|
|
904
|
+
const { resolveStrategyOverlay, applyStrategyCostCap } = await import('./agent/self-improvement/strategy-runtime.js');
|
|
905
|
+
const strategy = resolveStrategyOverlay('headless', { maxToolRounds });
|
|
906
|
+
if (strategy.strategyId && strategy.strategyId !== 'baseline') {
|
|
907
|
+
const cost = applyStrategyCostCap(strategy);
|
|
908
|
+
logger.info(`Execution strategy ${strategy.strategyId} in force (rounds ${strategy.maxToolRounds ?? maxToolRounds ?? 'explicit'}, cost cap ${cost.maxCostUsd !== undefined ? `$${cost.maxCostUsd}` : 'explicit'}, ${strategy.systemPromptAppend ? 'with' : 'no'} directives)`);
|
|
909
|
+
}
|
|
910
|
+
agent = new CodeBuddyAgent(apiKey, baseURL, modelToUse, maxToolRounds ?? strategy.maxToolRounds, true, undefined, undefined, strategy.systemPromptAppend);
|
|
856
911
|
await applyActiveLlmFailover(agent);
|
|
912
|
+
// A headless prompt is a real session unless --ephemeral was selected.
|
|
913
|
+
// The timeline hook is installed by the agent constructor and resolves the
|
|
914
|
+
// current session lazily at turn completion, so the session must exist
|
|
915
|
+
// before the first message is processed.
|
|
916
|
+
const sessionStore = agent.getSessionStore();
|
|
917
|
+
if (!sessionStore.isEphemeral()) {
|
|
918
|
+
// GK29: --resume/--continue hydrate the persisted session in headless mode; GK28: the run
|
|
919
|
+
// record keeps the session's working directory for `buddy run show`.
|
|
920
|
+
const existingId = sessionStore.getCurrentSessionId();
|
|
921
|
+
const existing = existingId ? await sessionStore.loadSession(existingId) : null;
|
|
922
|
+
if (existing) {
|
|
923
|
+
agent.hydratePersistedSession(existing);
|
|
924
|
+
}
|
|
925
|
+
else {
|
|
926
|
+
const sessionName = prompt.replace(/\s+/gu, ' ').trim().slice(0, 80) || 'Headless session';
|
|
927
|
+
await sessionStore.createSession(sessionName, modelToUse);
|
|
928
|
+
}
|
|
929
|
+
const sessionId = sessionStore.getCurrentSessionId();
|
|
930
|
+
if (sessionId) {
|
|
931
|
+
const current = existing ?? (await sessionStore.loadSession(sessionId));
|
|
932
|
+
const { RunStore: RunStoreClass } = await import('./observability/run-store.js');
|
|
933
|
+
runStore = RunStoreClass.getInstance();
|
|
934
|
+
const { auditLogger } = await import('./security/audit-logger.js');
|
|
935
|
+
const auditDir = process.env.CODEBUDDY_AUDIT_DIR || nodePath.join(nodeOs.homedir(), '.codebuddy');
|
|
936
|
+
auditLogger.init({ logDir: auditDir, sessionId });
|
|
937
|
+
runId = runStore.startRun('headless prompt', {
|
|
938
|
+
channel: 'terminal',
|
|
939
|
+
sessionId,
|
|
940
|
+
...(current?.workingDirectory ? { cwd: current.workingDirectory } : {}),
|
|
941
|
+
tags: ['headless', modelToUse || 'unknown'],
|
|
942
|
+
});
|
|
943
|
+
agent.setRunId(runId);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
857
946
|
await agent.systemPromptReady;
|
|
858
947
|
// When MCP is opted in for this headless run, wait for the servers to finish
|
|
859
948
|
// connecting so their tools (e.g. the Code Explorer / code-explorer bridge) are
|
|
@@ -882,7 +971,6 @@ async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRoun
|
|
|
882
971
|
const confirmationService = ConfirmationService.getInstance();
|
|
883
972
|
confirmationService.setSessionFlag("allOperations", true);
|
|
884
973
|
// Initialize interaction logger for headless session tracking
|
|
885
|
-
let interactionLogger = null;
|
|
886
974
|
try {
|
|
887
975
|
const { getInteractionLogger } = await import('./logging/interaction-logger.js');
|
|
888
976
|
const il = getInteractionLogger();
|
|
@@ -897,8 +985,47 @@ async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRoun
|
|
|
897
985
|
catch (e) {
|
|
898
986
|
logger.debug('Failed to initialize headless interaction logger', { error: String(e) });
|
|
899
987
|
}
|
|
988
|
+
// Slash commands must not be sent to the LLM as a user message.
|
|
989
|
+
if (prompt.trim().startsWith('/')) {
|
|
990
|
+
const { dispatchSlashPrompt } = await import('./commands/headless-slash.js');
|
|
991
|
+
const handler = (await import('./commands/enhanced-command-handler.js')).getEnhancedCommandHandler();
|
|
992
|
+
handler.setCodeBuddyClient(agent.getClient());
|
|
993
|
+
const slash = await dispatchSlashPrompt(prompt.trim(), { client: agent.getClient() });
|
|
994
|
+
if (slash?.handled) {
|
|
995
|
+
const resultText = slash.output ?? slash.reason ?? '(slash command produced no output)';
|
|
996
|
+
const format = outputFormat.toLowerCase();
|
|
997
|
+
if (format === 'text' || format === 'markdown') {
|
|
998
|
+
cli.stdout(resultText);
|
|
999
|
+
}
|
|
1000
|
+
else {
|
|
1001
|
+
const slashEffectiveModel = modelToUse || process.env.GROK_MODEL || 'unknown';
|
|
1002
|
+
const slashCostExtended = agent.getSessionCostExtended?.() ?? { total: agent.getSessionCost(), estimated: true, pricing: 'unknown', billing: 'pay-per-use', inputTokens: 0, outputTokens: 0 };
|
|
1003
|
+
const slashOutputData = {
|
|
1004
|
+
result: resultText,
|
|
1005
|
+
cost: {
|
|
1006
|
+
total: slashCostExtended.total,
|
|
1007
|
+
estimated: slashCostExtended.estimated,
|
|
1008
|
+
pricing: slashCostExtended.pricing,
|
|
1009
|
+
billing: slashCostExtended.billing,
|
|
1010
|
+
},
|
|
1011
|
+
model: slashEffectiveModel,
|
|
1012
|
+
messages: [{ role: 'assistant', content: resultText }],
|
|
1013
|
+
};
|
|
1014
|
+
// For slash commands, we don't have effective vs requested model tracking
|
|
1015
|
+
// since the agent hasn't processed a user message yet
|
|
1016
|
+
cli.stdout(JSON.stringify(slashOutputData));
|
|
1017
|
+
}
|
|
1018
|
+
return slash.denied ? 1 : 0;
|
|
1019
|
+
}
|
|
1020
|
+
if (slash?.passToAI && slash.prompt) {
|
|
1021
|
+
prompt = slash.prompt;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
900
1024
|
// Process the user message
|
|
901
|
-
const chatEntries = await agent.processUserMessage(prompt);
|
|
1025
|
+
const chatEntries = await agent.processUserMessage(prompt, { surface: 'cli' });
|
|
1026
|
+
if (!sessionStore.isEphemeral()) {
|
|
1027
|
+
await agent.saveCurrentSession();
|
|
1028
|
+
}
|
|
902
1029
|
// WS3-T1 — session-end flush (handoff + lesson candidates). Awaited with
|
|
903
1030
|
// a hard cap so headless runs keep their continuity write without ever
|
|
904
1031
|
// hanging the exit; trivial sessions no-op inside the module.
|
|
@@ -964,26 +1091,70 @@ async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRoun
|
|
|
964
1091
|
break;
|
|
965
1092
|
}
|
|
966
1093
|
}
|
|
967
|
-
//
|
|
1094
|
+
// Extract the final assistant response directly from chatEntries. This is
|
|
1095
|
+
// the text used by every headless output mode and by the file flags.
|
|
1096
|
+
const lastAssistantEntry = [...chatEntries]
|
|
1097
|
+
.reverse()
|
|
1098
|
+
.find((entry) => entry.type === 'assistant');
|
|
1099
|
+
const resultText = lastAssistantEntry?.content ?? '';
|
|
1100
|
+
const client = agent.getClient();
|
|
1101
|
+
const effectiveModel = client.getLastEffectiveModel() ?? modelToUse ?? process.env.GROK_MODEL ?? 'unknown';
|
|
1102
|
+
if (isHeadlessFinalResponseEmpty(resultText)) {
|
|
1103
|
+
const providerLabel = process.env.CODEBUDDY_PROVIDER?.trim()
|
|
1104
|
+
|| detectProviderFromEnv()?.provider
|
|
1105
|
+
|| 'inconnu';
|
|
1106
|
+
process.stderr.write(`${formatEmptyHeadlessResponseError({
|
|
1107
|
+
provider: providerLabel,
|
|
1108
|
+
model: effectiveModel,
|
|
1109
|
+
durationMs: Date.now() - startedAt,
|
|
1110
|
+
})}\n`);
|
|
1111
|
+
runStatus = 'failed';
|
|
1112
|
+
return 1;
|
|
1113
|
+
}
|
|
1114
|
+
// Validate before writing or emitting any successful output. The schema
|
|
1115
|
+
// applies to the JSON value represented by the final assistant text, not
|
|
1116
|
+
// to the internal/OpenAI-compatible message history.
|
|
968
1117
|
if (outputSchemaPath) {
|
|
969
|
-
const
|
|
970
|
-
const validation = validateOutputSchema(messages, outputSchemaPath);
|
|
1118
|
+
const validation = validateOutputText(resultText, outputSchemaPath);
|
|
971
1119
|
if (!validation.valid) {
|
|
972
1120
|
cli.error('Output schema validation failed:');
|
|
973
1121
|
for (const error of validation.errors) {
|
|
974
1122
|
cli.error(` - ${error}`);
|
|
975
1123
|
}
|
|
976
|
-
return
|
|
1124
|
+
return 1;
|
|
977
1125
|
}
|
|
978
1126
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
const
|
|
983
|
-
const
|
|
1127
|
+
if (outputLastMessagePath) {
|
|
1128
|
+
await writeFileAtomic(outputLastMessagePath, resultText);
|
|
1129
|
+
}
|
|
1130
|
+
const { getBuiltinToolNames } = await import('./codebuddy/tools.js');
|
|
1131
|
+
const knownToolNames = getBuiltinToolNames();
|
|
1132
|
+
const executedToolNames = chatEntries
|
|
1133
|
+
.filter((entry) => entry.type === 'tool_result' && entry.toolCall)
|
|
1134
|
+
.map((entry) => entry.toolCall?.function.name)
|
|
1135
|
+
.filter((toolName) => Boolean(toolName));
|
|
1136
|
+
const proseToolCall = findUnexecutedProseToolCall(resultText, knownToolNames, executedToolNames);
|
|
1137
|
+
if (proseToolCall) {
|
|
1138
|
+
logger.warn('le modèle a décrit un appel d’outil sans l’exécuter', {
|
|
1139
|
+
toolName: proseToolCall.toolName,
|
|
1140
|
+
line: proseToolCall.line,
|
|
1141
|
+
});
|
|
1142
|
+
}
|
|
1143
|
+
const exitCode = resolveHeadlessTurnExitCode(resultText, knownToolNames, executedToolNames);
|
|
1144
|
+
runStatus = exitCode === 0 ? 'completed' : 'failed';
|
|
984
1145
|
// Gather cost and model info from the agent
|
|
985
|
-
const
|
|
986
|
-
const
|
|
1146
|
+
const sessionCostExtended = agent.getSessionCostExtended?.() ?? { total: agent.getSessionCost(), estimated: true, pricing: 'unknown', billing: 'pay-per-use', inputTokens: 0, outputTokens: 0 };
|
|
1147
|
+
const sessionCost = sessionCostExtended.total;
|
|
1148
|
+
const requestedModel = client.getLastRequestedModel();
|
|
1149
|
+
// MODELLABEL1: Warn on stderr when requested model differs from effective model in headless mode
|
|
1150
|
+
if (requestedModel && requestedModel !== effectiveModel) {
|
|
1151
|
+
const fallbackWarning = `⚠️ Modèle "${requestedModel}" non disponible, repli sur "${effectiveModel}"`;
|
|
1152
|
+
// Only warn once per process in headless mode
|
|
1153
|
+
if (!process.env.CODEBUDDY_MODEL_FALLBACK_WARNED) {
|
|
1154
|
+
process.env.CODEBUDDY_MODEL_FALLBACK_WARNED = 'true';
|
|
1155
|
+
process.stderr.write(fallbackWarning + '\n');
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
987
1158
|
// Output in the requested format
|
|
988
1159
|
const format = outputFormat.toLowerCase();
|
|
989
1160
|
if (format === 'text' || format === 'markdown') {
|
|
@@ -999,23 +1170,51 @@ async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRoun
|
|
|
999
1170
|
process.stdout.write(JSON.stringify(message) + '\n');
|
|
1000
1171
|
}
|
|
1001
1172
|
// Emit a final summary event
|
|
1002
|
-
|
|
1173
|
+
const summaryData = {
|
|
1003
1174
|
type: 'summary',
|
|
1004
1175
|
result: resultText,
|
|
1005
|
-
cost: {
|
|
1006
|
-
|
|
1007
|
-
|
|
1176
|
+
cost: {
|
|
1177
|
+
total: sessionCost,
|
|
1178
|
+
estimated: sessionCostExtended.estimated,
|
|
1179
|
+
pricing: sessionCostExtended.pricing,
|
|
1180
|
+
billing: sessionCostExtended.billing,
|
|
1181
|
+
},
|
|
1182
|
+
model: effectiveModel,
|
|
1183
|
+
};
|
|
1184
|
+
if (requestedModel && requestedModel !== effectiveModel) {
|
|
1185
|
+
summaryData.requestedModel = requestedModel;
|
|
1186
|
+
}
|
|
1187
|
+
process.stdout.write(JSON.stringify(summaryData) + '\n');
|
|
1008
1188
|
}
|
|
1009
1189
|
else {
|
|
1010
1190
|
// Default: json — structured output goes to stdout (pipeable).
|
|
1011
|
-
|
|
1191
|
+
const { autoWidget } = await import('./widgets/auto-widget.js');
|
|
1192
|
+
const widgetPayloads = chatEntries
|
|
1193
|
+
.filter((entry) => entry.type === 'tool_result')
|
|
1194
|
+
.map((entry) => entry.toolResult ?? { output: entry.content });
|
|
1195
|
+
const widget = await autoWidget(resultText, widgetPayloads);
|
|
1196
|
+
const { detectWidgetable } = await import('./widgets/widget-matcher.js');
|
|
1197
|
+
// `data` is a public structured-output field even when automatic HTML
|
|
1198
|
+
// rendering is disabled. The matcher is pure and does not open the
|
|
1199
|
+
// registry; typed payloads also bypass the table length gate.
|
|
1200
|
+
const candidate = widget.candidate ?? detectWidgetable(resultText, widgetPayloads);
|
|
1201
|
+
const outputData = {
|
|
1012
1202
|
result: resultText,
|
|
1013
1203
|
cost: {
|
|
1014
1204
|
total: sessionCost,
|
|
1205
|
+
estimated: sessionCostExtended.estimated,
|
|
1206
|
+
pricing: sessionCostExtended.pricing,
|
|
1207
|
+
billing: sessionCostExtended.billing,
|
|
1015
1208
|
},
|
|
1016
|
-
model:
|
|
1209
|
+
model: effectiveModel,
|
|
1017
1210
|
messages,
|
|
1018
|
-
|
|
1211
|
+
...(candidate ? { data: candidate.data } : {}),
|
|
1212
|
+
...(widget.widgetHtml ? { widgetHtml: widget.widgetHtml } : {}),
|
|
1213
|
+
};
|
|
1214
|
+
if (requestedModel && requestedModel !== effectiveModel) {
|
|
1215
|
+
outputData.requestedModel = requestedModel;
|
|
1216
|
+
}
|
|
1217
|
+
cli.stdout(JSON.stringify(outputData));
|
|
1019
1218
|
}
|
|
1020
1219
|
return exitCode;
|
|
1021
1220
|
}
|
|
@@ -1038,6 +1237,49 @@ async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRoun
|
|
|
1038
1237
|
return 1;
|
|
1039
1238
|
}
|
|
1040
1239
|
finally {
|
|
1240
|
+
if (runStore && runId) {
|
|
1241
|
+
try {
|
|
1242
|
+
if (agent) {
|
|
1243
|
+
const ext = agent.getSessionCostExtended?.();
|
|
1244
|
+
if (ext) {
|
|
1245
|
+
runStore.updateMetrics(runId, {
|
|
1246
|
+
promptTokens: ext.inputTokens,
|
|
1247
|
+
completionTokens: ext.outputTokens,
|
|
1248
|
+
totalTokens: ext.inputTokens + ext.outputTokens,
|
|
1249
|
+
totalCost: ext.total,
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
runStore.endRun(runId, runStatus);
|
|
1254
|
+
runStore.dispose();
|
|
1255
|
+
}
|
|
1256
|
+
catch (e) {
|
|
1257
|
+
logger.debug('Headless run cleanup skipped', { error: String(e) });
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
if (interactionLogger) {
|
|
1261
|
+
try {
|
|
1262
|
+
interactionLogger.endSession();
|
|
1263
|
+
}
|
|
1264
|
+
catch (e) {
|
|
1265
|
+
logger.debug('Failed to end headless interaction logger session', { error: String(e) });
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
if (agent) {
|
|
1269
|
+
try {
|
|
1270
|
+
agent.dispose({ skipSessionLearning: true });
|
|
1271
|
+
}
|
|
1272
|
+
catch (e) {
|
|
1273
|
+
logger.debug('Headless agent cleanup skipped', { error: String(e) });
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
try {
|
|
1277
|
+
const { resetMCPClient } = await import('./mcp/mcp-client.js');
|
|
1278
|
+
await resetMCPClient();
|
|
1279
|
+
}
|
|
1280
|
+
catch (e) {
|
|
1281
|
+
logger.debug('Headless MCP cleanup skipped', { error: String(e) });
|
|
1282
|
+
}
|
|
1041
1283
|
if (previousDisableMCP === undefined) {
|
|
1042
1284
|
delete process.env.CODEBUDDY_DISABLE_MCP;
|
|
1043
1285
|
}
|
|
@@ -1054,6 +1296,11 @@ async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRoun
|
|
|
1054
1296
|
}
|
|
1055
1297
|
program
|
|
1056
1298
|
.name("buddy")
|
|
1299
|
+
// Git-style option scoping: ROOT options must come before the subcommand.
|
|
1300
|
+
// Without this, root flags are consumed from anywhere in argv and shadow
|
|
1301
|
+
// same-named subcommand options — e.g. `buddy lessons add -c RULE
|
|
1302
|
+
// --context ci` silently lost both to the root `-c, --context <patterns>`.
|
|
1303
|
+
.enablePositionalOptions()
|
|
1057
1304
|
.description("A conversational AI CLI tool powered by AI with text editor capabilities")
|
|
1058
1305
|
.version(packageJson.version)
|
|
1059
1306
|
.argument("[message...]", "Initial message to send to Code Buddy")
|
|
@@ -1064,9 +1311,10 @@ program
|
|
|
1064
1311
|
.option("-p, --prompt <prompt>", "process a single prompt and exit (headless mode, alias: --print)")
|
|
1065
1312
|
.option("--print <prompt>", "alias for --prompt: process a single prompt and exit (headless mode)")
|
|
1066
1313
|
.option("-b, --browser", "launch browser UI instead of terminal interface")
|
|
1067
|
-
.option("--max-tool-rounds <rounds>", "maximum number of tool execution rounds (default:
|
|
1314
|
+
.option("--max-tool-rounds <rounds>", "maximum number of tool execution rounds (default: 50) (400 in YOLO mode)")
|
|
1068
1315
|
.option("-s, --security-mode <mode>", "security mode: suggest (default), auto-edit, or full-auto")
|
|
1069
|
-
.option("
|
|
1316
|
+
.option("--output-format <format>", "output format for headless mode: json, stream-json, text, markdown")
|
|
1317
|
+
.option("-o, --output-last-message <file>", "write the agent's final text response directly and atomically to a file")
|
|
1070
1318
|
.addOption(new Option("--output <format>", "legacy alias for --output-format").hideHelp())
|
|
1071
1319
|
.option("--init", "initialize .codebuddy directory with templates and exit")
|
|
1072
1320
|
.option("--dry-run", "preview changes without applying them (simulation mode)")
|
|
@@ -1080,7 +1328,7 @@ program
|
|
|
1080
1328
|
.option("--no-emoji", "disable emoji in output")
|
|
1081
1329
|
.option("--list-models", "list available models from the API endpoint and exit")
|
|
1082
1330
|
.option("--continue", "continue from the most recent saved session (like mistral-vibe)")
|
|
1083
|
-
.option("--resume
|
|
1331
|
+
.option("--resume [sessionId]", "resume a specific session by ID (supports partial matching); without an ID, pick a recent session")
|
|
1084
1332
|
.option("--search-sessions <query>", "search saved sessions by content")
|
|
1085
1333
|
.option("--max-price <dollars>", "maximum cost in dollars before stopping (like mistral-vibe)", "10.0")
|
|
1086
1334
|
.option("--auto-approve", "automatically approve all tool executions (like mistral-vibe)")
|
|
@@ -1092,13 +1340,13 @@ program
|
|
|
1092
1340
|
.option("--disabled-tools <patterns>", "disable tools matching patterns (comma-separated, supports glob: bash,web_*)")
|
|
1093
1341
|
.option("--setup", "run interactive setup wizard for API key and configuration")
|
|
1094
1342
|
.option("--vim", "enable Vim keybindings for input")
|
|
1095
|
-
.option("--permission-mode <mode>", "permission mode: default, plan, acceptEdits, dontAsk, bypassPermissions")
|
|
1343
|
+
.option("--permission-mode <mode>", "permission mode: default, plan, acceptEdits, dontAsk, bypassPermissions", parseCliPermissionMode)
|
|
1096
1344
|
.option("--dangerously-skip-permissions", "bypass all permission checks (use in trusted containers without network access)")
|
|
1097
1345
|
.option("--allowed-tools <patterns>", "only enable tools matching patterns (natively --allowedTools)")
|
|
1098
1346
|
.option("--disallowed-tools <patterns>", "block tools matching patterns (natively --disallowedTools)")
|
|
1099
1347
|
.option("--mcp-debug", "enable MCP debugging output")
|
|
1100
1348
|
.option("--allow-outside", "allow file operations outside the workspace directory (disables workspace isolation)")
|
|
1101
|
-
.option("--output-schema <
|
|
1349
|
+
.option("--output-schema <file>", "path to a JSON Schema file to validate the final response shape against")
|
|
1102
1350
|
.option("--add-dir <paths...>", "grant additional writable directories (repeatable)")
|
|
1103
1351
|
.option("--no-alt-screen", "disable alternate screen buffer for Ink UI")
|
|
1104
1352
|
.option("--ephemeral", "skip session persistence (do not save session to disk)")
|
|
@@ -1107,17 +1355,30 @@ program
|
|
|
1107
1355
|
.option("--append-system-prompt <text>", "append text to the default system prompt")
|
|
1108
1356
|
.option("--append-system-prompt-file <path>", "append file contents to the default system prompt")
|
|
1109
1357
|
.option("--fallback-model <model>", "auto-fallback model when default is overloaded")
|
|
1110
|
-
.option("--profile <name>", "apply a
|
|
1358
|
+
.option("--profile <name>", "apply a built-in or configured profile (core, all, or [profiles.<name>])")
|
|
1111
1359
|
.option("--from-pr <pr>", "link session to a GitHub pull request (number or URL)")
|
|
1112
1360
|
.option("--yolo", "enable YOLO mode (full autonomy with guardrails, $100 cost cap)")
|
|
1113
1361
|
.option("--quiet", "suppress informational logs (only show errors and responses)")
|
|
1114
1362
|
.option("--verbose", "enable verbose/debug output")
|
|
1115
1363
|
.option("--speak", "enable automatic speech synthesis of agent responses using Text-to-Speech")
|
|
1116
1364
|
.option("--tts-provider <provider>", "TTS provider (edge-tts, espeak, say, piper, audioreader)")
|
|
1365
|
+
.option("--channel <name>", "Start with a messaging channel (telegram, discord, slack, …)")
|
|
1117
1366
|
.action(async (message, options) => {
|
|
1367
|
+
const unknownCommand = getNonInteractiveUnknownCommand({
|
|
1368
|
+
positionalArgs: Array.isArray(message) ? message : undefined,
|
|
1369
|
+
hasExplicitPrompt: Boolean(options.prompt || options.print),
|
|
1370
|
+
stdinIsTTY: process.stdin.isTTY,
|
|
1371
|
+
stdoutIsTTY: process.stdout.isTTY,
|
|
1372
|
+
});
|
|
1373
|
+
if (unknownCommand) {
|
|
1374
|
+
process.stderr.write(`Commande inconnue « ${unknownCommand} ». Voir buddy --help\n`);
|
|
1375
|
+
process.exitCode = 1;
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1118
1378
|
// Apply --quiet / --verbose flags
|
|
1119
1379
|
if (options.quiet) {
|
|
1120
1380
|
process.env.LOG_LEVEL = 'error';
|
|
1381
|
+
process.env.CODEBUDDY_QUIET = 'true';
|
|
1121
1382
|
logger.setLevel('error');
|
|
1122
1383
|
}
|
|
1123
1384
|
if (options.verbose) {
|
|
@@ -1125,6 +1386,11 @@ program
|
|
|
1125
1386
|
process.env.DEBUG = 'true';
|
|
1126
1387
|
logger.setLevel('debug');
|
|
1127
1388
|
}
|
|
1389
|
+
if (options.channel) {
|
|
1390
|
+
const { handleChannels } = await import('./commands/handlers/channel-handlers.js');
|
|
1391
|
+
await handleChannels('start', { type: String(options.channel) });
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1128
1394
|
// Apply --speak / --tts-provider flags
|
|
1129
1395
|
if (options.speak || options.ttsProvider) {
|
|
1130
1396
|
const { getTTSManager } = await import('./input/text-to-speech.js');
|
|
@@ -1143,18 +1409,6 @@ program
|
|
|
1143
1409
|
}
|
|
1144
1410
|
}
|
|
1145
1411
|
}
|
|
1146
|
-
// Apply named configuration profile (--profile <name>) before anything else
|
|
1147
|
-
if (options.profile) {
|
|
1148
|
-
try {
|
|
1149
|
-
const { getConfigManager } = await import('./config/toml-config.js');
|
|
1150
|
-
getConfigManager().load();
|
|
1151
|
-
getConfigManager().applyProfile(options.profile);
|
|
1152
|
-
}
|
|
1153
|
-
catch (err) {
|
|
1154
|
-
startupLogger.error(`Profile error: ${err instanceof Error ? err.message : err}`);
|
|
1155
|
-
process.exit(1);
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
1412
|
// Handle --setup flag (interactive setup wizard)
|
|
1159
1413
|
if (options.setup) {
|
|
1160
1414
|
const { runSetup } = await import("./utils/interactive-setup.js");
|
|
@@ -1265,6 +1519,14 @@ program
|
|
|
1265
1519
|
cli.info(` ${lastSession.messages.length} messages, last accessed: ${lastSession.lastAccessedAt.toLocaleString()}\n`);
|
|
1266
1520
|
}
|
|
1267
1521
|
// Handle --resume flag (resume specific session by ID, like mistral-vibe)
|
|
1522
|
+
if (options.resume === true) {
|
|
1523
|
+
// P6: `--resume` without an ID opens the recent-session picker.
|
|
1524
|
+
const { pickRecentSession } = await import("./cli/session-commands.js");
|
|
1525
|
+
const picked = await pickRecentSession(20);
|
|
1526
|
+
if (!picked)
|
|
1527
|
+
process.exit(process.exitCode ?? 1);
|
|
1528
|
+
options.resume = picked;
|
|
1529
|
+
}
|
|
1268
1530
|
if (options.resume) {
|
|
1269
1531
|
const { getSessionStore } = await import("./persistence/session-store.js");
|
|
1270
1532
|
const sessionStore = getSessionStore();
|
|
@@ -1280,7 +1542,9 @@ program
|
|
|
1280
1542
|
}
|
|
1281
1543
|
await sessionStore.resumeSession(session.id);
|
|
1282
1544
|
cli.info(`📂 Resuming session: ${session.name} (${session.id.slice(0, 8)})`);
|
|
1283
|
-
cli.info(` ${session.messages.length} messages, last accessed: ${session.lastAccessedAt.toLocaleString()}
|
|
1545
|
+
cli.info(` ${session.messages.length} messages, last accessed: ${session.lastAccessedAt.toLocaleString()}`);
|
|
1546
|
+
const { buildSessionRecap, formatSessionRecap } = await import("./cli/session-picker.js");
|
|
1547
|
+
cli.info(`${formatSessionRecap(buildSessionRecap(session)).join("\n")}\n`);
|
|
1284
1548
|
}
|
|
1285
1549
|
// Load environment before changing cwd so root .env values (API keys) remain available
|
|
1286
1550
|
// even when --directory points to a workspace without its own .env file.
|
|
@@ -1290,7 +1554,8 @@ program
|
|
|
1290
1554
|
process.chdir(options.directory);
|
|
1291
1555
|
}
|
|
1292
1556
|
catch (error) {
|
|
1293
|
-
|
|
1557
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
1558
|
+
process.stderr.write(`error: cannot change directory to ${options.directory}: ${detail}\n`);
|
|
1294
1559
|
process.exit(1);
|
|
1295
1560
|
}
|
|
1296
1561
|
}
|
|
@@ -1314,54 +1579,68 @@ program
|
|
|
1314
1579
|
}
|
|
1315
1580
|
try {
|
|
1316
1581
|
// Get API key from options, environment, or user settings
|
|
1582
|
+
// The OAuth-aware variant, NOT the sync one: naming a model on the command
|
|
1583
|
+
// line must not throw away a subscription login. The sync resolver is blind
|
|
1584
|
+
// to `buddy login xai`, so `--model grok-4.3` used to fall back to an
|
|
1585
|
+
// ambient XAI_API_KEY — dead, in the case measured on 2026-09-02.
|
|
1317
1586
|
const explicitProvider = options.model && !options.apiKey && !options.baseUrl
|
|
1318
|
-
? (await import('./commands/llm-provider-resolution.js')).
|
|
1319
|
-
explicitModel: options.model,
|
|
1320
|
-
})
|
|
1587
|
+
? await (await import('./commands/llm-provider-resolution.js')).resolveCommandProviderWithOAuth({ explicitModel: options.model })
|
|
1321
1588
|
: null;
|
|
1322
1589
|
let apiKey = options.apiKey || explicitProvider?.apiKey || await loadApiKey();
|
|
1323
1590
|
let baseURL = options.baseUrl || explicitProvider?.baseURL || await loadBaseURL();
|
|
1324
1591
|
let model = options.model || explicitProvider?.model || await loadModel(); // let: can be overridden by --agent
|
|
1325
|
-
const maxToolRounds =
|
|
1592
|
+
const maxToolRounds = options.maxToolRounds
|
|
1593
|
+
? parseInt(options.maxToolRounds, 10) || undefined
|
|
1594
|
+
: undefined;
|
|
1326
1595
|
if (!apiKey) {
|
|
1327
|
-
//
|
|
1328
|
-
//
|
|
1329
|
-
//
|
|
1596
|
+
// The shortest first-run path is a direct ChatGPT OAuth login. Keep the
|
|
1597
|
+
// full wizard available, but do not make a new user navigate provider,
|
|
1598
|
+
// model, and TTS choices before seeing the coding agent work.
|
|
1330
1599
|
const interactive = Boolean(process.stdin.isTTY) && Boolean(process.stdout.isTTY) &&
|
|
1331
1600
|
!options.prompt && !options.print &&
|
|
1332
1601
|
process.env.CI !== 'true' && process.env.GITHUB_ACTIONS !== 'true';
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
rl.close();
|
|
1339
|
-
const yes = answer.trim() === '' || /^y(es)?$/i.test(answer.trim());
|
|
1340
|
-
if (yes) {
|
|
1602
|
+
const recoveredProvider = await recoverFirstRunWithChatGpt({
|
|
1603
|
+
interactive,
|
|
1604
|
+
ask: async (question) => {
|
|
1605
|
+
const readline = await import('readline');
|
|
1606
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
1341
1607
|
try {
|
|
1342
|
-
|
|
1343
|
-
const result = await runOnboarding();
|
|
1344
|
-
// Bust the cached provider detection so the just-saved creds resolve.
|
|
1345
|
-
cachedProvider = undefined;
|
|
1346
|
-
apiKey = options.apiKey || await loadApiKey();
|
|
1347
|
-
baseURL = options.baseUrl || await loadBaseURL();
|
|
1348
|
-
model = options.model || result.model || await loadModel();
|
|
1349
|
-
recovered = Boolean(apiKey);
|
|
1608
|
+
return await new Promise((resolve) => rl.question(question, resolve));
|
|
1350
1609
|
}
|
|
1351
|
-
|
|
1352
|
-
|
|
1610
|
+
finally {
|
|
1611
|
+
rl.close();
|
|
1353
1612
|
}
|
|
1354
|
-
}
|
|
1613
|
+
},
|
|
1614
|
+
login: async () => {
|
|
1615
|
+
const { loginInteractive } = await import('./providers/codex-oauth.js');
|
|
1616
|
+
cli.stdout('\n🔐 ChatGPT login — opening your browser…');
|
|
1617
|
+
const auth = await loginInteractive();
|
|
1618
|
+
cli.stdout(`✅ Authenticated${auth.email ? ` as ${auth.email}` : ''}. Starting Code Buddy…`);
|
|
1619
|
+
},
|
|
1620
|
+
reloadProvider: async () => {
|
|
1621
|
+
// Bust provider detection so the OAuth file written moments ago is
|
|
1622
|
+
// immediately visible to this same process.
|
|
1623
|
+
cachedProvider = undefined;
|
|
1624
|
+
const nextApiKey = options.apiKey || await loadApiKey();
|
|
1625
|
+
if (!nextApiKey)
|
|
1626
|
+
return null;
|
|
1627
|
+
return {
|
|
1628
|
+
apiKey: nextApiKey,
|
|
1629
|
+
baseURL: options.baseUrl || await loadBaseURL(),
|
|
1630
|
+
model: options.model || await loadModel(),
|
|
1631
|
+
};
|
|
1632
|
+
},
|
|
1633
|
+
onLoginError: (err) => {
|
|
1634
|
+
logger.error('ChatGPT login did not complete', err instanceof Error ? err : { error: String(err) });
|
|
1635
|
+
},
|
|
1636
|
+
});
|
|
1637
|
+
if (recoveredProvider) {
|
|
1638
|
+
apiKey = recoveredProvider.apiKey;
|
|
1639
|
+
baseURL = recoveredProvider.baseURL;
|
|
1640
|
+
model = recoveredProvider.model;
|
|
1355
1641
|
}
|
|
1356
|
-
if (!
|
|
1357
|
-
logger.error(
|
|
1358
|
-
"❌ No AI provider configured. Pick one to get started:",
|
|
1359
|
-
" • Guided setup (recommended) — interactive wizard: buddy onboard",
|
|
1360
|
-
" • Free, no API key — sign in with your ChatGPT plan: buddy login",
|
|
1361
|
-
" • Local & free — run a model with Ollama, then: export OLLAMA_HOST=http://localhost:11434",
|
|
1362
|
-
" • API key — set GROK_API_KEY / OPENAI_API_KEY / ANTHROPIC_API_KEY / GOOGLE_API_KEY (or pass --api-key)",
|
|
1363
|
-
" Run buddy doctor to check your setup.",
|
|
1364
|
-
].join("\n"));
|
|
1642
|
+
if (!recoveredProvider) {
|
|
1643
|
+
logger.error(NO_PROVIDER_GUIDANCE);
|
|
1365
1644
|
process.exit(1);
|
|
1366
1645
|
}
|
|
1367
1646
|
}
|
|
@@ -1381,21 +1660,6 @@ program
|
|
|
1381
1660
|
confirmationService.setSessionFlag("allOperations", true);
|
|
1382
1661
|
cli.error("✅ Auto-approve: ENABLED (all tool executions will be approved)");
|
|
1383
1662
|
}
|
|
1384
|
-
// CC18: Handle --permission-mode
|
|
1385
|
-
if (options.permissionMode) {
|
|
1386
|
-
const { getPermissionModeManager } = await import("./security/permission-modes.js");
|
|
1387
|
-
const mgr = getPermissionModeManager();
|
|
1388
|
-
const validModes = ['default', 'plan', 'acceptEdits', 'dontAsk', 'bypassPermissions'];
|
|
1389
|
-
if (validModes.includes(options.permissionMode)) {
|
|
1390
|
-
const success = mgr.setMode(options.permissionMode);
|
|
1391
|
-
if (success) {
|
|
1392
|
-
cli.error(`Permission mode: ${options.permissionMode}`);
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
else {
|
|
1396
|
-
cli.error(`Invalid permission mode: ${options.permissionMode}. Valid: ${validModes.join(', ')}`);
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
1663
|
// Handle --dangerously-skip-permissions (natively)
|
|
1400
1664
|
if (options.dangerouslySkipPermissions) {
|
|
1401
1665
|
const { ConfirmationService } = await import("./utils/confirmation-service.js");
|
|
@@ -1505,7 +1769,7 @@ program
|
|
|
1505
1769
|
].filter(Boolean).join('\n\n');
|
|
1506
1770
|
// Headless mode: process prompt and exit (if prompt, message, or piped input provided)
|
|
1507
1771
|
if (combinedPrompt && (promptArg || pipedInput)) {
|
|
1508
|
-
const headlessExitCode = await processPromptHeadless(combinedPrompt, apiKey, baseURL, model, maxToolRounds, options.selfHeal !== false, resolveHeadlessOutputFormat(options), options.outputSchema, options.agent);
|
|
1772
|
+
const headlessExitCode = await processPromptHeadless(combinedPrompt, apiKey, baseURL, model, maxToolRounds, options.selfHeal !== false, resolveHeadlessOutputFormat(options), options.outputLastMessage, options.outputSchema, options.agent);
|
|
1509
1773
|
await finalizeHeadlessRun(headlessExitCode);
|
|
1510
1774
|
return;
|
|
1511
1775
|
}
|
|
@@ -1646,6 +1910,7 @@ program
|
|
|
1646
1910
|
await ensureUserSettingsDirectory();
|
|
1647
1911
|
recordStartupPhase('user-settings-done');
|
|
1648
1912
|
// ── Crash recovery: detect unclean shutdown and offer session resume ──
|
|
1913
|
+
let crashResumed = false;
|
|
1649
1914
|
if (!options.resume && !options.continue) {
|
|
1650
1915
|
try {
|
|
1651
1916
|
const { checkCrashRecovery, clearRecoveryFiles } = await import('./errors/crash-recovery.js');
|
|
@@ -1667,6 +1932,7 @@ program
|
|
|
1667
1932
|
const session = await sessionStore.getSessionByPartialId(recovery.sessionId);
|
|
1668
1933
|
if (session) {
|
|
1669
1934
|
await sessionStore.resumeSession(session.id);
|
|
1935
|
+
crashResumed = true;
|
|
1670
1936
|
cli.info(` Resuming session: ${session.name} (${session.messages.length} messages)`);
|
|
1671
1937
|
}
|
|
1672
1938
|
else {
|
|
@@ -1724,7 +1990,24 @@ program
|
|
|
1724
1990
|
// Only the interactive TUI enables it, so cron/headless/sub-agent runs cannot
|
|
1725
1991
|
// trigger a review (recursion + cost safety).
|
|
1726
1992
|
agent.enableBackgroundReview();
|
|
1727
|
-
|
|
1993
|
+
// Memory fact reconciliation (remember tool and /remember) must use the
|
|
1994
|
+
// provider this session runs on, never a provider auto-detected from env.
|
|
1995
|
+
const { setFactsMemorySessionClient } = await import('./memory/facts-memory.js');
|
|
1996
|
+
setFactsMemorySessionClient(agent.getClient());
|
|
1997
|
+
// A resumed session (--resume, --continue, crash recovery) must reach both the model
|
|
1998
|
+
// history and the chat view; resumeSession() alone only selects the store's current session.
|
|
1999
|
+
let initialHistory;
|
|
2000
|
+
if (options.resume || options.continue || crashResumed) {
|
|
2001
|
+
const { getSessionStore } = await import('./persistence/session-store.js');
|
|
2002
|
+
const resumedStore = getSessionStore();
|
|
2003
|
+
const resumedId = resumedStore.getCurrentSessionId();
|
|
2004
|
+
const resumed = resumedId ? await resumedStore.loadSession(resumedId) : null;
|
|
2005
|
+
if (resumed) {
|
|
2006
|
+
agent.hydratePersistedSession(resumed);
|
|
2007
|
+
initialHistory = agent.getChatHistory();
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
render(React.createElement(ChatInterface, { agent, initialMessage, initialHistory }), inkOptions);
|
|
1728
2011
|
// Initialize plugin system in background (non-blocking)
|
|
1729
2012
|
setImmediate(async () => {
|
|
1730
2013
|
try {
|
|
@@ -1790,6 +2073,9 @@ program
|
|
|
1790
2073
|
try {
|
|
1791
2074
|
const { RunStore } = await import('./observability/run-store.js');
|
|
1792
2075
|
const runStore = RunStore.getInstance();
|
|
2076
|
+
const { auditLogger } = await import('./security/audit-logger.js');
|
|
2077
|
+
const auditDir = process.env.CODEBUDDY_AUDIT_DIR || nodePath.join(nodeOs.homedir(), '.codebuddy');
|
|
2078
|
+
auditLogger.init({ logDir: auditDir });
|
|
1793
2079
|
const runId = runStore.startRun('interactive session', {
|
|
1794
2080
|
channel: 'terminal',
|
|
1795
2081
|
tags: ['interactive', model || 'unknown'],
|
|
@@ -1797,6 +2083,17 @@ program
|
|
|
1797
2083
|
agent.setRunId(runId);
|
|
1798
2084
|
const cleanupRun = () => {
|
|
1799
2085
|
try {
|
|
2086
|
+
if (agent) {
|
|
2087
|
+
const ext = agent.getSessionCostExtended?.();
|
|
2088
|
+
if (ext) {
|
|
2089
|
+
runStore.updateMetrics(runId, {
|
|
2090
|
+
promptTokens: ext.inputTokens,
|
|
2091
|
+
completionTokens: ext.outputTokens,
|
|
2092
|
+
totalTokens: ext.inputTokens + ext.outputTokens,
|
|
2093
|
+
totalCost: ext.total,
|
|
2094
|
+
});
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
1800
2097
|
runStore.endRun(runId, 'completed');
|
|
1801
2098
|
}
|
|
1802
2099
|
catch (_err) { /* ignore */ }
|
|
@@ -1855,7 +2152,7 @@ gitCommand
|
|
|
1855
2152
|
.option("-k, --api-key <key>", "CodeBuddy API key (or set GROK_API_KEY env var)")
|
|
1856
2153
|
.option("-u, --base-url <url>", "CodeBuddy API base URL (or set GROK_BASE_URL env var)")
|
|
1857
2154
|
.option("-m, --model <model>", "AI model to use (e.g., grok-code-fast-1, grok-4-latest) (or set GROK_MODEL env var)")
|
|
1858
|
-
.option("--max-tool-rounds <rounds>", "maximum number of tool execution rounds (default:
|
|
2155
|
+
.option("--max-tool-rounds <rounds>", "maximum number of tool execution rounds (default: 50)")
|
|
1859
2156
|
.action(async (options) => {
|
|
1860
2157
|
// Load environment before changing cwd so root .env values (API keys) remain available
|
|
1861
2158
|
// even when --directory points to a workspace without its own .env file.
|
|
@@ -1865,7 +2162,8 @@ gitCommand
|
|
|
1865
2162
|
process.chdir(options.directory);
|
|
1866
2163
|
}
|
|
1867
2164
|
catch (error) {
|
|
1868
|
-
|
|
2165
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
2166
|
+
process.stderr.write(`error: cannot change directory to ${options.directory}: ${detail}\n`);
|
|
1869
2167
|
process.exit(1);
|
|
1870
2168
|
}
|
|
1871
2169
|
}
|
|
@@ -1874,16 +2172,11 @@ gitCommand
|
|
|
1874
2172
|
const apiKey = options.apiKey || await loadApiKey();
|
|
1875
2173
|
const baseURL = options.baseUrl || await loadBaseURL();
|
|
1876
2174
|
const model = options.model || await loadModel();
|
|
1877
|
-
const maxToolRounds =
|
|
2175
|
+
const maxToolRounds = options.maxToolRounds
|
|
2176
|
+
? parseInt(options.maxToolRounds, 10) || undefined
|
|
2177
|
+
: undefined;
|
|
1878
2178
|
if (!apiKey) {
|
|
1879
|
-
logger.error(
|
|
1880
|
-
"❌ No AI provider configured. Pick one to get started:",
|
|
1881
|
-
" • Guided setup (recommended) — interactive wizard: buddy onboard",
|
|
1882
|
-
" • Free, no API key — sign in with your ChatGPT plan: buddy login",
|
|
1883
|
-
" • Local & free — run a model with Ollama, then: export OLLAMA_HOST=http://localhost:11434",
|
|
1884
|
-
" • API key — set GROK_API_KEY / OPENAI_API_KEY / ANTHROPIC_API_KEY / GOOGLE_API_KEY (or pass --api-key)",
|
|
1885
|
-
" Run buddy doctor to check your setup.",
|
|
1886
|
-
].join("\n"));
|
|
2179
|
+
logger.error(NO_PROVIDER_GUIDANCE);
|
|
1887
2180
|
process.exit(1);
|
|
1888
2181
|
}
|
|
1889
2182
|
// Save API key and base URL to user settings if provided via command line
|
|
@@ -1901,20 +2194,6 @@ gitCommand
|
|
|
1901
2194
|
// Lazy command registration: create lightweight Commander stubs that defer
|
|
1902
2195
|
// importing heavy modules until the command is actually invoked.
|
|
1903
2196
|
// This avoids loading MCP, provider, pipeline, etc. at startup.
|
|
1904
|
-
/**
|
|
1905
|
-
* Remove commands from a Commander program by name(s).
|
|
1906
|
-
* Uses splice to mutate the readonly commands array in-place.
|
|
1907
|
-
*/
|
|
1908
|
-
function removeCommands(parent, names) {
|
|
1909
|
-
const nameSet = new Set(Array.isArray(names) ? names : [names]);
|
|
1910
|
-
const cmds = parent.commands;
|
|
1911
|
-
for (let i = cmds.length - 1; i >= 0; i--) {
|
|
1912
|
-
const cmd = cmds[i];
|
|
1913
|
-
if (cmd !== undefined && nameSet.has(cmd.name())) {
|
|
1914
|
-
cmds.splice(i, 1);
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
2197
|
/**
|
|
1919
2198
|
* Register a lazy subcommand tree. When any subcommand action fires, the
|
|
1920
2199
|
* real module is imported and re-parsed to handle the invocation.
|
|
@@ -1944,19 +2223,52 @@ function addLazyCommand(parent, name, description, loader, prevalidateArgv) {
|
|
|
1944
2223
|
const realCommand = await loader();
|
|
1945
2224
|
// Replace the stub with the real command and re-parse
|
|
1946
2225
|
removeCommands(parent, name);
|
|
2226
|
+
attachUnknownOptionHint(realCommand, parent);
|
|
1947
2227
|
parent.addCommand(realCommand);
|
|
1948
2228
|
// Re-parse argv so the real command handles subcommands & options
|
|
1949
2229
|
await parent.parseAsync(process.argv);
|
|
1950
2230
|
});
|
|
1951
2231
|
}
|
|
2232
|
+
addLazyCommand(program, 'try', 'Run an isolated 60-second coding-agent demo (ChatGPT OAuth or local Ollama)', async () => {
|
|
2233
|
+
const { createTryCommand } = await import('./commands/try.js');
|
|
2234
|
+
return createTryCommand();
|
|
2235
|
+
});
|
|
2236
|
+
addLazyCommand(program, 'import', 'Import project rules and MCP servers from Cursor, Cline, Copilot, or Claude Code', async () => {
|
|
2237
|
+
const { createImportCommand } = await import('./commands/import.js');
|
|
2238
|
+
return createImportCommand();
|
|
2239
|
+
});
|
|
2240
|
+
addLazyCommand(program, 'explain', 'Explain an unfamiliar repository in one Markdown or self-contained HTML artifact', async () => {
|
|
2241
|
+
const { createExplainCommand } = await import('./commands/explain.js');
|
|
2242
|
+
return createExplainCommand();
|
|
2243
|
+
});
|
|
2244
|
+
addLazyCommand(program, 'changelog', 'Generate grouped release notes from Conventional Commits', async () => {
|
|
2245
|
+
const { createChangelogCommand } = await import('./commands/changelog.js');
|
|
2246
|
+
return createChangelogCommand();
|
|
2247
|
+
});
|
|
2248
|
+
addLazyCommand(program, 'ws', 'Manage and search the opt-in multi-repository workspace', async () => {
|
|
2249
|
+
const { createWsCommand } = await import('./commands/ws.js');
|
|
2250
|
+
return createWsCommand();
|
|
2251
|
+
});
|
|
1952
2252
|
addLazyCommand(program, 'provider', 'Manage AI providers (Claude, ChatGPT, Grok, Gemini)', async () => {
|
|
1953
2253
|
const { createProviderCommand } = await import('./commands/provider.js');
|
|
1954
2254
|
return createProviderCommand();
|
|
1955
2255
|
});
|
|
1956
|
-
addLazyCommand(program, 'mcp', 'Manage MCP
|
|
2256
|
+
addLazyCommand(program, 'mcp', 'Manage MCP servers or expose Code Buddy with `buddy mcp serve`', async () => {
|
|
1957
2257
|
const { createMCPCommand } = await import('./commands/mcp.js');
|
|
1958
2258
|
return createMCPCommand();
|
|
1959
2259
|
});
|
|
2260
|
+
addLazyCommand(program, 'campaign', 'Native editorial, book-promotion and PubCommander campaign workspace', async () => {
|
|
2261
|
+
const { createCampaignCommand } = await import('./commands/campaign.js');
|
|
2262
|
+
return createCampaignCommand();
|
|
2263
|
+
});
|
|
2264
|
+
addLazyCommand(program, 'influencer', 'Influencer & book-trailer media pipeline (scripts/influencer)', async () => {
|
|
2265
|
+
const { createInfluencerCommand } = await import('./commands/influencer.js');
|
|
2266
|
+
return createInfluencerCommand();
|
|
2267
|
+
});
|
|
2268
|
+
addLazyCommand(program, 'maison', 'Household rhythm, holidays, quiet modes and private meal safety', async () => {
|
|
2269
|
+
const { createMaisonCommand } = await import('./commands/maison.js');
|
|
2270
|
+
return createMaisonCommand();
|
|
2271
|
+
});
|
|
1960
2272
|
addLazyCommand(program, 'pipeline', 'Manage and run pipeline workflows', async () => {
|
|
1961
2273
|
const { createPipelineCommand } = await import('./commands/pipeline.js');
|
|
1962
2274
|
return createPipelineCommand();
|
|
@@ -1965,8 +2277,9 @@ addLazyCommand(program, 'pipeline', 'Manage and run pipeline workflows', async (
|
|
|
1965
2277
|
program
|
|
1966
2278
|
.command("channels")
|
|
1967
2279
|
.description("Manage channel connections (Telegram, Discord, Slack, etc.)")
|
|
1968
|
-
.argument("[action]", "start|stop|status|list", "list")
|
|
2280
|
+
.argument("[action]", "start|stop|status|list|pairing", "list")
|
|
1969
2281
|
.option("--type <type>", "Channel type (telegram|discord|slack|whatsapp|signal|google-chat|teams|matrix|webchat)")
|
|
2282
|
+
.option("--instance <name>", "Named channel instance, or default for an unnamed entry")
|
|
1970
2283
|
.option("--config <path>", "Channel config file path")
|
|
1971
2284
|
.option("--json", "Output JSON for status")
|
|
1972
2285
|
.action(async (action, options) => {
|
|
@@ -1979,12 +2292,21 @@ program
|
|
|
1979
2292
|
.description("Start the Code Buddy HTTP/WebSocket API server")
|
|
1980
2293
|
.option("--port <port>", "server port", "3000")
|
|
1981
2294
|
.option("--host <host>", "server host", "0.0.0.0")
|
|
1982
|
-
.option("--no-auth", "disable JWT authentication")
|
|
2295
|
+
.option("--no-auth", "disable JWT authentication (loopback development only)")
|
|
1983
2296
|
.action(async (options) => {
|
|
2297
|
+
let port;
|
|
2298
|
+
try {
|
|
2299
|
+
port = parseListenPort(String(options.port));
|
|
2300
|
+
}
|
|
2301
|
+
catch (error) {
|
|
2302
|
+
process.stderr.write(`error: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
2303
|
+
process.exit(1);
|
|
2304
|
+
return;
|
|
2305
|
+
}
|
|
1984
2306
|
const { startServer } = await import("./server/index.js");
|
|
1985
2307
|
try {
|
|
1986
2308
|
await startServer({
|
|
1987
|
-
port
|
|
2309
|
+
port,
|
|
1988
2310
|
host: options.host,
|
|
1989
2311
|
authEnabled: options.auth !== false,
|
|
1990
2312
|
});
|
|
@@ -1994,6 +2316,258 @@ program
|
|
|
1994
2316
|
process.exit(1);
|
|
1995
2317
|
}
|
|
1996
2318
|
});
|
|
2319
|
+
program
|
|
2320
|
+
.command("voice")
|
|
2321
|
+
.description("Push-to-talk voice commands — speak an instruction, the agent acts, the reply is spoken")
|
|
2322
|
+
.option("--mode <mode>", "voice ACT posture: default (guarded workspace, default) | plan (read-only) | acceptEdits | dontAsk | bypassPermissions", "default")
|
|
2323
|
+
.action(async (options) => {
|
|
2324
|
+
const allowed = ["default", "plan", "acceptEdits", "dontAsk", "bypassPermissions"];
|
|
2325
|
+
if (!allowed.includes(options.mode)) {
|
|
2326
|
+
cli.stdout(`error: unknown --mode '${options.mode}'. Values: ${allowed.join(", ")}`);
|
|
2327
|
+
process.exit(1);
|
|
2328
|
+
}
|
|
2329
|
+
const mode = options.mode;
|
|
2330
|
+
if (mode === "dontAsk" || mode === "bypassPermissions") {
|
|
2331
|
+
cli.stdout(`⚠️ Posture '${mode}': voice can EDIT FILES / RUN COMMANDS from a possibly-misheard transcript. Ctrl-C to abort.`);
|
|
2332
|
+
}
|
|
2333
|
+
try {
|
|
2334
|
+
const { runVoiceCommand } = await import("./cli/voice-command.js");
|
|
2335
|
+
await runVoiceCommand({
|
|
2336
|
+
permissionMode: mode,
|
|
2337
|
+
});
|
|
2338
|
+
}
|
|
2339
|
+
catch (error) {
|
|
2340
|
+
logger.error("Voice command session failed", error instanceof Error ? error : new Error(String(error)));
|
|
2341
|
+
process.exit(1);
|
|
2342
|
+
}
|
|
2343
|
+
});
|
|
2344
|
+
program
|
|
2345
|
+
.command("remind [action] [args...]")
|
|
2346
|
+
.description("Reminders — the robot reminds you (meds…) and you flag them done (add|list|agenda|done|rm)")
|
|
2347
|
+
.option("--at <time>", "time of day HH:MM (for `add`)")
|
|
2348
|
+
.option("--date <date>", "one-shot date YYYY-MM-DD — fires once then retires (not recurring)")
|
|
2349
|
+
.option("--days <csv>", "days of week 0=Sun..6=Sat, e.g. 1,3,5 (default: every day)")
|
|
2350
|
+
.option("--ahead <n>", "agenda: how many days ahead to list (default 7)")
|
|
2351
|
+
.option("--daily", "every day (default when --days omitted)")
|
|
2352
|
+
.option("--message <text>", "custom spoken/sent text")
|
|
2353
|
+
.action(async (action, args = [], options) => {
|
|
2354
|
+
const r = await import("./companion/reminders.js");
|
|
2355
|
+
const act = (action || "list").toLowerCase();
|
|
2356
|
+
try {
|
|
2357
|
+
if (act === "add") {
|
|
2358
|
+
const label = args.join(" ").trim();
|
|
2359
|
+
if (!label || !options.at) {
|
|
2360
|
+
cli.stdout('Usage: buddy remind add "<label>" --at HH:MM [--date YYYY-MM-DD] [--days 1,3,5]');
|
|
2361
|
+
process.exitCode = 1;
|
|
2362
|
+
return;
|
|
2363
|
+
}
|
|
2364
|
+
const days = options.days
|
|
2365
|
+
? String(options.days)
|
|
2366
|
+
.split(",")
|
|
2367
|
+
.map((s) => parseInt(s.trim(), 10))
|
|
2368
|
+
.filter((n) => Number.isInteger(n) && n >= 0 && n <= 6)
|
|
2369
|
+
: undefined;
|
|
2370
|
+
const rem = await r.addReminder({
|
|
2371
|
+
label,
|
|
2372
|
+
time: options.at,
|
|
2373
|
+
...(options.date ? { date: String(options.date) } : days && days.length ? { days } : {}),
|
|
2374
|
+
...(options.message ? { message: options.message } : {}),
|
|
2375
|
+
});
|
|
2376
|
+
cli.stdout(`✅ Added ${rem.id}: "${rem.label}" at ${rem.time} ${rem.date ? `on ${rem.date} (one-shot)` : rem.days?.length ? `on ${rem.days.join(",")}` : "daily"}`);
|
|
2377
|
+
}
|
|
2378
|
+
else if (act === "list") {
|
|
2379
|
+
const list = await r.listReminders();
|
|
2380
|
+
if (!list.length) {
|
|
2381
|
+
cli.stdout('No reminders yet. Add one: buddy remind add "médicaments" --at 09:00');
|
|
2382
|
+
return;
|
|
2383
|
+
}
|
|
2384
|
+
for (const x of list) {
|
|
2385
|
+
const cadence = x.date ? `${x.date} (once)` : x.days?.length ? `[${x.days.join(",")}]` : "daily";
|
|
2386
|
+
cli.stdout(`${x.enabled ? "•" : "◦"} ${x.id} ${x.time} ${cadence} ${x.label}` +
|
|
2387
|
+
`${x.lastDoneAt ? ` (last done ${x.lastDoneAt.slice(0, 16).replace("T", " ")})` : ""}`);
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
else if (act === "agenda") {
|
|
2391
|
+
const ahead = Number(options.ahead ?? 7);
|
|
2392
|
+
const agenda = r.agendaFor(await r.listReminders(), Date.now(), Number.isFinite(ahead) ? ahead : 7);
|
|
2393
|
+
if (!agenda.length) {
|
|
2394
|
+
cli.stdout("Rien de prévu dans cette période.");
|
|
2395
|
+
return;
|
|
2396
|
+
}
|
|
2397
|
+
for (const e of agenda) {
|
|
2398
|
+
const when = new Date(e.at).toLocaleDateString("fr-FR", { weekday: "short", day: "2-digit", month: "2-digit" });
|
|
2399
|
+
cli.stdout(`${when} ${e.time} ${e.label} ${e.recurring ? "[récurrent]" : "[ponctuel]"}`);
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
else if (act === "done") {
|
|
2403
|
+
const id = args[0];
|
|
2404
|
+
if (!id) {
|
|
2405
|
+
cli.stdout("Usage: buddy remind done <id>");
|
|
2406
|
+
process.exitCode = 1;
|
|
2407
|
+
return;
|
|
2408
|
+
}
|
|
2409
|
+
const done = await r.markDone(id, "cli");
|
|
2410
|
+
cli.stdout(done ? `✅ Marked done: ${done.label}` : `Reminder not found: ${id}`);
|
|
2411
|
+
if (!done)
|
|
2412
|
+
process.exitCode = 1;
|
|
2413
|
+
}
|
|
2414
|
+
else if (act === "rm" || act === "remove") {
|
|
2415
|
+
const id = args[0];
|
|
2416
|
+
if (!id) {
|
|
2417
|
+
cli.stdout("Usage: buddy remind rm <id>");
|
|
2418
|
+
process.exitCode = 1;
|
|
2419
|
+
return;
|
|
2420
|
+
}
|
|
2421
|
+
const removed = await r.removeReminder(id);
|
|
2422
|
+
cli.stdout(removed ? `🗑️ Removed ${id}` : `Reminder not found: ${id}`);
|
|
2423
|
+
if (!removed)
|
|
2424
|
+
process.exitCode = 1;
|
|
2425
|
+
}
|
|
2426
|
+
else {
|
|
2427
|
+
cli.stdout("Usage: buddy remind add|list|agenda|done|rm");
|
|
2428
|
+
process.exitCode = 1;
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
catch (e) {
|
|
2432
|
+
cli.stdout(`❌ ${e instanceof Error ? e.message : String(e)}`);
|
|
2433
|
+
process.exitCode = 1;
|
|
2434
|
+
}
|
|
2435
|
+
});
|
|
2436
|
+
program
|
|
2437
|
+
.command("rules [action] [args...]")
|
|
2438
|
+
.description("Administer sensory rules (event→action) — list|templates|enable|disable|rm|runs|validate|add")
|
|
2439
|
+
.option("--json <rule>", "rule JSON (for `add`)")
|
|
2440
|
+
.option("--from-file <path>", "read rule JSON from a file (for `add`)")
|
|
2441
|
+
.option("--template <name>", "install a bundled rule template (for `add`)")
|
|
2442
|
+
.option("--limit <n>", "max rows (for `runs`)", "20")
|
|
2443
|
+
.action(async (action, args = [], options) => {
|
|
2444
|
+
const r = await import("./sensory/sensory-rules-engine.js");
|
|
2445
|
+
const act = (action || "list").toLowerCase();
|
|
2446
|
+
try {
|
|
2447
|
+
if (act === "list") {
|
|
2448
|
+
const rules = await r.listSensoryRules();
|
|
2449
|
+
if (!rules.length) {
|
|
2450
|
+
cli.stdout("No sensory rules. Edit ~/.codebuddy/sensory-rules.json or: buddy rules add --json '…'");
|
|
2451
|
+
return;
|
|
2452
|
+
}
|
|
2453
|
+
for (const x of rules) {
|
|
2454
|
+
cli.stdout(`${x.enabled === false ? "◦" : "•"} ${x.id} on:${x.match.kind} → ${x.action.type}` +
|
|
2455
|
+
`${x.cooldownMs ? ` cd:${Math.round(x.cooldownMs / 1000)}s` : ""}${x.name ? ` (${x.name})` : ""}`);
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
else if (act === "enable" || act === "disable") {
|
|
2459
|
+
const id = args[0];
|
|
2460
|
+
if (!id) {
|
|
2461
|
+
cli.stdout(`Usage: buddy rules ${act} <id>`);
|
|
2462
|
+
process.exitCode = 1;
|
|
2463
|
+
return;
|
|
2464
|
+
}
|
|
2465
|
+
const ok = await r.toggleSensoryRule(id, act === "enable");
|
|
2466
|
+
cli.stdout(ok
|
|
2467
|
+
? `${act === "enable" ? "✅ enabled" : "⏸️ disabled"} ${id} (live within ~2s on a running server — no restart)`
|
|
2468
|
+
: `Rule not found: ${id}`);
|
|
2469
|
+
if (!ok)
|
|
2470
|
+
process.exitCode = 1;
|
|
2471
|
+
}
|
|
2472
|
+
else if (act === "rm" || act === "remove") {
|
|
2473
|
+
const id = args[0];
|
|
2474
|
+
if (!id) {
|
|
2475
|
+
cli.stdout("Usage: buddy rules rm <id>");
|
|
2476
|
+
process.exitCode = 1;
|
|
2477
|
+
return;
|
|
2478
|
+
}
|
|
2479
|
+
const removed = await r.removeSensoryRule(id);
|
|
2480
|
+
cli.stdout(removed ? `🗑️ Removed ${id}` : `Rule not found: ${id}`);
|
|
2481
|
+
if (!removed)
|
|
2482
|
+
process.exitCode = 1;
|
|
2483
|
+
}
|
|
2484
|
+
else if (act === "runs") {
|
|
2485
|
+
const runs = await r.readRuleRuns(parseInt(options.limit, 10) || 20);
|
|
2486
|
+
if (!runs.length) {
|
|
2487
|
+
cli.stdout("No rule fires logged yet.");
|
|
2488
|
+
return;
|
|
2489
|
+
}
|
|
2490
|
+
for (const run of runs) {
|
|
2491
|
+
cli.stdout(`${new Date(run.ts).toISOString().slice(0, 19).replace("T", " ")} ${run.ok ? "ok " : "FAIL"} ` +
|
|
2492
|
+
`${run.rule} ${run.action}${run.detail ? ` ${String(run.detail).slice(0, 60)}` : ""}`);
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
else if (act === "validate") {
|
|
2496
|
+
const rules = await r.listSensoryRules();
|
|
2497
|
+
let bad = 0;
|
|
2498
|
+
for (const x of rules) {
|
|
2499
|
+
const v = r.validateRule(x);
|
|
2500
|
+
if (!v.ok) {
|
|
2501
|
+
bad++;
|
|
2502
|
+
cli.stdout(`❌ ${x.id}: ${v.errors.join("; ")}`);
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
cli.stdout(bad ? `${bad} invalid rule(s).` : `✅ ${rules.length} rule(s) valid.`);
|
|
2506
|
+
}
|
|
2507
|
+
else if (act === "templates") {
|
|
2508
|
+
const { listRuleTemplates } = await import("./sensory/rule-templates.js");
|
|
2509
|
+
const templates = listRuleTemplates();
|
|
2510
|
+
cli.stdout("Available rule templates (install with: buddy rules add --template <name>):");
|
|
2511
|
+
for (const t of templates) {
|
|
2512
|
+
cli.stdout(`• ${t.name} — ${t.description}`);
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
else if (act === "add" && options.template) {
|
|
2516
|
+
const { getRuleTemplate } = await import("./sensory/rule-templates.js");
|
|
2517
|
+
const tpl = getRuleTemplate(String(options.template));
|
|
2518
|
+
if (!tpl) {
|
|
2519
|
+
cli.stdout(`❌ unknown template '${options.template}'. See: buddy rules templates`);
|
|
2520
|
+
process.exitCode = 1;
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
const rule = tpl.build();
|
|
2524
|
+
const validation = r.validateRule(rule);
|
|
2525
|
+
if (!validation.ok) {
|
|
2526
|
+
cli.stdout(`❌ template '${tpl.name}' failed validation:\n - ${validation.errors.join("\n - ")}`);
|
|
2527
|
+
process.exitCode = 1;
|
|
2528
|
+
return;
|
|
2529
|
+
}
|
|
2530
|
+
const res = await r.upsertSensoryRule(rule);
|
|
2531
|
+
cli.stdout(res.ok
|
|
2532
|
+
? `✅ Installed template '${tpl.name}' as rule ${rule.id} (disabled? ${rule.enabled === false ? "yes" : "no"})`
|
|
2533
|
+
: `❌ rejected:\n - ${res.errors.join("\n - ")}`);
|
|
2534
|
+
if (!res.ok)
|
|
2535
|
+
process.exitCode = 1;
|
|
2536
|
+
}
|
|
2537
|
+
else if (act === "add") {
|
|
2538
|
+
let raw = options.json;
|
|
2539
|
+
if (!raw && options.fromFile) {
|
|
2540
|
+
raw = await (await import("node:fs/promises")).readFile(options.fromFile, "utf8");
|
|
2541
|
+
}
|
|
2542
|
+
if (!raw) {
|
|
2543
|
+
cli.stdout('Usage: buddy rules add --json \'{"id":"x","match":{"kind":"person_entered"},"action":{"type":"alert","message":"hi"}}\'');
|
|
2544
|
+
process.exitCode = 1;
|
|
2545
|
+
return;
|
|
2546
|
+
}
|
|
2547
|
+
let rule;
|
|
2548
|
+
try {
|
|
2549
|
+
rule = JSON.parse(raw);
|
|
2550
|
+
}
|
|
2551
|
+
catch (e) {
|
|
2552
|
+
cli.stdout(`❌ invalid JSON: ${e instanceof Error ? e.message : String(e)}`);
|
|
2553
|
+
process.exitCode = 1;
|
|
2554
|
+
return;
|
|
2555
|
+
}
|
|
2556
|
+
const res = await r.upsertSensoryRule(rule);
|
|
2557
|
+
cli.stdout(res.ok ? `✅ Saved rule ${rule.id}` : `❌ rejected:\n - ${res.errors.join("\n - ")}`);
|
|
2558
|
+
if (!res.ok)
|
|
2559
|
+
process.exitCode = 1;
|
|
2560
|
+
}
|
|
2561
|
+
else {
|
|
2562
|
+
cli.stdout("Usage: buddy rules list|templates|enable|disable|rm|runs|validate|add [--template <name>]");
|
|
2563
|
+
process.exitCode = 1;
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
catch (e) {
|
|
2567
|
+
cli.stdout(`❌ ${e instanceof Error ? e.message : String(e)}`);
|
|
2568
|
+
process.exitCode = 1;
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
1997
2571
|
// Cowork (the Electron desktop GUI) needs Node >= 22; the terminal CLI runs on
|
|
1998
2572
|
// Node >= 18. Without this guard a Node 18/20 user gets a cryptic Electron/Vite
|
|
1999
2573
|
// crash mid-launch instead of a clear message — a classic first-run star-killer.
|
|
@@ -2171,6 +2745,7 @@ program
|
|
|
2171
2745
|
.command("login [provider]")
|
|
2172
2746
|
.description("Authenticate with a provider (chatgpt | xai — uses your subscription, no API key)")
|
|
2173
2747
|
.option("--code <code>", "Complete an xAI login with the code shown in the browser")
|
|
2748
|
+
.option("--no-browser", "Fail immediately instead of waiting for a browser callback")
|
|
2174
2749
|
.action(async (provider, options) => {
|
|
2175
2750
|
const target = (provider ?? "chatgpt").toLowerCase();
|
|
2176
2751
|
if (target === "xai" || target === "grok" || target === "xai-oauth") {
|
|
@@ -2182,12 +2757,18 @@ program
|
|
|
2182
2757
|
cli.stdout("Other providers (Gemini, Anthropic) authenticate via API key env vars.");
|
|
2183
2758
|
process.exit(1);
|
|
2184
2759
|
}
|
|
2185
|
-
const {
|
|
2760
|
+
const { canAttemptInteractiveLogin, LOGIN_NEEDS_BROWSER_MESSAGE } = await import("./commands/login-prerequisites.js");
|
|
2761
|
+
if (options.browser === false || !canAttemptInteractiveLogin()) {
|
|
2762
|
+
cli.error(LOGIN_NEEDS_BROWSER_MESSAGE);
|
|
2763
|
+
process.exit(1);
|
|
2764
|
+
}
|
|
2765
|
+
const { getCodexAuthFilePath } = await import("./providers/codex-oauth.js");
|
|
2766
|
+
const { loginChatGptWithBrowser } = await import('./commands/login-chatgpt.js');
|
|
2186
2767
|
cli.stdout("🔐 ChatGPT login");
|
|
2187
|
-
cli.stdout("Opening your browser
|
|
2768
|
+
cli.stdout("Opening your browser for ChatGPT sign-in ...");
|
|
2188
2769
|
cli.stdout("Sign in with your ChatGPT account, then return to this terminal.\n");
|
|
2189
2770
|
try {
|
|
2190
|
-
const auth = await
|
|
2771
|
+
const auth = await loginChatGptWithBrowser(cli);
|
|
2191
2772
|
cli.stdout("✅ Authenticated successfully");
|
|
2192
2773
|
if (auth.email)
|
|
2193
2774
|
cli.stdout(` Account: ${auth.email}`);
|
|
@@ -2195,8 +2776,11 @@ program
|
|
|
2195
2776
|
cli.stdout(` Plan: ${auth.plan_type}`);
|
|
2196
2777
|
if (auth.is_fedramp)
|
|
2197
2778
|
cli.stdout(` FedRAMP: yes`);
|
|
2198
|
-
|
|
2199
|
-
|
|
2779
|
+
const { CHATGPT_OAUTH_DEFAULT_MODEL, CHATGPT_OAUTH_SAFE_FALLBACK_MODEL, discoverChatGptModels, selectChatGptOAuthModel, } = await import('./providers/chatgpt-models.js');
|
|
2780
|
+
const catalog = await discoverChatGptModels(auth);
|
|
2781
|
+
cli.stdout(` Model: ${selectChatGptOAuthModel(CHATGPT_OAUTH_DEFAULT_MODEL, catalog)}`);
|
|
2782
|
+
if (!catalog)
|
|
2783
|
+
cli.stdout(` Safe fallback: ${CHATGPT_OAUTH_SAFE_FALLBACK_MODEL}`);
|
|
2200
2784
|
cli.stdout(`\nTokens stored at: ${getCodexAuthFilePath()}`);
|
|
2201
2785
|
cli.stdout("Run `buddy --print \"hello\"` to test, or just `buddy` for a chat session.");
|
|
2202
2786
|
}
|
|
@@ -2234,28 +2818,67 @@ program
|
|
|
2234
2818
|
});
|
|
2235
2819
|
program
|
|
2236
2820
|
.command("whoami")
|
|
2237
|
-
.description("Show current authentication status (email, plan,
|
|
2821
|
+
.description("Show current authentication status (email, plan, OAuth model)")
|
|
2238
2822
|
.action(async () => {
|
|
2823
|
+
const { formatWhoamiStatus } = await import("./commands/whoami-status.js");
|
|
2239
2824
|
const { hasCodexCredentials, getChatGptAuth } = await import("./providers/codex-oauth.js");
|
|
2825
|
+
let providerHealth = [];
|
|
2826
|
+
try {
|
|
2827
|
+
const { formatProviderHealthLines } = await import("./providers/provider-health.js");
|
|
2828
|
+
providerHealth = formatProviderHealthLines();
|
|
2829
|
+
}
|
|
2830
|
+
catch (error) {
|
|
2831
|
+
logger.debug("Health file optional or unreadable", { error });
|
|
2832
|
+
}
|
|
2833
|
+
let local = null;
|
|
2834
|
+
try {
|
|
2835
|
+
const { getSettingsManager } = await import("./utils/settings-manager.js");
|
|
2836
|
+
const settings = getSettingsManager().readUserSettingsIfPresent();
|
|
2837
|
+
if (settings?.provider) {
|
|
2838
|
+
local = {
|
|
2839
|
+
provider: settings.provider,
|
|
2840
|
+
...(settings.model || settings.defaultModel
|
|
2841
|
+
? { model: settings.model || settings.defaultModel }
|
|
2842
|
+
: {}),
|
|
2843
|
+
...(settings.baseURL ? { baseURL: settings.baseURL } : {}),
|
|
2844
|
+
};
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
catch (_error) {
|
|
2848
|
+
/* profile unreadable — ChatGPT status still prints */
|
|
2849
|
+
}
|
|
2240
2850
|
if (!hasCodexCredentials()) {
|
|
2241
|
-
|
|
2851
|
+
for (const line of formatWhoamiStatus({ chatgpt: null, local, providerHealth })) {
|
|
2852
|
+
cli.stdout(line);
|
|
2853
|
+
}
|
|
2242
2854
|
return;
|
|
2243
2855
|
}
|
|
2244
2856
|
try {
|
|
2245
2857
|
const auth = await getChatGptAuth();
|
|
2246
2858
|
if (!auth) {
|
|
2247
2859
|
cli.stdout("ChatGPT: token unreadable. Run `buddy logout` then `buddy login`.");
|
|
2860
|
+
if (local) {
|
|
2861
|
+
for (const line of formatWhoamiStatus({ chatgpt: null, local }).filter((line) => line.startsWith('Local:'))) {
|
|
2862
|
+
cli.stdout(line);
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2248
2865
|
return;
|
|
2249
2866
|
}
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2867
|
+
const { CHATGPT_OAUTH_DEFAULT_MODEL, CHATGPT_OAUTH_SAFE_FALLBACK_MODEL, discoverChatGptModels, selectChatGptOAuthModel, } = await import('./providers/chatgpt-models.js');
|
|
2868
|
+
const catalog = await discoverChatGptModels(auth);
|
|
2869
|
+
for (const line of formatWhoamiStatus({
|
|
2870
|
+
chatgpt: {
|
|
2871
|
+
email: auth.email,
|
|
2872
|
+
plan: auth.plan_type,
|
|
2873
|
+
model: selectChatGptOAuthModel(CHATGPT_OAUTH_DEFAULT_MODEL, catalog),
|
|
2874
|
+
fedramp: auth.is_fedramp,
|
|
2875
|
+
...(catalog ? {} : { fallback: CHATGPT_OAUTH_SAFE_FALLBACK_MODEL }),
|
|
2876
|
+
},
|
|
2877
|
+
local,
|
|
2878
|
+
providerHealth,
|
|
2879
|
+
})) {
|
|
2880
|
+
cli.stdout(line);
|
|
2881
|
+
}
|
|
2259
2882
|
}
|
|
2260
2883
|
catch (err) {
|
|
2261
2884
|
cli.error(`Error reading credentials: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -2341,21 +2964,33 @@ program
|
|
|
2341
2964
|
cli.stdout("\nNo additional active LLMs available for failover.");
|
|
2342
2965
|
}
|
|
2343
2966
|
const { getConfigManager } = await import("./config/toml-config.js");
|
|
2344
|
-
const
|
|
2345
|
-
|
|
2346
|
-
|
|
2967
|
+
const { isDeclaredProviderFallbackEnabled } = await import("./providers/provider-failover-policy.js");
|
|
2968
|
+
const on = isDeclaredProviderFallbackEnabled() ||
|
|
2969
|
+
Boolean(getConfigManager().getConfig().llm?.enabled);
|
|
2970
|
+
cli.stdout(`Auto-failover: ${on ? "ON" : "OFF (enable with CODEBUDDY_PROVIDER_FALLBACK=true; CODEBUDDY_LLM_FAILOVER is a deprecated alias)"}`);
|
|
2347
2971
|
});
|
|
2348
2972
|
// Council — capability-aware multi-LLM router + ensemble (judge + consensus) + learning.
|
|
2349
2973
|
program
|
|
2350
2974
|
.command("council [task...]")
|
|
2351
|
-
.description("Ask
|
|
2975
|
+
.description("Ask a capability-routed AI council with conductor roles, judge + reconcile the answers, and learn winners per task type")
|
|
2352
2976
|
.option("-n, --count <n>", "How many models to consult (default 3)")
|
|
2353
2977
|
.option("--models <list>", "Restrict to these providers/models (comma list)")
|
|
2354
2978
|
.option("--judge <model>", "Provider/model to use as the impartial judge")
|
|
2355
|
-
.option("--task-type <tag>", "Override inferred task type (code|reasoning|french|vision|general)")
|
|
2979
|
+
.option("--task-type <tag>", "Override inferred task type (code|reasoning|french|vision|general|literary categories)")
|
|
2980
|
+
.option("--task <tag>", "Task type for `council scoreboard best`")
|
|
2356
2981
|
.option("--no-consensus", "Skip the consensus/agreement summary")
|
|
2357
2982
|
.option("--scoreboard", "Print the learned model ranking and exit")
|
|
2983
|
+
.option("--fleet", "Also consult connected fleet peers (other machines' Code Buddy) over the network")
|
|
2984
|
+
.option("--no-conductor", "Disable adaptive council roles and ask every model the exact same prompt")
|
|
2985
|
+
.option("--no-synthesis", "Disable the final collective synthesis pass")
|
|
2358
2986
|
.action(async (taskParts = [], options) => {
|
|
2987
|
+
if (taskParts[0]?.toLowerCase() === 'scoreboard') {
|
|
2988
|
+
const { runScoreboardCommand } = await import("./commands/council-scoreboard.js");
|
|
2989
|
+
const ok = runScoreboardCommand(taskParts.slice(1), cli.stdout, undefined, { task: options.task });
|
|
2990
|
+
if (!ok)
|
|
2991
|
+
process.exitCode = 1;
|
|
2992
|
+
return;
|
|
2993
|
+
}
|
|
2359
2994
|
const { runCouncil } = await import("./commands/council.js");
|
|
2360
2995
|
await runCouncil((taskParts || []).join(" ").trim(), {
|
|
2361
2996
|
count: options.count ? Number(options.count) : undefined,
|
|
@@ -2364,17 +2999,25 @@ program
|
|
|
2364
2999
|
taskType: options.taskType,
|
|
2365
3000
|
consensus: options.consensus,
|
|
2366
3001
|
scoreboard: options.scoreboard,
|
|
3002
|
+
fleet: options.fleet,
|
|
3003
|
+
conductor: options.conductor,
|
|
3004
|
+
synthesis: options.synthesis,
|
|
2367
3005
|
}, cli.stdout);
|
|
2368
3006
|
});
|
|
2369
3007
|
// MCP Server command - run Code Buddy as an MCP tool provider over stdio
|
|
2370
3008
|
program
|
|
2371
3009
|
.command("mcp-server")
|
|
2372
|
-
.description("
|
|
3010
|
+
.description("Legacy alias for `buddy mcp serve`")
|
|
2373
3011
|
.option("--list", "List available MCP tools and exit")
|
|
3012
|
+
.option("--allow-write", "Expose write, shell, and execution tools")
|
|
3013
|
+
.option("--tools <glob>", "Restrict exposed tool names with glob patterns")
|
|
2374
3014
|
.action(async (options) => {
|
|
2375
3015
|
if (options.list) {
|
|
2376
3016
|
const { CodeBuddyMCPServer } = await import("./mcp/mcp-server.js");
|
|
2377
|
-
const tools = CodeBuddyMCPServer.getToolDefinitions(
|
|
3017
|
+
const tools = CodeBuddyMCPServer.getToolDefinitions({
|
|
3018
|
+
...(options.allowWrite ? { allowWrite: true } : {}),
|
|
3019
|
+
...(options.tools ? { tools: options.tools } : {}),
|
|
3020
|
+
});
|
|
2378
3021
|
// Pipeable listing.
|
|
2379
3022
|
for (const tool of tools) {
|
|
2380
3023
|
cli.stdout(`${tool.name}: ${tool.description}`);
|
|
@@ -2382,9 +3025,11 @@ program
|
|
|
2382
3025
|
return;
|
|
2383
3026
|
}
|
|
2384
3027
|
try {
|
|
2385
|
-
const {
|
|
2386
|
-
|
|
2387
|
-
|
|
3028
|
+
const { serveMCP } = await import("./commands/mcp.js");
|
|
3029
|
+
await serveMCP({
|
|
3030
|
+
...(options.allowWrite ? { allowWrite: true } : {}),
|
|
3031
|
+
...(options.tools ? { tools: options.tools } : {}),
|
|
3032
|
+
});
|
|
2388
3033
|
}
|
|
2389
3034
|
catch (error) {
|
|
2390
3035
|
logger.error("Failed to start MCP server", error instanceof Error ? error : new Error(String(error)));
|
|
@@ -2396,25 +3041,6 @@ program
|
|
|
2396
3041
|
// and its action handlers already use dynamic imports, but loading the module
|
|
2397
3042
|
// file itself pulls in transitive dependencies (logger, etc.) at startup.
|
|
2398
3043
|
// By deferring the import until the command is matched, we avoid that cost.
|
|
2399
|
-
/**
|
|
2400
|
-
* Register a lazy command group. Creates a stub command whose action
|
|
2401
|
-
* loads the real registration module and re-parses argv.
|
|
2402
|
-
*/
|
|
2403
|
-
function addLazyCommandGroup(parent, name, description, loader) {
|
|
2404
|
-
const stub = parent
|
|
2405
|
-
.command(name)
|
|
2406
|
-
.description(description)
|
|
2407
|
-
.allowUnknownOption(true)
|
|
2408
|
-
.allowExcessArguments(true)
|
|
2409
|
-
.helpOption(false);
|
|
2410
|
-
stub.action(async () => {
|
|
2411
|
-
// Remove stub and register the real commands
|
|
2412
|
-
removeCommands(parent, name);
|
|
2413
|
-
await loader();
|
|
2414
|
-
// Re-parse so the real command tree handles the invocation
|
|
2415
|
-
await parent.parseAsync(process.argv);
|
|
2416
|
-
});
|
|
2417
|
-
}
|
|
2418
3044
|
addLazyCommandGroup(program, 'daemon', 'Manage the Code Buddy daemon (background process)', async () => {
|
|
2419
3045
|
const { registerDaemonCommands } = await import('./commands/cli/daemon-commands.js');
|
|
2420
3046
|
registerDaemonCommands(program);
|
|
@@ -2427,6 +3053,18 @@ addLazyCommandGroup(program, 'speak', 'Synthesize speech using AudioReader TTS',
|
|
|
2427
3053
|
const { registerSpeakCommand } = await import('./commands/cli/speak-command.js');
|
|
2428
3054
|
registerSpeakCommand(program);
|
|
2429
3055
|
});
|
|
3056
|
+
addLazyCommandGroup(program, 'assistant', 'Manage the voice assistant (Lisa): improvement loop, voice', async () => {
|
|
3057
|
+
const { registerAssistantCommand } = await import('./commands/assistant.js');
|
|
3058
|
+
registerAssistantCommand(program);
|
|
3059
|
+
});
|
|
3060
|
+
addLazyCommandGroup(program, 'self', 'Inspect Code Buddy’s documented self-model and evolution', async () => {
|
|
3061
|
+
const { createSelfCommand } = await import('./commands/self.js');
|
|
3062
|
+
program.addCommand(createSelfCommand());
|
|
3063
|
+
});
|
|
3064
|
+
addLazyCommandGroup(program, 'widgets', 'Inline conversation widgets: list, preview, generate (authored)', async () => {
|
|
3065
|
+
const { registerWidgetsCommand } = await import('./commands/widgets.js');
|
|
3066
|
+
registerWidgetsCommand(program);
|
|
3067
|
+
});
|
|
2430
3068
|
// Utility commands (doctor, security-audit, onboard, webhook) are all registered
|
|
2431
3069
|
// by a single registerUtilityCommands() call, so we must remove all stubs before
|
|
2432
3070
|
// re-registering to avoid Commander duplicate command errors.
|
|
@@ -2436,6 +3074,11 @@ const loadUtilityCommands = async () => {
|
|
|
2436
3074
|
removeCommands(program, utilityCommandNames);
|
|
2437
3075
|
const { registerUtilityCommands } = await import('./commands/cli/utility-commands.js');
|
|
2438
3076
|
registerUtilityCommands(program);
|
|
3077
|
+
for (const name of utilityCommandNames) {
|
|
3078
|
+
const command = program.commands.find((candidate) => candidate.name() === name);
|
|
3079
|
+
if (command)
|
|
3080
|
+
attachUnknownOptionHint(command, program);
|
|
3081
|
+
}
|
|
2439
3082
|
await program.parseAsync(process.argv);
|
|
2440
3083
|
};
|
|
2441
3084
|
for (const cmdName of utilityCommandNames) {
|
|
@@ -2463,6 +3106,14 @@ addLazyCommandGroup(program, 'hub', 'Skills marketplace (search, install, publis
|
|
|
2463
3106
|
const { registerHubCommands } = await import('./commands/cli/native-engine-commands.js');
|
|
2464
3107
|
registerHubCommands(program);
|
|
2465
3108
|
});
|
|
3109
|
+
addLazyCommandGroup(program, 'curator', 'Propose-only maintenance report (memory, skills, CKG, lessons, costs)', async () => {
|
|
3110
|
+
const { registerCuratorCommand } = await import('./commands/curator-cli.js');
|
|
3111
|
+
registerCuratorCommand(program);
|
|
3112
|
+
});
|
|
3113
|
+
addLazyCommandGroup(program, 'triage', 'Write a local redacted support bundle and prompt (no network, launches nothing)', async () => {
|
|
3114
|
+
const { registerTriageCommand } = await import('./commands/cli/triage-command.js');
|
|
3115
|
+
registerTriageCommand(program);
|
|
3116
|
+
});
|
|
2466
3117
|
addLazyCommandGroup(program, 'gateway-pairing', 'Operator approval for gateway device pairing', async () => {
|
|
2467
3118
|
const { registerGatewayPairingCommands } = await import('./commands/cli/native-engine-commands.js');
|
|
2468
3119
|
registerGatewayPairingCommands(program);
|
|
@@ -2474,7 +3125,7 @@ addLazyCommandGroup(program, 'screen', 'Capture, record, or watch the screen / a
|
|
|
2474
3125
|
addLazyCommandGroup(program, 'autonomy', 'Autonomous fleet loop (claim + run colab tasks on local-first models)', async () => {
|
|
2475
3126
|
const { registerFleetAutonomyCommands } = await import('./commands/cli/native-engine-commands.js');
|
|
2476
3127
|
registerFleetAutonomyCommands(program);
|
|
2477
|
-
});
|
|
3128
|
+
}, ['colab']);
|
|
2478
3129
|
addLazyCommandGroup(program, 'device', 'Manage paired device nodes (SSH, ADB, local)', async () => {
|
|
2479
3130
|
const { registerDeviceCommands } = await import('./commands/cli/device-commands.js');
|
|
2480
3131
|
registerDeviceCommands(program);
|
|
@@ -2495,6 +3146,18 @@ addLazyCommandGroup(program, 'auth-profile', 'Manage authentication profiles (AP
|
|
|
2495
3146
|
const { registerAuthProfileCommands } = await import('./commands/cli/native-engine-commands.js');
|
|
2496
3147
|
registerAuthProfileCommands(program);
|
|
2497
3148
|
});
|
|
3149
|
+
addLazyCommand(program, 'token', 'Mint a signed JWT for the API and the mobile PWA', async () => {
|
|
3150
|
+
const { createTokenCommand } = await import('./commands/token.js');
|
|
3151
|
+
return createTokenCommand();
|
|
3152
|
+
});
|
|
3153
|
+
addLazyCommand(program, 'pair', 'Pair an Android authenticator with a local one-time code', async () => {
|
|
3154
|
+
const { createPairCommand } = await import('./commands/device-auth.js');
|
|
3155
|
+
return createPairCommand();
|
|
3156
|
+
});
|
|
3157
|
+
addLazyCommand(program, 'devices', 'Manage Android authentication devices', async () => {
|
|
3158
|
+
const { createDevicesCommand } = await import('./commands/device-auth.js');
|
|
3159
|
+
return createDevicesCommand();
|
|
3160
|
+
});
|
|
2498
3161
|
addLazyCommandGroup(program, 'fleet', 'Inspect Fleet routing and dispatch policy decisions', async () => {
|
|
2499
3162
|
const { registerFleetCommands } = await import('./commands/cli/fleet-commands.js');
|
|
2500
3163
|
registerFleetCommands(program);
|
|
@@ -2552,6 +3215,11 @@ addLazyCommand(program, 'pairing', 'Manage DM pairing security (allowlist for me
|
|
|
2552
3215
|
const { createPairingCommand } = await import('./commands/pairing.js');
|
|
2553
3216
|
return createPairingCommand();
|
|
2554
3217
|
});
|
|
3218
|
+
// Speculative shadow-workspace diagnostics
|
|
3219
|
+
addLazyCommand(program, 'shadow', 'Inspect or run speculative validation in the persistent shadow worktree', async () => {
|
|
3220
|
+
const { createShadowCommand } = await import('./commands/shadow.js');
|
|
3221
|
+
return createShadowCommand();
|
|
3222
|
+
});
|
|
2555
3223
|
// Knowledge base management — add, list, show, search, remove, context
|
|
2556
3224
|
addLazyCommand(program, 'knowledge', 'Manage agent knowledge bases (Knowledge.md files injected as context)', async () => {
|
|
2557
3225
|
const { createKnowledgeCommand } = await import('./commands/knowledge.js');
|
|
@@ -2562,11 +3230,51 @@ addLazyCommand(program, 'research', 'Wide Research: spawn parallel agent workers
|
|
|
2562
3230
|
const { createResearchCommand } = await import('./commands/research/index.js');
|
|
2563
3231
|
return createResearchCommand();
|
|
2564
3232
|
});
|
|
3233
|
+
// Meeting intelligence — local transcript/media to grounded Markdown + JSON
|
|
3234
|
+
addLazyCommand(program, 'meeting', 'Create grounded meeting notes from a local transcript, audio, or video file', async () => {
|
|
3235
|
+
const { createMeetingCommand } = await import('./commands/meeting.js');
|
|
3236
|
+
return createMeetingCommand();
|
|
3237
|
+
});
|
|
3238
|
+
// Local Scrapling scraper — fast HTTP, stealth/Cloudflare, or dynamic rendering.
|
|
3239
|
+
addLazyCommand(program, 'scrape', 'Scrape a web page locally with Scrapling (with web_fetch fallback)', async () => {
|
|
3240
|
+
const { createScrapeCommand } = await import('./commands/scrape.js');
|
|
3241
|
+
return createScrapeCommand();
|
|
3242
|
+
});
|
|
3243
|
+
// Paper QA — grounded, cited answers over a local corpus of scientific PDFs
|
|
3244
|
+
addLazyCommand(program, 'papers', 'Paper QA: ask a question over a corpus of scientific PDFs and get a grounded, cited answer', async () => {
|
|
3245
|
+
const { createPapersCommand } = await import('./commands/papers/index.js');
|
|
3246
|
+
return createPapersCommand();
|
|
3247
|
+
});
|
|
3248
|
+
// AI-Scientist-lite (Phases 0-3) — human-gated, sandboxed experiment: single pass or bounded discovery loop (opt-in)
|
|
3249
|
+
addLazyCommand(program, 'science', 'AI-Scientist-lite (EXPERIMENTAL, opt-in CODEBUDDY_AI_SCIENTIST=true): human-gated, sandboxed experiment — single pass or bounded best-first discovery loop (--loop)', async () => {
|
|
3250
|
+
const { createScienceCommand } = await import('./commands/science/index.js');
|
|
3251
|
+
return createScienceCommand();
|
|
3252
|
+
});
|
|
3253
|
+
addLazyCommand(program, 'gpu-worker', 'Run the authenticated PanoWorld/LongCat GPU job worker', async () => {
|
|
3254
|
+
const { createGpuWorkerCommand } = await import('./commands/gpu-worker.js');
|
|
3255
|
+
return createGpuWorkerCommand();
|
|
3256
|
+
});
|
|
3257
|
+
// Vision-training — synthetic perception curriculum: score robot vision vs
|
|
3258
|
+
// self-labeled scenes to find where it's weak (opt-in CODEBUDDY_VISION_TRAIN=true)
|
|
3259
|
+
addLazyCommand(program, 'vision-train', 'Synthetic perception-training loop (EXPERIMENTAL, opt-in CODEBUDDY_VISION_TRAIN=true): score the robot vision (YOLO) on labeled generated/real scenes → a weakness benchmark', async () => {
|
|
3260
|
+
const { createVisionTrainCommand } = await import('./commands/vision-train.js');
|
|
3261
|
+
return createVisionTrainCommand();
|
|
3262
|
+
});
|
|
3263
|
+
// Krea 2 LoRA — character/style LoRA dataset + fal cloud train + local plan + ComfyUI install
|
|
3264
|
+
addLazyCommand(program, 'lora', 'Krea 2 LoRA pipeline: init dataset, train cloud (fal, opt-in CODEBUDDY_LORA_TRAIN=true) or local plan, install into ComfyUI', async () => {
|
|
3265
|
+
const { createLoraCommand } = await import('./commands/lora.js');
|
|
3266
|
+
return createLoraCommand();
|
|
3267
|
+
});
|
|
2565
3268
|
// Planning Flow — OpenManus-compatible multi-agent orchestration
|
|
2566
3269
|
addLazyCommand(program, 'flow', 'Execute a multi-agent planning flow (OpenManus-compatible): plan → execute → synthesize', async () => {
|
|
2567
3270
|
const { createFlowCommand } = await import('./commands/flow.js');
|
|
2568
3271
|
return createFlowCommand();
|
|
2569
3272
|
});
|
|
3273
|
+
// Film producer — chain generated clips into a long-form film with transitions
|
|
3274
|
+
addLazyCommand(program, 'film', 'Produce a long-form film from a scene plan: generate a clip per scene → montage with transitions + music → quality gate (resumable). Subcommands: generate|assemble|status', async () => {
|
|
3275
|
+
const { createFilmCommand } = await import('./commands/film.js');
|
|
3276
|
+
return createFilmCommand();
|
|
3277
|
+
});
|
|
2570
3278
|
// Goal Ralph loop — headless judge-gated auto-continue (Hermes Agent parity)
|
|
2571
3279
|
addLazyCommand(program, 'goal', 'Run the agent toward a standing goal until a judge model confirms it is done (Ralph loop)', async () => {
|
|
2572
3280
|
const { createGoalCommand } = await import('./commands/goal-cli.js');
|
|
@@ -2575,6 +3283,48 @@ addLazyCommand(program, 'goal', 'Run the agent toward a standing goal until a ju
|
|
|
2575
3283
|
const { validateGoalCommandNumericOptions } = await import('./commands/goal-cli.js');
|
|
2576
3284
|
validateGoalCommandNumericOptions(argv);
|
|
2577
3285
|
});
|
|
3286
|
+
// Dev-loop — boucle unifiée plan→exécute→vérifie(Verifier)→juge→décide (façon /loop)
|
|
3287
|
+
addLazyCommand(program, 'loop', 'Autonomous development loop (plan → execute → verify → judge → decide) until proven done or budget exhausted', async () => {
|
|
3288
|
+
const { createLoopCommand } = await import('./commands/loop-cli.js');
|
|
3289
|
+
return createLoopCommand();
|
|
3290
|
+
}, async (argv) => {
|
|
3291
|
+
const { validateLoopCommandNumericOptions } = await import('./commands/loop-cli.js');
|
|
3292
|
+
validateLoopCommandNumericOptions(argv);
|
|
3293
|
+
});
|
|
3294
|
+
// Code Buddy 2.0 — durable mission intent + proof-carrying completion
|
|
3295
|
+
addLazyCommand(program, 'intent', 'Inspect the current Intent Graph and secret-redacted Proof Ledger', async () => {
|
|
3296
|
+
const { createIntentCommand } = await import('./commands/intent.js');
|
|
3297
|
+
return createIntentCommand();
|
|
3298
|
+
});
|
|
3299
|
+
// Code Buddy 2.0 — opt-in, repository-local living specifications
|
|
3300
|
+
addLazyCommand(program, 'intents', 'Manage replayable intent specifications (EXPERIMENTAL, opt-in CODEBUDDY_INTENTS=true)', async () => {
|
|
3301
|
+
const { createIntentsCommand } = await import('./commands/intents.js');
|
|
3302
|
+
return createIntentsCommand();
|
|
3303
|
+
});
|
|
3304
|
+
addLazyCommand(program, 'replay', 'Inspect, restore, or fork a time-travel session timeline', async () => {
|
|
3305
|
+
const { createReplayCommand } = await import('./commands/replay.js');
|
|
3306
|
+
return createReplayCommand();
|
|
3307
|
+
});
|
|
3308
|
+
addLazyCommand(program, 'share', 'Export a saved session as a self-contained, shareable HTML replay', async () => {
|
|
3309
|
+
const { createShareCommand } = await import('./commands/share.js');
|
|
3310
|
+
return createShareCommand();
|
|
3311
|
+
});
|
|
3312
|
+
addLazyCommand(program, 'cost', 'Aggregate saved-session cost and token usage by model, provider, or day', async () => {
|
|
3313
|
+
const { createCostCommand } = await import('./commands/cost.js');
|
|
3314
|
+
return createCostCommand();
|
|
3315
|
+
});
|
|
3316
|
+
addLazyCommand(program, 'forge', 'Counterfactual Forge: compare competing strategies against one proof contract', async () => {
|
|
3317
|
+
const { createForgeCommand } = await import('./commands/forge.js');
|
|
3318
|
+
return createForgeCommand();
|
|
3319
|
+
});
|
|
3320
|
+
addLazyCommand(program, 'exchange', 'Sovereign execution market: constitution, multi-LLM bids, Shadow Twin and proof-gated award', async () => {
|
|
3321
|
+
const { createExchangeCommand } = await import('./commands/exchange.js');
|
|
3322
|
+
return createExchangeCommand();
|
|
3323
|
+
});
|
|
3324
|
+
addLazyCommand(program, 'capsule', 'Compile proven outcomes into proof-backed, multi-runtime portable workflows', async () => {
|
|
3325
|
+
const { createCapsuleCommand } = await import('./commands/capsule.js');
|
|
3326
|
+
return createCapsuleCommand();
|
|
3327
|
+
});
|
|
2578
3328
|
// Todo attention bias — Manus AI-inspired persistent task list
|
|
2579
3329
|
addLazyCommand(program, 'todo', 'Manage persistent task list (todo.md) — injected at end of every agent turn for focus', async () => {
|
|
2580
3330
|
const { createTodosCommand } = await import('./commands/todos.js');
|
|
@@ -2590,6 +3340,10 @@ addLazyCommand(program, 'lessons', 'Manage lessons learned — self-improvement
|
|
|
2590
3340
|
const { createLessonsCommand } = await import('./commands/lessons.js');
|
|
2591
3341
|
return createLessonsCommand();
|
|
2592
3342
|
});
|
|
3343
|
+
addLazyCommand(program, 'resources', 'Explicit network resource inventory and read-only health selection', async () => {
|
|
3344
|
+
const { createResourcesCommand } = await import('./commands/resources.js');
|
|
3345
|
+
return createResourcesCommand();
|
|
3346
|
+
});
|
|
2593
3347
|
// Spec — BMAD-inspired spec-driven, review-gated work pipeline
|
|
2594
3348
|
addLazyCommandGroup(program, 'spec', 'Spec-driven, review-gated work pipeline (durable stories; approve before implementing)', async () => {
|
|
2595
3349
|
const { createSpecCommand } = await import('./commands/spec.js');
|
|
@@ -2640,6 +3394,11 @@ addLazyCommandGroup(program, 'improve', 'Recursive self-improvement: empirically
|
|
|
2640
3394
|
const { registerImproveCommands } = await import('./commands/cli/improve-command.js');
|
|
2641
3395
|
registerImproveCommands(program);
|
|
2642
3396
|
});
|
|
3397
|
+
// Evolve — git-versioned evolutionary self-improvement (evaluate code variants, keep the best, human-gated)
|
|
3398
|
+
addLazyCommandGroup(program, 'evolve', 'Git-versioned evolutionary self-improvement: evaluate code variants, keep the best (human-gated)', async () => {
|
|
3399
|
+
const { registerEvolveCommands } = await import('./commands/cli/evolve-command.js');
|
|
3400
|
+
registerEvolveCommands(program);
|
|
3401
|
+
});
|
|
2643
3402
|
// LSP — Language Server Protocol diagnostics (Hermes parity: `hermes lsp`)
|
|
2644
3403
|
addLazyCommandGroup(program, 'lsp', 'Language Server Protocol diagnostics', async () => {
|
|
2645
3404
|
const { registerLspCommands } = await import('./commands/cli/lsp-command.js');
|
|
@@ -2656,27 +3415,8 @@ addLazyCommandGroup(program, 'deploy', 'Generate cloud deployment configurations
|
|
|
2656
3415
|
registerDeployCommands(program);
|
|
2657
3416
|
});
|
|
2658
3417
|
// Backup — local backup management (Native Engine v2026.3.8 alignment)
|
|
2659
|
-
program
|
|
2660
|
-
|
|
2661
|
-
.description('Manage .codebuddy/ backups (create, verify, list, restore)')
|
|
2662
|
-
.option('--only-config', 'Only backup configuration files')
|
|
2663
|
-
.option('--no-include-workspace', 'Exclude workspace data')
|
|
2664
|
-
.option('--output <path>', 'Custom output directory')
|
|
2665
|
-
.action(async (subcommand, args, opts) => {
|
|
2666
|
-
const { handleBackup } = await import('./commands/handlers/backup-handlers.js');
|
|
2667
|
-
const flags = [];
|
|
2668
|
-
if (opts.onlyConfig)
|
|
2669
|
-
flags.push('--only-config');
|
|
2670
|
-
if (opts.includeWorkspace === false)
|
|
2671
|
-
flags.push('--no-include-workspace');
|
|
2672
|
-
if (opts.output)
|
|
2673
|
-
flags.push('--output', opts.output);
|
|
2674
|
-
const fullArgs = [subcommand || 'list', ...(args || []), ...flags].join(' ');
|
|
2675
|
-
const result = await handleBackup(fullArgs);
|
|
2676
|
-
// Backup command output is pipeable (scripts often capture it).
|
|
2677
|
-
if (result.response)
|
|
2678
|
-
cli.stdout(result.response);
|
|
2679
|
-
});
|
|
3418
|
+
registerBackupCommand(program, (msg) => cli.stdout(msg));
|
|
3419
|
+
registerSensoryCommand(program, (msg) => cli.stdout(msg));
|
|
2680
3420
|
// Cloud — background agent tasks (Cursor/Codex parity)
|
|
2681
3421
|
program
|
|
2682
3422
|
.command('cloud [subcommand] [args...]')
|
|
@@ -2716,5 +3456,75 @@ addLazyCommand(program, 'completions', 'Generate or install shell completion scr
|
|
|
2716
3456
|
const { createCompletionsCommand } = await import('./commands/cli/completions-command.js');
|
|
2717
3457
|
return createCompletionsCommand();
|
|
2718
3458
|
});
|
|
2719
|
-
program
|
|
3459
|
+
installPermissionModeActionHook(program, async (mode) => {
|
|
3460
|
+
const { getPermissionModeManager } = await import('./security/permission-modes.js');
|
|
3461
|
+
// setMode announces the posture itself (INFO, escalated WARN for bypass);
|
|
3462
|
+
// a second line here rendered as a false "ERROR Permission mode: <mode>".
|
|
3463
|
+
getPermissionModeManager().setMode(mode);
|
|
3464
|
+
});
|
|
3465
|
+
// Apply the profile before parsing so it governs root chat, lazy subcommands,
|
|
3466
|
+
// slash-command menus, tool selection, and `buddy --help` consistently.
|
|
3467
|
+
process.argv = hoistPermissionModeOption(process.argv);
|
|
3468
|
+
const requestedProfile = getRequestedProfile(process.argv);
|
|
3469
|
+
if (requestedProfile.kind === 'missing') {
|
|
3470
|
+
try {
|
|
3471
|
+
getConfigManager().load();
|
|
3472
|
+
}
|
|
3473
|
+
catch (_error) {
|
|
3474
|
+
// Listing available names is best-effort; the missing-value error still stands.
|
|
3475
|
+
}
|
|
3476
|
+
let available = '(none defined)';
|
|
3477
|
+
try {
|
|
3478
|
+
const names = Object.keys(getConfigManager().getConfig().profiles ?? {});
|
|
3479
|
+
if (names.length)
|
|
3480
|
+
available = names.join(', ');
|
|
3481
|
+
}
|
|
3482
|
+
catch (_error) {
|
|
3483
|
+
available = 'core, all';
|
|
3484
|
+
}
|
|
3485
|
+
process.stderr.write(`error: option '--profile <name>' argument missing. Available profiles: ${available}\n`);
|
|
3486
|
+
process.exitCode = 1;
|
|
3487
|
+
}
|
|
3488
|
+
else if (requestedProfile.kind === 'value') {
|
|
3489
|
+
try {
|
|
3490
|
+
getConfigManager().load();
|
|
3491
|
+
getConfigManager().applyProfile(requestedProfile.name);
|
|
3492
|
+
}
|
|
3493
|
+
catch (err) {
|
|
3494
|
+
process.stderr.write(`Profile error: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
3495
|
+
process.exitCode = 1;
|
|
3496
|
+
}
|
|
3497
|
+
}
|
|
3498
|
+
function isRootHelpRequest(argv) {
|
|
3499
|
+
const args = argv.slice(2);
|
|
3500
|
+
if (!args.some((arg) => arg === '--help' || arg === '-h')) {
|
|
3501
|
+
return false;
|
|
3502
|
+
}
|
|
3503
|
+
const commandNames = new Set(program.commands.map((command) => command.name()));
|
|
3504
|
+
const { operands } = program.parseOptions(args);
|
|
3505
|
+
return !operands.some((operand) => commandNames.has(operand));
|
|
3506
|
+
}
|
|
3507
|
+
// Commander writes help and immediately calls process.exit(). The root help is
|
|
3508
|
+
// larger than a macOS pipe buffer, so a slow reader can lose the queued suffix.
|
|
3509
|
+
// It is fully registered here: write it once and let Node drain stdout naturally.
|
|
3510
|
+
if (process.exitCode !== 1) {
|
|
3511
|
+
attachUnknownOptionHint(program, program);
|
|
3512
|
+
program.addHelpText('before', `Pour commencer — 6 démos qui montrent le cœur agent de code :
|
|
3513
|
+
1. buddy try
|
|
3514
|
+
Crée FizzBuzz, écrit son test et l’exécute dans un bac à sable.
|
|
3515
|
+
2. /loop "Corrige les tests en échec" (dans une session buddy)
|
|
3516
|
+
3. buddy research "Cartographie ce dépôt"
|
|
3517
|
+
4. buddy dev pr "Ajoute une petite fonctionnalité"
|
|
3518
|
+
5. /think deep "Propose le refactoring le plus sûr" (dans une session buddy)
|
|
3519
|
+
6. /share create demo (dans une session buddy)
|
|
3520
|
+
|
|
3521
|
+
`);
|
|
3522
|
+
removeCommands(program, getHiddenCliCommands());
|
|
3523
|
+
if (isRootHelpRequest(process.argv)) {
|
|
3524
|
+
program.outputHelp();
|
|
3525
|
+
}
|
|
3526
|
+
else {
|
|
3527
|
+
program.parse();
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
2720
3530
|
//# sourceMappingURL=index.js.map
|