vilvona 1.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/CHANGELOG.md +12331 -0
- package/LICENSE +24 -0
- package/README.md +314 -0
- package/THIRD_PARTY_NOTICES.md +37 -0
- package/docs/.i18n/README.md +81 -0
- package/docs/.i18n/ar-navigation.json +18 -0
- package/docs/.i18n/de-navigation.json +18 -0
- package/docs/.i18n/es-navigation.json +18 -0
- package/docs/.i18n/fr-navigation.json +18 -0
- package/docs/.i18n/glossary.ar.json +82 -0
- package/docs/.i18n/glossary.de.json +82 -0
- package/docs/.i18n/glossary.es.json +82 -0
- package/docs/.i18n/glossary.fa.json +82 -0
- package/docs/.i18n/glossary.fr.json +82 -0
- package/docs/.i18n/glossary.id.json +82 -0
- package/docs/.i18n/glossary.it.json +82 -0
- package/docs/.i18n/glossary.ja-JP.json +102 -0
- package/docs/.i18n/glossary.ko.json +82 -0
- package/docs/.i18n/glossary.nl.json +82 -0
- package/docs/.i18n/glossary.pl.json +82 -0
- package/docs/.i18n/glossary.pt-BR.json +82 -0
- package/docs/.i18n/glossary.th.json +82 -0
- package/docs/.i18n/glossary.tr.json +82 -0
- package/docs/.i18n/glossary.uk.json +82 -0
- package/docs/.i18n/glossary.vi.json +82 -0
- package/docs/.i18n/glossary.zh-CN.json +1182 -0
- package/docs/.i18n/glossary.zh-TW.json +162 -0
- package/docs/.i18n/id-navigation.json +18 -0
- package/docs/.i18n/it-navigation.json +18 -0
- package/docs/.i18n/ja-navigation.json +18 -0
- package/docs/.i18n/ko-navigation.json +18 -0
- package/docs/.i18n/pl-navigation.json +18 -0
- package/docs/.i18n/pt-BR-navigation.json +18 -0
- package/docs/.i18n/tr-navigation.json +18 -0
- package/docs/.i18n/translation-workflow.md +111 -0
- package/docs/.i18n/zh-Hans-navigation.json +552 -0
- package/docs/AGENTS.md +36 -0
- package/docs/agent-runtime-architecture.md +48 -0
- package/docs/announcements/bluebubbles-imessage.md +79 -0
- package/docs/auth-credential-semantics.md +124 -0
- package/docs/automation/auth-monitoring.md +11 -0
- package/docs/automation/clawflow.md +12 -0
- package/docs/automation/cron-jobs.md +569 -0
- package/docs/automation/cron-vs-heartbeat.md +11 -0
- package/docs/automation/gmail-pubsub.md +11 -0
- package/docs/automation/hooks.md +387 -0
- package/docs/automation/index.md +135 -0
- package/docs/automation/poll.md +12 -0
- package/docs/automation/standing-orders.md +250 -0
- package/docs/automation/taskflow.md +155 -0
- package/docs/automation/tasks.md +374 -0
- package/docs/automation/troubleshooting.md +12 -0
- package/docs/automation/webhook.md +12 -0
- package/docs/brave-search.md +11 -0
- package/docs/channels/access-groups.md +201 -0
- package/docs/channels/ambient-room-events.md +214 -0
- package/docs/channels/bot-loop-protection.md +131 -0
- package/docs/channels/broadcast-groups.md +472 -0
- package/docs/channels/channel-routing.md +162 -0
- package/docs/channels/clickclack.md +146 -0
- package/docs/channels/discord.md +1758 -0
- package/docs/channels/feishu.md +654 -0
- package/docs/channels/googlechat.md +286 -0
- package/docs/channels/group-messages.md +95 -0
- package/docs/channels/groups.md +610 -0
- package/docs/channels/imessage-from-bluebubbles.md +259 -0
- package/docs/channels/imessage.md +864 -0
- package/docs/channels/index.md +65 -0
- package/docs/channels/irc.md +253 -0
- package/docs/channels/line.md +243 -0
- package/docs/channels/location.md +71 -0
- package/docs/channels/matrix-migration.md +375 -0
- package/docs/channels/matrix-presentation.md +77 -0
- package/docs/channels/matrix-push-rules.md +150 -0
- package/docs/channels/matrix.md +935 -0
- package/docs/channels/mattermost.md +542 -0
- package/docs/channels/msteams.md +1097 -0
- package/docs/channels/nextcloud-talk.md +176 -0
- package/docs/channels/nostr.md +253 -0
- package/docs/channels/pairing.md +214 -0
- package/docs/channels/qqbot.md +317 -0
- package/docs/channels/signal.md +417 -0
- package/docs/channels/slack.md +1623 -0
- package/docs/channels/sms.md +380 -0
- package/docs/channels/synology-chat.md +187 -0
- package/docs/channels/telegram.md +1121 -0
- package/docs/channels/tlon.md +296 -0
- package/docs/channels/troubleshooting.md +162 -0
- package/docs/channels/twitch.md +431 -0
- package/docs/channels/wechat.md +171 -0
- package/docs/channels/whatsapp.md +796 -0
- package/docs/channels/yuanbao.md +416 -0
- package/docs/channels/zalo.md +253 -0
- package/docs/channels/zalouser.md +217 -0
- package/docs/ci.md +665 -0
- package/docs/clawhub/cli.md +82 -0
- package/docs/clawhub/publishing.md +96 -0
- package/docs/cli/acp.md +370 -0
- package/docs/cli/agent.md +109 -0
- package/docs/cli/agents.md +253 -0
- package/docs/cli/approvals.md +193 -0
- package/docs/cli/backup.md +98 -0
- package/docs/cli/browser.md +322 -0
- package/docs/cli/channels.md +154 -0
- package/docs/cli/clawbot.md +25 -0
- package/docs/cli/commitments.md +90 -0
- package/docs/cli/completion.md +39 -0
- package/docs/cli/config.md +504 -0
- package/docs/cli/configure.md +77 -0
- package/docs/cli/crestodian.md +337 -0
- package/docs/cli/cron.md +344 -0
- package/docs/cli/daemon.md +67 -0
- package/docs/cli/dashboard.md +33 -0
- package/docs/cli/devices.md +240 -0
- package/docs/cli/directory.md +68 -0
- package/docs/cli/dns.md +53 -0
- package/docs/cli/docs.md +63 -0
- package/docs/cli/doctor.md +254 -0
- package/docs/cli/flows.md +52 -0
- package/docs/cli/gateway.md +572 -0
- package/docs/cli/health.md +43 -0
- package/docs/cli/hooks.md +345 -0
- package/docs/cli/index.md +406 -0
- package/docs/cli/infer.md +364 -0
- package/docs/cli/logs.md +68 -0
- package/docs/cli/mcp.md +851 -0
- package/docs/cli/memory.md +183 -0
- package/docs/cli/message.md +317 -0
- package/docs/cli/migrate.md +334 -0
- package/docs/cli/models.md +239 -0
- package/docs/cli/node.md +178 -0
- package/docs/cli/nodes.md +76 -0
- package/docs/cli/onboard.md +251 -0
- package/docs/cli/pairing.md +77 -0
- package/docs/cli/path.md +511 -0
- package/docs/cli/plugins.md +480 -0
- package/docs/cli/policy.md +929 -0
- package/docs/cli/proxy.md +89 -0
- package/docs/cli/qr.md +56 -0
- package/docs/cli/reset.md +39 -0
- package/docs/cli/sandbox.md +208 -0
- package/docs/cli/secrets.md +202 -0
- package/docs/cli/security.md +135 -0
- package/docs/cli/sessions.md +178 -0
- package/docs/cli/setup.md +60 -0
- package/docs/cli/skills.md +156 -0
- package/docs/cli/status.md +45 -0
- package/docs/cli/system.md +89 -0
- package/docs/cli/tasks.md +111 -0
- package/docs/cli/transcripts.md +151 -0
- package/docs/cli/tui.md +92 -0
- package/docs/cli/uninstall.md +45 -0
- package/docs/cli/update.md +283 -0
- package/docs/cli/voicecall.md +204 -0
- package/docs/cli/webhooks.md +117 -0
- package/docs/cli/wiki.md +256 -0
- package/docs/cli/workboard.md +228 -0
- package/docs/concepts/active-memory.md +856 -0
- package/docs/concepts/agent-loop.md +185 -0
- package/docs/concepts/agent-runtimes.md +276 -0
- package/docs/concepts/agent-workspace.md +230 -0
- package/docs/concepts/agent.md +142 -0
- package/docs/concepts/architecture.md +154 -0
- package/docs/concepts/channel-docking.md +145 -0
- package/docs/concepts/commitments.md +150 -0
- package/docs/concepts/compaction.md +203 -0
- package/docs/concepts/context-engine.md +347 -0
- package/docs/concepts/context.md +199 -0
- package/docs/concepts/delegate-architecture.md +319 -0
- package/docs/concepts/dreaming.md +279 -0
- package/docs/concepts/experimental-features.md +111 -0
- package/docs/concepts/features.md +91 -0
- package/docs/concepts/mantis-slack-desktop-runbook.md +231 -0
- package/docs/concepts/mantis.md +744 -0
- package/docs/concepts/markdown-formatting.md +139 -0
- package/docs/concepts/memory-builtin.md +151 -0
- package/docs/concepts/memory-honcho.md +144 -0
- package/docs/concepts/memory-qmd.md +277 -0
- package/docs/concepts/memory-search.md +175 -0
- package/docs/concepts/memory.md +299 -0
- package/docs/concepts/message-lifecycle-refactor.md +1126 -0
- package/docs/concepts/messages.md +216 -0
- package/docs/concepts/model-failover.md +405 -0
- package/docs/concepts/model-providers.md +719 -0
- package/docs/concepts/models.md +371 -0
- package/docs/concepts/multi-agent.md +625 -0
- package/docs/concepts/oauth.md +218 -0
- package/docs/concepts/parallel-specialist-lanes.md +127 -0
- package/docs/concepts/personal-agent-benchmark-pack.md +74 -0
- package/docs/concepts/presence.md +117 -0
- package/docs/concepts/progress-drafts.md +406 -0
- package/docs/concepts/qa-e2e-automation.md +979 -0
- package/docs/concepts/qa-matrix.md +139 -0
- package/docs/concepts/queue-steering.md +90 -0
- package/docs/concepts/queue.md +136 -0
- package/docs/concepts/retry.md +86 -0
- package/docs/concepts/session-pruning.md +104 -0
- package/docs/concepts/session-tool.md +201 -0
- package/docs/concepts/session.md +164 -0
- package/docs/concepts/soul.md +116 -0
- package/docs/concepts/streaming.md +258 -0
- package/docs/concepts/system-prompt.md +330 -0
- package/docs/concepts/timezone.md +47 -0
- package/docs/concepts/typebox.md +309 -0
- package/docs/concepts/typing-indicators.md +88 -0
- package/docs/concepts/usage-tracking.md +72 -0
- package/docs/date-time.md +126 -0
- package/docs/debug/node-issue.md +90 -0
- package/docs/diagnostics/flags.md +182 -0
- package/docs/docs.json +1885 -0
- package/docs/gateway/authentication.md +286 -0
- package/docs/gateway/background-process.md +147 -0
- package/docs/gateway/bonjour.md +303 -0
- package/docs/gateway/bridge-protocol.md +97 -0
- package/docs/gateway/cli-backends.md +463 -0
- package/docs/gateway/config-agents.md +1525 -0
- package/docs/gateway/config-channels.md +942 -0
- package/docs/gateway/config-tools.md +806 -0
- package/docs/gateway/configuration-examples.md +706 -0
- package/docs/gateway/configuration-reference.md +1449 -0
- package/docs/gateway/configuration.md +748 -0
- package/docs/gateway/diagnostics.md +213 -0
- package/docs/gateway/discovery.md +154 -0
- package/docs/gateway/doctor.md +576 -0
- package/docs/gateway/external-apps.md +86 -0
- package/docs/gateway/gateway-lock.md +37 -0
- package/docs/gateway/health.md +73 -0
- package/docs/gateway/heartbeat.md +498 -0
- package/docs/gateway/index.md +385 -0
- package/docs/gateway/local-model-services.md +205 -0
- package/docs/gateway/local-models.md +355 -0
- package/docs/gateway/logging.md +149 -0
- package/docs/gateway/multiple-gateways.md +178 -0
- package/docs/gateway/network-model.md +15 -0
- package/docs/gateway/openai-http-api.md +379 -0
- package/docs/gateway/openresponses-http-api.md +349 -0
- package/docs/gateway/openshell.md +316 -0
- package/docs/gateway/opentelemetry.md +440 -0
- package/docs/gateway/operator-scopes.md +119 -0
- package/docs/gateway/pairing.md +207 -0
- package/docs/gateway/prometheus.md +249 -0
- package/docs/gateway/protocol.md +839 -0
- package/docs/gateway/remote-gateway-readme.md +169 -0
- package/docs/gateway/remote.md +280 -0
- package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +148 -0
- package/docs/gateway/sandboxing.md +546 -0
- package/docs/gateway/secrets-plan-contract.md +159 -0
- package/docs/gateway/secrets.md +805 -0
- package/docs/gateway/security/audit-checks.md +127 -0
- package/docs/gateway/security/exposure-runbook.md +212 -0
- package/docs/gateway/security/index.md +1344 -0
- package/docs/gateway/security/secure-file-operations.md +76 -0
- package/docs/gateway/security/shrinkwrap.md +111 -0
- package/docs/gateway/tailscale.md +180 -0
- package/docs/gateway/tools-invoke-http-api.md +175 -0
- package/docs/gateway/troubleshooting.md +881 -0
- package/docs/gateway/trusted-proxy-auth.md +483 -0
- package/docs/help/debugging.md +341 -0
- package/docs/help/environment.md +240 -0
- package/docs/help/faq-first-run.md +872 -0
- package/docs/help/faq-models.md +557 -0
- package/docs/help/faq.md +2115 -0
- package/docs/help/index.md +39 -0
- package/docs/help/scripts.md +56 -0
- package/docs/help/testing-live.md +592 -0
- package/docs/help/testing-updates-plugins.md +299 -0
- package/docs/help/testing.md +977 -0
- package/docs/help/troubleshooting.md +500 -0
- package/docs/index.md +196 -0
- package/docs/install/ansible.md +233 -0
- package/docs/install/azure.md +315 -0
- package/docs/install/bun.md +59 -0
- package/docs/install/clawdock.md +112 -0
- package/docs/install/development-channels.md +148 -0
- package/docs/install/digitalocean.md +174 -0
- package/docs/install/docker-vm-runtime.md +154 -0
- package/docs/install/docker.md +564 -0
- package/docs/install/exe-dev.md +201 -0
- package/docs/install/fly.md +524 -0
- package/docs/install/gcp.md +418 -0
- package/docs/install/hetzner.md +285 -0
- package/docs/install/hostinger.md +98 -0
- package/docs/install/index.md +236 -0
- package/docs/install/installer.md +447 -0
- package/docs/install/kubernetes.md +196 -0
- package/docs/install/macos-vm.md +281 -0
- package/docs/install/migrating-claude.md +165 -0
- package/docs/install/migrating-hermes.md +178 -0
- package/docs/install/migrating.md +137 -0
- package/docs/install/nix.md +112 -0
- package/docs/install/node.md +142 -0
- package/docs/install/northflank.mdx +44 -0
- package/docs/install/oracle.md +218 -0
- package/docs/install/podman.md +216 -0
- package/docs/install/railway.mdx +92 -0
- package/docs/install/raspberry-pi.md +234 -0
- package/docs/install/render.mdx +167 -0
- package/docs/install/uninstall.md +140 -0
- package/docs/install/updating.md +284 -0
- package/docs/install/upstash.md +96 -0
- package/docs/logging.md +322 -0
- package/docs/maturity-scores.yaml +5361 -0
- package/docs/nav-tabs-underline.js +104 -0
- package/docs/network.md +72 -0
- package/docs/nodes/audio.md +216 -0
- package/docs/nodes/camera.md +166 -0
- package/docs/nodes/images.md +77 -0
- package/docs/nodes/index.md +444 -0
- package/docs/nodes/location-command.md +102 -0
- package/docs/nodes/media-understanding.md +495 -0
- package/docs/nodes/talk.md +160 -0
- package/docs/nodes/troubleshooting.md +123 -0
- package/docs/nodes/voicewake.md +93 -0
- package/docs/openclaw-agent-runtime.md +82 -0
- package/docs/perplexity.md +11 -0
- package/docs/plan/codex-context-engine-harness.md +624 -0
- package/docs/plan/ui-channels.md +284 -0
- package/docs/platforms/android.md +286 -0
- package/docs/platforms/digitalocean.md +12 -0
- package/docs/platforms/easyrunner.md +109 -0
- package/docs/platforms/index.md +65 -0
- package/docs/platforms/ios.md +287 -0
- package/docs/platforms/linux.md +141 -0
- package/docs/platforms/mac/bundled-gateway.md +79 -0
- package/docs/platforms/mac/canvas.md +128 -0
- package/docs/platforms/mac/child-process.md +72 -0
- package/docs/platforms/mac/dev-setup.md +112 -0
- package/docs/platforms/mac/health.md +39 -0
- package/docs/platforms/mac/icon.md +36 -0
- package/docs/platforms/mac/logging.md +62 -0
- package/docs/platforms/mac/menu-bar.md +93 -0
- package/docs/platforms/mac/peekaboo.md +96 -0
- package/docs/platforms/mac/permissions.md +73 -0
- package/docs/platforms/mac/remote.md +123 -0
- package/docs/platforms/mac/signing.md +52 -0
- package/docs/platforms/mac/skills.md +45 -0
- package/docs/platforms/mac/voice-overlay.md +66 -0
- package/docs/platforms/mac/voicewake.md +79 -0
- package/docs/platforms/mac/webchat.md +54 -0
- package/docs/platforms/mac/xpc.md +66 -0
- package/docs/platforms/macos.md +228 -0
- package/docs/platforms/oracle.md +12 -0
- package/docs/platforms/raspberry-pi.md +13 -0
- package/docs/platforms/windows.md +304 -0
- package/docs/plugins/adding-capabilities.md +146 -0
- package/docs/plugins/admin-http-rpc.md +216 -0
- package/docs/plugins/agent-tools.md +13 -0
- package/docs/plugins/architecture-internals.md +1203 -0
- package/docs/plugins/architecture.md +483 -0
- package/docs/plugins/building-extensions.md +13 -0
- package/docs/plugins/building-plugins.md +343 -0
- package/docs/plugins/bundles.md +310 -0
- package/docs/plugins/cli-backend-plugins.md +328 -0
- package/docs/plugins/codex-computer-use.md +297 -0
- package/docs/plugins/codex-harness-reference.md +480 -0
- package/docs/plugins/codex-harness-runtime.md +268 -0
- package/docs/plugins/codex-harness.md +800 -0
- package/docs/plugins/codex-native-plugins.md +280 -0
- package/docs/plugins/community.md +77 -0
- package/docs/plugins/compatibility.md +198 -0
- package/docs/plugins/copilot.md +355 -0
- package/docs/plugins/dependency-resolution.md +176 -0
- package/docs/plugins/google-meet.md +1737 -0
- package/docs/plugins/hooks.md +525 -0
- package/docs/plugins/install-overrides.md +80 -0
- package/docs/plugins/llama-cpp.md +58 -0
- package/docs/plugins/manage-plugins.md +214 -0
- package/docs/plugins/manifest.md +1468 -0
- package/docs/plugins/memory-lancedb.md +385 -0
- package/docs/plugins/memory-wiki.md +529 -0
- package/docs/plugins/message-presentation.md +487 -0
- package/docs/plugins/oc-path.md +166 -0
- package/docs/plugins/plugin-inventory.md +318 -0
- package/docs/plugins/plugin-permission-requests.md +193 -0
- package/docs/plugins/reference/acpx.md +23 -0
- package/docs/plugins/reference/admin-http-rpc.md +23 -0
- package/docs/plugins/reference/alibaba.md +23 -0
- package/docs/plugins/reference/amazon-bedrock-mantle.md +23 -0
- package/docs/plugins/reference/amazon-bedrock.md +23 -0
- package/docs/plugins/reference/anthropic-vertex.md +29 -0
- package/docs/plugins/reference/anthropic.md +23 -0
- package/docs/plugins/reference/arcee.md +23 -0
- package/docs/plugins/reference/azure-speech.md +23 -0
- package/docs/plugins/reference/bonjour.md +19 -0
- package/docs/plugins/reference/brave.md +23 -0
- package/docs/plugins/reference/browser.md +23 -0
- package/docs/plugins/reference/byteplus.md +19 -0
- package/docs/plugins/reference/canvas.md +19 -0
- package/docs/plugins/reference/cerebras.md +23 -0
- package/docs/plugins/reference/chutes.md +23 -0
- package/docs/plugins/reference/clickclack.md +23 -0
- package/docs/plugins/reference/cloudflare-ai-gateway.md +23 -0
- package/docs/plugins/reference/codex-supervisor.md +27 -0
- package/docs/plugins/reference/codex.md +23 -0
- package/docs/plugins/reference/comfy.md +23 -0
- package/docs/plugins/reference/copilot-proxy.md +19 -0
- package/docs/plugins/reference/copilot.md +23 -0
- package/docs/plugins/reference/deepgram.md +23 -0
- package/docs/plugins/reference/deepinfra.md +23 -0
- package/docs/plugins/reference/deepseek.md +23 -0
- package/docs/plugins/reference/diagnostics-otel.md +19 -0
- package/docs/plugins/reference/diagnostics-prometheus.md +19 -0
- package/docs/plugins/reference/diffs-language-pack.md +31 -0
- package/docs/plugins/reference/diffs.md +19 -0
- package/docs/plugins/reference/discord.md +23 -0
- package/docs/plugins/reference/document-extract.md +23 -0
- package/docs/plugins/reference/duckduckgo.md +23 -0
- package/docs/plugins/reference/elevenlabs.md +23 -0
- package/docs/plugins/reference/exa.md +23 -0
- package/docs/plugins/reference/fal.md +23 -0
- package/docs/plugins/reference/feishu.md +23 -0
- package/docs/plugins/reference/file-transfer.md +19 -0
- package/docs/plugins/reference/firecrawl.md +23 -0
- package/docs/plugins/reference/fireworks.md +23 -0
- package/docs/plugins/reference/github-copilot.md +23 -0
- package/docs/plugins/reference/gmi.md +23 -0
- package/docs/plugins/reference/google-meet.md +23 -0
- package/docs/plugins/reference/google.md +23 -0
- package/docs/plugins/reference/googlechat.md +23 -0
- package/docs/plugins/reference/gradium.md +23 -0
- package/docs/plugins/reference/groq.md +23 -0
- package/docs/plugins/reference/huggingface.md +23 -0
- package/docs/plugins/reference/imessage.md +23 -0
- package/docs/plugins/reference/inworld.md +23 -0
- package/docs/plugins/reference/irc.md +23 -0
- package/docs/plugins/reference/kilocode.md +23 -0
- package/docs/plugins/reference/kimi.md +23 -0
- package/docs/plugins/reference/line.md +23 -0
- package/docs/plugins/reference/litellm.md +23 -0
- package/docs/plugins/reference/llama-cpp.md +23 -0
- package/docs/plugins/reference/llm-task.md +19 -0
- package/docs/plugins/reference/lmstudio.md +23 -0
- package/docs/plugins/reference/lobster.md +19 -0
- package/docs/plugins/reference/matrix.md +23 -0
- package/docs/plugins/reference/mattermost.md +23 -0
- package/docs/plugins/reference/memory-core.md +19 -0
- package/docs/plugins/reference/memory-lancedb.md +23 -0
- package/docs/plugins/reference/memory-wiki.md +23 -0
- package/docs/plugins/reference/microsoft-foundry.md +113 -0
- package/docs/plugins/reference/microsoft.md +19 -0
- package/docs/plugins/reference/migrate-claude.md +19 -0
- package/docs/plugins/reference/migrate-hermes.md +19 -0
- package/docs/plugins/reference/minimax.md +23 -0
- package/docs/plugins/reference/mistral.md +23 -0
- package/docs/plugins/reference/moonshot.md +23 -0
- package/docs/plugins/reference/msteams.md +23 -0
- package/docs/plugins/reference/nextcloud-talk.md +23 -0
- package/docs/plugins/reference/nostr.md +23 -0
- package/docs/plugins/reference/novita.md +23 -0
- package/docs/plugins/reference/nvidia.md +23 -0
- package/docs/plugins/reference/oc-path.md +23 -0
- package/docs/plugins/reference/ollama.md +24 -0
- package/docs/plugins/reference/open-prose.md +19 -0
- package/docs/plugins/reference/openai.md +23 -0
- package/docs/plugins/reference/opencode-go.md +23 -0
- package/docs/plugins/reference/opencode.md +23 -0
- package/docs/plugins/reference/openrouter.md +23 -0
- package/docs/plugins/reference/openshell.md +19 -0
- package/docs/plugins/reference/perplexity.md +23 -0
- package/docs/plugins/reference/pixverse.md +23 -0
- package/docs/plugins/reference/policy.md +79 -0
- package/docs/plugins/reference/qa-channel.md +23 -0
- package/docs/plugins/reference/qa-lab.md +19 -0
- package/docs/plugins/reference/qa-matrix.md +19 -0
- package/docs/plugins/reference/qianfan.md +23 -0
- package/docs/plugins/reference/qqbot.md +23 -0
- package/docs/plugins/reference/qwen.md +24 -0
- package/docs/plugins/reference/runway.md +23 -0
- package/docs/plugins/reference/searxng.md +19 -0
- package/docs/plugins/reference/senseaudio.md +23 -0
- package/docs/plugins/reference/sglang.md +23 -0
- package/docs/plugins/reference/signal.md +23 -0
- package/docs/plugins/reference/slack.md +23 -0
- package/docs/plugins/reference/sms.md +23 -0
- package/docs/plugins/reference/stepfun.md +23 -0
- package/docs/plugins/reference/synology-chat.md +23 -0
- package/docs/plugins/reference/synthetic.md +23 -0
- package/docs/plugins/reference/tavily.md +23 -0
- package/docs/plugins/reference/telegram.md +23 -0
- package/docs/plugins/reference/tencent.md +23 -0
- package/docs/plugins/reference/tlon.md +23 -0
- package/docs/plugins/reference/together.md +23 -0
- package/docs/plugins/reference/tokenjuice.md +23 -0
- package/docs/plugins/reference/tts-local-cli.md +19 -0
- package/docs/plugins/reference/twitch.md +23 -0
- package/docs/plugins/reference/venice.md +23 -0
- package/docs/plugins/reference/vercel-ai-gateway.md +23 -0
- package/docs/plugins/reference/vllm.md +23 -0
- package/docs/plugins/reference/voice-call.md +23 -0
- package/docs/plugins/reference/volcengine.md +23 -0
- package/docs/plugins/reference/voyage.md +19 -0
- package/docs/plugins/reference/vydra.md +23 -0
- package/docs/plugins/reference/web-readability.md +19 -0
- package/docs/plugins/reference/webhooks.md +23 -0
- package/docs/plugins/reference/whatsapp.md +23 -0
- package/docs/plugins/reference/workboard.md +23 -0
- package/docs/plugins/reference/xai.md +23 -0
- package/docs/plugins/reference/xiaomi.md +23 -0
- package/docs/plugins/reference/zai.md +23 -0
- package/docs/plugins/reference/zalo.md +23 -0
- package/docs/plugins/reference/zalouser.md +24 -0
- package/docs/plugins/reference.md +19 -0
- package/docs/plugins/sdk-agent-harness.md +339 -0
- package/docs/plugins/sdk-channel-inbound.md +70 -0
- package/docs/plugins/sdk-channel-ingress.md +137 -0
- package/docs/plugins/sdk-channel-message.md +18 -0
- package/docs/plugins/sdk-channel-outbound.md +113 -0
- package/docs/plugins/sdk-channel-plugins.md +770 -0
- package/docs/plugins/sdk-channel-turn.md +9 -0
- package/docs/plugins/sdk-entrypoints.md +344 -0
- package/docs/plugins/sdk-migration.md +1011 -0
- package/docs/plugins/sdk-overview.md +525 -0
- package/docs/plugins/sdk-provider-plugins.md +1019 -0
- package/docs/plugins/sdk-runtime.md +683 -0
- package/docs/plugins/sdk-setup.md +550 -0
- package/docs/plugins/sdk-subpaths.md +401 -0
- package/docs/plugins/sdk-testing.md +403 -0
- package/docs/plugins/tool-plugins.md +411 -0
- package/docs/plugins/voice-call.md +942 -0
- package/docs/plugins/webhooks.md +192 -0
- package/docs/plugins/workboard.md +402 -0
- package/docs/plugins/zalouser.md +86 -0
- package/docs/prose.md +191 -0
- package/docs/providers/alibaba.md +158 -0
- package/docs/providers/anthropic.md +386 -0
- package/docs/providers/arcee.md +144 -0
- package/docs/providers/azure-speech.md +119 -0
- package/docs/providers/bedrock-mantle.md +224 -0
- package/docs/providers/bedrock.md +433 -0
- package/docs/providers/cerebras.md +130 -0
- package/docs/providers/chutes.md +153 -0
- package/docs/providers/claude-max-api-proxy.md +191 -0
- package/docs/providers/cloudflare-ai-gateway.md +119 -0
- package/docs/providers/comfy.md +362 -0
- package/docs/providers/deepgram.md +184 -0
- package/docs/providers/deepinfra.md +92 -0
- package/docs/providers/deepseek.md +146 -0
- package/docs/providers/ds4.md +309 -0
- package/docs/providers/elevenlabs.md +130 -0
- package/docs/providers/fal.md +240 -0
- package/docs/providers/fireworks.md +144 -0
- package/docs/providers/github-copilot.md +257 -0
- package/docs/providers/gmi.md +92 -0
- package/docs/providers/google.md +472 -0
- package/docs/providers/gradium.md +123 -0
- package/docs/providers/groq.md +171 -0
- package/docs/providers/huggingface.md +235 -0
- package/docs/providers/index.md +105 -0
- package/docs/providers/inferrs.md +272 -0
- package/docs/providers/inworld.md +120 -0
- package/docs/providers/kilocode.md +135 -0
- package/docs/providers/litellm.md +234 -0
- package/docs/providers/lmstudio.md +224 -0
- package/docs/providers/minimax.md +518 -0
- package/docs/providers/mistral.md +235 -0
- package/docs/providers/models.md +64 -0
- package/docs/providers/moonshot.md +413 -0
- package/docs/providers/novita.md +92 -0
- package/docs/providers/nvidia.md +208 -0
- package/docs/providers/ollama-cloud.md +115 -0
- package/docs/providers/ollama.md +1225 -0
- package/docs/providers/openai.md +1091 -0
- package/docs/providers/opencode-go.md +123 -0
- package/docs/providers/opencode.md +149 -0
- package/docs/providers/openrouter.md +390 -0
- package/docs/providers/perplexity-provider.md +123 -0
- package/docs/providers/pixverse.md +165 -0
- package/docs/providers/qianfan.md +132 -0
- package/docs/providers/qwen-oauth.md +115 -0
- package/docs/providers/qwen.md +364 -0
- package/docs/providers/runway.md +103 -0
- package/docs/providers/senseaudio.md +68 -0
- package/docs/providers/sglang.md +161 -0
- package/docs/providers/stepfun.md +229 -0
- package/docs/providers/synthetic.md +154 -0
- package/docs/providers/tencent.md +130 -0
- package/docs/providers/together.md +140 -0
- package/docs/providers/venice.md +312 -0
- package/docs/providers/vercel-ai-gateway.md +128 -0
- package/docs/providers/vllm.md +407 -0
- package/docs/providers/volcengine.md +199 -0
- package/docs/providers/vydra.md +180 -0
- package/docs/providers/xai.md +571 -0
- package/docs/providers/xiaomi.md +286 -0
- package/docs/providers/zai.md +224 -0
- package/docs/refactor/access.md +9 -0
- package/docs/refactor/acp.md +298 -0
- package/docs/refactor/canvas.md +131 -0
- package/docs/refactor/database-first.md +2263 -0
- package/docs/refactor/ingress-core.md +341 -0
- package/docs/reference/AGENTS.default.md +131 -0
- package/docs/reference/RELEASING.md +844 -0
- package/docs/reference/api-usage-costs.md +208 -0
- package/docs/reference/application-modernization-plan.md +208 -0
- package/docs/reference/code-mode.md +1058 -0
- package/docs/reference/credits.md +33 -0
- package/docs/reference/device-models.md +50 -0
- package/docs/reference/full-release-validation.md +206 -0
- package/docs/reference/memory-config.md +630 -0
- package/docs/reference/prompt-caching.md +358 -0
- package/docs/reference/release-performance-sweep.md +347 -0
- package/docs/reference/rich-output-protocol.md +93 -0
- package/docs/reference/rpc.md +43 -0
- package/docs/reference/secret-placeholder-conventions.md +33 -0
- package/docs/reference/secretref-credential-surface.md +163 -0
- package/docs/reference/secretref-user-supplied-credentials-matrix.json +691 -0
- package/docs/reference/session-management-compaction.md +474 -0
- package/docs/reference/templates/AGENTS.dev.md +90 -0
- package/docs/reference/templates/AGENTS.md +227 -0
- package/docs/reference/templates/BOOT.md +16 -0
- package/docs/reference/templates/BOOTSTRAP.md +66 -0
- package/docs/reference/templates/HEARTBEAT.md +24 -0
- package/docs/reference/templates/IDENTITY.dev.md +52 -0
- package/docs/reference/templates/IDENTITY.md +34 -0
- package/docs/reference/templates/SOUL.dev.md +82 -0
- package/docs/reference/templates/SOUL.md +49 -0
- package/docs/reference/templates/TOOLS.dev.md +29 -0
- package/docs/reference/templates/TOOLS.md +51 -0
- package/docs/reference/templates/USER.dev.md +23 -0
- package/docs/reference/templates/USER.md +28 -0
- package/docs/reference/test.md +248 -0
- package/docs/reference/token-use.md +246 -0
- package/docs/reference/transcript-hygiene.md +226 -0
- package/docs/reference/wizard.md +252 -0
- package/docs/security/CONTRIBUTING-THREAT-MODEL.md +101 -0
- package/docs/security/THREAT-MODEL-ATLAS.md +611 -0
- package/docs/security/formal-verification.md +170 -0
- package/docs/security/incident-response.md +59 -0
- package/docs/security/network-proxy.md +268 -0
- package/docs/snippets/plugin-publish/minimal-openclaw.plugin.json +12 -0
- package/docs/snippets/plugin-publish/minimal-package.json +16 -0
- package/docs/specs/claw-supervisor.md +247 -0
- package/docs/start/bootstrapping.md +49 -0
- package/docs/start/docs-directory.md +69 -0
- package/docs/start/getting-started.md +152 -0
- package/docs/start/hubs.md +201 -0
- package/docs/start/lore.md +223 -0
- package/docs/start/onboarding-overview.md +72 -0
- package/docs/start/onboarding.md +98 -0
- package/docs/start/openclaw.md +246 -0
- package/docs/start/quickstart.md +25 -0
- package/docs/start/setup.md +178 -0
- package/docs/start/showcase.md +371 -0
- package/docs/start/wizard-cli-automation.md +232 -0
- package/docs/start/wizard-cli-reference.md +331 -0
- package/docs/start/wizard.md +142 -0
- package/docs/style.css +137 -0
- package/docs/tools/acp-agents-setup.md +356 -0
- package/docs/tools/acp-agents.md +865 -0
- package/docs/tools/agent-send.md +130 -0
- package/docs/tools/apply-patch.md +64 -0
- package/docs/tools/brave-search.md +139 -0
- package/docs/tools/browser-control.md +405 -0
- package/docs/tools/browser-linux-troubleshooting.md +173 -0
- package/docs/tools/browser-login.md +77 -0
- package/docs/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md +219 -0
- package/docs/tools/browser.md +866 -0
- package/docs/tools/btw.md +159 -0
- package/docs/tools/capability-cookbook.md +12 -0
- package/docs/tools/clawhub.md +5 -0
- package/docs/tools/code-execution.md +173 -0
- package/docs/tools/creating-skills.md +271 -0
- package/docs/tools/diffs.md +527 -0
- package/docs/tools/duckduckgo-search.md +109 -0
- package/docs/tools/elevated.md +128 -0
- package/docs/tools/exa-search.md +152 -0
- package/docs/tools/exec-approvals-advanced.md +457 -0
- package/docs/tools/exec-approvals.md +520 -0
- package/docs/tools/exec.md +294 -0
- package/docs/tools/firecrawl.md +155 -0
- package/docs/tools/gemini-search.md +114 -0
- package/docs/tools/goal.md +217 -0
- package/docs/tools/grok-search.md +129 -0
- package/docs/tools/image-generation.md +538 -0
- package/docs/tools/index.md +176 -0
- package/docs/tools/kimi-search.md +105 -0
- package/docs/tools/llm-task.md +137 -0
- package/docs/tools/lobster.md +365 -0
- package/docs/tools/loop-detection.md +154 -0
- package/docs/tools/media-overview.md +161 -0
- package/docs/tools/minimax-search.md +102 -0
- package/docs/tools/multi-agent-sandbox-tools.md +409 -0
- package/docs/tools/music-generation.md +372 -0
- package/docs/tools/ollama-search.md +153 -0
- package/docs/tools/parallel-search.md +154 -0
- package/docs/tools/pdf.md +213 -0
- package/docs/tools/permission-modes.md +111 -0
- package/docs/tools/perplexity-search.md +220 -0
- package/docs/tools/plugin.md +378 -0
- package/docs/tools/reactions.md +100 -0
- package/docs/tools/searxng-search.md +141 -0
- package/docs/tools/skill-workshop.md +283 -0
- package/docs/tools/skills-config.md +457 -0
- package/docs/tools/skills.md +591 -0
- package/docs/tools/slash-commands.md +518 -0
- package/docs/tools/steer.md +77 -0
- package/docs/tools/subagents.md +652 -0
- package/docs/tools/tavily.md +162 -0
- package/docs/tools/thinking.md +142 -0
- package/docs/tools/tokenjuice.md +84 -0
- package/docs/tools/tool-search.md +269 -0
- package/docs/tools/trajectory.md +229 -0
- package/docs/tools/tts.md +1013 -0
- package/docs/tools/video-generation.md +555 -0
- package/docs/tools/web-fetch.md +210 -0
- package/docs/tools/web.md +476 -0
- package/docs/tts.md +11 -0
- package/docs/vps.md +139 -0
- package/docs/web/control-ui.md +530 -0
- package/docs/web/dashboard.md +107 -0
- package/docs/web/index.md +133 -0
- package/docs/web/tui.md +258 -0
- package/docs/web/webchat.md +102 -0
- package/npm-shrinkwrap.json +3485 -0
- package/openclaw.mjs +661 -0
- package/package.json +1971 -0
- package/patches/.gitkeep +0 -0
- package/patches/@agentclientprotocol__claude-agent-acp@0.39.0.patch +40 -0
- package/pnpm-workspace.yaml +124 -0
- package/scripts/crabbox-wrapper.mjs +2470 -0
- package/scripts/lib/official-external-channel-catalog.json +570 -0
- package/scripts/lib/official-external-plugin-catalog.json +284 -0
- package/scripts/lib/official-external-provider-catalog.json +158 -0
- package/scripts/lib/package-dist-imports.mjs +174 -0
- package/scripts/npm-runner.mjs +95 -0
- package/scripts/postinstall-bundled-plugins.mjs +978 -0
- package/scripts/preinstall-package-manager-warning.mjs +74 -0
- package/scripts/prepare-git-hooks.mjs +73 -0
- package/scripts/windows-cmd-helpers.mjs +29 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +118 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +78 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +143 -0
- package/skills/diagram-maker/SKILL.md +53 -0
- package/skills/diagram-maker/references/excalidraw-patterns.md +85 -0
- package/skills/diagram-maker/references/svg-template.md +112 -0
- package/skills/discord/SKILL.md +136 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/gemini/SKILL.md +47 -0
- package/skills/gh-issues/SKILL.md +213 -0
- package/skills/gifgrep/SKILL.md +85 -0
- package/skills/github/SKILL.md +84 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +105 -0
- package/skills/himalaya/SKILL.md +80 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +122 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/meme-maker/SKILL.md +42 -0
- package/skills/meme-maker/references/templates.json +358 -0
- package/skills/meme-maker/scripts/meme.mjs +398 -0
- package/skills/model-usage/SKILL.md +71 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +319 -0
- package/skills/model-usage/scripts/test_model_usage.py +40 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/node-connect/SKILL.md +143 -0
- package/skills/node-inspect-debugger/SKILL.md +85 -0
- package/skills/notion/SKILL.md +150 -0
- package/skills/obsidian/SKILL.md +119 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +71 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +154 -0
- package/skills/openhue/SKILL.md +112 -0
- package/skills/oracle/SKILL.md +126 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +198 -0
- package/skills/pyproject.toml +10 -0
- package/skills/python-debugpy/SKILL.md +73 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/session-logs/SKILL.md +151 -0
- package/skills/sherpa-onnx-tts/SKILL.md +109 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +78 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +144 -0
- package/skills/skill-creator/scripts/quick_validate.py +169 -0
- package/skills/skill-creator/scripts/test_package_skill.py +199 -0
- package/skills/skill-creator/scripts/test_quick_validate.py +116 -0
- package/skills/slack/SKILL.md +78 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +65 -0
- package/skills/spike/SKILL.md +51 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/taskflow/SKILL.md +149 -0
- package/skills/taskflow/examples/inbox-triage.lobster +33 -0
- package/skills/taskflow/examples/pr-intake.lobster +32 -0
- package/skills/taskflow-inbox-triage/SKILL.md +119 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +91 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +108 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +87 -0
- package/skills/xurl/SKILL.md +120 -0
- package/src/agents/templates/HEARTBEAT.md +5 -0
package/openclaw.mjs
ADDED
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
5
|
+
import { access } from "node:fs/promises";
|
|
6
|
+
import module from "node:module";
|
|
7
|
+
import os from "node:os";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
const MIN_NODE_MAJOR = 22;
|
|
12
|
+
const MIN_NODE_MINOR = 19;
|
|
13
|
+
const MIN_NODE_VERSION = `${MIN_NODE_MAJOR}.${MIN_NODE_MINOR}`;
|
|
14
|
+
|
|
15
|
+
const parseNodeVersion = (rawVersion) => {
|
|
16
|
+
const [majorRaw = "0", minorRaw = "0"] = rawVersion.split(".");
|
|
17
|
+
return {
|
|
18
|
+
major: Number(majorRaw),
|
|
19
|
+
minor: Number(minorRaw),
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const isSupportedNodeVersion = (version) =>
|
|
24
|
+
version.major > MIN_NODE_MAJOR ||
|
|
25
|
+
(version.major === MIN_NODE_MAJOR && version.minor >= MIN_NODE_MINOR);
|
|
26
|
+
|
|
27
|
+
const ensureSupportedNodeVersion = () => {
|
|
28
|
+
if (isSupportedNodeVersion(parseNodeVersion(process.versions.node))) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
process.stderr.write(
|
|
33
|
+
`vilvona: Node.js v${MIN_NODE_VERSION}+ is required (current: v${process.versions.node}).\n` +
|
|
34
|
+
"If you use nvm, run:\n" +
|
|
35
|
+
` nvm install ${MIN_NODE_MAJOR}\n` +
|
|
36
|
+
` nvm use ${MIN_NODE_MAJOR}\n` +
|
|
37
|
+
` nvm alias default ${MIN_NODE_MAJOR}\n`,
|
|
38
|
+
);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
ensureSupportedNodeVersion();
|
|
43
|
+
|
|
44
|
+
if (tryOutputLauncherVersion(process.argv)) {
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const isSourceCheckoutLauncher = () =>
|
|
49
|
+
existsSync(new URL("./.git", import.meta.url)) ||
|
|
50
|
+
existsSync(new URL("./src/entry.ts", import.meta.url));
|
|
51
|
+
|
|
52
|
+
const isNodeCompileCacheDisabled = () => process.env.NODE_DISABLE_COMPILE_CACHE !== undefined;
|
|
53
|
+
const isNodeCompileCacheRequested = () =>
|
|
54
|
+
Boolean(process.env.NODE_COMPILE_CACHE) && !isNodeCompileCacheDisabled();
|
|
55
|
+
const sanitizeCompileCachePathSegment = (value) => {
|
|
56
|
+
const normalized = value.replace(/[^A-Za-z0-9._-]+/g, "_").replace(/^_+|_+$/g, "");
|
|
57
|
+
return normalized.length > 0 ? normalized : "unknown";
|
|
58
|
+
};
|
|
59
|
+
const readPackageVersion = () => {
|
|
60
|
+
try {
|
|
61
|
+
const parsed = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8"));
|
|
62
|
+
if (typeof parsed?.version === "string" && parsed.version.trim().length > 0) {
|
|
63
|
+
return parsed.version;
|
|
64
|
+
}
|
|
65
|
+
} catch {
|
|
66
|
+
// Fall through to an install-metadata-only cache key.
|
|
67
|
+
}
|
|
68
|
+
return "unknown";
|
|
69
|
+
};
|
|
70
|
+
const resolvePackagedCompileCacheDirectory = () => {
|
|
71
|
+
const packageJsonUrl = new URL("./package.json", import.meta.url);
|
|
72
|
+
const version = sanitizeCompileCachePathSegment(readPackageVersion());
|
|
73
|
+
let installMarker = "no-package-json";
|
|
74
|
+
try {
|
|
75
|
+
const stat = statSync(packageJsonUrl);
|
|
76
|
+
installMarker = `${Math.trunc(stat.mtimeMs)}-${stat.size}`;
|
|
77
|
+
} catch {
|
|
78
|
+
// Package archives should always have package.json, but keep startup best-effort.
|
|
79
|
+
}
|
|
80
|
+
const baseDirectory = isNodeCompileCacheRequested()
|
|
81
|
+
? process.env.NODE_COMPILE_CACHE
|
|
82
|
+
: path.join(os.tmpdir(), "node-compile-cache");
|
|
83
|
+
return path.join(
|
|
84
|
+
baseDirectory,
|
|
85
|
+
"vilvona",
|
|
86
|
+
version,
|
|
87
|
+
sanitizeCompileCachePathSegment(installMarker),
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const respawnSignals =
|
|
92
|
+
process.platform === "win32"
|
|
93
|
+
? ["SIGTERM", "SIGINT", "SIGBREAK"]
|
|
94
|
+
: ["SIGTERM", "SIGINT", "SIGHUP", "SIGQUIT"];
|
|
95
|
+
const respawnSignalExitGraceMs = 1_000;
|
|
96
|
+
const respawnSignalForceKillGraceMs = 1_000;
|
|
97
|
+
const respawnSignalHardExitGraceMs = 1_000;
|
|
98
|
+
|
|
99
|
+
const runRespawnedChild = (command, args, env) => {
|
|
100
|
+
const child = spawn(command, args, {
|
|
101
|
+
stdio: "inherit",
|
|
102
|
+
env,
|
|
103
|
+
});
|
|
104
|
+
const listeners = new Map();
|
|
105
|
+
// This intentionally overlaps with src/entry.compile-cache.ts; keep the
|
|
106
|
+
// respawn supervision behavior in sync until the launcher can share TS code.
|
|
107
|
+
// Give the child a moment to honor forwarded signals, then exit the wrapper so
|
|
108
|
+
// a child that ignores SIGTERM cannot keep the launcher alive indefinitely.
|
|
109
|
+
let signalExitTimer = null;
|
|
110
|
+
let signalForceKillTimer = null;
|
|
111
|
+
let signalHardExitTimer = null;
|
|
112
|
+
const detach = () => {
|
|
113
|
+
for (const [signal, listener] of listeners) {
|
|
114
|
+
process.off(signal, listener);
|
|
115
|
+
}
|
|
116
|
+
listeners.clear();
|
|
117
|
+
if (signalExitTimer) {
|
|
118
|
+
clearTimeout(signalExitTimer);
|
|
119
|
+
signalExitTimer = null;
|
|
120
|
+
}
|
|
121
|
+
if (signalForceKillTimer) {
|
|
122
|
+
clearTimeout(signalForceKillTimer);
|
|
123
|
+
signalForceKillTimer = null;
|
|
124
|
+
}
|
|
125
|
+
if (signalHardExitTimer) {
|
|
126
|
+
clearTimeout(signalHardExitTimer);
|
|
127
|
+
signalHardExitTimer = null;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const forceKillChild = () => {
|
|
131
|
+
try {
|
|
132
|
+
child.kill(process.platform === "win32" ? "SIGTERM" : "SIGKILL");
|
|
133
|
+
} catch {
|
|
134
|
+
// Best-effort shutdown fallback.
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const requestChildTermination = () => {
|
|
138
|
+
try {
|
|
139
|
+
child.kill("SIGTERM");
|
|
140
|
+
} catch {
|
|
141
|
+
// Best-effort shutdown fallback.
|
|
142
|
+
}
|
|
143
|
+
signalForceKillTimer = setTimeout(() => {
|
|
144
|
+
forceKillChild();
|
|
145
|
+
signalHardExitTimer = setTimeout(() => {
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}, respawnSignalHardExitGraceMs);
|
|
148
|
+
signalHardExitTimer.unref?.();
|
|
149
|
+
}, respawnSignalForceKillGraceMs);
|
|
150
|
+
signalForceKillTimer.unref?.();
|
|
151
|
+
};
|
|
152
|
+
const scheduleParentExit = () => {
|
|
153
|
+
if (signalExitTimer) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
signalExitTimer = setTimeout(() => {
|
|
157
|
+
requestChildTermination();
|
|
158
|
+
}, respawnSignalExitGraceMs);
|
|
159
|
+
signalExitTimer.unref?.();
|
|
160
|
+
};
|
|
161
|
+
for (const signal of respawnSignals) {
|
|
162
|
+
const listener = () => {
|
|
163
|
+
try {
|
|
164
|
+
child.kill(signal);
|
|
165
|
+
} catch {
|
|
166
|
+
// Best-effort signal forwarding.
|
|
167
|
+
}
|
|
168
|
+
scheduleParentExit();
|
|
169
|
+
};
|
|
170
|
+
try {
|
|
171
|
+
process.on(signal, listener);
|
|
172
|
+
listeners.set(signal, listener);
|
|
173
|
+
} catch {
|
|
174
|
+
// Unsupported signal on this platform.
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
child.once("exit", (code, signal) => {
|
|
178
|
+
detach();
|
|
179
|
+
if (signal) {
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
process.exit(code ?? 1);
|
|
183
|
+
});
|
|
184
|
+
child.once("error", (error) => {
|
|
185
|
+
detach();
|
|
186
|
+
process.stderr.write(
|
|
187
|
+
`[vilvona] Failed to respawn launcher: ${
|
|
188
|
+
error instanceof Error ? (error.stack ?? error.message) : String(error)
|
|
189
|
+
}\n`,
|
|
190
|
+
);
|
|
191
|
+
process.exit(1);
|
|
192
|
+
});
|
|
193
|
+
return true;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const respawnWithoutCompileCacheIfNeeded = () => {
|
|
197
|
+
if (!isSourceCheckoutLauncher()) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
if (process.env.OPENCLAW_SOURCE_COMPILE_CACHE_RESPAWNED === "1") {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
if (!module.getCompileCacheDir?.() && !isNodeCompileCacheRequested()) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
const env = {
|
|
207
|
+
...process.env,
|
|
208
|
+
NODE_DISABLE_COMPILE_CACHE: "1",
|
|
209
|
+
OPENCLAW_SOURCE_COMPILE_CACHE_RESPAWNED: "1",
|
|
210
|
+
};
|
|
211
|
+
delete env.NODE_COMPILE_CACHE;
|
|
212
|
+
return runRespawnedChild(
|
|
213
|
+
process.execPath,
|
|
214
|
+
[...process.execArgv, fileURLToPath(import.meta.url), ...process.argv.slice(2)],
|
|
215
|
+
env,
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const respawnWithPackagedCompileCacheIfNeeded = () => {
|
|
220
|
+
if (isSourceCheckoutLauncher() || isNodeCompileCacheDisabled()) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
if (process.env.OPENCLAW_PACKAGED_COMPILE_CACHE_RESPAWNED === "1") {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
const currentDirectory = module.getCompileCacheDir?.();
|
|
227
|
+
if (!currentDirectory) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
const desiredDirectory = resolvePackagedCompileCacheDirectory();
|
|
231
|
+
if (path.resolve(currentDirectory) === path.resolve(desiredDirectory)) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
const env = {
|
|
235
|
+
...process.env,
|
|
236
|
+
NODE_COMPILE_CACHE: desiredDirectory,
|
|
237
|
+
OPENCLAW_PACKAGED_COMPILE_CACHE_RESPAWNED: "1",
|
|
238
|
+
};
|
|
239
|
+
return runRespawnedChild(
|
|
240
|
+
process.execPath,
|
|
241
|
+
[...process.execArgv, fileURLToPath(import.meta.url), ...process.argv.slice(2)],
|
|
242
|
+
env,
|
|
243
|
+
);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
const waitingForCompileCacheRespawn =
|
|
247
|
+
respawnWithoutCompileCacheIfNeeded() || respawnWithPackagedCompileCacheIfNeeded();
|
|
248
|
+
|
|
249
|
+
// https://nodejs.org/api/module.html#module-compile-cache
|
|
250
|
+
if (
|
|
251
|
+
!waitingForCompileCacheRespawn &&
|
|
252
|
+
module.enableCompileCache &&
|
|
253
|
+
!isNodeCompileCacheDisabled() &&
|
|
254
|
+
!isSourceCheckoutLauncher()
|
|
255
|
+
) {
|
|
256
|
+
try {
|
|
257
|
+
module.enableCompileCache(resolvePackagedCompileCacheDirectory());
|
|
258
|
+
} catch {
|
|
259
|
+
// Ignore errors
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const getErrorMessage = (err) =>
|
|
264
|
+
err && typeof err === "object" && "message" in err && typeof err.message === "string"
|
|
265
|
+
? err.message
|
|
266
|
+
: "";
|
|
267
|
+
|
|
268
|
+
const isModuleNotFoundError = (err) =>
|
|
269
|
+
err && typeof err === "object" && "code" in err && err.code === "ERR_MODULE_NOT_FOUND";
|
|
270
|
+
|
|
271
|
+
const isDirectModuleNotFoundError = (err, specifier) => {
|
|
272
|
+
const message = getErrorMessage(err);
|
|
273
|
+
const bunSpecifierMiss =
|
|
274
|
+
message.includes(`Cannot find module '${specifier}'`) ||
|
|
275
|
+
message.includes(`Cannot find module "${specifier}"`);
|
|
276
|
+
const launcherPath = fileURLToPath(import.meta.url);
|
|
277
|
+
const bunLauncherImporterMiss =
|
|
278
|
+
message.includes(` from '${launcherPath}'`) || message.includes(` from "${launcherPath}"`);
|
|
279
|
+
|
|
280
|
+
const expectedUrl = new URL(specifier, import.meta.url);
|
|
281
|
+
const expectedPath = fileURLToPath(expectedUrl);
|
|
282
|
+
const nodePathMiss =
|
|
283
|
+
message.includes(`Cannot find module '${expectedPath}'`) ||
|
|
284
|
+
message.includes(`Cannot find module "${expectedPath}"`);
|
|
285
|
+
|
|
286
|
+
if (isModuleNotFoundError(err)) {
|
|
287
|
+
if (err && typeof err === "object" && "url" in err && err.url === expectedUrl.href) {
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
return nodePathMiss || (bunSpecifierMiss && bunLauncherImporterMiss);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return bunSpecifierMiss && bunLauncherImporterMiss;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const installProcessWarningFilter = async () => {
|
|
297
|
+
// Keep bootstrap warnings consistent with the TypeScript runtime.
|
|
298
|
+
for (const specifier of ["./dist/warning-filter.js", "./dist/warning-filter.mjs"]) {
|
|
299
|
+
try {
|
|
300
|
+
const mod = await import(specifier);
|
|
301
|
+
if (typeof mod.installProcessWarningFilter === "function") {
|
|
302
|
+
mod.installProcessWarningFilter();
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
} catch (err) {
|
|
306
|
+
if (isDirectModuleNotFoundError(err, specifier)) {
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
throw err;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
const tryImport = async (specifier) => {
|
|
315
|
+
try {
|
|
316
|
+
await import(specifier);
|
|
317
|
+
return true;
|
|
318
|
+
} catch (err) {
|
|
319
|
+
// Only swallow direct entry misses; rethrow transitive resolution failures.
|
|
320
|
+
if (isDirectModuleNotFoundError(err, specifier)) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
throw err;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
const exists = async (specifier) => {
|
|
328
|
+
try {
|
|
329
|
+
await access(new URL(specifier, import.meta.url));
|
|
330
|
+
return true;
|
|
331
|
+
} catch {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
const buildMissingEntryErrorMessage = async () => {
|
|
337
|
+
const lines = ["vilvona: missing dist/entry.(m)js (build output)."];
|
|
338
|
+
if (!(await exists("./src/entry.ts"))) {
|
|
339
|
+
return lines.join("\n");
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
lines.push("This install looks like an unbuilt source tree or GitHub source archive.");
|
|
343
|
+
lines.push(
|
|
344
|
+
"Build locally with `pnpm install && pnpm build`, or install a built package instead.",
|
|
345
|
+
);
|
|
346
|
+
lines.push(
|
|
347
|
+
"For pinned GitHub installs, use `npm install -g github:vignesh2027/Vilvona-AI#<ref>` instead of a raw `/archive/<ref>.tar.gz` URL.",
|
|
348
|
+
);
|
|
349
|
+
lines.push("For releases, use `npm install -g vilvona@latest`.");
|
|
350
|
+
return lines.join("\n");
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
const isBareRootHelpInvocation = (argv) =>
|
|
354
|
+
argv.length === 3 && (argv[2] === "--help" || argv[2] === "-h");
|
|
355
|
+
|
|
356
|
+
const resolvePrecomputedCommandHelp = (argv) => {
|
|
357
|
+
if (argv.length !== 4 || (argv[3] !== "--help" && argv[3] !== "-h")) {
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
if (argv[2] === "browser") {
|
|
361
|
+
return { command: "browser", metadataKey: "browserHelpText" };
|
|
362
|
+
}
|
|
363
|
+
if (argv[2] === "secrets") {
|
|
364
|
+
return { command: "secrets", metadataKey: "secretsHelpText" };
|
|
365
|
+
}
|
|
366
|
+
if (argv[2] === "nodes") {
|
|
367
|
+
return { command: "nodes", metadataKey: "nodesHelpText" };
|
|
368
|
+
}
|
|
369
|
+
return null;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const isHelpFastPathDisabled = () =>
|
|
373
|
+
process.env.OPENCLAW_DISABLE_CLI_STARTUP_HELP_FAST_PATH === "1";
|
|
374
|
+
|
|
375
|
+
const normalizeLauncherHomeValue = (value) => {
|
|
376
|
+
const trimmed = value?.trim();
|
|
377
|
+
return trimmed && trimmed !== "undefined" && trimmed !== "null" ? trimmed : undefined;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
const resolveLauncherOsHomeDir = () =>
|
|
381
|
+
normalizeLauncherHomeValue(process.env.HOME) ??
|
|
382
|
+
normalizeLauncherHomeValue(process.env.USERPROFILE) ??
|
|
383
|
+
os.homedir();
|
|
384
|
+
|
|
385
|
+
const resolveLauncherHomeDir = () => {
|
|
386
|
+
const explicit = normalizeLauncherHomeValue(process.env.OPENCLAW_HOME);
|
|
387
|
+
const rawHome =
|
|
388
|
+
explicit && (explicit === "~" || explicit.startsWith("~/") || explicit.startsWith("~\\"))
|
|
389
|
+
? explicit.replace(/^~(?=$|[\\/])/, resolveLauncherOsHomeDir())
|
|
390
|
+
: (explicit ?? resolveLauncherOsHomeDir());
|
|
391
|
+
return path.resolve(rawHome);
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
const resolveLauncherUserPath = (input) => {
|
|
395
|
+
if (input === "~") {
|
|
396
|
+
return resolveLauncherHomeDir();
|
|
397
|
+
}
|
|
398
|
+
if (input.startsWith("~/") || input.startsWith("~\\")) {
|
|
399
|
+
return path.join(resolveLauncherHomeDir(), input.slice(2));
|
|
400
|
+
}
|
|
401
|
+
return path.resolve(input);
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
const resolveLauncherConfigPaths = () => {
|
|
405
|
+
const explicit = process.env.OPENCLAW_CONFIG_PATH?.trim();
|
|
406
|
+
if (explicit) {
|
|
407
|
+
return [resolveLauncherUserPath(explicit)];
|
|
408
|
+
}
|
|
409
|
+
const stateOverride = process.env.OPENCLAW_STATE_DIR?.trim();
|
|
410
|
+
if (stateOverride) {
|
|
411
|
+
const stateDir = resolveLauncherUserPath(stateOverride);
|
|
412
|
+
return [path.join(stateDir, "openclaw.json"), path.join(stateDir, "clawdbot.json")];
|
|
413
|
+
}
|
|
414
|
+
const homeDir = resolveLauncherHomeDir();
|
|
415
|
+
return [
|
|
416
|
+
path.join(homeDir, ".openclaw", "openclaw.json"),
|
|
417
|
+
path.join(homeDir, ".openclaw", "clawdbot.json"),
|
|
418
|
+
path.join(homeDir, ".clawdbot", "openclaw.json"),
|
|
419
|
+
path.join(homeDir, ".clawdbot", "clawdbot.json"),
|
|
420
|
+
];
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
const shouldDeferRootHelpToRuntimeEntry = () => {
|
|
424
|
+
if (
|
|
425
|
+
process.env.OPENCLAW_BUNDLED_PLUGINS_DIR?.trim() ||
|
|
426
|
+
process.env.OPENCLAW_DISABLE_BUNDLED_PLUGINS?.trim()
|
|
427
|
+
) {
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
for (const configPath of resolveLauncherConfigPaths()) {
|
|
431
|
+
try {
|
|
432
|
+
const raw = readFileSync(configPath, "utf8");
|
|
433
|
+
return /\bplugins\b|\$include\b/.test(raw);
|
|
434
|
+
} catch {
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return false;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
const loadPrecomputedHelpText = (key) => {
|
|
442
|
+
try {
|
|
443
|
+
const raw = readFileSync(new URL("./dist/cli-startup-metadata.json", import.meta.url), "utf8");
|
|
444
|
+
const parsed = JSON.parse(raw);
|
|
445
|
+
const value = parsed?.[key];
|
|
446
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
447
|
+
} catch {
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
function tryOutputLauncherVersion(argv) {
|
|
453
|
+
try {
|
|
454
|
+
if (normalizeLauncherMetadataValue(process.env.OPENCLAW_CONTAINER)) {
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
if (!isLauncherVersionFastPathArgv(argv)) {
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
const version = resolveLauncherVersion();
|
|
461
|
+
const commit = resolveLauncherCommit();
|
|
462
|
+
process.stdout.write(commit ? `Vilvona AI ${version} (${commit})\n` : `Vilvona AI ${version}\n`);
|
|
463
|
+
return true;
|
|
464
|
+
} catch {
|
|
465
|
+
return false;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function isLauncherVersionFastPathArgv(argv) {
|
|
470
|
+
return argv.length === 3 && (argv[2] === "--version" || argv[2] === "-V" || argv[2] === "-v");
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function normalizeLauncherMetadataValue(value) {
|
|
474
|
+
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
475
|
+
return trimmed && trimmed !== "undefined" && trimmed !== "null" ? trimmed : undefined;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function readLauncherJson(relativePath) {
|
|
479
|
+
try {
|
|
480
|
+
return JSON.parse(readFileSync(new URL(relativePath, import.meta.url), "utf8"));
|
|
481
|
+
} catch {
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function resolveLauncherVersion() {
|
|
487
|
+
const packageJson = readLauncherJson("./package.json");
|
|
488
|
+
const packageVersion = normalizeLauncherMetadataValue(packageJson?.version);
|
|
489
|
+
if (packageVersion) {
|
|
490
|
+
return packageVersion;
|
|
491
|
+
}
|
|
492
|
+
const buildInfo = readLauncherJson("./dist/build-info.json");
|
|
493
|
+
const buildVersion = normalizeLauncherMetadataValue(buildInfo?.version);
|
|
494
|
+
if (buildVersion) {
|
|
495
|
+
return buildVersion;
|
|
496
|
+
}
|
|
497
|
+
return normalizeLauncherMetadataValue(process.env.OPENCLAW_BUNDLED_VERSION) ?? "0.0.0";
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function resolveLauncherCommit() {
|
|
501
|
+
const envCommit = formatLauncherCommit(process.env.GIT_COMMIT ?? process.env.GIT_SHA);
|
|
502
|
+
if (envCommit) {
|
|
503
|
+
return envCommit;
|
|
504
|
+
}
|
|
505
|
+
return (
|
|
506
|
+
readLauncherGitCommit() ??
|
|
507
|
+
formatLauncherCommit(readLauncherJson("./dist/build-info.json")?.commit) ??
|
|
508
|
+
formatLauncherCommit(readLauncherJson("./package.json")?.gitHead) ??
|
|
509
|
+
formatLauncherCommit(readLauncherJson("./package.json")?.githead)
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
function formatLauncherCommit(value) {
|
|
514
|
+
if (typeof value !== "string") {
|
|
515
|
+
return null;
|
|
516
|
+
}
|
|
517
|
+
const match = value.trim().match(/[0-9a-fA-F]{7,40}/);
|
|
518
|
+
return match ? match[0].slice(0, 7).toLowerCase() : null;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
function readLauncherGitCommit() {
|
|
522
|
+
try {
|
|
523
|
+
const gitPath = fileURLToPath(new URL("./.git", import.meta.url));
|
|
524
|
+
const headPath = resolveLauncherGitHeadPath(gitPath);
|
|
525
|
+
if (!headPath) {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
const head = readFileSync(headPath, "utf8").trim();
|
|
529
|
+
if (!head) {
|
|
530
|
+
return null;
|
|
531
|
+
}
|
|
532
|
+
if (!head.startsWith("ref:")) {
|
|
533
|
+
return formatLauncherCommit(head);
|
|
534
|
+
}
|
|
535
|
+
const ref = head.replace(/^ref:\s*/i, "").trim();
|
|
536
|
+
if (!ref.startsWith("refs/") || path.isAbsolute(ref) || ref.split("/").includes("..")) {
|
|
537
|
+
return null;
|
|
538
|
+
}
|
|
539
|
+
const refsBase = resolveLauncherGitRefsBase(headPath);
|
|
540
|
+
const refPath = path.resolve(refsBase, ref);
|
|
541
|
+
const rel = path.relative(refsBase, refPath);
|
|
542
|
+
if (!rel || rel.startsWith("..") || path.isAbsolute(rel)) {
|
|
543
|
+
return null;
|
|
544
|
+
}
|
|
545
|
+
try {
|
|
546
|
+
return formatLauncherCommit(readFileSync(refPath, "utf8"));
|
|
547
|
+
} catch {
|
|
548
|
+
return readLauncherPackedRef(refsBase, ref);
|
|
549
|
+
}
|
|
550
|
+
} catch {
|
|
551
|
+
return null;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function resolveLauncherGitHeadPath(gitPath) {
|
|
556
|
+
try {
|
|
557
|
+
if (statSync(gitPath).isDirectory()) {
|
|
558
|
+
return path.join(gitPath, "HEAD");
|
|
559
|
+
}
|
|
560
|
+
const raw = readFileSync(gitPath, "utf8").trim();
|
|
561
|
+
if (!raw.startsWith("gitdir:")) {
|
|
562
|
+
return null;
|
|
563
|
+
}
|
|
564
|
+
return path.join(
|
|
565
|
+
path.resolve(path.dirname(gitPath), raw.slice("gitdir:".length).trim()),
|
|
566
|
+
"HEAD",
|
|
567
|
+
);
|
|
568
|
+
} catch {
|
|
569
|
+
return null;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
function resolveLauncherGitRefsBase(headPath) {
|
|
574
|
+
const gitDir = path.dirname(headPath);
|
|
575
|
+
try {
|
|
576
|
+
const commonDir = readFileSync(path.join(gitDir, "commondir"), "utf8").trim();
|
|
577
|
+
return commonDir ? path.resolve(gitDir, commonDir) : gitDir;
|
|
578
|
+
} catch {
|
|
579
|
+
return gitDir;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function readLauncherPackedRef(refsBase, ref) {
|
|
584
|
+
try {
|
|
585
|
+
const packedRefs = readFileSync(path.join(refsBase, "packed-refs"), "utf8");
|
|
586
|
+
for (const line of packedRefs.split("\n")) {
|
|
587
|
+
if (!line || line.startsWith("#") || line.startsWith("^")) {
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
const [commit, packedRef] = line.trim().split(/\s+/, 2);
|
|
591
|
+
if (packedRef === ref) {
|
|
592
|
+
return formatLauncherCommit(commit);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
} catch {
|
|
596
|
+
// fall through
|
|
597
|
+
}
|
|
598
|
+
return null;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
const tryOutputBareRootHelp = async () => {
|
|
602
|
+
if (!isBareRootHelpInvocation(process.argv)) {
|
|
603
|
+
return false;
|
|
604
|
+
}
|
|
605
|
+
if (shouldDeferRootHelpToRuntimeEntry()) {
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
const precomputed = loadPrecomputedHelpText("rootHelpText");
|
|
609
|
+
if (precomputed) {
|
|
610
|
+
process.stdout.write(precomputed);
|
|
611
|
+
return true;
|
|
612
|
+
}
|
|
613
|
+
for (const specifier of ["./dist/cli/program/root-help.js", "./dist/cli/program/root-help.mjs"]) {
|
|
614
|
+
try {
|
|
615
|
+
const mod = await import(specifier);
|
|
616
|
+
if (typeof mod.outputRootHelp === "function") {
|
|
617
|
+
await mod.outputRootHelp();
|
|
618
|
+
return true;
|
|
619
|
+
}
|
|
620
|
+
} catch (err) {
|
|
621
|
+
if (isDirectModuleNotFoundError(err, specifier)) {
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
throw err;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
return false;
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
const tryOutputPrecomputedCommandHelp = () => {
|
|
631
|
+
const commandHelp = resolvePrecomputedCommandHelp(process.argv);
|
|
632
|
+
if (!commandHelp) {
|
|
633
|
+
return false;
|
|
634
|
+
}
|
|
635
|
+
if (commandHelp.command === "nodes" && shouldDeferRootHelpToRuntimeEntry()) {
|
|
636
|
+
return false;
|
|
637
|
+
}
|
|
638
|
+
const precomputed = loadPrecomputedHelpText(commandHelp.metadataKey);
|
|
639
|
+
if (!precomputed) {
|
|
640
|
+
return false;
|
|
641
|
+
}
|
|
642
|
+
process.stdout.write(precomputed);
|
|
643
|
+
return true;
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
if (!waitingForCompileCacheRespawn) {
|
|
647
|
+
if (!isHelpFastPathDisabled() && (await tryOutputBareRootHelp())) {
|
|
648
|
+
// OK
|
|
649
|
+
} else if (!isHelpFastPathDisabled() && tryOutputPrecomputedCommandHelp()) {
|
|
650
|
+
// OK
|
|
651
|
+
} else {
|
|
652
|
+
await installProcessWarningFilter();
|
|
653
|
+
if (await tryImport("./dist/entry.js")) {
|
|
654
|
+
// OK
|
|
655
|
+
} else if (await tryImport("./dist/entry.mjs")) {
|
|
656
|
+
// OK
|
|
657
|
+
} else {
|
|
658
|
+
throw new Error(await buildMissingEntryErrorMessage());
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|