@phuetz/code-buddy 1.6.1 → 2.0.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.md +145 -349
- 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 +93 -6
- package/dist/agent/codebuddy-agent.js +452 -58
- 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 -31
- package/dist/agent/execution/agent-executor.js +1520 -547
- package/dist/agent/execution/context-pipeline.d.ts +54 -6
- package/dist/agent/execution/context-pipeline.js +285 -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-selection-strategy.d.ts +20 -0
- package/dist/agent/execution/tool-selection-strategy.js +145 -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 -2
- package/dist/agent/facades/session-facade.js +59 -1
- 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 -0
- package/dist/agent/hermes-claw-migrate.js +189 -15
- package/dist/agent/hermes-memory-providers.js +3 -3
- package/dist/agent/hermes-parity-manifest.js +69 -15
- 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 +21 -15
- 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 +8 -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 +20 -0
- package/dist/agent/self-improvement/evolution/ast-novelty.js +81 -0
- package/dist/agent/self-improvement/evolution/code-variant-store.d.ts +101 -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 +503 -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 +105 -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 +86 -0
- package/dist/agent/self-improvement/evolution/variant-fitness.js +217 -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 +44 -0
- package/dist/agent/self-improvement/evolution/worktree-scorer.js +99 -0
- package/dist/agent/self-improvement/evolutionary-archive.js +3 -2
- 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 +46 -0
- package/dist/agent/self-improvement/proposal-store.js +87 -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-benchmark.js +27 -0
- package/dist/agent/self-improvement/skill-consolidator.js +16 -0
- package/dist/agent/self-improvement/skill-engine.d.ts +7 -0
- package/dist/agent/self-improvement/skill-engine.js +54 -28
- package/dist/agent/self-improvement/skill-gate.d.ts +4 -4
- package/dist/agent/self-improvement/skill-gate.js +38 -20
- package/dist/agent/self-improvement/skill-mutator.d.ts +20 -1
- package/dist/agent/self-improvement/skill-mutator.js +138 -19
- package/dist/agent/self-improvement/skill-proposer.js +2 -1
- package/dist/agent/self-improvement/skill-types.d.ts +4 -0
- 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 +7 -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 +49 -2
- package/dist/agent/tool-handler.js +738 -181
- 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 +8 -4
- 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 +30 -0
- package/dist/channels/companion-channel-turn.js +38 -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/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/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/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.js +5 -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/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 +59 -7
- package/dist/codebuddy/providers/provider-chatgpt-responses.js +519 -164
- 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/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 +195 -7
- 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 +29 -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/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 +28 -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 -17
- package/dist/codebuddy/tools.js +235 -55
- 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/evolve-command.d.ts +26 -0
- package/dist/commands/cli/evolve-command.js +259 -0
- package/dist/commands/cli/fleet-commands.js +105 -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 +68 -36
- package/dist/commands/cli/utility-commands.js +34 -9
- package/dist/commands/client-dispatcher.d.ts +1 -0
- package/dist/commands/client-dispatcher.js +40 -21
- 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/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/enhanced-command-handler.d.ts +3 -0
- package/dist/commands/enhanced-command-handler.js +29 -12
- 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/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 +1665 -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/extra-handlers.js +23 -24
- 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 +41 -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.js +40 -0
- package/dist/commands/handlers/permissions-handlers.js +3 -2
- package/dist/commands/handlers/pr-handlers.js +15 -17
- 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/swarm-handler.js +41 -2
- package/dist/commands/handlers/team-handlers.d.ts +28 -1
- package/dist/commands/handlers/team-handlers.js +243 -2
- package/dist/commands/handlers/think-handlers.js +2 -1
- 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-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.d.ts +6 -0
- package/dist/commands/mcp.js +236 -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/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/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 +190 -15
- package/dist/commands/slash/builtin-commands.js +41 -21
- 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-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-turn.d.ts +88 -0
- package/dist/companion/companion-turn.js +223 -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/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 +56 -0
- package/dist/config/model-tools.js +819 -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 +442 -89
- 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 +593 -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-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 +79 -0
- package/dist/curator/curator.js +317 -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/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 +37 -0
- package/dist/doctor/index.js +389 -37
- 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/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/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 +1 -1
- package/dist/fleet/fleet-listener.js +4 -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/saga-store.d.ts +25 -1
- package/dist/fleet/saga-store.js +34 -6
- 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 +1 -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 +84 -84
- 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-input-handler.js +9 -63
- 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 +411 -0
- package/dist/identity/operational-self-model.d.ts +143 -0
- package/dist/identity/operational-self-model.js +974 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +987 -223
- 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 +110 -24
- package/dist/mcp/config.d.ts +12 -1
- package/dist/mcp/config.js +55 -12
- 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/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 +9 -4
- package/dist/memory/facts-memory.js +21 -4
- 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.js +9 -4
- 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 +98 -0
- package/dist/memory/persistent-memory.js +711 -119
- 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 +65 -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/run-store.d.ts +6 -1
- package/dist/observability/run-store.js +89 -22
- 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/orchestration/orchestrator.js +4 -1
- 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-store.d.ts +26 -0
- package/dist/persistence/session-store.js +56 -17
- package/dist/personas/persona-manager.d.ts +39 -1
- package/dist/personas/persona-manager.js +276 -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 +52 -4
- package/dist/plugins/code-explorer/CodeExplorerManager.js +201 -31
- 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 +6 -9
- package/dist/plugins/sandbox-worker.js +1 -1
- package/dist/prompts/system-base.js +27 -3
- package/dist/protocols/a2a/codebuddy-executor.d.ts +9 -0
- package/dist/protocols/a2a/codebuddy-executor.js +25 -6
- package/dist/protocols/a2a/index.d.ts +6 -0
- package/dist/protocols/a2a/index.js +32 -3
- 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 +47 -39
- 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 +48 -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 +53 -0
- package/dist/sandbox/os-sandbox.js +315 -70
- package/dist/sandbox/sandbox-backend.d.ts +2 -0
- package/dist/scheduler/cron-scheduler.d.ts +1 -0
- package/dist/scheduler/cron-scheduler.js +142 -41
- 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.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/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 +7 -2
- package/dist/security/session-encryption.js +28 -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 +618 -0
- package/dist/sensory/voice-loop.js +3581 -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/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 -0
- package/dist/server/index.js +913 -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 +54 -0
- 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/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/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 +25 -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 +123 -1
- package/dist/server/websocket/handler.js +852 -67
- 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 +47 -2
- package/dist/services/prompt-builder.js +310 -99
- 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/hub.js +52 -30
- package/dist/skills/index.d.ts +6 -3
- package/dist/skills/index.js +19 -4
- 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-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/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/themes/theme-manager.js +9 -6
- package/dist/themes/theme-schema.d.ts +46 -46
- 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 +1 -1
- package/dist/tools/bash/streaming-executor.js +124 -18
- 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-tool.d.ts +55 -23
- package/dist/tools/code-exec-tool.js +598 -111
- 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/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/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 +30 -0
- package/dist/tools/env-doctor-tool.js +54 -0
- package/dist/tools/execute-code-rpc-invoker.js +2 -2
- package/dist/tools/execute-code-runner.d.ts +21 -0
- package/dist/tools/execute-code-runner.js +117 -8
- 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/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/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/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 +90 -1
- package/dist/tools/media-generation-tool.js +1553 -11
- 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 +1 -1
- package/dist/tools/metadata.d.ts +7 -1
- package/dist/tools/metadata.js +823 -13
- 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/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.js +6 -0
- 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/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.js +32 -20
- 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 +17 -0
- package/dist/tools/registry/research-tools.js +21 -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 +156 -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/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/stock-quote.d.ts +67 -0
- package/dist/tools/stock-quote.js +645 -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-manager.js +8 -0
- package/dist/tools/tool-search.js +11 -3
- 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 +16 -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.js +12 -0
- package/dist/ui/components/ChatInterface.js +6 -2
- package/dist/ui/components/FileAutocomplete.d.ts +6 -1
- package/dist/ui/components/FileAutocomplete.js +136 -76
- package/dist/ui/components/FuzzyPicker.d.ts +5 -0
- package/dist/ui/components/FuzzyPicker.js +1 -1
- package/dist/ui/http-server/server.js +2 -2
- 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 +77 -0
- package/dist/utils/atomic-write.js +530 -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/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/history-manager.js +6 -7
- 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 +5 -10
- 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 +67 -0
- package/dist/wizard/environment-detection.js +210 -0
- package/dist/wizard/onboarding.d.ts +21 -1
- package/dist/wizard/onboarding.js +202 -27
- 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 +75 -31
- 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
|
@@ -0,0 +1,942 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { constants as fsConstants } from 'node:fs';
|
|
3
|
+
import { lstat, mkdir, open, realpath } from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { ComfyUIRecipeValidationError, isSafeComfyUIAssetReference, isSafeComfyUIRelativePath, materializeComfyUIWorkflow, } from './comfyui-recipe-contract.js';
|
|
6
|
+
const SAFE_SERVER_ID = /^[A-Za-z0-9_.-]{1,160}$/;
|
|
7
|
+
const SAFE_FILENAME = /^[A-Za-z0-9][A-Za-z0-9._ +()@-]{0,254}$/;
|
|
8
|
+
const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]', '::1']);
|
|
9
|
+
const FAILURE_STATUSES = new Set(['error', 'failed', 'cancelled', 'canceled']);
|
|
10
|
+
const RESOURCE_TIER_ORDER = {
|
|
11
|
+
low: 0,
|
|
12
|
+
balanced: 1,
|
|
13
|
+
high: 2,
|
|
14
|
+
extreme: 3,
|
|
15
|
+
};
|
|
16
|
+
const DEFAULT_OUTPUT_LIMITS = {
|
|
17
|
+
image: 64 * 1024 * 1024,
|
|
18
|
+
video: 1024 * 1024 * 1024,
|
|
19
|
+
audio: 512 * 1024 * 1024,
|
|
20
|
+
glb: 1024 * 1024 * 1024,
|
|
21
|
+
};
|
|
22
|
+
const OUTPUT_MEDIA = {
|
|
23
|
+
image: {
|
|
24
|
+
'.png': ['image/png'],
|
|
25
|
+
'.jpg': ['image/jpeg'],
|
|
26
|
+
'.jpeg': ['image/jpeg'],
|
|
27
|
+
'.webp': ['image/webp'],
|
|
28
|
+
'.gif': ['image/gif'],
|
|
29
|
+
},
|
|
30
|
+
video: {
|
|
31
|
+
'.mp4': ['video/mp4'],
|
|
32
|
+
'.webm': ['video/webm'],
|
|
33
|
+
'.mov': ['video/quicktime'],
|
|
34
|
+
'.mkv': ['video/x-matroska', 'video/webm'],
|
|
35
|
+
'.gif': ['image/gif'],
|
|
36
|
+
},
|
|
37
|
+
audio: {
|
|
38
|
+
'.wav': ['audio/wav', 'audio/x-wav'],
|
|
39
|
+
'.flac': ['audio/flac'],
|
|
40
|
+
'.mp3': ['audio/mpeg'],
|
|
41
|
+
'.ogg': ['audio/ogg', 'application/ogg'],
|
|
42
|
+
'.m4a': ['audio/mp4'],
|
|
43
|
+
'.aac': ['audio/aac'],
|
|
44
|
+
},
|
|
45
|
+
glb: {
|
|
46
|
+
'.glb': ['model/gltf-binary', 'application/octet-stream'],
|
|
47
|
+
'.gltf': ['model/gltf+json', 'application/json'],
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
export class ComfyUIRecipeRuntimeError extends Error {
|
|
51
|
+
code;
|
|
52
|
+
details;
|
|
53
|
+
constructor(code, message, details) {
|
|
54
|
+
super(message);
|
|
55
|
+
this.name = 'ComfyUIRecipeRuntimeError';
|
|
56
|
+
this.code = code;
|
|
57
|
+
this.details = details;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export class ComfyUIRecipeRuntime {
|
|
61
|
+
registry;
|
|
62
|
+
baseUrl;
|
|
63
|
+
modelsRoot;
|
|
64
|
+
outputRoot;
|
|
65
|
+
fetchImpl;
|
|
66
|
+
resources;
|
|
67
|
+
limits;
|
|
68
|
+
commercialUse;
|
|
69
|
+
exclusiveServer;
|
|
70
|
+
createClientId;
|
|
71
|
+
createSeed;
|
|
72
|
+
constructor(options) {
|
|
73
|
+
this.registry = options.registry;
|
|
74
|
+
this.baseUrl = validateBaseUrl(options.baseUrl ?? 'http://127.0.0.1:8188', options.trustedOrigins ?? []);
|
|
75
|
+
this.modelsRoot = requireAbsolutePath(options.modelsRoot, 'modelsRoot');
|
|
76
|
+
this.outputRoot = requireAbsolutePath(options.outputRoot, 'outputRoot');
|
|
77
|
+
this.fetchImpl = options.fetchImpl ?? fetch;
|
|
78
|
+
this.resources = validateResources(options.resources ?? {});
|
|
79
|
+
this.limits = resolveLimits(options.limits ?? {});
|
|
80
|
+
this.commercialUse = options.commercialUse ?? false;
|
|
81
|
+
this.exclusiveServer = options.exclusiveServer ?? false;
|
|
82
|
+
this.createClientId = options.createClientId ?? randomUUID;
|
|
83
|
+
this.createSeed = options.createSeed ?? defaultSeed;
|
|
84
|
+
}
|
|
85
|
+
async preflight(selector, options = {}) {
|
|
86
|
+
const recipe = this.registry.get(selector);
|
|
87
|
+
const objectInfo = await this.fetchObjectInfo(options.signal);
|
|
88
|
+
return this.preflightRecipe(recipe, objectInfo, options.commercialUse ?? this.commercialUse, options.signal);
|
|
89
|
+
}
|
|
90
|
+
async run(selector, inputs, options = {}) {
|
|
91
|
+
throwIfAborted(options.signal);
|
|
92
|
+
const requested = this.registry.get(selector);
|
|
93
|
+
const candidates = options.allowFallback === false
|
|
94
|
+
? [requested]
|
|
95
|
+
: [...this.registry.resolveFallbackChain({ id: requested.id, version: requested.version })];
|
|
96
|
+
const objectInfo = await this.fetchObjectInfo(options.signal);
|
|
97
|
+
const preflights = [];
|
|
98
|
+
let selected;
|
|
99
|
+
for (const candidate of candidates) {
|
|
100
|
+
const result = await this.preflightRecipe(candidate, objectInfo, options.commercialUse ?? this.commercialUse, options.signal);
|
|
101
|
+
preflights.push(result);
|
|
102
|
+
if (result.ok) {
|
|
103
|
+
selected = candidate;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!selected) {
|
|
108
|
+
throw new ComfyUIRecipeRuntimeError('PREFLIGHT_FAILED', 'No registered ComfyUI recipe in the fallback chain passed preflight', preflights);
|
|
109
|
+
}
|
|
110
|
+
const materialized = materializeComfyUIWorkflow(selected, inputs, this.createSeed);
|
|
111
|
+
const clientId = this.createClientId();
|
|
112
|
+
if (!SAFE_SERVER_ID.test(clientId)) {
|
|
113
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'createClientId returned an unsafe value');
|
|
114
|
+
}
|
|
115
|
+
const body = JSON.stringify({ prompt: materialized.workflow, client_id: clientId });
|
|
116
|
+
if (Buffer.byteLength(body, 'utf8') > 2 * 1024 * 1024) {
|
|
117
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Materialized workflow exceeds 2 MB');
|
|
118
|
+
}
|
|
119
|
+
let promptId;
|
|
120
|
+
const deadline = Date.now() + this.limits.maxRunMs;
|
|
121
|
+
try {
|
|
122
|
+
const submitted = await this.requestJson('/prompt', {
|
|
123
|
+
method: 'POST',
|
|
124
|
+
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
125
|
+
body,
|
|
126
|
+
}, 256 * 1024, this.requestBudget(deadline), options.signal);
|
|
127
|
+
promptId = readString(submitted, 'prompt_id') ?? readString(submitted, 'promptId');
|
|
128
|
+
if (!promptId || !SAFE_SERVER_ID.test(promptId)) {
|
|
129
|
+
throw new ComfyUIRecipeRuntimeError('BAD_RESPONSE', 'ComfyUI /prompt returned an unsafe prompt id');
|
|
130
|
+
}
|
|
131
|
+
const historyOutputs = await this.watchPrompt(selected, promptId, deadline, options.signal);
|
|
132
|
+
const artifacts = await this.fetchOutputs(historyOutputs, promptId, deadline, options.signal);
|
|
133
|
+
return {
|
|
134
|
+
requestedRecipeId: requested.id,
|
|
135
|
+
requestedRecipeVersion: requested.version,
|
|
136
|
+
recipeId: selected.id,
|
|
137
|
+
recipeVersion: selected.version,
|
|
138
|
+
fallbackUsed: selected.id !== requested.id || selected.version !== requested.version,
|
|
139
|
+
promptId,
|
|
140
|
+
clientId,
|
|
141
|
+
...(materialized.seed === undefined ? {} : { seed: materialized.seed }),
|
|
142
|
+
...(materialized.dimensions === undefined ? {} : { dimensions: materialized.dimensions }),
|
|
143
|
+
artifacts,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
if (promptId)
|
|
148
|
+
await this.cancel(promptId).catch(() => false);
|
|
149
|
+
throw normalizeRuntimeError(error, options.signal, deadline);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/** Upload a bounded image. Returned collision-renamed paths are revalidated. */
|
|
153
|
+
async uploadImage(upload, signal) {
|
|
154
|
+
validateUpload(upload, this.limits.maxUploadBytes, false);
|
|
155
|
+
return this.upload('/upload/image', upload, undefined, signal);
|
|
156
|
+
}
|
|
157
|
+
/** Upload a PNG mask tied to the exact source reference ComfyUI returned. */
|
|
158
|
+
async uploadMask(upload, signal) {
|
|
159
|
+
validateUpload(upload, this.limits.maxUploadBytes, true);
|
|
160
|
+
validateUploadedAsset(upload.originalRef);
|
|
161
|
+
return this.upload('/upload/mask', upload, upload.originalRef, signal);
|
|
162
|
+
}
|
|
163
|
+
/** Delete only this prompt from the queue; global interrupt is opt-in for an exclusive server. */
|
|
164
|
+
async cancel(promptId) {
|
|
165
|
+
if (!SAFE_SERVER_ID.test(promptId)) {
|
|
166
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Unsafe prompt id');
|
|
167
|
+
}
|
|
168
|
+
const operations = [
|
|
169
|
+
this.requestAck('/queue', {
|
|
170
|
+
method: 'POST',
|
|
171
|
+
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
172
|
+
body: JSON.stringify({ delete: [promptId] }),
|
|
173
|
+
}, Math.min(this.limits.requestTimeoutMs, 5000)),
|
|
174
|
+
];
|
|
175
|
+
if (this.exclusiveServer) {
|
|
176
|
+
operations.push(this.requestAck('/interrupt', {
|
|
177
|
+
method: 'POST',
|
|
178
|
+
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
179
|
+
body: '{}',
|
|
180
|
+
}, Math.min(this.limits.requestTimeoutMs, 5000)));
|
|
181
|
+
}
|
|
182
|
+
const results = await Promise.allSettled(operations);
|
|
183
|
+
return results.some((result) => result.status === 'fulfilled');
|
|
184
|
+
}
|
|
185
|
+
async preflightRecipe(recipe, objectInfo, commercialUse, signal) {
|
|
186
|
+
throwIfAborted(signal);
|
|
187
|
+
const issues = [];
|
|
188
|
+
if (commercialUse && !recipe.commercialAllowed) {
|
|
189
|
+
issues.push({ code: 'license', message: `${recipe.id} does not permit commercial use` });
|
|
190
|
+
}
|
|
191
|
+
for (const requirement of recipe.requirements.nodes) {
|
|
192
|
+
if (!Object.prototype.hasOwnProperty.call(objectInfo, requirement.classType)) {
|
|
193
|
+
issues.push({
|
|
194
|
+
code: 'missing-node',
|
|
195
|
+
requirement: requirement.classType,
|
|
196
|
+
message: `ComfyUI node is unavailable: ${requirement.classType}`,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
this.checkResourceProfile(recipe, issues);
|
|
201
|
+
let modelRoot;
|
|
202
|
+
if (recipe.requirements.models.length > 0) {
|
|
203
|
+
try {
|
|
204
|
+
modelRoot = await inspectModelRoot(this.modelsRoot);
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
issues.push({
|
|
208
|
+
code: 'models-root',
|
|
209
|
+
message: error instanceof Error ? error.message : String(error),
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (modelRoot) {
|
|
214
|
+
for (const model of recipe.requirements.models) {
|
|
215
|
+
issues.push(...await checkModel(modelRoot, model, signal));
|
|
216
|
+
}
|
|
217
|
+
try {
|
|
218
|
+
await verifyModelRoot(modelRoot);
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
issues.push({ code: 'models-root', message: error instanceof Error ? error.message : String(error) });
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
ok: issues.length === 0,
|
|
226
|
+
recipeId: recipe.id,
|
|
227
|
+
recipeVersion: recipe.version,
|
|
228
|
+
issues,
|
|
229
|
+
checkedNodes: recipe.requirements.nodes.length,
|
|
230
|
+
checkedModels: recipe.requirements.models.length,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
checkResourceProfile(recipe, issues) {
|
|
234
|
+
if (this.resources.availableVramMiB !== undefined
|
|
235
|
+
&& this.resources.availableVramMiB < recipe.resources.minVramMiB) {
|
|
236
|
+
issues.push({
|
|
237
|
+
code: 'insufficient-vram',
|
|
238
|
+
message: `Recipe needs ${recipe.resources.minVramMiB} MiB VRAM; ${this.resources.availableVramMiB} MiB declared`,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
if (this.resources.availableRamMiB !== undefined
|
|
242
|
+
&& this.resources.availableRamMiB < recipe.resources.minRamMiB) {
|
|
243
|
+
issues.push({
|
|
244
|
+
code: 'insufficient-ram',
|
|
245
|
+
message: `Recipe needs ${recipe.resources.minRamMiB} MiB RAM; ${this.resources.availableRamMiB} MiB declared`,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
if (this.resources.maxTier !== undefined
|
|
249
|
+
&& RESOURCE_TIER_ORDER[recipe.resources.tier] > RESOURCE_TIER_ORDER[this.resources.maxTier]) {
|
|
250
|
+
issues.push({
|
|
251
|
+
code: 'resource-tier',
|
|
252
|
+
message: `Recipe tier ${recipe.resources.tier} exceeds configured tier ${this.resources.maxTier}`,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
async fetchObjectInfo(signal) {
|
|
257
|
+
const objectInfo = await this.requestJson('/object_info', { method: 'GET', headers: { accept: 'application/json' } }, this.limits.maxObjectInfoBytes, this.limits.requestTimeoutMs, signal);
|
|
258
|
+
if (!isPlainRecord(objectInfo) || Object.keys(objectInfo).length > 20_000) {
|
|
259
|
+
throw new ComfyUIRecipeRuntimeError('BAD_RESPONSE', 'ComfyUI /object_info returned an invalid object');
|
|
260
|
+
}
|
|
261
|
+
return objectInfo;
|
|
262
|
+
}
|
|
263
|
+
async watchPrompt(recipe, promptId, deadline, signal) {
|
|
264
|
+
while (Date.now() < deadline) {
|
|
265
|
+
throwIfAborted(signal);
|
|
266
|
+
const history = await this.requestJson(`/history/${encodeURIComponent(promptId)}`, { method: 'GET', headers: { accept: 'application/json' } }, this.limits.maxHistoryBytes, this.requestBudget(deadline), signal);
|
|
267
|
+
const entry = historyEntry(history, promptId);
|
|
268
|
+
if (entry) {
|
|
269
|
+
const status = readStatus(entry);
|
|
270
|
+
if (status && FAILURE_STATUSES.has(status)) {
|
|
271
|
+
throw new ComfyUIRecipeRuntimeError('RUN_FAILED', `ComfyUI execution failed (${status})`, boundedStatusDetails(entry));
|
|
272
|
+
}
|
|
273
|
+
const complete = status === 'success'
|
|
274
|
+
|| (isPlainRecord(entry.status) && entry.status.completed === true)
|
|
275
|
+
|| (isPlainRecord(entry.outputs) && Object.keys(entry.outputs).length > 0);
|
|
276
|
+
if (complete)
|
|
277
|
+
return extractHistoryOutputs(recipe, entry);
|
|
278
|
+
}
|
|
279
|
+
const remaining = deadline - Date.now();
|
|
280
|
+
if (remaining <= 0)
|
|
281
|
+
break;
|
|
282
|
+
await delay(Math.min(this.limits.pollIntervalMs, remaining), signal);
|
|
283
|
+
}
|
|
284
|
+
throw new ComfyUIRecipeRuntimeError('RUN_TIMEOUT', `ComfyUI run exceeded ${this.limits.maxRunMs} ms`);
|
|
285
|
+
}
|
|
286
|
+
async fetchOutputs(outputs, promptId, deadline, signal) {
|
|
287
|
+
const outputDirectory = await createConfinedOutputDirectory(this.outputRoot, promptId);
|
|
288
|
+
const artifacts = [];
|
|
289
|
+
let totalBytes = 0;
|
|
290
|
+
for (const output of outputs) {
|
|
291
|
+
throwIfAborted(signal);
|
|
292
|
+
const extension = validatedOutputExtension(output.descriptor.type, output.reference.filename);
|
|
293
|
+
const declaredLimit = output.descriptor.maxBytes ?? DEFAULT_OUTPUT_LIMITS[output.descriptor.type];
|
|
294
|
+
const outputLimit = Math.min(declaredLimit, this.limits.maxOutputBytes);
|
|
295
|
+
const remainingTotal = this.limits.maxTotalOutputBytes - totalBytes;
|
|
296
|
+
if (remainingTotal <= 0) {
|
|
297
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', 'ComfyUI outputs exceed the total byte limit');
|
|
298
|
+
}
|
|
299
|
+
const url = this.endpoint('/view');
|
|
300
|
+
url.searchParams.set('filename', output.reference.filename);
|
|
301
|
+
url.searchParams.set('subfolder', output.reference.subfolder);
|
|
302
|
+
url.searchParams.set('type', output.reference.type);
|
|
303
|
+
const response = await this.requestRaw(url, { method: 'GET', headers: { accept: acceptedMimeTypes(output.descriptor.type, extension).join(', ') } }, this.requestBudget(deadline), signal);
|
|
304
|
+
assertOk(response, url.toString());
|
|
305
|
+
const limit = Math.min(outputLimit, remainingTotal);
|
|
306
|
+
const bytes = await readResponseBytes(response, limit, this.requestBudget(deadline), signal);
|
|
307
|
+
const mimeType = validateOutputMedia(response, bytes, output.descriptor.type, extension);
|
|
308
|
+
totalBytes += bytes.length;
|
|
309
|
+
const localName = `${output.descriptor.id}-${output.index}${extension}`;
|
|
310
|
+
const outputPath = path.join(outputDirectory, localName);
|
|
311
|
+
assertContained(outputDirectory, outputPath, 'Output file');
|
|
312
|
+
const flags = fsConstants.O_WRONLY
|
|
313
|
+
| fsConstants.O_CREAT
|
|
314
|
+
| fsConstants.O_EXCL
|
|
315
|
+
| (fsConstants.O_NOFOLLOW ?? 0);
|
|
316
|
+
const handle = await open(outputPath, flags, 0o600);
|
|
317
|
+
try {
|
|
318
|
+
await handle.writeFile(bytes);
|
|
319
|
+
await handle.sync();
|
|
320
|
+
}
|
|
321
|
+
finally {
|
|
322
|
+
await handle.close();
|
|
323
|
+
}
|
|
324
|
+
const realOutput = await realpath(outputPath);
|
|
325
|
+
assertContained(outputDirectory, realOutput, 'Saved output');
|
|
326
|
+
artifacts.push({
|
|
327
|
+
id: output.descriptor.id,
|
|
328
|
+
type: output.descriptor.type,
|
|
329
|
+
path: realOutput,
|
|
330
|
+
bytes: bytes.length,
|
|
331
|
+
sha256: createHash('sha256').update(bytes).digest('hex'),
|
|
332
|
+
mimeType,
|
|
333
|
+
source: { ...output.reference },
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
return artifacts;
|
|
337
|
+
}
|
|
338
|
+
async upload(endpoint, upload, originalRef, signal) {
|
|
339
|
+
const form = new FormData();
|
|
340
|
+
const bytes = Uint8Array.from(upload.bytes);
|
|
341
|
+
form.append('image', new Blob([bytes], { type: upload.mimeType }), upload.filename);
|
|
342
|
+
form.append('type', 'input');
|
|
343
|
+
const requestedSubfolder = originalRef?.subfolder ?? upload.subfolder;
|
|
344
|
+
if (originalRef && upload.subfolder !== undefined && upload.subfolder !== originalRef.subfolder) {
|
|
345
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Mask upload subfolder must match its original image reference');
|
|
346
|
+
}
|
|
347
|
+
if (requestedSubfolder)
|
|
348
|
+
form.append('subfolder', requestedSubfolder);
|
|
349
|
+
if (originalRef) {
|
|
350
|
+
form.append('original_ref', JSON.stringify({
|
|
351
|
+
filename: originalRef.filename,
|
|
352
|
+
subfolder: originalRef.subfolder,
|
|
353
|
+
type: originalRef.type,
|
|
354
|
+
}));
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
form.append('overwrite', 'false');
|
|
358
|
+
}
|
|
359
|
+
const response = await this.requestJson(endpoint, { method: 'POST', headers: { accept: 'application/json' }, body: form }, 256 * 1024, this.limits.uploadTimeoutMs, signal);
|
|
360
|
+
const filename = readString(response, 'name') ?? readString(response, 'filename');
|
|
361
|
+
const responseSubfolder = readString(response, 'subfolder') ?? '';
|
|
362
|
+
const type = readString(response, 'type') ?? 'input';
|
|
363
|
+
const result = {
|
|
364
|
+
filename: filename ?? '',
|
|
365
|
+
subfolder: responseSubfolder,
|
|
366
|
+
type,
|
|
367
|
+
workflowPath: responseSubfolder ? `${responseSubfolder}/${filename ?? ''}` : filename ?? '',
|
|
368
|
+
};
|
|
369
|
+
validateUploadedAsset(result);
|
|
370
|
+
return { ...result, type: 'input' };
|
|
371
|
+
}
|
|
372
|
+
async requestJson(endpoint, init, maxBytes, timeoutMs, signal) {
|
|
373
|
+
const startedAt = Date.now();
|
|
374
|
+
const url = this.endpoint(endpoint);
|
|
375
|
+
const response = await this.requestRaw(url, init, timeoutMs, signal);
|
|
376
|
+
assertOk(response, url.toString());
|
|
377
|
+
const remaining = Math.max(1, timeoutMs - (Date.now() - startedAt));
|
|
378
|
+
const bytes = await readResponseBytes(response, maxBytes, remaining, signal);
|
|
379
|
+
try {
|
|
380
|
+
return JSON.parse(bytes.toString('utf8'));
|
|
381
|
+
}
|
|
382
|
+
catch {
|
|
383
|
+
throw new ComfyUIRecipeRuntimeError('BAD_RESPONSE', `${url.pathname} returned invalid JSON`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
async requestAck(endpoint, init, timeoutMs) {
|
|
387
|
+
const url = this.endpoint(endpoint);
|
|
388
|
+
const response = await this.requestRaw(url, init, timeoutMs);
|
|
389
|
+
assertOk(response, url.toString());
|
|
390
|
+
await response.body?.cancel();
|
|
391
|
+
}
|
|
392
|
+
requestRaw(url, init, timeoutMs, signal) {
|
|
393
|
+
return boundedOperation(async (boundedSignal) => {
|
|
394
|
+
try {
|
|
395
|
+
return await this.fetchImpl(url, { ...init, redirect: 'error', signal: boundedSignal });
|
|
396
|
+
}
|
|
397
|
+
catch (error) {
|
|
398
|
+
if (boundedSignal.aborted)
|
|
399
|
+
throw abortLikeError(signal, 'NETWORK_TIMEOUT');
|
|
400
|
+
throw new ComfyUIRecipeRuntimeError('NETWORK_ERROR', `ComfyUI request failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
401
|
+
}
|
|
402
|
+
}, timeoutMs, signal);
|
|
403
|
+
}
|
|
404
|
+
endpoint(endpoint) {
|
|
405
|
+
if (!endpoint.startsWith('/') || endpoint.startsWith('//')) {
|
|
406
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'ComfyUI endpoint must be root-relative');
|
|
407
|
+
}
|
|
408
|
+
const url = new URL(this.baseUrl.origin);
|
|
409
|
+
url.pathname = endpoint;
|
|
410
|
+
return url;
|
|
411
|
+
}
|
|
412
|
+
requestBudget(deadline) {
|
|
413
|
+
const remaining = deadline - Date.now();
|
|
414
|
+
if (remaining <= 0)
|
|
415
|
+
throw new ComfyUIRecipeRuntimeError('RUN_TIMEOUT', 'ComfyUI run timed out');
|
|
416
|
+
return Math.max(1, Math.min(this.limits.requestTimeoutMs, remaining));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function validateBaseUrl(raw, trustedOrigins) {
|
|
420
|
+
let url;
|
|
421
|
+
try {
|
|
422
|
+
url = new URL(raw);
|
|
423
|
+
}
|
|
424
|
+
catch {
|
|
425
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Invalid ComfyUI base URL');
|
|
426
|
+
}
|
|
427
|
+
if (!['http:', 'https:'].includes(url.protocol)
|
|
428
|
+
|| url.username
|
|
429
|
+
|| url.password
|
|
430
|
+
|| url.search
|
|
431
|
+
|| url.hash
|
|
432
|
+
|| (url.pathname !== '/' && url.pathname !== '')) {
|
|
433
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Unsafe ComfyUI base URL');
|
|
434
|
+
}
|
|
435
|
+
const trusted = new Set();
|
|
436
|
+
for (const origin of trustedOrigins) {
|
|
437
|
+
let parsed;
|
|
438
|
+
try {
|
|
439
|
+
parsed = new URL(origin);
|
|
440
|
+
}
|
|
441
|
+
catch {
|
|
442
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Invalid trusted ComfyUI origin');
|
|
443
|
+
}
|
|
444
|
+
if (parsed.origin !== origin || parsed.protocol !== 'https:') {
|
|
445
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Trusted remote ComfyUI entries must be exact HTTPS origins');
|
|
446
|
+
}
|
|
447
|
+
trusted.add(parsed.origin);
|
|
448
|
+
}
|
|
449
|
+
if (!LOOPBACK_HOSTS.has(url.hostname.toLowerCase()) && !trusted.has(url.origin)) {
|
|
450
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Remote ComfyUI origins must be explicitly trusted by core configuration');
|
|
451
|
+
}
|
|
452
|
+
if (url.protocol === 'http:' && !LOOPBACK_HOSTS.has(url.hostname.toLowerCase())) {
|
|
453
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Remote ComfyUI origins must use HTTPS');
|
|
454
|
+
}
|
|
455
|
+
return new URL(`${url.origin}/`);
|
|
456
|
+
}
|
|
457
|
+
function requireAbsolutePath(value, label) {
|
|
458
|
+
if (!path.isAbsolute(value)) {
|
|
459
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', `${label} must be absolute`);
|
|
460
|
+
}
|
|
461
|
+
return path.resolve(value);
|
|
462
|
+
}
|
|
463
|
+
function validateResources(resources) {
|
|
464
|
+
for (const [name, value] of Object.entries(resources)) {
|
|
465
|
+
if (name !== 'maxTier' && (!Number.isInteger(value) || value < 0 || value > 1024 * 1024)) {
|
|
466
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', `Invalid resource limit: ${name}`);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (resources.maxTier !== undefined && !(resources.maxTier in RESOURCE_TIER_ORDER)) {
|
|
470
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Invalid maximum resource tier');
|
|
471
|
+
}
|
|
472
|
+
return { ...resources };
|
|
473
|
+
}
|
|
474
|
+
function resolveLimits(limits) {
|
|
475
|
+
return {
|
|
476
|
+
requestTimeoutMs: boundedLimit(limits.requestTimeoutMs, 10, 5 * 60_000, 30_000, 'requestTimeoutMs'),
|
|
477
|
+
uploadTimeoutMs: boundedLimit(limits.uploadTimeoutMs, 10, 10 * 60_000, 120_000, 'uploadTimeoutMs'),
|
|
478
|
+
maxRunMs: boundedLimit(limits.maxRunMs, 20, 60 * 60_000, 15 * 60_000, 'maxRunMs'),
|
|
479
|
+
pollIntervalMs: boundedLimit(limits.pollIntervalMs, 1, 60_000, 500, 'pollIntervalMs'),
|
|
480
|
+
maxObjectInfoBytes: boundedLimit(limits.maxObjectInfoBytes, 1024, 64 * 1024 * 1024, 16 * 1024 * 1024, 'maxObjectInfoBytes'),
|
|
481
|
+
maxHistoryBytes: boundedLimit(limits.maxHistoryBytes, 1024, 64 * 1024 * 1024, 8 * 1024 * 1024, 'maxHistoryBytes'),
|
|
482
|
+
maxOutputBytes: boundedLimit(limits.maxOutputBytes, 1024, 2 * 1024 * 1024 * 1024, 1024 * 1024 * 1024, 'maxOutputBytes'),
|
|
483
|
+
maxTotalOutputBytes: boundedLimit(limits.maxTotalOutputBytes, 1024, 4 * 1024 * 1024 * 1024, 2 * 1024 * 1024 * 1024, 'maxTotalOutputBytes'),
|
|
484
|
+
maxUploadBytes: boundedLimit(limits.maxUploadBytes, 1024, 512 * 1024 * 1024, 64 * 1024 * 1024, 'maxUploadBytes'),
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
function boundedLimit(value, minimum, maximum, fallback, label) {
|
|
488
|
+
if (value === undefined)
|
|
489
|
+
return fallback;
|
|
490
|
+
if (!Number.isInteger(value) || value < minimum || value > maximum) {
|
|
491
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', `${label} must be an integer between ${minimum} and ${maximum}`);
|
|
492
|
+
}
|
|
493
|
+
return value;
|
|
494
|
+
}
|
|
495
|
+
async function inspectModelRoot(rootPath) {
|
|
496
|
+
const stats = await lstat(rootPath);
|
|
497
|
+
if (!stats.isDirectory() || stats.isSymbolicLink())
|
|
498
|
+
throw new Error('ComfyUI models root is not a real directory');
|
|
499
|
+
const canonical = await realpath(rootPath);
|
|
500
|
+
if (canonical !== rootPath)
|
|
501
|
+
throw new Error('ComfyUI models root contains a symbolic-link path component');
|
|
502
|
+
return { configuredPath: rootPath, realPath: canonical, stats };
|
|
503
|
+
}
|
|
504
|
+
async function verifyModelRoot(root) {
|
|
505
|
+
const current = await lstat(root.configuredPath);
|
|
506
|
+
if (!current.isDirectory() || current.isSymbolicLink() || !sameIdentity(current, root.stats)) {
|
|
507
|
+
throw new Error('ComfyUI models root changed during preflight');
|
|
508
|
+
}
|
|
509
|
+
if (await realpath(root.configuredPath) !== root.realPath) {
|
|
510
|
+
throw new Error('ComfyUI models root identity changed during preflight');
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
async function checkModel(root, requirement, signal) {
|
|
514
|
+
throwIfAborted(signal);
|
|
515
|
+
const issues = [];
|
|
516
|
+
const candidate = path.resolve(root.realPath, ...requirement.relativePath.split('/'));
|
|
517
|
+
try {
|
|
518
|
+
assertContained(root.realPath, candidate, 'Model path');
|
|
519
|
+
const snapshots = await snapshotModelPath(root.realPath, requirement.relativePath);
|
|
520
|
+
const fileSnapshot = snapshots.at(-1);
|
|
521
|
+
if (!fileSnapshot?.stats.isFile())
|
|
522
|
+
throw new Error('model is not a regular file');
|
|
523
|
+
const flags = fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0);
|
|
524
|
+
const handle = await open(candidate, flags);
|
|
525
|
+
try {
|
|
526
|
+
const opened = await handle.stat();
|
|
527
|
+
if (!opened.isFile() || !sameIdentity(opened, fileSnapshot.stats)) {
|
|
528
|
+
throw new Error('model changed while it was being opened');
|
|
529
|
+
}
|
|
530
|
+
if (opened.size < requirement.minBytes) {
|
|
531
|
+
issues.push({
|
|
532
|
+
code: 'model-too-small',
|
|
533
|
+
requirement: requirement.id,
|
|
534
|
+
message: `${requirement.relativePath} is ${opened.size} bytes; minimum is ${requirement.minBytes}`,
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
if (requirement.sha256) {
|
|
538
|
+
const digest = await hashFileHandle(handle, signal);
|
|
539
|
+
if (digest !== requirement.sha256) {
|
|
540
|
+
issues.push({
|
|
541
|
+
code: 'model-hash',
|
|
542
|
+
requirement: requirement.id,
|
|
543
|
+
message: `${requirement.relativePath} failed SHA-256 verification`,
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
const after = await handle.stat();
|
|
548
|
+
if (!sameSnapshot(opened, after))
|
|
549
|
+
throw new Error('model changed during preflight');
|
|
550
|
+
}
|
|
551
|
+
finally {
|
|
552
|
+
await handle.close();
|
|
553
|
+
}
|
|
554
|
+
const canonical = await realpath(candidate);
|
|
555
|
+
assertContained(root.realPath, canonical, 'Model real path');
|
|
556
|
+
await verifyFileSnapshots(snapshots);
|
|
557
|
+
}
|
|
558
|
+
catch (error) {
|
|
559
|
+
if (error instanceof ComfyUIRecipeRuntimeError && error.code === 'ABORTED')
|
|
560
|
+
throw error;
|
|
561
|
+
const code = error.code;
|
|
562
|
+
issues.push({
|
|
563
|
+
code: code === 'ENOENT' ? 'missing-model' : 'unsafe-model',
|
|
564
|
+
requirement: requirement.id,
|
|
565
|
+
message: code === 'ENOENT'
|
|
566
|
+
? `Missing model: ${requirement.relativePath}`
|
|
567
|
+
: `Unsafe model ${requirement.relativePath}: ${error instanceof Error ? error.message : String(error)}`,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
return issues;
|
|
571
|
+
}
|
|
572
|
+
async function snapshotModelPath(root, relativePath) {
|
|
573
|
+
if (!isSafeComfyUIRelativePath(relativePath))
|
|
574
|
+
throw new Error('unsafe model relative path');
|
|
575
|
+
const snapshots = [];
|
|
576
|
+
let cursor = root;
|
|
577
|
+
const segments = relativePath.split('/');
|
|
578
|
+
for (let index = 0; index < segments.length; index += 1) {
|
|
579
|
+
const segment = segments[index];
|
|
580
|
+
if (!segment)
|
|
581
|
+
throw new Error('empty model path segment');
|
|
582
|
+
cursor = path.join(cursor, segment);
|
|
583
|
+
const stats = await lstat(cursor);
|
|
584
|
+
if (stats.isSymbolicLink())
|
|
585
|
+
throw new Error('model path contains a symbolic link');
|
|
586
|
+
const isLast = index === segments.length - 1;
|
|
587
|
+
if ((!isLast && !stats.isDirectory()) || (isLast && !stats.isFile())) {
|
|
588
|
+
throw new Error('model path has an unexpected file type');
|
|
589
|
+
}
|
|
590
|
+
snapshots.push({ path: cursor, stats });
|
|
591
|
+
}
|
|
592
|
+
return snapshots;
|
|
593
|
+
}
|
|
594
|
+
async function verifyFileSnapshots(snapshots) {
|
|
595
|
+
for (const snapshot of snapshots) {
|
|
596
|
+
const current = await lstat(snapshot.path);
|
|
597
|
+
if (current.isSymbolicLink() || !sameIdentity(current, snapshot.stats)) {
|
|
598
|
+
throw new Error('model path changed during preflight');
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
async function hashFileHandle(handle, signal) {
|
|
603
|
+
const hash = createHash('sha256');
|
|
604
|
+
const buffer = Buffer.allocUnsafe(1024 * 1024);
|
|
605
|
+
let position = 0;
|
|
606
|
+
while (true) {
|
|
607
|
+
throwIfAborted(signal);
|
|
608
|
+
const { bytesRead } = await handle.read(buffer, 0, buffer.length, position);
|
|
609
|
+
if (bytesRead === 0)
|
|
610
|
+
break;
|
|
611
|
+
hash.update(buffer.subarray(0, bytesRead));
|
|
612
|
+
position += bytesRead;
|
|
613
|
+
}
|
|
614
|
+
return hash.digest('hex');
|
|
615
|
+
}
|
|
616
|
+
function extractHistoryOutputs(recipe, entry) {
|
|
617
|
+
const outputs = isPlainRecord(entry.outputs) ? entry.outputs : {};
|
|
618
|
+
const result = [];
|
|
619
|
+
for (const descriptor of recipe.outputs) {
|
|
620
|
+
const nodeOutput = outputs[descriptor.nodeId];
|
|
621
|
+
const values = isPlainRecord(nodeOutput) ? nodeOutput[descriptor.field] : undefined;
|
|
622
|
+
if (!Array.isArray(values)) {
|
|
623
|
+
if (descriptor.required) {
|
|
624
|
+
throw new ComfyUIRecipeRuntimeError('BAD_RESPONSE', `Required ComfyUI output is missing: ${descriptor.id} (${descriptor.nodeId}.${descriptor.field})`);
|
|
625
|
+
}
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
if (values.length > descriptor.maxItems) {
|
|
629
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', `Output ${descriptor.id} exceeds its item limit`);
|
|
630
|
+
}
|
|
631
|
+
for (let index = 0; index < values.length; index += 1) {
|
|
632
|
+
result.push({ descriptor, reference: parseOutputReference(values[index]), index });
|
|
633
|
+
}
|
|
634
|
+
if (descriptor.required && values.length === 0) {
|
|
635
|
+
throw new ComfyUIRecipeRuntimeError('BAD_RESPONSE', `Required ComfyUI output is empty: ${descriptor.id}`);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
if (result.length > 64) {
|
|
639
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', 'ComfyUI history returned too many outputs');
|
|
640
|
+
}
|
|
641
|
+
return result;
|
|
642
|
+
}
|
|
643
|
+
function parseOutputReference(value) {
|
|
644
|
+
if (!isPlainRecord(value))
|
|
645
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', 'Invalid output reference');
|
|
646
|
+
const filename = readString(value, 'filename') ?? readString(value, 'name');
|
|
647
|
+
const subfolder = readString(value, 'subfolder') ?? '';
|
|
648
|
+
const type = readString(value, 'type') ?? 'output';
|
|
649
|
+
if (!filename
|
|
650
|
+
|| !isSafeFilename(filename)
|
|
651
|
+
|| !isSafeSubfolder(subfolder)
|
|
652
|
+
|| (type !== 'output' && type !== 'temp')) {
|
|
653
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', 'ComfyUI returned an unsafe output path');
|
|
654
|
+
}
|
|
655
|
+
return { filename, subfolder, type };
|
|
656
|
+
}
|
|
657
|
+
function historyEntry(history, promptId) {
|
|
658
|
+
if (!isPlainRecord(history)) {
|
|
659
|
+
throw new ComfyUIRecipeRuntimeError('BAD_RESPONSE', 'ComfyUI history response is not an object');
|
|
660
|
+
}
|
|
661
|
+
const nested = history[promptId];
|
|
662
|
+
if (isPlainRecord(nested))
|
|
663
|
+
return nested;
|
|
664
|
+
if (Object.prototype.hasOwnProperty.call(history, 'outputs')
|
|
665
|
+
|| Object.prototype.hasOwnProperty.call(history, 'status'))
|
|
666
|
+
return history;
|
|
667
|
+
return undefined;
|
|
668
|
+
}
|
|
669
|
+
function readStatus(entry) {
|
|
670
|
+
if (!isPlainRecord(entry.status))
|
|
671
|
+
return undefined;
|
|
672
|
+
const value = entry.status.status_str;
|
|
673
|
+
return typeof value === 'string' ? value.toLowerCase() : undefined;
|
|
674
|
+
}
|
|
675
|
+
function boundedStatusDetails(entry) {
|
|
676
|
+
if (!isPlainRecord(entry.status))
|
|
677
|
+
return '';
|
|
678
|
+
try {
|
|
679
|
+
return JSON.stringify(entry.status.messages ?? '').slice(0, 1000);
|
|
680
|
+
}
|
|
681
|
+
catch {
|
|
682
|
+
return '';
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
function validatedOutputExtension(type, filename) {
|
|
686
|
+
const extension = path.extname(filename).toLowerCase();
|
|
687
|
+
if (!Object.prototype.hasOwnProperty.call(OUTPUT_MEDIA[type], extension)) {
|
|
688
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', `Unsupported ${type} output extension: ${extension || '<none>'}`);
|
|
689
|
+
}
|
|
690
|
+
return extension;
|
|
691
|
+
}
|
|
692
|
+
function acceptedMimeTypes(type, extension) {
|
|
693
|
+
return OUTPUT_MEDIA[type][extension] ?? [];
|
|
694
|
+
}
|
|
695
|
+
function validateOutputMedia(response, bytes, type, extension) {
|
|
696
|
+
const rawMime = (response.headers.get('content-type') ?? '').split(';', 1)[0]?.trim().toLowerCase() ?? '';
|
|
697
|
+
const allowed = acceptedMimeTypes(type, extension);
|
|
698
|
+
if (rawMime && rawMime !== 'application/octet-stream' && !allowed.includes(rawMime)) {
|
|
699
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', `Output MIME ${rawMime} does not match ${type}${extension}`);
|
|
700
|
+
}
|
|
701
|
+
if (!matchesMediaSignature(bytes, extension)) {
|
|
702
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', `Output bytes do not match ${extension}`);
|
|
703
|
+
}
|
|
704
|
+
return rawMime || allowed[0] || 'application/octet-stream';
|
|
705
|
+
}
|
|
706
|
+
function matchesMediaSignature(bytes, extension) {
|
|
707
|
+
switch (extension) {
|
|
708
|
+
case '.png':
|
|
709
|
+
return bytes.length >= 8 && bytes.subarray(0, 8).equals(Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]));
|
|
710
|
+
case '.jpg':
|
|
711
|
+
case '.jpeg':
|
|
712
|
+
return bytes.length >= 3 && bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff;
|
|
713
|
+
case '.webp':
|
|
714
|
+
return bytes.length >= 12 && bytes.toString('ascii', 0, 4) === 'RIFF' && bytes.toString('ascii', 8, 12) === 'WEBP';
|
|
715
|
+
case '.gif':
|
|
716
|
+
return bytes.length >= 6 && ['GIF87a', 'GIF89a'].includes(bytes.toString('ascii', 0, 6));
|
|
717
|
+
case '.mp4':
|
|
718
|
+
case '.mov':
|
|
719
|
+
case '.m4a':
|
|
720
|
+
return bytes.length >= 12 && bytes.toString('ascii', 4, 8) === 'ftyp';
|
|
721
|
+
case '.webm':
|
|
722
|
+
case '.mkv':
|
|
723
|
+
return bytes.length >= 4 && bytes.subarray(0, 4).equals(Buffer.from([0x1a, 0x45, 0xdf, 0xa3]));
|
|
724
|
+
case '.wav':
|
|
725
|
+
return bytes.length >= 12 && bytes.toString('ascii', 0, 4) === 'RIFF' && bytes.toString('ascii', 8, 12) === 'WAVE';
|
|
726
|
+
case '.flac':
|
|
727
|
+
return bytes.length >= 4 && bytes.toString('ascii', 0, 4) === 'fLaC';
|
|
728
|
+
case '.mp3':
|
|
729
|
+
return bytes.length >= 3 && (bytes.toString('ascii', 0, 3) === 'ID3' || (bytes[0] === 0xff && (bytes[1] & 0xe0) === 0xe0));
|
|
730
|
+
case '.ogg':
|
|
731
|
+
return bytes.length >= 4 && bytes.toString('ascii', 0, 4) === 'OggS';
|
|
732
|
+
case '.aac':
|
|
733
|
+
return bytes.length >= 2 && bytes[0] === 0xff && (bytes[1] & 0xf6) === 0xf0;
|
|
734
|
+
case '.glb':
|
|
735
|
+
return bytes.length >= 12 && bytes.toString('ascii', 0, 4) === 'glTF';
|
|
736
|
+
case '.gltf':
|
|
737
|
+
try {
|
|
738
|
+
const value = JSON.parse(bytes.toString('utf8'));
|
|
739
|
+
return isPlainRecord(value) && typeof value.asset === 'object';
|
|
740
|
+
}
|
|
741
|
+
catch {
|
|
742
|
+
return false;
|
|
743
|
+
}
|
|
744
|
+
default:
|
|
745
|
+
return false;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
function validateUpload(upload, maxBytes, mask) {
|
|
749
|
+
if (!(upload.bytes instanceof Uint8Array) || upload.bytes.byteLength === 0 || upload.bytes.byteLength > maxBytes) {
|
|
750
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Upload bytes are empty or exceed the configured limit');
|
|
751
|
+
}
|
|
752
|
+
if (!isSafeFilename(upload.filename) || !isSafeSubfolder(upload.subfolder ?? '')) {
|
|
753
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Upload path is unsafe');
|
|
754
|
+
}
|
|
755
|
+
const expectedExtension = upload.mimeType === 'image/png'
|
|
756
|
+
? '.png'
|
|
757
|
+
: upload.mimeType === 'image/webp' ? '.webp' : ['.jpg', '.jpeg'];
|
|
758
|
+
const extension = path.extname(upload.filename).toLowerCase();
|
|
759
|
+
if (Array.isArray(expectedExtension) ? !expectedExtension.includes(extension) : extension !== expectedExtension) {
|
|
760
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Upload extension does not match its MIME type');
|
|
761
|
+
}
|
|
762
|
+
if (mask && upload.mimeType !== 'image/png') {
|
|
763
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'ComfyUI masks must use PNG');
|
|
764
|
+
}
|
|
765
|
+
if (!matchesMediaSignature(Buffer.from(upload.bytes), extension)) {
|
|
766
|
+
throw new ComfyUIRecipeRuntimeError('INVALID_CONFIGURATION', 'Upload bytes do not match the declared image format');
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
function validateUploadedAsset(asset) {
|
|
770
|
+
const expectedPath = asset.subfolder ? `${asset.subfolder}/${asset.filename}` : asset.filename;
|
|
771
|
+
if (!isSafeFilename(asset.filename)
|
|
772
|
+
|| !isSafeSubfolder(asset.subfolder)
|
|
773
|
+
|| asset.type !== 'input'
|
|
774
|
+
|| !isSafeComfyUIAssetReference(expectedPath)
|
|
775
|
+
|| (asset.workflowPath !== undefined && asset.workflowPath !== expectedPath)) {
|
|
776
|
+
throw new ComfyUIRecipeRuntimeError('BAD_RESPONSE', 'ComfyUI upload returned an unsafe reference');
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
function isSafeFilename(value) {
|
|
780
|
+
return SAFE_FILENAME.test(value) && value !== '.' && value !== '..';
|
|
781
|
+
}
|
|
782
|
+
function isSafeSubfolder(value) {
|
|
783
|
+
return value === '' || (value.length <= 512 && isSafeComfyUIRelativePath(value));
|
|
784
|
+
}
|
|
785
|
+
async function createConfinedOutputDirectory(outputRoot, promptId) {
|
|
786
|
+
await mkdir(outputRoot, { recursive: true, mode: 0o700 });
|
|
787
|
+
const rootStats = await lstat(outputRoot);
|
|
788
|
+
if (!rootStats.isDirectory() || rootStats.isSymbolicLink()) {
|
|
789
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', 'Output root is not a real directory');
|
|
790
|
+
}
|
|
791
|
+
const rootReal = await realpath(outputRoot);
|
|
792
|
+
if (rootReal !== outputRoot) {
|
|
793
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', 'Output root contains a symbolic-link path component');
|
|
794
|
+
}
|
|
795
|
+
const directoryName = `${promptId.slice(0, 40)}-${randomUUID()}`;
|
|
796
|
+
const directory = path.join(rootReal, directoryName);
|
|
797
|
+
assertContained(rootReal, directory, 'Output directory');
|
|
798
|
+
await mkdir(directory, { mode: 0o700 });
|
|
799
|
+
const stats = await lstat(directory);
|
|
800
|
+
if (!stats.isDirectory() || stats.isSymbolicLink()) {
|
|
801
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', 'Output directory is unsafe');
|
|
802
|
+
}
|
|
803
|
+
const canonical = await realpath(directory);
|
|
804
|
+
assertContained(rootReal, canonical, 'Output directory');
|
|
805
|
+
const rootAfter = await lstat(outputRoot);
|
|
806
|
+
if (!sameIdentity(rootStats, rootAfter)) {
|
|
807
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', 'Output root changed during creation');
|
|
808
|
+
}
|
|
809
|
+
return canonical;
|
|
810
|
+
}
|
|
811
|
+
async function readResponseBytes(response, maxBytes, timeoutMs, signal) {
|
|
812
|
+
return boundedOperation((boundedSignal) => readResponseBytesUnchecked(response, maxBytes, boundedSignal), timeoutMs, signal);
|
|
813
|
+
}
|
|
814
|
+
async function readResponseBytesUnchecked(response, maxBytes, signal) {
|
|
815
|
+
const declaredLength = Number(response.headers.get('content-length') ?? '0');
|
|
816
|
+
if (Number.isFinite(declaredLength) && declaredLength > maxBytes) {
|
|
817
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', `Response exceeds ${maxBytes} bytes`);
|
|
818
|
+
}
|
|
819
|
+
if (!response.body)
|
|
820
|
+
throw new ComfyUIRecipeRuntimeError('BAD_RESPONSE', 'ComfyUI response has no body');
|
|
821
|
+
const reader = response.body.getReader();
|
|
822
|
+
const chunks = [];
|
|
823
|
+
let total = 0;
|
|
824
|
+
const onAbort = () => { void reader.cancel('aborted'); };
|
|
825
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
826
|
+
try {
|
|
827
|
+
while (true) {
|
|
828
|
+
throwIfAborted(signal);
|
|
829
|
+
const { done, value } = await reader.read();
|
|
830
|
+
if (done)
|
|
831
|
+
break;
|
|
832
|
+
total += value.byteLength;
|
|
833
|
+
if (total > maxBytes) {
|
|
834
|
+
await reader.cancel('response too large');
|
|
835
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', `Response exceeds ${maxBytes} bytes`);
|
|
836
|
+
}
|
|
837
|
+
chunks.push(Buffer.from(value));
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
finally {
|
|
841
|
+
signal.removeEventListener('abort', onAbort);
|
|
842
|
+
}
|
|
843
|
+
return Buffer.concat(chunks, total);
|
|
844
|
+
}
|
|
845
|
+
function boundedOperation(operation, timeoutMs, externalSignal) {
|
|
846
|
+
return new Promise((resolve, reject) => {
|
|
847
|
+
const controller = new AbortController();
|
|
848
|
+
let settled = false;
|
|
849
|
+
const finish = (callback) => {
|
|
850
|
+
if (settled)
|
|
851
|
+
return;
|
|
852
|
+
settled = true;
|
|
853
|
+
clearTimeout(timer);
|
|
854
|
+
externalSignal?.removeEventListener('abort', onExternalAbort);
|
|
855
|
+
callback();
|
|
856
|
+
};
|
|
857
|
+
const onExternalAbort = () => {
|
|
858
|
+
controller.abort(externalSignal?.reason);
|
|
859
|
+
finish(() => reject(new ComfyUIRecipeRuntimeError('ABORTED', 'ComfyUI operation aborted')));
|
|
860
|
+
};
|
|
861
|
+
const timer = setTimeout(() => {
|
|
862
|
+
controller.abort('timeout');
|
|
863
|
+
finish(() => reject(new ComfyUIRecipeRuntimeError('NETWORK_TIMEOUT', `ComfyUI request exceeded ${timeoutMs} ms`)));
|
|
864
|
+
}, timeoutMs);
|
|
865
|
+
if (externalSignal?.aborted) {
|
|
866
|
+
onExternalAbort();
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
externalSignal?.addEventListener('abort', onExternalAbort, { once: true });
|
|
870
|
+
Promise.resolve()
|
|
871
|
+
.then(() => operation(controller.signal))
|
|
872
|
+
.then((value) => finish(() => resolve(value)), (error) => finish(() => reject(error)));
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
function delay(milliseconds, signal) {
|
|
876
|
+
throwIfAborted(signal);
|
|
877
|
+
return new Promise((resolve, reject) => {
|
|
878
|
+
const timer = setTimeout(() => {
|
|
879
|
+
signal?.removeEventListener('abort', onAbort);
|
|
880
|
+
resolve();
|
|
881
|
+
}, milliseconds);
|
|
882
|
+
const onAbort = () => {
|
|
883
|
+
clearTimeout(timer);
|
|
884
|
+
reject(new ComfyUIRecipeRuntimeError('ABORTED', 'ComfyUI operation aborted'));
|
|
885
|
+
};
|
|
886
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
function assertOk(response, url) {
|
|
890
|
+
if (!response.ok) {
|
|
891
|
+
throw new ComfyUIRecipeRuntimeError('BAD_RESPONSE', `${url} returned HTTP ${response.status}`);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
function readString(value, key) {
|
|
895
|
+
if (!isPlainRecord(value))
|
|
896
|
+
return undefined;
|
|
897
|
+
const field = value[key];
|
|
898
|
+
return typeof field === 'string' ? field : undefined;
|
|
899
|
+
}
|
|
900
|
+
function isPlainRecord(value) {
|
|
901
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
902
|
+
return false;
|
|
903
|
+
const prototype = Object.getPrototypeOf(value);
|
|
904
|
+
return prototype === Object.prototype || prototype === null;
|
|
905
|
+
}
|
|
906
|
+
function assertContained(root, candidate, label) {
|
|
907
|
+
const relative = path.relative(root, candidate);
|
|
908
|
+
if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
909
|
+
throw new ComfyUIRecipeRuntimeError('UNSAFE_OUTPUT', `${label} escapes its configured root`);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
function sameIdentity(left, right) {
|
|
913
|
+
return left.dev === right.dev && left.ino === right.ino;
|
|
914
|
+
}
|
|
915
|
+
function sameSnapshot(left, right) {
|
|
916
|
+
return sameIdentity(left, right)
|
|
917
|
+
&& left.size === right.size
|
|
918
|
+
&& left.mtimeMs === right.mtimeMs
|
|
919
|
+
&& left.ctimeMs === right.ctimeMs;
|
|
920
|
+
}
|
|
921
|
+
function defaultSeed() {
|
|
922
|
+
return Number.parseInt(createHash('sha256').update(randomUUID()).digest('hex').slice(0, 12), 16);
|
|
923
|
+
}
|
|
924
|
+
function throwIfAborted(signal) {
|
|
925
|
+
if (signal?.aborted)
|
|
926
|
+
throw new ComfyUIRecipeRuntimeError('ABORTED', 'ComfyUI operation aborted');
|
|
927
|
+
}
|
|
928
|
+
function abortLikeError(externalSignal, fallback) {
|
|
929
|
+
return externalSignal?.aborted
|
|
930
|
+
? new ComfyUIRecipeRuntimeError('ABORTED', 'ComfyUI operation aborted')
|
|
931
|
+
: new ComfyUIRecipeRuntimeError(fallback, 'ComfyUI request timed out');
|
|
932
|
+
}
|
|
933
|
+
function normalizeRuntimeError(error, signal, deadline) {
|
|
934
|
+
if (error instanceof ComfyUIRecipeRuntimeError || error instanceof ComfyUIRecipeValidationError)
|
|
935
|
+
return error;
|
|
936
|
+
if (signal?.aborted)
|
|
937
|
+
return new ComfyUIRecipeRuntimeError('ABORTED', 'ComfyUI operation aborted');
|
|
938
|
+
if (Date.now() >= deadline)
|
|
939
|
+
return new ComfyUIRecipeRuntimeError('RUN_TIMEOUT', 'ComfyUI run timed out');
|
|
940
|
+
return new ComfyUIRecipeRuntimeError('RUN_FAILED', error instanceof Error ? error.message : String(error));
|
|
941
|
+
}
|
|
942
|
+
//# sourceMappingURL=comfyui-recipe-runtime.js.map
|