@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/server/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createA2AJsonRpcRoutes } from './routes/a2a-jsonrpc.js';
|
|
1
2
|
/**
|
|
2
3
|
* API Server
|
|
3
4
|
*
|
|
@@ -16,6 +17,7 @@ import cors from 'cors';
|
|
|
16
17
|
import { createServer } from 'http';
|
|
17
18
|
import { createServer as createHttpsServer, Server as HttpsServer } from 'https';
|
|
18
19
|
import { resolveServerTlsOptions } from './tls-config.js';
|
|
20
|
+
import { createDeviceAuthRoutes } from './routes/device-auth.js';
|
|
19
21
|
const _require = createRequire(import.meta.url);
|
|
20
22
|
let SERVER_VERSION = '0.0.0';
|
|
21
23
|
try {
|
|
@@ -24,11 +26,14 @@ try {
|
|
|
24
26
|
catch {
|
|
25
27
|
/* ignore */
|
|
26
28
|
}
|
|
27
|
-
import { isOriginAllowed,
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
29
|
+
import { isOriginAllowed, DEFAULT_LOCALHOST_ORIGINS } from './origin-check.js';
|
|
30
|
+
import { diagnoseServerExposure } from './exposure-diagnostic.js';
|
|
31
|
+
import { createAuthMiddleware, requireLocalAnonymousAccess, requireScope, createRateLimitMiddleware, createLoggingMiddleware, createSecurityHeadersMiddleware, requestIdMiddleware, errorHandler, notFoundHandler, } from './middleware/index.js';
|
|
32
|
+
import { chatRoutes, toolsRoutes, sessionsRoutes, memoryRoutes, lessonsRoutes, healthRoutes, metricsRoutes, createWorkflowApiRouter, createA2AProtocolRoutes, createACPRoutes, createK8sHealthAliases, createCanvasRouter, createDashboardRouter, createCloudTaskRoutes, createWebhookRoutes, createCognitionRoutes, mobileRoutes, mobilePwaRouter, isMobilePwaEnabled, runsRoutes, } from './routes/index.js';
|
|
33
|
+
import { setupWebSocket, closeAllConnections, getConnectionStats, wireCognitionBridge, } from './websocket/index.js';
|
|
31
34
|
import { setupDesktopWebSocket, closeDesktopWebSocket } from './websocket/desktop-handler.js';
|
|
35
|
+
import { getPeerMethodHandler } from './websocket/peer-rpc.js';
|
|
36
|
+
import { fleetHttpDescribeEnvelope } from '../fleet/fleet-http-surface.js';
|
|
32
37
|
import { startFleetHeartbeat, stopFleetHeartbeat } from '../fleet/heartbeat-broadcaster.js';
|
|
33
38
|
import { startAutonomousTick, stopAutonomousTick } from '../fleet/autonomous-tick-broadcaster.js';
|
|
34
39
|
import { startApiHeartbeatMonitor, stopApiHeartbeatMonitor } from './heartbeat-monitor.js';
|
|
@@ -36,12 +41,17 @@ import { wireCompactionBridge, unwireCompactionBridge } from '../fleet/compactio
|
|
|
36
41
|
import { wirePeerChatBridge, unwirePeerChatBridge } from '../fleet/peer-chat-bridge.js';
|
|
37
42
|
import { wirePeerSessionBridge, unwirePeerSessionBridge } from '../fleet/peer-session-bridge.js';
|
|
38
43
|
import { wirePeerToolBridge, unwirePeerToolBridge } from '../fleet/peer-tool-bridge.js';
|
|
44
|
+
import { wirePeerCkgBridge, unwirePeerCkgBridge } from '../fleet/peer-ckg-bridge.js';
|
|
45
|
+
import { wirePeerMissionExchangeBridge, unwirePeerMissionExchangeBridge, } from '../fleet/peer-mission-exchange-bridge.js';
|
|
46
|
+
import { unwireMobileConfirmationBridge } from './websocket/confirmation-bridge.js';
|
|
39
47
|
import { logger } from '../utils/logger.js';
|
|
40
48
|
import { initMetrics } from '../metrics/index.js';
|
|
41
49
|
import { CSRFProtection } from '../security/csrf-protection.js';
|
|
42
50
|
import { initializeDatabase } from '../database/database-manager.js';
|
|
43
51
|
import { SERVER_CONFIG, TIMEOUT_CONFIG, LIMIT_CONFIG } from '../config/constants.js';
|
|
44
52
|
import { listServerModels } from './agent-adapter.js';
|
|
53
|
+
import { CognitiveHub, createInternalCognitivePrincipal, } from '../cognition/cognitive-hub.js';
|
|
54
|
+
import { InProcessCognitivePort, } from '../cognition/cognitive-port.js';
|
|
45
55
|
// Lazy import to avoid circular dependency: channels/index.ts re-exports
|
|
46
56
|
// TelegramChannel/DiscordChannel which import BaseChannel from channels/index.ts
|
|
47
57
|
// before it's fully initialized.
|
|
@@ -130,10 +140,11 @@ function wantsStatusReport(query) {
|
|
|
130
140
|
/**
|
|
131
141
|
* Create and configure the Express application
|
|
132
142
|
*/
|
|
133
|
-
function createApp(config) {
|
|
143
|
+
function createApp(config, cognitiveHub) {
|
|
134
144
|
const app = express();
|
|
135
145
|
// Trust proxy (for rate limiting behind reverse proxy)
|
|
136
146
|
app.set('trust proxy', 1);
|
|
147
|
+
app.set('authEnabled', config.authEnabled);
|
|
137
148
|
// Request ID middleware
|
|
138
149
|
app.use(requestIdMiddleware);
|
|
139
150
|
// Security headers middleware (CSP, X-Frame-Options, HSTS, etc.)
|
|
@@ -167,6 +178,10 @@ function createApp(config) {
|
|
|
167
178
|
],
|
|
168
179
|
}));
|
|
169
180
|
}
|
|
181
|
+
// Separate opt-in peer bearer auth, bounded parser and rate limit; existing REST/JWT routes unchanged.
|
|
182
|
+
if (process.env.CODEBUDDY_A2A_PEERS) {
|
|
183
|
+
app.use(createA2AJsonRpcRoutes({ publicUrl: process.env.CODEBUDDY_A2A_PUBLIC_URL ?? `http://127.0.0.1:${config.port}/a2a/v1` }));
|
|
184
|
+
}
|
|
170
185
|
// Body parsing
|
|
171
186
|
app.use(express.json({ limit: config.maxRequestSize }));
|
|
172
187
|
app.use(express.urlencoded({ extended: true, limit: config.maxRequestSize }));
|
|
@@ -184,10 +199,57 @@ function createApp(config) {
|
|
|
184
199
|
app.use('/metrics', metricsRoutes);
|
|
185
200
|
// Mobile remote-supervision routes (custom pairing-token auth)
|
|
186
201
|
app.use('/api/mobile', mobileRoutes);
|
|
202
|
+
// PWA shell (HTML/CSS/JS/manifest/SW) is public; /api and /ws still require JWT.
|
|
203
|
+
// Opt-in: without CODEBUDDY_MOBILE_PWA=true the route is absent (404).
|
|
204
|
+
if (isMobilePwaEnabled()) {
|
|
205
|
+
app.use('/__codebuddy__/mobile', mobilePwaRouter);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
app.use('/__codebuddy__/mobile', (_req, res) => {
|
|
209
|
+
res.status(404).end();
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
// Android pairs with a local code and proves key possession before JWT auth.
|
|
213
|
+
app.use('/api/auth/device', createDeviceAuthRoutes(config.jwtSecret));
|
|
187
214
|
// Authentication (applied after public health/metrics/mobile endpoints)
|
|
188
215
|
app.use(createAuthMiddleware(config));
|
|
189
216
|
// A2A routes (auth-based, exempt from CSRF) — must be mounted BEFORE CSRF middleware
|
|
190
217
|
app.use('/api/a2a', createA2AProtocolRoutes());
|
|
218
|
+
// In --no-auth mode, only the deliberately constrained A2A surface remains
|
|
219
|
+
// network-reachable. All general agent/session/tool/workflow routes below are
|
|
220
|
+
// direct-loopback only; otherwise remote chat could invoke tools indirectly.
|
|
221
|
+
app.use(requireLocalAnonymousAccess);
|
|
222
|
+
// Read-only Fleet diagnostics for the CLI. These HTTP wrappers expose the
|
|
223
|
+
// same server state and peer description as the Gateway WebSocket methods.
|
|
224
|
+
app.get('/api/fleet/status', (_req, res) => {
|
|
225
|
+
res.json({
|
|
226
|
+
status: 'ok',
|
|
227
|
+
connections: getConnectionStats(),
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
app.get('/api/fleet/describe', async (_req, res) => {
|
|
231
|
+
const describe = getPeerMethodHandler('peer.describe');
|
|
232
|
+
if (!describe) {
|
|
233
|
+
res.status(503).json({ error: 'Fleet peer description is unavailable' });
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
try {
|
|
237
|
+
const description = await describe({}, {
|
|
238
|
+
connectionId: 'http-fleet-cli',
|
|
239
|
+
scopes: ['peer:invoke'],
|
|
240
|
+
traceId: `http-fleet-${Date.now().toString(36)}`,
|
|
241
|
+
depth: 0,
|
|
242
|
+
});
|
|
243
|
+
res.json(fleetHttpDescribeEnvelope(description && typeof description === 'object'
|
|
244
|
+
? description
|
|
245
|
+
: { description }));
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
res.status(503).json({
|
|
249
|
+
error: error instanceof Error ? error.message : String(error),
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
});
|
|
191
253
|
// CSRF protection for state-changing endpoints (POST/PUT/DELETE)
|
|
192
254
|
// Applied AFTER A2A routes so they are never touched by CSRF middleware
|
|
193
255
|
if (config.authEnabled && process.env.CSRF_PROTECTION !== 'false') {
|
|
@@ -208,10 +270,13 @@ function createApp(config) {
|
|
|
208
270
|
app.use('/api/tools', toolsRoutes);
|
|
209
271
|
app.use('/api/sessions', sessionsRoutes);
|
|
210
272
|
app.use('/api/memory', memoryRoutes);
|
|
273
|
+
app.use('/api/lessons', lessonsRoutes);
|
|
274
|
+
app.use('/api/cognition', createCognitionRoutes(cognitiveHub));
|
|
211
275
|
app.use('/api/workflows', createWorkflowApiRouter());
|
|
212
276
|
app.use('/api/acp', createACPRoutes());
|
|
213
277
|
app.use('/api/cloud/tasks', createCloudTaskRoutes());
|
|
214
278
|
app.use('/api/webhooks', createWebhookRoutes());
|
|
279
|
+
app.use('/api', runsRoutes);
|
|
215
280
|
// OpenAI-compatible alias
|
|
216
281
|
app.use('/v1/chat', chatRoutes);
|
|
217
282
|
app.get('/v1/models', requireScope('chat'), (_req, res) => {
|
|
@@ -232,7 +297,7 @@ function createApp(config) {
|
|
|
232
297
|
}
|
|
233
298
|
});
|
|
234
299
|
// Peer route resolution endpoint (for testing/debugging)
|
|
235
|
-
app.post('/api/routing/resolve', async (req, res) => {
|
|
300
|
+
app.post('/api/routing/resolve', requireScope('admin'), async (req, res) => {
|
|
236
301
|
const message = req.body.message;
|
|
237
302
|
const accountId = req.body.accountId;
|
|
238
303
|
if (!message) {
|
|
@@ -297,12 +362,12 @@ function createApp(config) {
|
|
|
297
362
|
res.json({ jobs: [], stats: {} });
|
|
298
363
|
}
|
|
299
364
|
});
|
|
300
|
-
app.post('/api/cron/jobs/:id/trigger', async (req, res) => {
|
|
365
|
+
app.post('/api/cron/jobs/:id/trigger', requireScope('admin'), async (req, res) => {
|
|
301
366
|
try {
|
|
302
367
|
const { getCronScheduler } = await import('../scheduler/cron-scheduler.js');
|
|
303
368
|
const scheduler = getCronScheduler();
|
|
304
369
|
await scheduler.loadFromDisk();
|
|
305
|
-
const run = await scheduler.runJobNow(req.params.id);
|
|
370
|
+
const run = await scheduler.runJobNow(String(req.params.id || ''));
|
|
306
371
|
if (run) {
|
|
307
372
|
res.json({ success: true, run });
|
|
308
373
|
}
|
|
@@ -325,7 +390,7 @@ function createApp(config) {
|
|
|
325
390
|
res.json({});
|
|
326
391
|
}
|
|
327
392
|
});
|
|
328
|
-
app.post('/api/notifications/preferences', async (req, res) => {
|
|
393
|
+
app.post('/api/notifications/preferences', requireScope('admin'), async (req, res) => {
|
|
329
394
|
try {
|
|
330
395
|
if (!req.body || typeof req.body !== 'object') {
|
|
331
396
|
res.status(400).json({ error: 'Request body must be a JSON object' });
|
|
@@ -351,7 +416,7 @@ function createApp(config) {
|
|
|
351
416
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
352
417
|
}
|
|
353
418
|
});
|
|
354
|
-
app.post('/api/webhooks', async (req, res) => {
|
|
419
|
+
app.post('/api/webhooks', requireScope('admin'), async (req, res) => {
|
|
355
420
|
try {
|
|
356
421
|
const { name, agentMessage, secret } = req.body;
|
|
357
422
|
if (!name || typeof name !== 'string' || !agentMessage || typeof agentMessage !== 'string') {
|
|
@@ -371,11 +436,11 @@ function createApp(config) {
|
|
|
371
436
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
372
437
|
}
|
|
373
438
|
});
|
|
374
|
-
app.delete('/api/webhooks/:id', async (req, res) => {
|
|
439
|
+
app.delete('/api/webhooks/:id', requireScope('admin'), async (req, res) => {
|
|
375
440
|
try {
|
|
376
441
|
const { WebhookManager } = await import('../webhooks/webhook-manager.js');
|
|
377
442
|
const mgr = new WebhookManager();
|
|
378
|
-
if (mgr.remove(req.params.id)) {
|
|
443
|
+
if (mgr.remove(String(req.params.id || ''))) {
|
|
379
444
|
res.json({ success: true });
|
|
380
445
|
}
|
|
381
446
|
else {
|
|
@@ -386,12 +451,12 @@ function createApp(config) {
|
|
|
386
451
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
387
452
|
}
|
|
388
453
|
});
|
|
389
|
-
app.post('/api/webhooks/:id/trigger', async (req, res) => {
|
|
454
|
+
app.post('/api/webhooks/:id/trigger', requireScope('admin'), async (req, res) => {
|
|
390
455
|
try {
|
|
391
456
|
const { WebhookManager } = await import('../webhooks/webhook-manager.js');
|
|
392
457
|
const mgr = new WebhookManager();
|
|
393
458
|
const signature = req.headers['x-webhook-signature'];
|
|
394
|
-
const result = mgr.processPayload(req.params.id, req.body, signature);
|
|
459
|
+
const result = mgr.processPayload(String(req.params.id || ''), req.body, signature);
|
|
395
460
|
if ('error' in result) {
|
|
396
461
|
const status = result.error === 'Webhook not found' ? 404 : 400;
|
|
397
462
|
res.status(status).json(result);
|
|
@@ -446,7 +511,7 @@ function createApp(config) {
|
|
|
446
511
|
res.json({ running: false, enabled: false, totalTicks: 0 });
|
|
447
512
|
}
|
|
448
513
|
});
|
|
449
|
-
app.post('/api/heartbeat/start', async (_req, res) => {
|
|
514
|
+
app.post('/api/heartbeat/start', requireScope('admin'), async (_req, res) => {
|
|
450
515
|
try {
|
|
451
516
|
const { getHeartbeatEngine } = await import('../daemon/heartbeat.js');
|
|
452
517
|
const engine = getHeartbeatEngine();
|
|
@@ -457,7 +522,7 @@ function createApp(config) {
|
|
|
457
522
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
458
523
|
}
|
|
459
524
|
});
|
|
460
|
-
app.post('/api/heartbeat/stop', async (_req, res) => {
|
|
525
|
+
app.post('/api/heartbeat/stop', requireScope('admin'), async (_req, res) => {
|
|
461
526
|
try {
|
|
462
527
|
const { getHeartbeatEngine } = await import('../daemon/heartbeat.js');
|
|
463
528
|
const engine = getHeartbeatEngine();
|
|
@@ -468,7 +533,7 @@ function createApp(config) {
|
|
|
468
533
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
469
534
|
}
|
|
470
535
|
});
|
|
471
|
-
app.post('/api/heartbeat/tick', async (_req, res) => {
|
|
536
|
+
app.post('/api/heartbeat/tick', requireScope('admin'), async (_req, res) => {
|
|
472
537
|
try {
|
|
473
538
|
const { getHeartbeatEngine } = await import('../daemon/heartbeat.js');
|
|
474
539
|
const engine = getHeartbeatEngine();
|
|
@@ -504,7 +569,7 @@ function createApp(config) {
|
|
|
504
569
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
505
570
|
}
|
|
506
571
|
});
|
|
507
|
-
app.post('/api/hub/install', async (req, res) => {
|
|
572
|
+
app.post('/api/hub/install', requireScope('admin'), async (req, res) => {
|
|
508
573
|
try {
|
|
509
574
|
const { name, version } = req.body;
|
|
510
575
|
if (!name || typeof name !== 'string') {
|
|
@@ -524,11 +589,11 @@ function createApp(config) {
|
|
|
524
589
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
525
590
|
}
|
|
526
591
|
});
|
|
527
|
-
app.delete('/api/hub/:name', async (req, res) => {
|
|
592
|
+
app.delete('/api/hub/:name', requireScope('admin'), async (req, res) => {
|
|
528
593
|
try {
|
|
529
594
|
const { getSkillsHub } = await import('../skills/hub.js');
|
|
530
595
|
const hub = getSkillsHub();
|
|
531
|
-
const removed = await hub.uninstall(req.params.name);
|
|
596
|
+
const removed = await hub.uninstall(String(req.params.name || ''));
|
|
532
597
|
if (removed) {
|
|
533
598
|
res.json({ success: true });
|
|
534
599
|
}
|
|
@@ -563,7 +628,7 @@ function createApp(config) {
|
|
|
563
628
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
564
629
|
}
|
|
565
630
|
});
|
|
566
|
-
app.put('/api/identity/:name', async (req, res) => {
|
|
631
|
+
app.put('/api/identity/:name', requireScope('admin'), async (req, res) => {
|
|
567
632
|
try {
|
|
568
633
|
const { content } = req.body;
|
|
569
634
|
if (!content || typeof content !== 'string') {
|
|
@@ -577,7 +642,7 @@ function createApp(config) {
|
|
|
577
642
|
const { getIdentityManager } = await import('../identity/identity-manager.js');
|
|
578
643
|
const mgr = getIdentityManager();
|
|
579
644
|
await mgr.load(process.cwd());
|
|
580
|
-
await mgr.set(req.params.name, content);
|
|
645
|
+
await mgr.set(String(req.params.name || ''), content);
|
|
581
646
|
res.json({ success: true });
|
|
582
647
|
}
|
|
583
648
|
catch (error) {
|
|
@@ -605,7 +670,7 @@ function createApp(config) {
|
|
|
605
670
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
606
671
|
}
|
|
607
672
|
});
|
|
608
|
-
app.post('/api/groups/block', async (req, res) => {
|
|
673
|
+
app.post('/api/groups/block', requireScope('admin'), async (req, res) => {
|
|
609
674
|
try {
|
|
610
675
|
const { userId } = req.body;
|
|
611
676
|
if (!userId || typeof userId !== 'string') {
|
|
@@ -621,11 +686,11 @@ function createApp(config) {
|
|
|
621
686
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
622
687
|
}
|
|
623
688
|
});
|
|
624
|
-
app.delete('/api/groups/block/:userId', async (req, res) => {
|
|
689
|
+
app.delete('/api/groups/block/:userId', requireScope('admin'), async (req, res) => {
|
|
625
690
|
try {
|
|
626
691
|
const { getGroupSecurity } = await import('../channels/group-security.js');
|
|
627
692
|
const mgr = getGroupSecurity();
|
|
628
|
-
if (mgr.removeFromBlocklist(req.params.userId)) {
|
|
693
|
+
if (mgr.removeFromBlocklist(String(req.params.userId || ''))) {
|
|
629
694
|
res.json({ success: true });
|
|
630
695
|
}
|
|
631
696
|
else {
|
|
@@ -647,7 +712,7 @@ function createApp(config) {
|
|
|
647
712
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
648
713
|
}
|
|
649
714
|
});
|
|
650
|
-
app.post('/api/auth-profiles', async (req, res) => {
|
|
715
|
+
app.post('/api/auth-profiles', requireScope('admin'), async (req, res) => {
|
|
651
716
|
try {
|
|
652
717
|
const profile = req.body;
|
|
653
718
|
if (!profile || typeof profile !== 'object') {
|
|
@@ -676,11 +741,11 @@ function createApp(config) {
|
|
|
676
741
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
677
742
|
}
|
|
678
743
|
});
|
|
679
|
-
app.delete('/api/auth-profiles/:id', async (req, res) => {
|
|
744
|
+
app.delete('/api/auth-profiles/:id', requireScope('admin'), async (req, res) => {
|
|
680
745
|
try {
|
|
681
746
|
const { getAuthProfileManager } = await import('../auth/profile-manager.js');
|
|
682
747
|
const mgr = getAuthProfileManager();
|
|
683
|
-
if (mgr.removeProfile(req.params.id)) {
|
|
748
|
+
if (mgr.removeProfile(String(req.params.id || ''))) {
|
|
684
749
|
res.json({ success: true });
|
|
685
750
|
}
|
|
686
751
|
else {
|
|
@@ -691,7 +756,7 @@ function createApp(config) {
|
|
|
691
756
|
res.status(500).json({ error: error instanceof Error ? error.message : String(error) });
|
|
692
757
|
}
|
|
693
758
|
});
|
|
694
|
-
app.post('/api/auth-profiles/reset', async (_req, res) => {
|
|
759
|
+
app.post('/api/auth-profiles/reset', requireScope('admin'), async (_req, res) => {
|
|
695
760
|
try {
|
|
696
761
|
const { resetAuthProfileManager, getAuthProfileManager } = await import('../auth/profile-manager.js');
|
|
697
762
|
resetAuthProfileManager();
|
|
@@ -750,16 +815,113 @@ function createApp(config) {
|
|
|
750
815
|
get: { summary: 'Historical metrics data', tags: ['Metrics'] },
|
|
751
816
|
},
|
|
752
817
|
'/api/chat': {
|
|
753
|
-
post: {
|
|
818
|
+
post: {
|
|
819
|
+
summary: 'Send chat message',
|
|
820
|
+
tags: ['Chat'],
|
|
821
|
+
requestBody: {
|
|
822
|
+
required: true,
|
|
823
|
+
content: {
|
|
824
|
+
'application/json': {
|
|
825
|
+
schema: {
|
|
826
|
+
type: 'object',
|
|
827
|
+
required: ['messages'],
|
|
828
|
+
properties: {
|
|
829
|
+
messages: { type: 'array', items: { type: 'object' } },
|
|
830
|
+
sessionId: {
|
|
831
|
+
type: 'string',
|
|
832
|
+
maxLength: 512,
|
|
833
|
+
description: 'Logical conversation shared by REST chat and tool calls.',
|
|
834
|
+
},
|
|
835
|
+
stream: { type: 'boolean' },
|
|
836
|
+
},
|
|
837
|
+
},
|
|
838
|
+
},
|
|
839
|
+
},
|
|
840
|
+
},
|
|
841
|
+
},
|
|
754
842
|
},
|
|
755
843
|
'/api/chat/completions': {
|
|
756
|
-
post: {
|
|
844
|
+
post: {
|
|
845
|
+
summary: 'OpenAI-compatible chat completions',
|
|
846
|
+
tags: ['Chat'],
|
|
847
|
+
requestBody: {
|
|
848
|
+
required: true,
|
|
849
|
+
content: {
|
|
850
|
+
'application/json': {
|
|
851
|
+
schema: {
|
|
852
|
+
type: 'object',
|
|
853
|
+
required: ['messages'],
|
|
854
|
+
properties: {
|
|
855
|
+
messages: { type: 'array', items: { type: 'object' } },
|
|
856
|
+
session_id: {
|
|
857
|
+
type: 'string',
|
|
858
|
+
maxLength: 512,
|
|
859
|
+
description: 'OpenAI-style logical conversation identifier.',
|
|
860
|
+
},
|
|
861
|
+
sessionId: {
|
|
862
|
+
type: 'string',
|
|
863
|
+
maxLength: 512,
|
|
864
|
+
description: 'Code Buddy alias for session_id.',
|
|
865
|
+
},
|
|
866
|
+
stream: { type: 'boolean' },
|
|
867
|
+
},
|
|
868
|
+
},
|
|
869
|
+
},
|
|
870
|
+
},
|
|
871
|
+
},
|
|
872
|
+
},
|
|
757
873
|
},
|
|
758
874
|
'/api/tools': {
|
|
759
875
|
get: { summary: 'List available tools', tags: ['Tools'] },
|
|
760
876
|
},
|
|
761
877
|
'/api/tools/{name}/execute': {
|
|
762
|
-
post: {
|
|
878
|
+
post: {
|
|
879
|
+
summary: 'Execute a tool',
|
|
880
|
+
tags: ['Tools'],
|
|
881
|
+
requestBody: {
|
|
882
|
+
content: {
|
|
883
|
+
'application/json': {
|
|
884
|
+
schema: {
|
|
885
|
+
type: 'object',
|
|
886
|
+
properties: {
|
|
887
|
+
parameters: { type: 'object' },
|
|
888
|
+
confirmed: { type: 'boolean' },
|
|
889
|
+
sessionId: {
|
|
890
|
+
type: 'string',
|
|
891
|
+
maxLength: 512,
|
|
892
|
+
description: 'Logical conversation shared with REST chat.',
|
|
893
|
+
},
|
|
894
|
+
},
|
|
895
|
+
},
|
|
896
|
+
},
|
|
897
|
+
},
|
|
898
|
+
},
|
|
899
|
+
},
|
|
900
|
+
},
|
|
901
|
+
'/api/tools/batch': {
|
|
902
|
+
post: {
|
|
903
|
+
summary: 'Execute a sequence of tools in one logical conversation',
|
|
904
|
+
tags: ['Tools'],
|
|
905
|
+
requestBody: {
|
|
906
|
+
required: true,
|
|
907
|
+
content: {
|
|
908
|
+
'application/json': {
|
|
909
|
+
schema: {
|
|
910
|
+
type: 'object',
|
|
911
|
+
required: ['tools'],
|
|
912
|
+
properties: {
|
|
913
|
+
tools: { type: 'array', maxItems: 10, items: { type: 'object' } },
|
|
914
|
+
sessionId: {
|
|
915
|
+
type: 'string',
|
|
916
|
+
maxLength: 512,
|
|
917
|
+
description: 'Logical conversation shared with REST chat.',
|
|
918
|
+
},
|
|
919
|
+
},
|
|
920
|
+
},
|
|
921
|
+
},
|
|
922
|
+
},
|
|
923
|
+
},
|
|
924
|
+
},
|
|
763
925
|
},
|
|
764
926
|
'/api/sessions': {
|
|
765
927
|
get: { summary: 'List sessions', tags: ['Sessions'] },
|
|
@@ -836,6 +998,8 @@ function createApp(config) {
|
|
|
836
998
|
},
|
|
837
999
|
});
|
|
838
1000
|
});
|
|
1001
|
+
// Canvas / A2UI (documented at /__codebuddy__/canvas/:id and /__codebuddy__/a2ui/)
|
|
1002
|
+
app.use('/__codebuddy__', createCanvasRouter());
|
|
839
1003
|
// Dashboard SPA
|
|
840
1004
|
app.use('/__codebuddy__/dashboard', createDashboardRouter());
|
|
841
1005
|
// 404 handler
|
|
@@ -886,7 +1050,9 @@ export async function startServer(userConfig = {}) {
|
|
|
886
1050
|
catch {
|
|
887
1051
|
/* prometheus exporter optional */
|
|
888
1052
|
}
|
|
889
|
-
const
|
|
1053
|
+
const cognitiveHub = new CognitiveHub();
|
|
1054
|
+
const cognitionPort = new InProcessCognitivePort(cognitiveHub, createInternalCognitivePrincipal('embedded-cowork'));
|
|
1055
|
+
const app = createApp(config, cognitiveHub);
|
|
890
1056
|
// Optional TLS: serve the API (including /api/mobile) over HTTPS when
|
|
891
1057
|
// CODEBUDDY_HTTPS / CODEBUDDY_MOBILE_TLS is set so the mobile-supervision
|
|
892
1058
|
// endpoint can be exposed off-device securely. Default (no env) is plain HTTP,
|
|
@@ -898,6 +1064,8 @@ export async function startServer(userConfig = {}) {
|
|
|
898
1064
|
const server = tlsOptions
|
|
899
1065
|
? createHttpsServer(tlsOptions, app)
|
|
900
1066
|
: createServer(app);
|
|
1067
|
+
server._cognitiveHub = cognitiveHub;
|
|
1068
|
+
server._cognitionPort = cognitionPort;
|
|
901
1069
|
const startChannelBridge = async (baseUrl) => {
|
|
902
1070
|
try {
|
|
903
1071
|
const { getChannelManager } = await import('../channels/index.js');
|
|
@@ -947,7 +1115,11 @@ export async function startServer(userConfig = {}) {
|
|
|
947
1115
|
// Setup WebSocket if enabled
|
|
948
1116
|
if (config.websocketEnabled) {
|
|
949
1117
|
await setupWebSocket(server, config);
|
|
1118
|
+
const unwireCognition = wireCognitionBridge(cognitiveHub);
|
|
1119
|
+
server._unwireCognition =
|
|
1120
|
+
unwireCognition;
|
|
950
1121
|
logger.info('WebSocket server enabled at /ws');
|
|
1122
|
+
logger.info('Cognitive bus enabled at /ws (bounded, scoped, resumable)');
|
|
951
1123
|
// Dedicated desktop (Cowork) endpoint for the conversational core only
|
|
952
1124
|
// (chat / sessions / live stream events). Speaks the Cowork ClientEvent
|
|
953
1125
|
// /ServerEvent protocol, auth at handshake (JWT), origin-hardened. Mounted
|
|
@@ -981,6 +1153,11 @@ export async function startServer(userConfig = {}) {
|
|
|
981
1153
|
// needed: the bridge wraps standalone executors and runs gates
|
|
982
1154
|
// (allowlist + fleetSafe + workspace root) per invocation.
|
|
983
1155
|
wirePeerToolBridge();
|
|
1156
|
+
// CB2 INNOV-4 — pull-only CKG federation. The method remains registered
|
|
1157
|
+
// when disabled so callers receive CKG_SYNC_NOT_ENABLED; its handler gates
|
|
1158
|
+
// before touching the ledger.
|
|
1159
|
+
wirePeerCkgBridge();
|
|
1160
|
+
wirePeerMissionExchangeBridge();
|
|
984
1161
|
// Phase (d).16a — auto-detect the peer.chat client from env
|
|
985
1162
|
// (priority order: ollama > grok > anthropic > gemini > openai).
|
|
986
1163
|
// When no key is detected, peer.chat still wires but answers
|
|
@@ -988,16 +1165,16 @@ export async function startServer(userConfig = {}) {
|
|
|
988
1165
|
// so remote Claudes know what they're talking to.
|
|
989
1166
|
(async () => {
|
|
990
1167
|
try {
|
|
991
|
-
const { createPeerChatClientFromEnv } = await import('../fleet/peer-chat-client-factory.js');
|
|
1168
|
+
const { createPeerChatClientFromEnv, createPeerChatClientForProvider } = await import('../fleet/peer-chat-client-factory.js');
|
|
992
1169
|
const factory = createPeerChatClientFromEnv();
|
|
993
1170
|
if (factory) {
|
|
994
|
-
wirePeerChatBridge(() => factory.client, factory.info);
|
|
995
|
-
await wirePeerSessionBridge(() => factory.client);
|
|
1171
|
+
wirePeerChatBridge(() => factory.client, factory.info, (provider, model) => createPeerChatClientForProvider(provider, model));
|
|
1172
|
+
await wirePeerSessionBridge(() => factory.client, factory.info, (provider, model) => createPeerChatClientForProvider(provider, model));
|
|
996
1173
|
logger.info(`[fleet] peer.chat wired: ${factory.info.provider} (${factory.info.model}${factory.info.isLocal ? ', local' : ''})`);
|
|
997
1174
|
}
|
|
998
1175
|
else {
|
|
999
|
-
wirePeerChatBridge(() => null);
|
|
1000
|
-
await wirePeerSessionBridge(() => null);
|
|
1176
|
+
wirePeerChatBridge(() => null, null, (provider, model) => createPeerChatClientForProvider(provider, model));
|
|
1177
|
+
await wirePeerSessionBridge(() => null, null, (provider, model) => createPeerChatClientForProvider(provider, model));
|
|
1001
1178
|
logger.info('[fleet] peer.chat wired without provider — set GOOGLE_API_KEY / GROK_API_KEY / ... or OLLAMA_HOST to activate');
|
|
1002
1179
|
}
|
|
1003
1180
|
}
|
|
@@ -1022,21 +1199,70 @@ export async function startServer(userConfig = {}) {
|
|
|
1022
1199
|
logger.info(`Metrics Dashboard: ${baseUrl}/api/metrics/dashboard`);
|
|
1023
1200
|
logger.info(`Docs: ${baseUrl}/api/docs`);
|
|
1024
1201
|
logger.info(`WebSocket: ${config.websocketEnabled ? 'Enabled (/ws)' : 'Disabled'}`);
|
|
1202
|
+
// Fleet rooms (opt-in): persistent signed messages between members. Wired
|
|
1203
|
+
// after listen so auth audiences use the port actually bound.
|
|
1204
|
+
if (config.websocketEnabled && process.env.CODEBUDDY_FLEET_ROOMS === 'true') {
|
|
1205
|
+
try {
|
|
1206
|
+
const address = server.address();
|
|
1207
|
+
const port = address && typeof address === 'object' ? address.port : config.port;
|
|
1208
|
+
const { startFleetRooms } = await import('../fleet/rooms/room-server.js');
|
|
1209
|
+
server._fleetRooms =
|
|
1210
|
+
startFleetRooms({ port });
|
|
1211
|
+
}
|
|
1212
|
+
catch (error) {
|
|
1213
|
+
logger.warn('[fleet-rooms] not enabled', {
|
|
1214
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1025
1218
|
// Sensory nervous-system bridge (opt-in): ingress for the Rust buddy-sense
|
|
1026
1219
|
// daemon → internal event bus → reactions. Loopback-only.
|
|
1027
1220
|
if (process.env.CODEBUDDY_SENSORY === 'true' && !sensoryWired) {
|
|
1028
1221
|
sensoryWired = true; // wire once per process (a 2nd start would double listeners + re-bind the port)
|
|
1029
1222
|
try {
|
|
1030
1223
|
const { startSensoryBridge } = await import('../sensory/sensory-bridge.js');
|
|
1031
|
-
const { wireSensoryReactions } = await import('../sensory/reactions.js');
|
|
1224
|
+
const { shouldWireSpeechReaction, wireSensoryReactions } = await import('../sensory/reactions.js');
|
|
1032
1225
|
const { getHeartbeatScheduler } = await import('../sensory/heartbeat-scheduler.js');
|
|
1033
1226
|
const sensoryBridgeHandle = startSensoryBridge();
|
|
1227
|
+
sensoryTeardown.push(() => sensoryBridgeHandle.close());
|
|
1228
|
+
await sensoryBridgeHandle.ready;
|
|
1034
1229
|
const unwireReactions = wireSensoryReactions();
|
|
1035
|
-
|
|
1036
|
-
|
|
1230
|
+
const { wireSensoryWorkspace } = await import('../cognition/sensory-workspace.js');
|
|
1231
|
+
const embodiedCognition = wireSensoryWorkspace({
|
|
1232
|
+
workspace: cognitiveHub.workspace,
|
|
1233
|
+
mesh: cognitiveHub.mesh,
|
|
1234
|
+
});
|
|
1235
|
+
const { CognitiveContextProjector } = await import('../cognition/context-renderer.js');
|
|
1236
|
+
const cognitiveContextProjector = new CognitiveContextProjector(embodiedCognition.workspace);
|
|
1237
|
+
sensoryTeardown.push(unwireReactions, () => embodiedCognition.close());
|
|
1238
|
+
logger.info('Embodied cognition: Enabled in shadow mode (bounded workspace + parallel specialist mailboxes)');
|
|
1239
|
+
if (config.websocketEnabled && process.env.CODEBUDDY_AVATAR_BRIDGE !== 'false') {
|
|
1240
|
+
const [{ wireAvatarGatewayBridge }, { broadcast }] = await Promise.all([
|
|
1241
|
+
import('../avatar/avatar-gateway-bridge.js'),
|
|
1242
|
+
import('./websocket/handler.js'),
|
|
1243
|
+
]);
|
|
1244
|
+
const unsubscribeAvatar = wireAvatarGatewayBridge(broadcast);
|
|
1245
|
+
sensoryTeardown.push(unsubscribeAvatar);
|
|
1246
|
+
logger.info('Avatar performance bridge: Enabled (Gateway avatar:event, scope avatar:read)');
|
|
1247
|
+
}
|
|
1248
|
+
// Vision reaction (opt-in) — vision/motion → bounded local VLM description.
|
|
1037
1249
|
// Requires a shared token: a frame can trigger the webcam, so refuse to
|
|
1038
1250
|
// wire it on an unauthenticated bridge.
|
|
1039
1251
|
const sensoryToken = process.env.CODEBUDDY_SENSORY_TOKEN;
|
|
1252
|
+
// One shared response decider for the whole sensory session: the vision
|
|
1253
|
+
// arrival greeting opens the engagement window (markEngaged) that the
|
|
1254
|
+
// speech reaction's gate reads, so a greeted visitor's natural reply is
|
|
1255
|
+
// treated as addressed — no wake-word needed. Without this shared wiring
|
|
1256
|
+
// the greeting played but never opened a conversation.
|
|
1257
|
+
const { createResponseDecider, resolveSensoryResponsePolicy } = await import('../sensory/respond-decider.js');
|
|
1258
|
+
const responsePolicy = resolveSensoryResponsePolicy();
|
|
1259
|
+
for (const warning of responsePolicy.warnings) {
|
|
1260
|
+
logger.warn(`[respond-policy] ${warning}`);
|
|
1261
|
+
}
|
|
1262
|
+
const responseDecider = createResponseDecider({ chimeIn: responsePolicy.chimeIn });
|
|
1263
|
+
const { setVoiceResponseDecider } = await import('../sensory/voice-loop.js');
|
|
1264
|
+
setVoiceResponseDecider(responseDecider);
|
|
1265
|
+
sensoryTeardown.push(() => setVoiceResponseDecider(undefined));
|
|
1040
1266
|
{
|
|
1041
1267
|
const { shouldWireVisionReaction, wireVisionReaction } = await import('../sensory/vision-reaction.js');
|
|
1042
1268
|
if (shouldWireVisionReaction({ camera: process.env.CODEBUDDY_SENSORY_CAMERA, token: sensoryToken })) {
|
|
@@ -1046,6 +1272,23 @@ export async function startServer(userConfig = {}) {
|
|
|
1046
1272
|
else if (process.env.CODEBUDDY_SENSORY_CAMERA === 'true') {
|
|
1047
1273
|
logger.warn('Sensory vision reaction NOT enabled: set CODEBUDDY_SENSORY_TOKEN to allow camera triggering.');
|
|
1048
1274
|
}
|
|
1275
|
+
// Semantic vision events (person_entered/lost, drowsy) from the vision sidecar.
|
|
1276
|
+
if (shouldWireVisionReaction({ camera: process.env.CODEBUDDY_SENSORY_CAMERA, token: sensoryToken })) {
|
|
1277
|
+
const { wireSemanticVisionReaction } = await import('../sensory/semantic-vision-reaction.js');
|
|
1278
|
+
sensoryTeardown.push(wireSemanticVisionReaction({ onEngage: () => responseDecider.markEngaged('arrival') }));
|
|
1279
|
+
logger.info('Sensory semantic-vision reaction: Enabled (person/drowsy → alert + greet→engage)');
|
|
1280
|
+
}
|
|
1281
|
+
// Event→action rules engine (a camera event triggers code) — opt-in + token-gated,
|
|
1282
|
+
// since rules can run shell. Safety lives in sensory-action-executor (env-only context,
|
|
1283
|
+
// destructive-block). Off unless CODEBUDDY_SENSORY_RULES=true AND a token is set.
|
|
1284
|
+
if (process.env.CODEBUDDY_SENSORY_RULES === 'true' && sensoryToken) {
|
|
1285
|
+
const { wireSensoryRules } = await import('../sensory/sensory-rules-engine.js');
|
|
1286
|
+
sensoryTeardown.push(wireSensoryRules());
|
|
1287
|
+
logger.info('Sensory rules engine: Enabled (event → shell/webhook/alert/agent)');
|
|
1288
|
+
}
|
|
1289
|
+
else if (process.env.CODEBUDDY_SENSORY_RULES === 'true') {
|
|
1290
|
+
logger.warn('Sensory rules NOT enabled: set CODEBUDDY_SENSORY_TOKEN (rules can run shell).');
|
|
1291
|
+
}
|
|
1049
1292
|
}
|
|
1050
1293
|
// Screen reaction (opt-in) — also token-gated (an injected analyzer could capture the desktop).
|
|
1051
1294
|
if (process.env.CODEBUDDY_SENSORY_SCREEN === 'true') {
|
|
@@ -1058,11 +1301,373 @@ export async function startServer(userConfig = {}) {
|
|
|
1058
1301
|
logger.warn('Sensory screen reaction NOT enabled: set CODEBUDDY_SENSORY_TOKEN.');
|
|
1059
1302
|
}
|
|
1060
1303
|
}
|
|
1304
|
+
// Perceptive pair (opt-in) — existing screen text/keyframes → one
|
|
1305
|
+
// conductor-arbitrated local voice suggestion. No capture, agent turn,
|
|
1306
|
+
// edit or remote notification is performed.
|
|
1307
|
+
if (process.env.CODEBUDDY_SENSORY_ERRORWATCH === 'true') {
|
|
1308
|
+
const { wireErrorWatchReaction } = await import('../sensory/error-watch-reaction.js');
|
|
1309
|
+
sensoryTeardown.push(wireErrorWatchReaction());
|
|
1310
|
+
logger.info('Sensory error watch: Enabled (screen error → local voice suggestion)');
|
|
1311
|
+
}
|
|
1061
1312
|
// Speech reaction (opt-in) — speech_end → STT → 'hearing' percept (+ onHeard hook).
|
|
1062
|
-
|
|
1313
|
+
// With CODEBUDDY_SENSORY_SPEAK=true the loop closes: STT → think (local $0) → speak (Piper).
|
|
1314
|
+
if (shouldWireSpeechReaction({
|
|
1315
|
+
speech: process.env.CODEBUDDY_SENSORY_SPEECH,
|
|
1316
|
+
token: sensoryToken,
|
|
1317
|
+
})) {
|
|
1063
1318
|
const { wireSpeechReaction } = await import('../sensory/speech-reaction.js');
|
|
1064
|
-
|
|
1065
|
-
|
|
1319
|
+
if (process.env.CODEBUDDY_SENSORY_SPEAK === 'true') {
|
|
1320
|
+
const { makeVoiceReply, playCachedConversationCue, describeVoiceReadiness, prewarmVoiceModel, prewarmVoiceRuntime, resolveVoiceModel, } = await import('../sensory/voice-loop.js');
|
|
1321
|
+
const readiness = describeVoiceReadiness();
|
|
1322
|
+
// Fail LOUD: a wired-but-silent robot looks broken. Name what to set.
|
|
1323
|
+
for (const w of readiness.warnings)
|
|
1324
|
+
logger.warn(`[voice] ${w}`);
|
|
1325
|
+
const { registerDefaultVoiceSpecialists, isLoopbackCognitiveRoute } = await import('../cognition/voice-specialists.js');
|
|
1326
|
+
void resolveVoiceModel('Bonjour Lisa', {
|
|
1327
|
+
forceFastLane: true,
|
|
1328
|
+
})
|
|
1329
|
+
.then((specialistRoute) => {
|
|
1330
|
+
const registration = registerDefaultVoiceSpecialists(embodiedCognition.mesh, specialistRoute, {
|
|
1331
|
+
enabled: process.env.CODEBUDDY_COGNITIVE_SPECIALISTS !== 'false',
|
|
1332
|
+
maxActivationsPerHour: Number(process.env.CODEBUDDY_COGNITIVE_SPECIALIST_MAX_PER_HOUR ?? 30),
|
|
1333
|
+
});
|
|
1334
|
+
logger.info(`[cognition] voice specialists ${registration.enabled ? 'enabled' : 'disabled'} ` +
|
|
1335
|
+
`reason=${registration.reason} models=${specialistRoute.model} ` +
|
|
1336
|
+
`ids=${registration.specialistIds.join(',') || 'none'}`);
|
|
1337
|
+
})
|
|
1338
|
+
.catch((error) => {
|
|
1339
|
+
logger.warn(`[cognition] voice specialists unavailable: ${error instanceof Error ? error.message : String(error)}`);
|
|
1340
|
+
});
|
|
1341
|
+
const acquireCognitiveContext = (route, heard) => {
|
|
1342
|
+
const privacyClearance = route.baseURL && isLoopbackCognitiveRoute(route.baseURL)
|
|
1343
|
+
? 'local-only'
|
|
1344
|
+
: 'cloud-ok';
|
|
1345
|
+
const lease = cognitiveContextProjector.begin({
|
|
1346
|
+
consumerId: 'voice:resident',
|
|
1347
|
+
privacyClearance,
|
|
1348
|
+
query: heard,
|
|
1349
|
+
maxItems: 4,
|
|
1350
|
+
maxChars: 1_200,
|
|
1351
|
+
});
|
|
1352
|
+
return lease.leaseId ? lease : null;
|
|
1353
|
+
};
|
|
1354
|
+
// Pay the real cold costs (route probe, Ollama model load, common Piper clips)
|
|
1355
|
+
// before somebody speaks. All work is background and never delays server readiness.
|
|
1356
|
+
const prewarmFactLane = async () => {
|
|
1357
|
+
const factModel = process.env.CODEBUDDY_SENSORY_SPEAK_FACT_MODEL?.trim();
|
|
1358
|
+
if (!factModel)
|
|
1359
|
+
return;
|
|
1360
|
+
const route = await resolveVoiceModel('Pourquoi le ciel est-il bleu ?');
|
|
1361
|
+
const result = await prewarmVoiceModel({ route });
|
|
1362
|
+
logger.info(`[voice] factual model warm: model=${result.model} ` +
|
|
1363
|
+
`${result.warmed ? `${result.durationMs}ms` : result.reason || 'skipped'}`);
|
|
1364
|
+
};
|
|
1365
|
+
void prewarmVoiceRuntime()
|
|
1366
|
+
.then(async (result) => {
|
|
1367
|
+
logger.info(`[voice] runtime warm: model=${result.route.model} ` +
|
|
1368
|
+
`route=${result.routeMs}ms ollama=${result.model.warmed ? `${result.model.durationMs}ms` : result.model.reason || 'skipped'} ` +
|
|
1369
|
+
`tts=${result.tts.cached}/${result.tts.attempted} (${result.tts.durationMs}ms)`);
|
|
1370
|
+
await prewarmFactLane();
|
|
1371
|
+
})
|
|
1372
|
+
.catch((err) => {
|
|
1373
|
+
logger.warn(`[voice] runtime prewarm failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1374
|
+
});
|
|
1375
|
+
const refreshValue = Number(process.env.CODEBUDDY_VOICE_MODEL_REFRESH_MS);
|
|
1376
|
+
const modelRefreshMs = Number.isFinite(refreshValue) && refreshValue >= 0 ? refreshValue : 15 * 60_000;
|
|
1377
|
+
if (process.env.CODEBUDDY_VOICE_MODEL_PREWARM !== 'false' &&
|
|
1378
|
+
modelRefreshMs > 0) {
|
|
1379
|
+
const keepWarmTimer = setInterval(() => {
|
|
1380
|
+
void prewarmVoiceModel()
|
|
1381
|
+
.then(() => prewarmFactLane())
|
|
1382
|
+
.catch(() => undefined);
|
|
1383
|
+
}, modelRefreshMs);
|
|
1384
|
+
keepWarmTimer.unref();
|
|
1385
|
+
sensoryTeardown.push(() => clearInterval(keepWarmTimer));
|
|
1386
|
+
}
|
|
1387
|
+
// Build the richer relationship graph before the first user turn. The cache remains
|
|
1388
|
+
// latency-bounded if startup warming has not completed when somebody speaks.
|
|
1389
|
+
if (process.env.CODEBUDDY_COMPANION_RELATIONAL === 'true') {
|
|
1390
|
+
void import('../companion/relational-context.js')
|
|
1391
|
+
.then((m) => m.prewarmVoiceRelationalContext())
|
|
1392
|
+
.catch(() => undefined);
|
|
1393
|
+
}
|
|
1394
|
+
// ACT (opt-in): a spoken command drives a REAL agent turn (can edit/run) under a
|
|
1395
|
+
// permission posture. Default off → today's chatty companion reply.
|
|
1396
|
+
// Both paths use the hybrid for conversational MEMORY + persona warmth + phatic
|
|
1397
|
+
// short-circuit. With ACT on, a real question/command escalates to a GROUNDED agent
|
|
1398
|
+
// turn (reads/searches under the posture). With ACT off, ordinary dialogue stays on
|
|
1399
|
+
// the fast warm lane while Lisa can still inspect herself in read-only plan mode.
|
|
1400
|
+
const { makeHybridReply, classifyLisaIntrospection } = await import('../sensory/hybrid-reply.js');
|
|
1401
|
+
const { getCrossChannelConversationBridge } = await import('../conversation/cross-channel-bridge.js');
|
|
1402
|
+
const { createCanonicalVoiceReplySpeaker, speakCanonicalVoiceInitiative, } = await import('../conversation/voice-continuity.js');
|
|
1403
|
+
const conversationBridge = getCrossChannelConversationBridge();
|
|
1404
|
+
// Resolve activity on every turn. The voice process may start
|
|
1405
|
+
// before Telegram/Cowork publishes the rendezvous event.
|
|
1406
|
+
const sharedHistory = () => conversationBridge.isActive() ? conversationBridge.history() : [];
|
|
1407
|
+
let replyFn;
|
|
1408
|
+
if (readiness.act) {
|
|
1409
|
+
// Grounded turn can take a few seconds → speak a short ack first so a real
|
|
1410
|
+
// question isn't met with silence. Optional repo cwd so it grounds on real files.
|
|
1411
|
+
const { sayNow } = await import('../sensory/voice-loop.js');
|
|
1412
|
+
const speakCwd = process.env.CODEBUDDY_SENSORY_SPEAK_CWD;
|
|
1413
|
+
replyFn = makeHybridReply({
|
|
1414
|
+
permissionMode: readiness.permissionMode || 'default',
|
|
1415
|
+
...(speakCwd ? { cwd: speakCwd } : {}),
|
|
1416
|
+
sharedHistory,
|
|
1417
|
+
acquireCognitiveContext,
|
|
1418
|
+
ack: async (_transcript, opts) => {
|
|
1419
|
+
await sayNow("D'accord, je regarde ça.", {
|
|
1420
|
+
signal: opts?.signal,
|
|
1421
|
+
phoneDelivery: 'never',
|
|
1422
|
+
});
|
|
1423
|
+
},
|
|
1424
|
+
});
|
|
1425
|
+
}
|
|
1426
|
+
else {
|
|
1427
|
+
const { sayNow } = await import('../sensory/voice-loop.js');
|
|
1428
|
+
const speakCwd = process.env.CODEBUDDY_SENSORY_SPEAK_CWD;
|
|
1429
|
+
replyFn = makeHybridReply({
|
|
1430
|
+
permissionMode: 'plan',
|
|
1431
|
+
...(speakCwd ? { cwd: speakCwd } : {}),
|
|
1432
|
+
classify: (heard) => classifyLisaIntrospection(heard) !== null,
|
|
1433
|
+
sharedHistory,
|
|
1434
|
+
acquireCognitiveContext,
|
|
1435
|
+
ack: async (_transcript, opts) => {
|
|
1436
|
+
await sayNow("D'accord, je regarde ça.", {
|
|
1437
|
+
signal: opts?.signal,
|
|
1438
|
+
phoneDelivery: 'never',
|
|
1439
|
+
});
|
|
1440
|
+
},
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
let latestVoiceTiming;
|
|
1444
|
+
const reply = makeVoiceReply({
|
|
1445
|
+
replyFn,
|
|
1446
|
+
onConversationTurn: async (turn) => {
|
|
1447
|
+
await conversationBridge.recordVoiceTurn(turn);
|
|
1448
|
+
},
|
|
1449
|
+
onCorrelatedConversationTurn: (turn) => {
|
|
1450
|
+
if (turn.role === 'assistant') {
|
|
1451
|
+
embodiedCognition.mesh.publish({
|
|
1452
|
+
kind: 'result',
|
|
1453
|
+
producerId: 'voice:dialogue',
|
|
1454
|
+
correlationId: turn.turnId ?? `voice-assistant:${Date.now()}`,
|
|
1455
|
+
salience: 0.8,
|
|
1456
|
+
confidence: 1,
|
|
1457
|
+
privacy: 'local-only',
|
|
1458
|
+
provenance: { source: 'voice-loop' },
|
|
1459
|
+
ttlMs: 5 * 60_000,
|
|
1460
|
+
payload: { role: turn.role, content: turn.content, surface: 'voice' },
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
},
|
|
1464
|
+
onTiming: (timing) => {
|
|
1465
|
+
latestVoiceTiming = timing;
|
|
1466
|
+
},
|
|
1467
|
+
});
|
|
1468
|
+
// Human-like response policy: contextual/addressed always install the shared
|
|
1469
|
+
// decider. Only contextual permits the optional high-bar chime-in judge; addressed
|
|
1470
|
+
// keeps deterministic address/greeting/continuity only. `always` is the explicit
|
|
1471
|
+
// unfiltered push-to-talk/test escape hatch resolved and warned at startup above.
|
|
1472
|
+
// Reminder voice-ack: a spoken "c'est fait" marks a PENDING reminder done. It binds
|
|
1473
|
+
// only to a reminder fired in its window (safety: never from ambient speech / the
|
|
1474
|
+
// chime-in LLM), bypasses the silence gate, reads the bind back, and short-circuits
|
|
1475
|
+
// the normal reply so the robot doesn't both confirm AND chat.
|
|
1476
|
+
// `reply` is a VoiceReplyHandler (callable + `.interrupt()`); the wrappers below
|
|
1477
|
+
// replace it with plain handlers, so type onHeard by the call contract they share.
|
|
1478
|
+
let onHeard = reply;
|
|
1479
|
+
let reminderShortcut;
|
|
1480
|
+
let maisonShortcut;
|
|
1481
|
+
if (process.env.CODEBUDDY_REMINDERS === 'true') {
|
|
1482
|
+
const rem = await import('../companion/reminders.js');
|
|
1483
|
+
const { sayNow } = await import('../sensory/voice-loop.js');
|
|
1484
|
+
// A reminder voice-ack OR a voice-creation both bypass the silence gate and
|
|
1485
|
+
// short-circuit the normal reply (the robot confirms instead of chatting).
|
|
1486
|
+
reminderShortcut = (t) => rem.matchAck(t, Date.now()) !== null ||
|
|
1487
|
+
rem.isSnoozeCommand(t, Date.now()) ||
|
|
1488
|
+
rem.isUndoCommand(t, Date.now()) ||
|
|
1489
|
+
rem.isReminderVoiceCommand(t) ||
|
|
1490
|
+
rem.parseVoiceReminder(t) !== null;
|
|
1491
|
+
onHeard = async (t, context) => {
|
|
1492
|
+
const sayCanonical = createCanonicalVoiceReplySpeaker(t, (content) => sayNow(content, { phoneDelivery: 'never' }), conversationBridge);
|
|
1493
|
+
// Spoken undo FIRST: a bare "annule" right after a creation reverts it (the
|
|
1494
|
+
// confirm-and-await flow, ambient-style — the confirmation read the cadence
|
|
1495
|
+
// back, the correction stays natural speech). Window-bounded, so it never
|
|
1496
|
+
// hijacks an "annule" said minutes later in conversation.
|
|
1497
|
+
const undone = rem.undoPending(t, Date.now());
|
|
1498
|
+
if (undone) {
|
|
1499
|
+
await rem.removeReminder(undone.id);
|
|
1500
|
+
await sayCanonical(`OK, j'annule le rappel : ${undone.label}.`);
|
|
1501
|
+
return;
|
|
1502
|
+
}
|
|
1503
|
+
// Snooze a pending reminder ("dans 10 minutes" / "plus tard") before anything else.
|
|
1504
|
+
const snoozed = await rem.snoozePending(t, Date.now());
|
|
1505
|
+
if (snoozed) {
|
|
1506
|
+
const mins = Math.max(1, Math.round(snoozed.delayMs / 60_000));
|
|
1507
|
+
await sayCanonical(`D'accord, je te le rappelle dans ${mins} minute${mins > 1 ? 's' : ''}.`);
|
|
1508
|
+
return;
|
|
1509
|
+
}
|
|
1510
|
+
const id = rem.matchAck(t, Date.now());
|
|
1511
|
+
if (id) {
|
|
1512
|
+
const done = await rem.markDone(id, 'voice');
|
|
1513
|
+
if (done)
|
|
1514
|
+
await sayCanonical(rem.reminderReadback(done.label));
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1517
|
+
// Manage reminders by voice (list / remove / disable) BEFORE create, so
|
|
1518
|
+
// "supprime le rappel du train" isn't misread as a new reminder.
|
|
1519
|
+
if (await rem.handleReminderVoiceCommand(t, { speak: sayCanonical }))
|
|
1520
|
+
return;
|
|
1521
|
+
const created = rem.parseVoiceReminder(t);
|
|
1522
|
+
if (created) {
|
|
1523
|
+
try {
|
|
1524
|
+
const r = await rem.addReminder(created);
|
|
1525
|
+
// Arm the spoken undo: a bare "annule" within the window reverts THIS creation.
|
|
1526
|
+
rem.noteCreatedForUndo(r, Date.now());
|
|
1527
|
+
// Read back the CADENCE ("demain" / "tous les jours") so a mis-captured
|
|
1528
|
+
// recurrence is audible on the spot (the train-bug class of confusion).
|
|
1529
|
+
await sayCanonical(`C'est noté : ${r.label}, ${rem.reminderCadencePhrase(r)} à ${r.time}.`);
|
|
1530
|
+
}
|
|
1531
|
+
catch (err) {
|
|
1532
|
+
logger.warn(`[reminders] voice create failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1533
|
+
}
|
|
1534
|
+
return;
|
|
1535
|
+
}
|
|
1536
|
+
await reply(t, context);
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
// Maison shortcuts are deterministic and local: quiet/focus/guest/cooking modes and
|
|
1540
|
+
// named cooking timers do not wait for an LLM. Explicit wording only, so ordinary
|
|
1541
|
+
// conversation still falls through to the normal hybrid reply.
|
|
1542
|
+
{
|
|
1543
|
+
const maison = await import('../companion/maison-voice-actions.js');
|
|
1544
|
+
const { sayNow } = await import('../sensory/voice-loop.js');
|
|
1545
|
+
maisonShortcut = maison.isMaisonVoiceCommand;
|
|
1546
|
+
const inner = onHeard;
|
|
1547
|
+
onHeard = async (t, context) => {
|
|
1548
|
+
const sayCanonical = createCanonicalVoiceReplySpeaker(t, (content) => sayNow(content, { phoneDelivery: 'never' }), conversationBridge);
|
|
1549
|
+
if (await maison.handleMaisonVoiceCommand(t, { speak: sayCanonical }))
|
|
1550
|
+
return;
|
|
1551
|
+
await inner(t, context);
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
// Event follow-ups (opt-in): when Patrice mentions a dated future event IN a real
|
|
1555
|
+
// conversation with Lisa, capture it and confirm aloud so a mis-hear is corrected on
|
|
1556
|
+
// the spot; the presence loop later asks how it went. Capture runs AFTER the reply and
|
|
1557
|
+
// fire-and-forget so it never adds reply latency, and is skipped for reminder commands
|
|
1558
|
+
// (those are handled above and would otherwise double as a "future event").
|
|
1559
|
+
if (process.env.CODEBUDDY_COMPANION_EVENT_FOLLOWUPS === 'true') {
|
|
1560
|
+
const ef = await import('../companion/event-followups.js');
|
|
1561
|
+
const { sayNow } = await import('../sensory/voice-loop.js');
|
|
1562
|
+
const extractor = ef.makeLLMEventExtractor();
|
|
1563
|
+
const inner = onHeard;
|
|
1564
|
+
onHeard = async (t, context) => {
|
|
1565
|
+
// Start prospective extraction on its own cognitive lane while
|
|
1566
|
+
// the canonical response is generated and spoken. The result
|
|
1567
|
+
// may propose a later initiative, but never owns this turn's mouth.
|
|
1568
|
+
const capturePromise = reminderShortcut?.(t) || maisonShortcut?.(t)
|
|
1569
|
+
? null
|
|
1570
|
+
: ef.captureEventFollowUp(t, Date.now(), { extractor })
|
|
1571
|
+
.then((captured) => ({ captured, error: undefined }))
|
|
1572
|
+
.catch((error) => ({ captured: null, error }));
|
|
1573
|
+
await inner(t, context);
|
|
1574
|
+
if (!capturePromise)
|
|
1575
|
+
return;
|
|
1576
|
+
void capturePromise
|
|
1577
|
+
.then(async ({ captured, error }) => {
|
|
1578
|
+
if (error) {
|
|
1579
|
+
logger.warn(`[event-followup] capture failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1580
|
+
return;
|
|
1581
|
+
}
|
|
1582
|
+
if (captured) {
|
|
1583
|
+
const confirmation = ef.confirmationLine(captured, Date.now());
|
|
1584
|
+
await speakCanonicalVoiceInitiative(confirmation, (content) => sayNow(content, { phoneDelivery: 'never' }), conversationBridge);
|
|
1585
|
+
logger.info(`[event-followup] captured "${captured.event}" → due ${new Date(captured.dueAt).toISOString()}`);
|
|
1586
|
+
}
|
|
1587
|
+
});
|
|
1588
|
+
};
|
|
1589
|
+
logger.info('Event follow-ups: Enabled (CODEBUDDY_COMPANION_EVENT_FOLLOWUPS) — capture dated events from conversation, ask how they went');
|
|
1590
|
+
}
|
|
1591
|
+
const wireOpts = {
|
|
1592
|
+
onHeard,
|
|
1593
|
+
onRecognizedTurn: ({ turnId, text }) => {
|
|
1594
|
+
embodiedCognition.mesh.publish({
|
|
1595
|
+
kind: 'utterance',
|
|
1596
|
+
producerId: 'voice:hearing',
|
|
1597
|
+
correlationId: turnId,
|
|
1598
|
+
salience: 0.9,
|
|
1599
|
+
confidence: 0.9,
|
|
1600
|
+
privacy: 'local-only',
|
|
1601
|
+
provenance: { source: 'recognized-voice-turn' },
|
|
1602
|
+
ttlMs: 5 * 60_000,
|
|
1603
|
+
payload: { role: 'user', content: text, surface: 'voice' },
|
|
1604
|
+
});
|
|
1605
|
+
},
|
|
1606
|
+
// The Rust VAD publishes this before endpointing/STT. Prepare
|
|
1607
|
+
// the grounded standby during the user's own speaking time;
|
|
1608
|
+
// the transcript gate below remains the only authority to talk.
|
|
1609
|
+
onSpeechStart: () => replyFn.prewarm(),
|
|
1610
|
+
// One local offline partial may retarget the prepared model and
|
|
1611
|
+
// MCP set. It is never published, remembered, or treated as a
|
|
1612
|
+
// committed request; only transcript_final can enter cognition.
|
|
1613
|
+
onSpeechPartial: ({ text }) => replyFn.prewarm(text),
|
|
1614
|
+
onBargeInStart: (_payload, interruptedTurnId) => {
|
|
1615
|
+
reply.interrupt(interruptedTurnId);
|
|
1616
|
+
if (interruptedTurnId) {
|
|
1617
|
+
embodiedCognition.mesh.cancelCorrelation(interruptedTurnId);
|
|
1618
|
+
}
|
|
1619
|
+
},
|
|
1620
|
+
onBargeIn: (_text, interruptedTurnId) => {
|
|
1621
|
+
reply.interrupt(interruptedTurnId);
|
|
1622
|
+
if (interruptedTurnId) {
|
|
1623
|
+
embodiedCognition.mesh.cancelCorrelation(interruptedTurnId);
|
|
1624
|
+
}
|
|
1625
|
+
},
|
|
1626
|
+
getResponseTiming: () => {
|
|
1627
|
+
const timing = latestVoiceTiming;
|
|
1628
|
+
latestVoiceTiming = undefined;
|
|
1629
|
+
return timing;
|
|
1630
|
+
},
|
|
1631
|
+
getAttentionSnapshot: () => responseDecider.snapshot(),
|
|
1632
|
+
isAddressed: (text) => responseDecider.isAddressed(text),
|
|
1633
|
+
};
|
|
1634
|
+
if (process.env.CODEBUDDY_SENSORY_BACKCHANNEL === 'true'
|
|
1635
|
+
|| process.env.CODEBUDDY_SENSORY_REPAIR === 'true') {
|
|
1636
|
+
wireOpts.onConversationCue = playCachedConversationCue;
|
|
1637
|
+
}
|
|
1638
|
+
if (responsePolicy.gateEnabled) {
|
|
1639
|
+
// Reuse the session decider shared with the vision greeting above, so a
|
|
1640
|
+
// person-arrival greeting's open engagement window carries into this gate.
|
|
1641
|
+
wireOpts.shouldRespond = (t) => reminderShortcut?.(t) || maisonShortcut?.(t)
|
|
1642
|
+
? Promise.resolve({
|
|
1643
|
+
respond: true,
|
|
1644
|
+
reason: reminderShortcut?.(t) ? 'reminder' : 'maison',
|
|
1645
|
+
})
|
|
1646
|
+
: responseDecider.decide(t);
|
|
1647
|
+
}
|
|
1648
|
+
sensoryTeardown.push(wireSpeechReaction(wireOpts));
|
|
1649
|
+
sensoryTeardown.push(() => replyFn.dispose());
|
|
1650
|
+
sensoryTeardown.push(() => conversationBridge.flush());
|
|
1651
|
+
const gateLabel = responsePolicy.policy === 'always'
|
|
1652
|
+
? 'always-respond[unfiltered:test-or-push-to-talk-only]'
|
|
1653
|
+
: responsePolicy.policy === 'contextual'
|
|
1654
|
+
? responsePolicy.chimeIn
|
|
1655
|
+
? 'gate[contextual+chime-in]'
|
|
1656
|
+
: 'gate[contextual]'
|
|
1657
|
+
: 'gate[addressed:no-chime-in]';
|
|
1658
|
+
logger.info(`Sensory speech reaction: Enabled (speech_end → STT → ${gateLabel} → ${readiness.act ? `agent[${readiness.permissionMode}]` : `think[${readiness.model}]+introspection[plan]`} → speak` +
|
|
1659
|
+
`${readiness.speakReady ? `[${readiness.voice}]` : ' — SILENT until CODEBUDDY_TTS_VOICE is set'})`);
|
|
1660
|
+
if (conversationBridge.isActive() && conversationBridge.config.target) {
|
|
1661
|
+
logger.info(`Conversation bridge: voice ↔ ${conversationBridge.config.target.channel} (configured target, thread ${conversationBridge.config.conversationId})`);
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
else {
|
|
1665
|
+
sensoryTeardown.push(wireSpeechReaction());
|
|
1666
|
+
logger.info('Sensory speech reaction: Enabled (speech_end → STT → percept)');
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
else if (process.env.CODEBUDDY_SENSORY_SPEECH === 'true') {
|
|
1670
|
+
logger.warn('Sensory speech reaction NOT enabled: set CODEBUDDY_SENSORY_TOKEN (speech can trigger an agent turn).');
|
|
1066
1671
|
}
|
|
1067
1672
|
// Privacy: camera/screen descriptions land in percepts.jsonl — warn if not encrypted at rest.
|
|
1068
1673
|
if ((process.env.CODEBUDDY_SENSORY_CAMERA === 'true' || process.env.CODEBUDDY_SENSORY_SCREEN === 'true') &&
|
|
@@ -1078,6 +1683,25 @@ export async function startServer(userConfig = {}) {
|
|
|
1078
1683
|
everyBeats,
|
|
1079
1684
|
handler: (ctx) => logger.info(`[heartbeat] pacemaker tick — beat ${ctx.beat} (load ${ctx.load1 ?? '?'})`),
|
|
1080
1685
|
});
|
|
1686
|
+
const configuredCognitionEvery = Number(process.env.CODEBUDDY_COGNITION_METRICS_EVERY ?? 30);
|
|
1687
|
+
const cognitionEvery = Number.isFinite(configuredCognitionEvery)
|
|
1688
|
+
? Math.max(10, Math.floor(configuredCognitionEvery))
|
|
1689
|
+
: 30;
|
|
1690
|
+
heart.register({
|
|
1691
|
+
name: 'cognitive-observability',
|
|
1692
|
+
everyBeats: cognitionEvery,
|
|
1693
|
+
handler: () => {
|
|
1694
|
+
const workspaceMetrics = embodiedCognition.workspace.metrics();
|
|
1695
|
+
const specialistMetrics = embodiedCognition.mesh.metrics();
|
|
1696
|
+
const queued = specialistMetrics.reduce((sum, metric) => sum + metric.queued, 0);
|
|
1697
|
+
const active = specialistMetrics.reduce((sum, metric) => sum + metric.active, 0);
|
|
1698
|
+
const dropped = specialistMetrics.reduce((sum, metric) => sum + metric.dropped, 0);
|
|
1699
|
+
const privacyRejected = specialistMetrics.reduce((sum, metric) => sum + metric.privacyRejected, 0);
|
|
1700
|
+
logger.info(`[cognition] workspace=${workspaceMetrics.size} world=${embodiedCognition.snapshotWorld().length} ` +
|
|
1701
|
+
`queued=${queued} active=${active} dropped=${dropped} ` +
|
|
1702
|
+
`privacyRejected=${privacyRejected}`);
|
|
1703
|
+
},
|
|
1704
|
+
});
|
|
1081
1705
|
// Dreaming — consolidate short-term sensory memory every N beats.
|
|
1082
1706
|
const dreamEvery = Math.max(1, Number(process.env.CODEBUDDY_DREAM_EVERY ?? 30));
|
|
1083
1707
|
heart.register({
|
|
@@ -1088,16 +1712,275 @@ export async function startServer(userConfig = {}) {
|
|
|
1088
1712
|
await runDreamingPass();
|
|
1089
1713
|
},
|
|
1090
1714
|
});
|
|
1715
|
+
// System vitals (opt-in) — turn the EXISTING system monitors into heartbeat-paced
|
|
1716
|
+
// percepts on the bus (resource_threshold / disk_low / fleet_saturated / process_runaway),
|
|
1717
|
+
// so declarative rules replace busy-loop monitoring. The scheduler's inFlight lock means
|
|
1718
|
+
// one sample per beat, never a loop. Default OFF => byte-identical behavior.
|
|
1719
|
+
if (process.env.CODEBUDDY_SYSTEM_VITALS === 'true') {
|
|
1720
|
+
const vitalsEvery = Math.max(1, Number(process.env.CODEBUDDY_SYSTEM_VITALS_EVERY ?? 30));
|
|
1721
|
+
heart.register({
|
|
1722
|
+
name: 'system-vitals',
|
|
1723
|
+
everyBeats: vitalsEvery,
|
|
1724
|
+
handler: async () => {
|
|
1725
|
+
const { runSystemVitalsPass } = await import('../sensory/system-vitals-emitter.js');
|
|
1726
|
+
await runSystemVitalsPass();
|
|
1727
|
+
},
|
|
1728
|
+
});
|
|
1729
|
+
sensoryTeardown.push(() => heart.unregister('system-vitals'));
|
|
1730
|
+
logger.info(`System vitals: Enabled (CODEBUDDY_SYSTEM_VITALS) - heartbeat-paced resource percepts every ${vitalsEvery} beats`);
|
|
1731
|
+
}
|
|
1732
|
+
// Lisa selfie cache refill (opt-in) — one image per beat when ComfyUI is
|
|
1733
|
+
// reachable and load is low. Default OFF ⇒ byte-identical. Tests inject a
|
|
1734
|
+
// fake generator; this path never busy-loops if the generator is down.
|
|
1735
|
+
if (process.env.CODEBUDDY_LISA_SELFIE_REFILL === 'true') {
|
|
1736
|
+
const refillEvery = Math.max(1, Number(process.env.CODEBUDDY_LISA_SELFIE_REFILL_EVERY ?? 40));
|
|
1737
|
+
heart.register({
|
|
1738
|
+
name: 'lisa-selfie-refill',
|
|
1739
|
+
everyBeats: refillEvery,
|
|
1740
|
+
handler: async (ctx) => {
|
|
1741
|
+
const { runLisaSelfieRefillPass } = await import('../companion/lisa-selfie-refill.js');
|
|
1742
|
+
await runLisaSelfieRefillPass({
|
|
1743
|
+
...(typeof ctx.load1 === 'number' ? { load1: () => ctx.load1 } : {}),
|
|
1744
|
+
});
|
|
1745
|
+
},
|
|
1746
|
+
});
|
|
1747
|
+
sensoryTeardown.push(() => heart.unregister('lisa-selfie-refill'));
|
|
1748
|
+
logger.info(`Lisa selfie refill: Enabled (CODEBUDDY_LISA_SELFIE_REFILL) - at most one image every ${refillEvery} beats`);
|
|
1749
|
+
}
|
|
1750
|
+
// Schedule ticks (opt-in) — emit a `time/tick` percept each pass so rules can fire at a
|
|
1751
|
+
// time of day (match.kind:'tick' + between/filters on hhmm) with no busy loop. The
|
|
1752
|
+
// heartbeat is the clock. Default OFF => byte-identical behavior.
|
|
1753
|
+
if (process.env.CODEBUDDY_SCHEDULE_TICKS === 'true') {
|
|
1754
|
+
const ticksEvery = Math.max(1, Number(process.env.CODEBUDDY_SCHEDULE_TICKS_EVERY ?? 20));
|
|
1755
|
+
heart.register({
|
|
1756
|
+
name: 'schedule-ticks',
|
|
1757
|
+
everyBeats: ticksEvery,
|
|
1758
|
+
handler: async () => {
|
|
1759
|
+
const { runSchedulePass } = await import('../sensory/schedule-emitter.js');
|
|
1760
|
+
runSchedulePass();
|
|
1761
|
+
},
|
|
1762
|
+
});
|
|
1763
|
+
sensoryTeardown.push(() => heart.unregister('schedule-ticks'));
|
|
1764
|
+
logger.info(`Schedule ticks: Enabled (CODEBUDDY_SCHEDULE_TICKS) - time/tick percept every ${ticksEvery} beats`);
|
|
1765
|
+
}
|
|
1766
|
+
// Domain-event bridge (opt-in) — re-emit the agent's internal domain events
|
|
1767
|
+
// (fleet:activity, agent:loop_detected, cost:*, context:pre_compact) as sensory
|
|
1768
|
+
// percepts, so ONE rule grammar covers physical perception AND inner life. Anti-loop:
|
|
1769
|
+
// it never subscribes to sensory:perception. Default OFF => byte-identical behavior.
|
|
1770
|
+
if (process.env.CODEBUDDY_DOMAIN_EVENTS === 'true') {
|
|
1771
|
+
const { wireDomainEventBridge } = await import('../sensory/domain-event-bridge.js');
|
|
1772
|
+
sensoryTeardown.push(wireDomainEventBridge());
|
|
1773
|
+
logger.info('Domain-event bridge: Enabled (CODEBUDDY_DOMAIN_EVENTS) - domain events -> sensory:perception');
|
|
1774
|
+
}
|
|
1775
|
+
// Episodic journal (opt-in) — consolidate the heard DIALOGUE into "what we talked about"
|
|
1776
|
+
// so the arrival opener / follow-ups can reference it. Distinct from dreaming (sensor stats).
|
|
1777
|
+
if (process.env.CODEBUDDY_EPISODE_JOURNAL === 'true') {
|
|
1778
|
+
const episodeEvery = Math.max(1, Number(process.env.CODEBUDDY_EPISODE_EVERY ?? 40));
|
|
1779
|
+
heart.register({
|
|
1780
|
+
name: 'episodic-journal',
|
|
1781
|
+
everyBeats: episodeEvery,
|
|
1782
|
+
handler: async () => {
|
|
1783
|
+
const { runEpisodeConsolidation } = await import('../sensory/episodic-journal.js');
|
|
1784
|
+
const { getCrossChannelConversationBridge } = await import('../conversation/cross-channel-bridge.js');
|
|
1785
|
+
await runEpisodeConsolidation({
|
|
1786
|
+
readConversation: async (limit) => getCrossChannelConversationBridge().history(limit),
|
|
1787
|
+
});
|
|
1788
|
+
},
|
|
1789
|
+
});
|
|
1790
|
+
logger.info(`Episodic journal: Enabled (CODEBUDDY_EPISODE_JOURNAL) — dialogue consolidation every ${episodeEvery} beats`);
|
|
1791
|
+
}
|
|
1792
|
+
// Inner life (opt-in) — every N beats Lisa "spends a moment" (a digital-authentic vignette
|
|
1793
|
+
// + her own small mood drift), surfaced via relational memory so a reply can reference what
|
|
1794
|
+
// she did while he was away. Gives her an interior without ever claiming a human life.
|
|
1795
|
+
if (process.env.CODEBUDDY_COMPANION_INNER_LIFE === 'true') {
|
|
1796
|
+
const innerLifeEvery = Math.max(1, Number(process.env.CODEBUDDY_INNER_LIFE_EVERY ?? 50));
|
|
1797
|
+
heart.register({
|
|
1798
|
+
name: 'inner-life',
|
|
1799
|
+
everyBeats: innerLifeEvery,
|
|
1800
|
+
handler: async () => {
|
|
1801
|
+
const { runInnerLifeTick } = await import('../companion/inner-life.js');
|
|
1802
|
+
await runInnerLifeTick();
|
|
1803
|
+
// A fresh vignette/mood should be visible to the next spoken turn.
|
|
1804
|
+
try {
|
|
1805
|
+
const { invalidateVoiceRelationalContext } = await import('../companion/relational-context.js');
|
|
1806
|
+
invalidateVoiceRelationalContext();
|
|
1807
|
+
}
|
|
1808
|
+
catch {
|
|
1809
|
+
/* best-effort refresh */
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
});
|
|
1813
|
+
logger.info(`Inner life: Enabled (CODEBUDDY_COMPANION_INNER_LIFE) — a moment to herself every ${innerLifeEvery} beats`);
|
|
1814
|
+
}
|
|
1815
|
+
// Voice-assistant improvement loop (opt-in, MySoulmate-inspired) — reflect on recent
|
|
1816
|
+
// dialogue and adapt over time: learned reply-guidance + bounded trait drift (behavioral
|
|
1817
|
+
// mode; never auto-accepts personal facts — those stay pending for `buddy assistant improve --apply`).
|
|
1818
|
+
if (process.env.CODEBUDDY_VOICE_IMPROVE === 'true') {
|
|
1819
|
+
const improveEvery = Math.max(1, Number(process.env.CODEBUDDY_VOICE_IMPROVE_EVERY ?? 60));
|
|
1820
|
+
heart.register({
|
|
1821
|
+
name: 'voice-improvement',
|
|
1822
|
+
everyBeats: improveEvery,
|
|
1823
|
+
handler: async () => {
|
|
1824
|
+
const { runVoiceImprovementCycle } = await import('../companion/voice-improvement-loop.js');
|
|
1825
|
+
await runVoiceImprovementCycle({ mode: 'behavioral' });
|
|
1826
|
+
},
|
|
1827
|
+
});
|
|
1828
|
+
logger.info(`Voice improvement loop: Enabled (CODEBUDDY_VOICE_IMPROVE) — reflect + adapt every ${improveEvery} beats (behavioral; facts stay pending)`);
|
|
1829
|
+
}
|
|
1830
|
+
// Deterministic conversation-quality loop — evaluates complete user/Lisa exchanges,
|
|
1831
|
+
// stores aggregate metrics only, and applies a reversible guidance line only after the
|
|
1832
|
+
// same weakness recurs. This has no model/API cost and is enabled by default.
|
|
1833
|
+
if (process.env.CODEBUDDY_CONVERSATION_EVAL !== 'false') {
|
|
1834
|
+
const configuredEvery = Number(process.env.CODEBUDDY_CONVERSATION_EVAL_EVERY ?? 30);
|
|
1835
|
+
const evaluationEvery = Number.isFinite(configuredEvery)
|
|
1836
|
+
? Math.max(5, Math.floor(configuredEvery))
|
|
1837
|
+
: 30;
|
|
1838
|
+
const configuredStreak = Number(process.env.CODEBUDDY_CONVERSATION_EVAL_MIN_STREAK ?? 2);
|
|
1839
|
+
const minIssueStreak = Number.isFinite(configuredStreak)
|
|
1840
|
+
? Math.max(2, Math.min(5, Math.floor(configuredStreak)))
|
|
1841
|
+
: 2;
|
|
1842
|
+
const configuredCooldown = Number(process.env.CODEBUDDY_CONVERSATION_EVAL_COOLDOWN_MS ?? 6 * 60 * 60_000);
|
|
1843
|
+
const guidanceCooldownMs = Number.isFinite(configuredCooldown)
|
|
1844
|
+
? Math.max(60_000, configuredCooldown)
|
|
1845
|
+
: 6 * 60 * 60_000;
|
|
1846
|
+
heart.register({
|
|
1847
|
+
name: 'conversation-quality',
|
|
1848
|
+
everyBeats: evaluationEvery,
|
|
1849
|
+
handler: async () => {
|
|
1850
|
+
const { runConversationImprovementCycle } = await import('../companion/conversation-improvement-loop.js');
|
|
1851
|
+
await runConversationImprovementCycle({
|
|
1852
|
+
mode: 'behavioral',
|
|
1853
|
+
minIssueStreak,
|
|
1854
|
+
guidanceCooldownMs,
|
|
1855
|
+
});
|
|
1856
|
+
},
|
|
1857
|
+
});
|
|
1858
|
+
logger.info(`Conversation quality: Enabled — aggregate evaluation every ${evaluationEvery} beats (adapt after ${minIssueStreak} recurring cycle(s))`);
|
|
1859
|
+
}
|
|
1860
|
+
// Fresh-context warmer — structured evidence, not canned LLM prose. It runs on wall
|
|
1861
|
+
// clock time so a changing sensory heartbeat cannot make news unexpectedly stale.
|
|
1862
|
+
if (process.env.CODEBUDDY_PREFETCH !== 'false') {
|
|
1863
|
+
const configuredInterval = Number(process.env.CODEBUDDY_PREFETCH_INTERVAL_MS ?? 15 * 60_000);
|
|
1864
|
+
const prefetchIntervalMs = Number.isFinite(configuredInterval)
|
|
1865
|
+
? Math.max(60_000, configuredInterval)
|
|
1866
|
+
: 15 * 60_000;
|
|
1867
|
+
const runPrefetch = async () => {
|
|
1868
|
+
const { runPrefetchCycle } = await import('../companion/prefetch-engine.js');
|
|
1869
|
+
await runPrefetchCycle();
|
|
1870
|
+
};
|
|
1871
|
+
void runPrefetch(); // warm the cache immediately, don't wait for the first beat
|
|
1872
|
+
const prefetchTimer = setInterval(() => void runPrefetch(), prefetchIntervalMs);
|
|
1873
|
+
prefetchTimer.unref();
|
|
1874
|
+
sensoryTeardown.push(() => clearInterval(prefetchTimer));
|
|
1875
|
+
logger.info(`Fresh context: Enabled — structured refresh every ${Math.round(prefetchIntervalMs / 60_000)} minute(s)`);
|
|
1876
|
+
}
|
|
1877
|
+
// Jokes top-up (opt-in) — generate a few fresh jokes in the background so Lisa's humour
|
|
1878
|
+
// stays varied. The curated list already works instantly WITHOUT this.
|
|
1879
|
+
if (process.env.CODEBUDDY_JOKES_TOPUP === 'true') {
|
|
1880
|
+
const jokesEvery = Math.max(1, Number(process.env.CODEBUDDY_JOKES_TOPUP_EVERY ?? 200));
|
|
1881
|
+
heart.register({
|
|
1882
|
+
name: 'jokes-topup',
|
|
1883
|
+
everyBeats: jokesEvery,
|
|
1884
|
+
handler: async () => {
|
|
1885
|
+
const { refreshJokePool } = await import('../companion/jokes.js');
|
|
1886
|
+
await refreshJokePool();
|
|
1887
|
+
},
|
|
1888
|
+
});
|
|
1889
|
+
logger.info(`Jokes top-up: Enabled (CODEBUDDY_JOKES_TOPUP) — fresh jokes every ${jokesEvery} beats`);
|
|
1890
|
+
}
|
|
1091
1891
|
heart.start();
|
|
1092
1892
|
sensoryTeardown.push(() => heart.stop());
|
|
1893
|
+
// TS pacemaker (opt-in) — emits the same vital/heartbeat percept when
|
|
1894
|
+
// buddy-sense is absent. Auto-disables on a real beat; re-arms after
|
|
1895
|
+
// silence. Default OFF => no timer, byte-identical.
|
|
1896
|
+
if (process.env.CODEBUDDY_HEARTBEAT_FALLBACK === 'true') {
|
|
1897
|
+
const { startHeartbeatFallback } = await import('../sensory/heartbeat-fallback.js');
|
|
1898
|
+
const fallback = startHeartbeatFallback();
|
|
1899
|
+
sensoryTeardown.push(() => fallback.stop());
|
|
1900
|
+
logger.info('Heartbeat fallback: Enabled (CODEBUDDY_HEARTBEAT_FALLBACK) - TS pacemaker until buddy-sense beats');
|
|
1901
|
+
}
|
|
1902
|
+
{
|
|
1903
|
+
const { wireSensoryStatusSnapshot } = await import('../sensory/sensory-status.js');
|
|
1904
|
+
sensoryTeardown.push(wireSensoryStatusSnapshot({
|
|
1905
|
+
treatments: heart.list().map((t) => ({ name: t.name, everyBeats: t.everyBeats })),
|
|
1906
|
+
}));
|
|
1907
|
+
}
|
|
1093
1908
|
logger.info(`Sensory bridge: Enabled (buddy-sense → event bus; heartbeat treatments every ${everyBeats} beats)`);
|
|
1094
1909
|
}
|
|
1095
1910
|
catch (err) {
|
|
1096
1911
|
logger.warn(`Sensory bridge failed to start: ${err instanceof Error ? err.message : String(err)}`);
|
|
1097
1912
|
}
|
|
1098
1913
|
}
|
|
1914
|
+
// Persistent named cooking timers are user-requested alerts, not
|
|
1915
|
+
// spontaneous companion speech. They reuse this server lifecycle and are
|
|
1916
|
+
// enabled by default; set CODEBUDDY_COOKING_TIMERS=false to disable.
|
|
1917
|
+
if (process.env.CODEBUDDY_COOKING_TIMERS !== 'false') {
|
|
1918
|
+
try {
|
|
1919
|
+
const { wireCookingTimerRunner } = await import('../companion/cooking-timer-runner.js');
|
|
1920
|
+
sensoryTeardown.push(wireCookingTimerRunner());
|
|
1921
|
+
logger.info('Cooking timers: Enabled — persistent named alerts, explicit acknowledgement');
|
|
1922
|
+
}
|
|
1923
|
+
catch (err) {
|
|
1924
|
+
logger.warn(`Cooking timers failed to start: ${err instanceof Error ? err.message : String(err)}`);
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
// Reminders (opt-in, independent of the sensory daemon so Telegram delivery works without a
|
|
1928
|
+
// mic/camera): a tick loop announces due reminders (voice + Telegram) and escalates a missed
|
|
1929
|
+
// dose to Telegram. Voice acknowledgement ("c'est fait") is wired in the speech block above.
|
|
1930
|
+
if (process.env.CODEBUDDY_REMINDERS === 'true') {
|
|
1931
|
+
try {
|
|
1932
|
+
const { wireReminderRunner } = await import('../companion/reminder-runner.js');
|
|
1933
|
+
sensoryTeardown.push(wireReminderRunner());
|
|
1934
|
+
logger.info('Reminders: Enabled (CODEBUDDY_REMINDERS) — due reminders announced (voice + Telegram); no-ack → re-nag then Telegram');
|
|
1935
|
+
}
|
|
1936
|
+
catch (err) {
|
|
1937
|
+
logger.warn(`Reminders failed to start: ${err instanceof Error ? err.message : String(err)}`);
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
// Companion presence (opt-in): the conductor that occasionally says one small warm thing when
|
|
1941
|
+
// the moment warrants (check-in / debrief / encouragement / break) and is otherwise silent.
|
|
1942
|
+
// Hard-gated (quiet hours, presence-aware, hourly cap) — see presence-loop.ts.
|
|
1943
|
+
if (process.env.CODEBUDDY_COMPANION_PRESENCE === 'true') {
|
|
1944
|
+
try {
|
|
1945
|
+
const { wirePresenceLoop } = await import('../companion/presence-loop.js');
|
|
1946
|
+
sensoryTeardown.push(wirePresenceLoop());
|
|
1947
|
+
logger.info('Companion presence: Enabled (CODEBUDDY_COMPANION_PRESENCE) — gentle proactive presence, default-silent');
|
|
1948
|
+
}
|
|
1949
|
+
catch (err) {
|
|
1950
|
+
logger.warn(`Companion presence failed to start: ${err instanceof Error ? err.message : String(err)}`);
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
// Companion proactive (opt-in): Lisa reaches out FIRST — morning/evening, after an absence, on
|
|
1954
|
+
// a tenure milestone or a due follow-up — INDEPENDENT of the camera (Telegram voice note when
|
|
1955
|
+
// away, spoken when present). Priority-scored, single winner, 12h cooldown. See proactive-engine.ts.
|
|
1956
|
+
if (process.env.CODEBUDDY_COMPANION_PROACTIVE === 'true') {
|
|
1957
|
+
try {
|
|
1958
|
+
const { wireProactiveLoop } = await import('../companion/proactive-engine.js');
|
|
1959
|
+
sensoryTeardown.push(wireProactiveLoop());
|
|
1960
|
+
logger.info('Companion proactive: Enabled (CODEBUDDY_COMPANION_PROACTIVE) — reaches out first, camera-independent (spoken/Telegram)');
|
|
1961
|
+
}
|
|
1962
|
+
catch (err) {
|
|
1963
|
+
logger.warn(`Companion proactive failed to start: ${err instanceof Error ? err.message : String(err)}`);
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
// Companion idle (opt-in): when ALONE, it does useful safe work ($0, read-only/reversible) and
|
|
1967
|
+
// leaves reviewable artifacts in the idle log — never acts on your repos/prod. See idle-loop.ts.
|
|
1968
|
+
if (process.env.CODEBUDDY_COMPANION_IDLE === 'true') {
|
|
1969
|
+
try {
|
|
1970
|
+
const { wireIdleLoop } = await import('../companion/idle-loop.js');
|
|
1971
|
+
sensoryTeardown.push(wireIdleLoop());
|
|
1972
|
+
logger.info('Companion idle: Enabled (CODEBUDDY_COMPANION_IDLE) — alone-only useful work, $0, artifacts only');
|
|
1973
|
+
}
|
|
1974
|
+
catch (err) {
|
|
1975
|
+
logger.warn(`Companion idle failed to start: ${err instanceof Error ? err.message : String(err)}`);
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1099
1978
|
logger.info(`Auth: ${config.authEnabled ? 'Enabled' : 'Disabled'}`);
|
|
1100
|
-
|
|
1979
|
+
const exposure = diagnoseServerExposure(config);
|
|
1980
|
+
if (exposure.unsafe) {
|
|
1981
|
+
logger.warn(exposure.message);
|
|
1982
|
+
}
|
|
1983
|
+
else if (exposure.networkExposed) {
|
|
1101
1984
|
logger.warn(`Server is bound to ${config.host} (non-loopback) and is reachable from the network. ` +
|
|
1102
1985
|
`Auth is ${config.authEnabled ? 'ENABLED' : 'DISABLED'}; CORS origins: ${[config.corsOrigins ?? []].flat().join(', ') || '(none)'}. ` +
|
|
1103
1986
|
`Bind to localhost with HOST=127.0.0.1 if remote access is not intended.`);
|
|
@@ -1141,7 +2024,7 @@ export async function startServer(userConfig = {}) {
|
|
|
1141
2024
|
catch {
|
|
1142
2025
|
logger.info('Peer Routing: not initialized');
|
|
1143
2026
|
}
|
|
1144
|
-
resolve({ app, server, config });
|
|
2027
|
+
resolve({ app, server, config, cognitionPort });
|
|
1145
2028
|
});
|
|
1146
2029
|
server.on('error', reject);
|
|
1147
2030
|
});
|
|
@@ -1161,6 +2044,11 @@ export async function stopServer(server) {
|
|
|
1161
2044
|
}
|
|
1162
2045
|
}
|
|
1163
2046
|
sensoryWired = false;
|
|
2047
|
+
const cognitiveHub = server._cognitiveHub;
|
|
2048
|
+
const cognitionPort = server
|
|
2049
|
+
._cognitionPort;
|
|
2050
|
+
cognitionPort?.close();
|
|
2051
|
+
cognitiveHub?.close();
|
|
1164
2052
|
return new Promise((resolve, reject) => {
|
|
1165
2053
|
// Phase (d).9 — cancel the heartbeat timer so it doesn't keep
|
|
1166
2054
|
// emitting against a half-shut server. Idempotent.
|
|
@@ -1177,6 +2065,13 @@ export async function stopServer(server) {
|
|
|
1177
2065
|
unwirePeerSessionBridge();
|
|
1178
2066
|
// Phase (d).23 — un-register peer.tool.invoke + .stream.
|
|
1179
2067
|
unwirePeerToolBridge();
|
|
2068
|
+
unwirePeerCkgBridge();
|
|
2069
|
+
unwirePeerMissionExchangeBridge();
|
|
2070
|
+
unwireMobileConfirmationBridge();
|
|
2071
|
+
const unwireCognition = server
|
|
2072
|
+
._unwireCognition;
|
|
2073
|
+
unwireCognition?.();
|
|
2074
|
+
server._fleetRooms?.stop();
|
|
1180
2075
|
// Detach the channel-A2A bridge handler + shut down the
|
|
1181
2076
|
// ChannelManager so polling loops (Telegram, Discord, ...) stop.
|
|
1182
2077
|
const bridgeStop = server
|