jishushell 0.6.5 → 0.6.18
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/apps/anythingllm-container.yaml +15 -170
- package/apps/browserless-chromium-container.yaml +15 -10
- package/apps/filebrowser-container.yaml +14 -9
- package/apps/hermes-container.yaml +23 -2
- package/apps/jishu-kb-container.yaml +29 -161
- package/apps/ollama-binary.yaml +32 -28
- package/apps/ollama-cpu-container.yaml +5 -0
- package/apps/ollama-with-hollama-binary.yaml +33 -28
- package/apps/openclaw-binary.yaml +34 -10
- package/apps/openclaw-container.yaml +31 -7
- package/apps/openclaw-with-ollama-container.yaml +8 -2
- package/apps/openclaw-with-searxng-container.yaml +18 -6
- package/apps/searxng-container.yaml +11 -6
- package/apps/weknora-container.yaml +21 -21
- package/dependencies/jishushell-panel-0.6.18.tgz +0 -0
- package/dist/cli/app.js +244 -213
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/backup.js +15 -12
- package/dist/cli/backup.js.map +1 -1
- package/dist/cli/core.d.ts +4 -3
- package/dist/cli/core.js +392 -227
- package/dist/cli/core.js.map +1 -1
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/doctor.js +17 -10
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/job.js +62 -14
- package/dist/cli/job.js.map +1 -1
- package/dist/cli/llm.js +80 -11
- package/dist/cli/llm.js.map +1 -1
- package/dist/cli/managed-list.d.ts +1 -3
- package/dist/cli/managed-list.js +18 -16
- package/dist/cli/managed-list.js.map +1 -1
- package/dist/cli/migrate.d.ts +2 -0
- package/dist/cli/migrate.js +160 -0
- package/dist/cli/migrate.js.map +1 -0
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +23 -19
- package/dist/config.js +60 -49
- package/dist/config.js.map +1 -1
- package/dist/control.d.ts +6 -6
- package/dist/control.js +31 -23
- package/dist/control.js.map +1 -1
- package/dist/core.d.ts +5 -5
- package/dist/core.js +5 -5
- package/dist/core.js.map +1 -1
- package/dist/install.d.ts +2 -2
- package/dist/install.js +18 -18
- package/dist/install.js.map +1 -1
- package/dist/routes/apps.d.ts +1 -1
- package/dist/routes/apps.js +101 -193
- package/dist/routes/apps.js.map +1 -1
- package/dist/routes/auth.js +1 -1
- package/dist/routes/auth.js.map +1 -1
- package/dist/routes/backup.js +1 -1
- package/dist/routes/backup.js.map +1 -1
- package/dist/routes/external-mounts.d.ts +1 -1
- package/dist/routes/external-mounts.js +1 -1
- package/dist/routes/external-mounts.js.map +1 -1
- package/dist/routes/file-mounts.d.ts +4 -3
- package/dist/routes/file-mounts.js +51 -30
- package/dist/routes/file-mounts.js.map +1 -1
- package/dist/routes/files-organize.d.ts +2 -2
- package/dist/routes/files-organize.js +5 -5
- package/dist/routes/files-organize.js.map +1 -1
- package/dist/routes/files.d.ts +1 -1
- package/dist/routes/files.js +1 -1
- package/dist/routes/files.js.map +1 -1
- package/dist/routes/instances.d.ts +10 -4
- package/dist/routes/instances.js +323 -541
- package/dist/routes/instances.js.map +1 -1
- package/dist/routes/integration-apps.d.ts +14 -0
- package/dist/routes/integration-apps.js +81 -0
- package/dist/routes/integration-apps.js.map +1 -0
- package/dist/routes/integrations.d.ts +9 -0
- package/dist/routes/integrations.js +12 -0
- package/dist/routes/integrations.js.map +1 -0
- package/dist/routes/llm-proxy.js +26 -3
- package/dist/routes/llm-proxy.js.map +1 -1
- package/dist/routes/setup.js +53 -38
- package/dist/routes/setup.js.map +1 -1
- package/dist/routes/system.js +108 -68
- package/dist/routes/system.js.map +1 -1
- package/dist/routes/webdav.d.ts +1 -1
- package/dist/routes/webdav.js +2 -2
- package/dist/routes/webdav.js.map +1 -1
- package/dist/server.js +315 -213
- package/dist/server.js.map +1 -1
- package/dist/services/app-common/app-compiler.js +186 -0
- package/dist/services/app-common/app-compiler.js.map +1 -0
- package/dist/services/app-common/app-shared.d.ts +15 -0
- package/dist/services/app-common/app-shared.js +64 -0
- package/dist/services/app-common/app-shared.js.map +1 -0
- package/dist/services/app-common/capability-service.d.ts +45 -0
- package/dist/services/app-common/capability-service.js +331 -0
- package/dist/services/app-common/capability-service.js.map +1 -0
- package/dist/services/app-common/catalog-service.d.ts +59 -0
- package/dist/services/app-common/catalog-service.js +308 -0
- package/dist/services/app-common/catalog-service.js.map +1 -0
- package/dist/services/app-common/create-pipeline.d.ts +26 -0
- package/dist/services/app-common/create-pipeline.js +298 -0
- package/dist/services/app-common/create-pipeline.js.map +1 -0
- package/dist/services/app-common/delete-service.d.ts +5 -0
- package/dist/services/app-common/delete-service.js +104 -0
- package/dist/services/app-common/delete-service.js.map +1 -0
- package/dist/services/app-common/execution-owner.d.ts +23 -0
- package/dist/services/app-common/execution-owner.js +124 -0
- package/dist/services/app-common/execution-owner.js.map +1 -0
- package/dist/services/app-common/execution-service.d.ts +23 -0
- package/dist/services/app-common/execution-service.js +105 -0
- package/dist/services/app-common/execution-service.js.map +1 -0
- package/dist/services/app-common/id-normalizer.d.ts +31 -0
- package/dist/services/app-common/id-normalizer.js +83 -0
- package/dist/services/app-common/id-normalizer.js.map +1 -0
- package/dist/services/app-common/install-store.d.ts +34 -0
- package/dist/services/app-common/install-store.js +261 -0
- package/dist/services/app-common/install-store.js.map +1 -0
- package/dist/services/app-common/instance-store.d.ts +78 -0
- package/dist/services/app-common/instance-store.js +495 -0
- package/dist/services/app-common/instance-store.js.map +1 -0
- package/dist/services/app-common/integration-refs.d.ts +17 -0
- package/dist/services/app-common/integration-refs.js +47 -0
- package/dist/services/app-common/integration-refs.js.map +1 -0
- package/dist/services/app-common/lifecycle-pipeline.d.ts +62 -0
- package/dist/services/app-common/lifecycle-pipeline.js +317 -0
- package/dist/services/app-common/lifecycle-pipeline.js.map +1 -0
- package/dist/services/app-common/lifecycle-scripts.d.ts +38 -0
- package/dist/services/app-common/lifecycle-scripts.js +935 -0
- package/dist/services/app-common/lifecycle-scripts.js.map +1 -0
- package/dist/services/app-common/lifecycle-service.d.ts +68 -0
- package/dist/services/app-common/lifecycle-service.js +467 -0
- package/dist/services/app-common/lifecycle-service.js.map +1 -0
- package/dist/services/app-common/paths.d.ts +29 -0
- package/dist/services/app-common/paths.js +34 -0
- package/dist/services/app-common/paths.js.map +1 -0
- package/dist/services/app-common/platform-transform.d.ts +32 -0
- package/dist/services/app-common/platform-transform.js +65 -0
- package/dist/services/app-common/platform-transform.js.map +1 -0
- package/dist/services/app-common/provide-resolver.d.ts +29 -0
- package/dist/services/app-common/provide-resolver.js +129 -0
- package/dist/services/app-common/provide-resolver.js.map +1 -0
- package/dist/services/app-common/remote-spec.d.ts +14 -0
- package/dist/services/app-common/remote-spec.js +58 -0
- package/dist/services/app-common/remote-spec.js.map +1 -0
- package/dist/services/app-common/runtime-builder.d.ts +1 -0
- package/dist/services/app-common/runtime-builder.js +2 -0
- package/dist/services/app-common/runtime-builder.js.map +1 -0
- package/dist/services/app-common/runtime-facts.d.ts +19 -0
- package/dist/services/app-common/runtime-facts.js +126 -0
- package/dist/services/app-common/runtime-facts.js.map +1 -0
- package/dist/services/app-common/service.d.ts +9 -0
- package/dist/services/app-common/service.js +10 -0
- package/dist/services/app-common/service.js.map +1 -0
- package/dist/services/app-common/spec-materializer.d.ts +9 -0
- package/dist/services/app-common/spec-materializer.js +361 -0
- package/dist/services/app-common/spec-materializer.js.map +1 -0
- package/dist/services/app-common/status-refresh.d.ts +33 -0
- package/dist/services/app-common/status-refresh.js +759 -0
- package/dist/services/app-common/status-refresh.js.map +1 -0
- package/dist/services/app-common/task-service.d.ts +29 -0
- package/dist/services/app-common/task-service.js +93 -0
- package/dist/services/app-common/task-service.js.map +1 -0
- package/dist/services/app-common/terminal-session-manager.js +157 -0
- package/dist/services/app-common/terminal-session-manager.js.map +1 -0
- package/dist/services/app-modules/browserless/routes.d.ts +9 -0
- package/dist/services/app-modules/browserless/routes.js +517 -0
- package/dist/services/app-modules/browserless/routes.js.map +1 -0
- package/dist/services/app-modules/routes.d.ts +2 -0
- package/dist/services/app-modules/routes.js +5 -0
- package/dist/services/app-modules/routes.js.map +1 -0
- package/dist/services/backup/backup-admin.d.ts +95 -0
- package/dist/services/backup/backup-admin.js +246 -0
- package/dist/services/backup/backup-admin.js.map +1 -0
- package/dist/services/backup/backup-manager.d.ts +264 -0
- package/dist/services/backup/backup-manager.js +2318 -0
- package/dist/services/backup/backup-manager.js.map +1 -0
- package/dist/services/backup/backup-verify.js +240 -0
- package/dist/services/backup/backup-verify.js.map +1 -0
- package/dist/services/capabilities/browser-policy.d.ts +14 -0
- package/dist/services/capabilities/browser-policy.js +141 -0
- package/dist/services/capabilities/browser-policy.js.map +1 -0
- package/dist/services/capabilities/contract.d.ts +50 -0
- package/dist/services/capabilities/contract.js +129 -0
- package/dist/services/capabilities/contract.js.map +1 -0
- package/dist/services/capabilities/endpoint-validator.d.ts +42 -0
- package/dist/services/capabilities/endpoint-validator.js +114 -0
- package/dist/services/capabilities/endpoint-validator.js.map +1 -0
- package/dist/services/capabilities/health.d.ts +16 -0
- package/dist/services/capabilities/health.js +121 -0
- package/dist/services/capabilities/health.js.map +1 -0
- package/dist/services/capabilities/registry.d.ts +56 -0
- package/dist/services/capabilities/registry.js +222 -0
- package/dist/services/capabilities/registry.js.map +1 -0
- package/dist/services/capabilities/sync.d.ts +7 -0
- package/dist/services/capabilities/sync.js +223 -0
- package/dist/services/capabilities/sync.js.map +1 -0
- package/dist/services/capability-proxy/html-rewriters/browserless.d.ts +1 -0
- package/dist/services/capability-proxy/html-rewriters/browserless.js +83 -0
- package/dist/services/capability-proxy/html-rewriters/browserless.js.map +1 -0
- package/dist/services/capability-proxy/html-rewriters/index.d.ts +12 -0
- package/dist/services/capability-proxy/html-rewriters/index.js +25 -0
- package/dist/services/capability-proxy/html-rewriters/index.js.map +1 -0
- package/dist/services/capability-proxy/html-rewriters/jishukb.d.ts +1 -0
- package/dist/services/capability-proxy/html-rewriters/jishukb.js +161 -0
- package/dist/services/capability-proxy/html-rewriters/jishukb.js.map +1 -0
- package/dist/services/connections/admin.d.ts +80 -0
- package/dist/services/connections/admin.js +327 -0
- package/dist/services/connections/admin.js.map +1 -0
- package/dist/services/connections/apply.d.ts +110 -0
- package/dist/services/connections/apply.js +444 -0
- package/dist/services/connections/apply.js.map +1 -0
- package/dist/services/connections/resolver.d.ts +82 -0
- package/dist/services/connections/resolver.js +289 -0
- package/dist/services/connections/resolver.js.map +1 -0
- package/dist/services/connections/suggestions.d.ts +27 -0
- package/dist/services/connections/suggestions.js +124 -0
- package/dist/services/connections/suggestions.js.map +1 -0
- package/dist/services/connections/transactor.d.ts +39 -0
- package/dist/services/connections/transactor.js +307 -0
- package/dist/services/connections/transactor.js.map +1 -0
- package/dist/services/files/external-mounts.js +187 -0
- package/dist/services/files/external-mounts.js.map +1 -0
- package/dist/services/files/files-manager.d.ts +265 -0
- package/dist/services/files/files-manager.js +1189 -0
- package/dist/services/files/files-manager.js.map +1 -0
- package/dist/services/files/files-mounts.d.ts +42 -0
- package/dist/services/files/files-mounts.js +207 -0
- package/dist/services/files/files-mounts.js.map +1 -0
- package/dist/services/files/organize/applier.js +218 -0
- package/dist/services/files/organize/applier.js.map +1 -0
- package/dist/services/files/organize/rules.js +286 -0
- package/dist/services/files/organize/rules.js.map +1 -0
- package/dist/services/files/organize/scanner.js +366 -0
- package/dist/services/files/organize/scanner.js.map +1 -0
- package/dist/services/files/organize/store.js +82 -0
- package/dist/services/files/organize/store.js.map +1 -0
- package/dist/services/files/webdav/server.d.ts +47 -0
- package/dist/services/files/webdav/server.js +329 -0
- package/dist/services/files/webdav/server.js.map +1 -0
- package/dist/services/files/webdav/xml-builder.js.map +1 -0
- package/dist/services/instances/admin.d.ts +23 -0
- package/dist/services/instances/admin.js +218 -0
- package/dist/services/instances/admin.js.map +1 -0
- package/dist/services/instances/clone.d.ts +26 -0
- package/dist/services/instances/clone.js +78 -0
- package/dist/services/instances/clone.js.map +1 -0
- package/dist/services/instances/config-admin.d.ts +17 -0
- package/dist/services/instances/config-admin.js +181 -0
- package/dist/services/instances/config-admin.js.map +1 -0
- package/dist/services/instances/manager.d.ts +231 -0
- package/dist/services/instances/manager.js +1348 -0
- package/dist/services/instances/manager.js.map +1 -0
- package/dist/services/instances/passwords.js +173 -0
- package/dist/services/instances/passwords.js.map +1 -0
- package/dist/services/instances/types.d.ts +21 -0
- package/dist/services/instances/types.js +2 -0
- package/dist/services/instances/types.js.map +1 -0
- package/dist/services/integrations/anythingllm/integration.d.ts +25 -0
- package/dist/services/integrations/anythingllm/integration.js +251 -0
- package/dist/services/integrations/anythingllm/integration.js.map +1 -0
- package/dist/services/integrations/catalog.d.ts +3 -0
- package/dist/services/integrations/catalog.js +73 -0
- package/dist/services/integrations/catalog.js.map +1 -0
- package/dist/services/integrations/custom/integration.d.ts +28 -0
- package/dist/services/integrations/custom/integration.js +179 -0
- package/dist/services/integrations/custom/integration.js.map +1 -0
- package/dist/services/integrations/hermes/integration.d.ts +194 -0
- package/dist/services/integrations/hermes/integration.js +1669 -0
- package/dist/services/integrations/hermes/integration.js.map +1 -0
- package/dist/services/integrations/index.d.ts +40 -0
- package/dist/services/integrations/index.js +59 -0
- package/dist/services/integrations/index.js.map +1 -0
- package/dist/services/integrations/installable/catalog.d.ts +33 -0
- package/dist/services/integrations/installable/catalog.js +88 -0
- package/dist/services/integrations/installable/catalog.js.map +1 -0
- package/dist/services/integrations/installable/index.d.ts +35 -0
- package/dist/services/integrations/installable/index.js +170 -0
- package/dist/services/integrations/installable/index.js.map +1 -0
- package/dist/services/integrations/installable/installers/integration-probes.d.ts +50 -0
- package/dist/services/integrations/installable/installers/integration-probes.js +231 -0
- package/dist/services/integrations/installable/installers/integration-probes.js.map +1 -0
- package/dist/services/integrations/installable/installers/integration.d.ts +30 -0
- package/dist/services/integrations/installable/installers/integration.js +177 -0
- package/dist/services/integrations/installable/installers/integration.js.map +1 -0
- package/dist/services/integrations/installable/installers/registry-probe.js.map +1 -0
- package/dist/services/integrations/installable/installers/shell-script.d.ts +46 -0
- package/dist/services/integrations/installable/installers/shell-script.js +487 -0
- package/dist/services/integrations/installable/installers/shell-script.js.map +1 -0
- package/dist/services/integrations/installable/types.d.ts +130 -0
- package/dist/services/integrations/installable/types.js +19 -0
- package/dist/services/integrations/installable/types.js.map +1 -0
- package/dist/services/integrations/jishukb/integration.d.ts +22 -0
- package/dist/services/integrations/jishukb/integration.js +189 -0
- package/dist/services/integrations/jishukb/integration.js.map +1 -0
- package/dist/services/integrations/openclaw/anythingllm-shim.d.ts +46 -0
- package/dist/services/integrations/openclaw/anythingllm-shim.js +281 -0
- package/dist/services/integrations/openclaw/anythingllm-shim.js.map +1 -0
- package/dist/services/integrations/openclaw/drive-shim.js +490 -0
- package/dist/services/integrations/openclaw/drive-shim.js.map +1 -0
- package/dist/services/integrations/openclaw/integration.d.ts +424 -0
- package/dist/services/integrations/openclaw/integration.js +4402 -0
- package/dist/services/integrations/openclaw/integration.js.map +1 -0
- package/dist/services/integrations/openclaw/jishukb-shim.d.ts +48 -0
- package/dist/services/integrations/openclaw/jishukb-shim.js +750 -0
- package/dist/services/integrations/openclaw/jishukb-shim.js.map +1 -0
- package/dist/services/integrations/openclaw/mcporter-lite.js +276 -0
- package/dist/services/integrations/openclaw/mcporter-lite.js.map +1 -0
- package/dist/services/integrations/openclaw/mcporter.d.ts +46 -0
- package/dist/services/integrations/openclaw/mcporter.js +112 -0
- package/dist/services/integrations/openclaw/mcporter.js.map +1 -0
- package/dist/services/integrations/openclaw/routes.d.ts +21 -0
- package/dist/services/integrations/openclaw/routes.js +1191 -0
- package/dist/services/integrations/openclaw/routes.js.map +1 -0
- package/dist/services/integrations/registry.d.ts +17 -0
- package/dist/services/integrations/registry.js +36 -0
- package/dist/services/integrations/registry.js.map +1 -0
- package/dist/services/integrations/routes.d.ts +2 -0
- package/dist/services/integrations/routes.js +9 -0
- package/dist/services/integrations/routes.js.map +1 -0
- package/dist/services/integrations/types.d.ts +469 -0
- package/dist/services/integrations/types.js +2 -0
- package/dist/services/integrations/types.js.map +1 -0
- package/dist/services/legacy-migrator/classifier.d.ts +44 -0
- package/dist/services/legacy-migrator/classifier.js +309 -0
- package/dist/services/legacy-migrator/classifier.js.map +1 -0
- package/dist/services/legacy-migrator/executor.d.ts +42 -0
- package/dist/services/legacy-migrator/executor.js +637 -0
- package/dist/services/legacy-migrator/executor.js.map +1 -0
- package/dist/services/legacy-migrator/index.d.ts +31 -0
- package/dist/services/legacy-migrator/index.js +34 -0
- package/dist/services/legacy-migrator/index.js.map +1 -0
- package/dist/services/legacy-migrator/planner.d.ts +8 -0
- package/dist/services/legacy-migrator/planner.js +154 -0
- package/dist/services/legacy-migrator/planner.js.map +1 -0
- package/dist/services/legacy-migrator/provider-settings.d.ts +6 -0
- package/dist/services/legacy-migrator/provider-settings.js +72 -0
- package/dist/services/legacy-migrator/provider-settings.js.map +1 -0
- package/dist/services/legacy-migrator/report.d.ts +9 -0
- package/dist/services/legacy-migrator/report.js +99 -0
- package/dist/services/legacy-migrator/report.js.map +1 -0
- package/dist/services/legacy-migrator/scanner.d.ts +13 -0
- package/dist/services/legacy-migrator/scanner.js +157 -0
- package/dist/services/legacy-migrator/scanner.js.map +1 -0
- package/dist/services/legacy-migrator/types.d.ts +97 -0
- package/dist/services/legacy-migrator/types.js +23 -0
- package/dist/services/legacy-migrator/types.js.map +1 -0
- package/dist/services/llm-proxy/instance-proxy.d.ts +17 -1
- package/dist/services/llm-proxy/instance-proxy.js +171 -44
- package/dist/services/llm-proxy/instance-proxy.js.map +1 -1
- package/dist/services/llm-proxy/probe.js +5 -14
- package/dist/services/llm-proxy/probe.js.map +1 -1
- package/dist/services/llm-proxy/providers.js +23 -31
- package/dist/services/llm-proxy/providers.js.map +1 -1
- package/dist/services/llm-proxy/ssrf.d.ts +11 -4
- package/dist/services/llm-proxy/ssrf.js +45 -7
- package/dist/services/llm-proxy/ssrf.js.map +1 -1
- package/dist/services/llm-proxy/validate-key.js +16 -37
- package/dist/services/llm-proxy/validate-key.js.map +1 -1
- package/dist/services/repair/runtime-repair.d.ts +22 -0
- package/dist/services/repair/runtime-repair.js +307 -0
- package/dist/services/repair/runtime-repair.js.map +1 -0
- package/dist/services/runtime/driver-registry.d.ts +21 -0
- package/dist/services/runtime/driver-registry.js +22 -0
- package/dist/services/runtime/driver-registry.js.map +1 -0
- package/dist/services/runtime/drivers/nomad.d.ts +260 -0
- package/dist/services/runtime/drivers/nomad.js +3092 -0
- package/dist/services/runtime/drivers/nomad.js.map +1 -0
- package/dist/services/runtime/errors.d.ts +3 -3
- package/dist/services/runtime/errors.js +3 -3
- package/dist/services/runtime/instance.d.ts +14 -16
- package/dist/services/runtime/instance.js +93 -123
- package/dist/services/runtime/instance.js.map +1 -1
- package/dist/services/runtime/job-id.d.ts +1 -1
- package/dist/services/runtime/job-id.js +1 -1
- package/dist/services/runtime/mcp-shims/firewall.d.ts +2 -2
- package/dist/services/runtime/mcp-shims/firewall.js +2 -2
- package/dist/services/runtime/mcp-shims/searxng-shim.d.ts +3 -5
- package/dist/services/runtime/mcp-shims/searxng-shim.js +3 -5
- package/dist/services/runtime/mcp-shims/searxng-shim.js.map +1 -1
- package/dist/services/runtime/mcp-shims/write-mcp-entry.d.ts +20 -20
- package/dist/services/runtime/mcp-shims/write-mcp-entry.js +16 -16
- package/dist/services/runtime/mcp-shims/write-mcp-entry.js.map +1 -1
- package/dist/services/runtime/ownership-marker.d.ts +83 -0
- package/dist/services/runtime/ownership-marker.js +109 -0
- package/dist/services/runtime/ownership-marker.js.map +1 -0
- package/dist/services/runtime/types.d.ts +22 -501
- package/dist/services/runtime/types.js +0 -12
- package/dist/services/runtime/types.js.map +1 -1
- package/dist/services/runtime/workload-compiler.d.ts +17 -0
- package/dist/services/runtime/workload-compiler.js +525 -0
- package/dist/services/runtime/workload-compiler.js.map +1 -0
- package/dist/services/runtime/workload-types.d.ts +11 -0
- package/dist/services/runtime/workload-types.js +2 -0
- package/dist/services/runtime/workload-types.js.map +1 -0
- package/dist/services/setup/core-manager.d.ts +50 -0
- package/dist/services/setup/core-manager.js +456 -0
- package/dist/services/setup/core-manager.js.map +1 -0
- package/dist/services/setup/plugin-installer.js +136 -0
- package/dist/services/setup/plugin-installer.js.map +1 -0
- package/dist/services/setup/setup-manager.d.ts +158 -0
- package/dist/services/setup/setup-manager.js +2768 -0
- package/dist/services/setup/setup-manager.js.map +1 -0
- package/dist/services/system/cli-command.d.ts +5 -0
- package/dist/services/system/cli-command.js +18 -0
- package/dist/services/system/cli-command.js.map +1 -0
- package/dist/services/system/macos-launchd.js +312 -0
- package/dist/services/system/macos-launchd.js.map +1 -0
- package/dist/services/system/repair-orchestrator.d.ts +71 -0
- package/dist/services/system/repair-orchestrator.js +412 -0
- package/dist/services/system/repair-orchestrator.js.map +1 -0
- package/dist/services/system/system-monitor.js +96 -0
- package/dist/services/system/system-monitor.js.map +1 -0
- package/dist/services/system/system-ollama-provider.d.ts +14 -0
- package/dist/services/system/system-ollama-provider.js +129 -0
- package/dist/services/system/system-ollama-provider.js.map +1 -0
- package/dist/services/system/system-reconciler.d.ts +59 -0
- package/dist/services/system/system-reconciler.js +710 -0
- package/dist/services/system/system-reconciler.js.map +1 -0
- package/dist/services/system/update-manager.d.ts +43 -0
- package/dist/services/system/update-manager.js +315 -0
- package/dist/services/system/update-manager.js.map +1 -0
- package/dist/services/system/upgrade-finalize.d.ts +80 -0
- package/dist/services/system/upgrade-finalize.js +507 -0
- package/dist/services/system/upgrade-finalize.js.map +1 -0
- package/dist/services/tasks/registry.d.ts +44 -0
- package/dist/services/tasks/registry.js +90 -0
- package/dist/services/tasks/registry.js.map +1 -0
- package/dist/services/telemetry/activation.d.ts +6 -2
- package/dist/services/telemetry/activation.js +6 -2
- package/dist/services/telemetry/activation.js.map +1 -1
- package/dist/services/telemetry/heartbeat.d.ts +6 -2
- package/dist/services/telemetry/heartbeat.js +6 -2
- package/dist/services/telemetry/heartbeat.js.map +1 -1
- package/dist/services/workspaces/builder.d.ts +29 -0
- package/dist/services/workspaces/builder.js +186 -0
- package/dist/services/workspaces/builder.js.map +1 -0
- package/dist/types.d.ts +331 -45
- package/dist/utils/instance-lock.d.ts +2 -2
- package/dist/utils/instance-lock.js +2 -2
- package/install/jishu-install.sh +107 -26
- package/install/jishu-uninstall.sh +8 -0
- package/install/post-install.sh +162 -185
- package/install/post-uninstall.sh +6 -0
- package/node_modules/@fastify/static/.github/workflows/ci.yml +1 -1
- package/node_modules/@fastify/static/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/@fastify/static/LICENSE +1 -3
- package/node_modules/@fastify/static/example/server-benchmark.js +39 -0
- package/node_modules/@fastify/static/index.js +169 -23
- package/node_modules/@fastify/static/lib/dirList.js +20 -6
- package/node_modules/@fastify/static/package.json +10 -8
- package/node_modules/@fastify/static/test/dir-list.test.js +82 -0
- package/node_modules/@fastify/static/test/static.test.js +326 -4
- package/node_modules/@fastify/static/types/index.d.ts +0 -4
- package/node_modules/@fastify/static/types/index.test-d.ts +1 -1
- package/node_modules/content-disposition/README.md +21 -22
- package/node_modules/content-disposition/index.js +122 -44
- package/node_modules/content-disposition/package.json +16 -20
- package/node_modules/glob/README.md +39 -130
- package/node_modules/glob/dist/commonjs/glob.d.ts +8 -0
- package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/glob.js +2 -1
- package/node_modules/glob/dist/commonjs/glob.js.map +1 -1
- package/node_modules/glob/dist/commonjs/index.min.js +4 -0
- package/node_modules/glob/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts +3 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/pattern.js +4 -0
- package/node_modules/glob/dist/commonjs/pattern.js.map +1 -1
- package/node_modules/glob/dist/esm/glob.d.ts +8 -0
- package/node_modules/glob/dist/esm/glob.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/glob.js +2 -1
- package/node_modules/glob/dist/esm/glob.js.map +1 -1
- package/node_modules/glob/dist/esm/index.min.js +4 -0
- package/node_modules/glob/dist/esm/index.min.js.map +7 -0
- package/node_modules/glob/dist/esm/pattern.d.ts +3 -0
- package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/pattern.js +4 -0
- package/node_modules/glob/dist/esm/pattern.js.map +1 -1
- package/node_modules/glob/package.json +38 -37
- package/node_modules/jishushell-panel/README.md +4 -4
- package/node_modules/jishushell-panel/output/dist/server.js +17 -6
- package/node_modules/jishushell-panel/output/dist/server.js.map +1 -1
- package/node_modules/jishushell-panel/output/public/assets/ApiKeyField-NKcbHjNz.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/Dashboard-Da1fL38t.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/HermesChatPanel-DZvmYsoh.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/HermesConfigForm-BLUWlKwm.js +4 -0
- package/node_modules/jishushell-panel/output/public/assets/InitPassword-BAKsshzk.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/InstanceDetail-Dgyc_TX5.js +14 -0
- package/node_modules/jishushell-panel/output/public/assets/Login-DHeOmwI8.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/NewInstance-CIy0cYtp.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/ProviderRecommendations-H0ByEYF0.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/Settings-DAT-UMfP.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/Setup-g3uckFYR.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/WeixinLoginPanel-D-T6BxkQ.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/api-C70Gt678.js +4 -0
- package/node_modules/jishushell-panel/output/public/assets/index-DnnqTf7s.css +1 -0
- package/node_modules/jishushell-panel/output/public/assets/index-ERt6_ngA.js +23 -0
- package/node_modules/jishushell-panel/output/public/assets/registry-DF93EzIb.js +2 -0
- package/node_modules/jishushell-panel/output/public/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/setup-task-q21GnI0E.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/usePolling-DeoThIQn.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/vendor-i18n-CS8DFbkQ.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/vendor-react-Cc84NArf.js +8 -0
- package/node_modules/jishushell-panel/output/public/index.html +6 -4
- package/node_modules/jishushell-panel/package.json +2 -2
- package/node_modules/semver/classes/range.js +11 -2
- package/node_modules/semver/package.json +2 -2
- package/package.json +12 -64
- package/scripts/check-app-path-boundaries.mjs +121 -0
- package/scripts/check-app-spec.mjs +127 -25
- package/scripts/check-colima-launchd.mjs +10 -8
- package/scripts/check-integration-isolation.ts +541 -0
- package/scripts/check-new-file-tests.mjs +11 -3
- package/scripts/check-open-core-boundaries.mjs +60 -10
- package/scripts/check-test-layering.sh +1 -1
- package/scripts/fixtures/instances/hermes-sample/instance.json +3 -2
- package/scripts/fixtures/instances/legacy-openclaw-sample/instance.json +1 -1
- package/scripts/local-web-upgrade-test.README +4 -3
- package/scripts/local-web-upgrade-test.example.env +2 -2
- package/scripts/local-web-upgrade-test.sh +14 -1
- package/scripts/pack-gui-and-send-pi.sh +41 -0
- package/scripts/perf/instances.js +1 -1
- package/scripts/prune-open-core-dist.mjs +89 -2
- package/scripts/smoke/hermes-bootstrap.sh +5 -5
- package/templates/hermes-entrypoint.sh +19 -29
- package/apps/openwebui-container.yaml +0 -97
- package/apps/playwright-container.yaml +0 -126
- package/dependencies/jishushell-panel-0.6.5.tgz +0 -0
- package/dist/crypto-shim.d.ts +0 -1
- package/dist/crypto-shim.js +0 -2
- package/dist/crypto-shim.js.map +0 -1
- package/dist/routes/agent-apps.d.ts +0 -14
- package/dist/routes/agent-apps.js +0 -77
- package/dist/routes/agent-apps.js.map +0 -1
- package/dist/routes/internal.d.ts +0 -2
- package/dist/routes/internal.js +0 -55
- package/dist/routes/internal.js.map +0 -1
- package/dist/routes/openclaw-routes.d.ts +0 -22
- package/dist/routes/openclaw-routes.js +0 -1020
- package/dist/routes/openclaw-routes.js.map +0 -1
- package/dist/routes/runtime.d.ts +0 -15
- package/dist/routes/runtime.js +0 -76
- package/dist/routes/runtime.js.map +0 -1
- package/dist/services/agent-apps/catalog.d.ts +0 -33
- package/dist/services/agent-apps/catalog.js +0 -88
- package/dist/services/agent-apps/catalog.js.map +0 -1
- package/dist/services/agent-apps/index.d.ts +0 -36
- package/dist/services/agent-apps/index.js +0 -171
- package/dist/services/agent-apps/index.js.map +0 -1
- package/dist/services/agent-apps/installers/adapter-probes.d.ts +0 -49
- package/dist/services/agent-apps/installers/adapter-probes.js +0 -230
- package/dist/services/agent-apps/installers/adapter-probes.js.map +0 -1
- package/dist/services/agent-apps/installers/adapter.d.ts +0 -30
- package/dist/services/agent-apps/installers/adapter.js +0 -171
- package/dist/services/agent-apps/installers/adapter.js.map +0 -1
- package/dist/services/agent-apps/installers/registry-probe.js.map +0 -1
- package/dist/services/agent-apps/installers/shell-script.d.ts +0 -47
- package/dist/services/agent-apps/installers/shell-script.js +0 -488
- package/dist/services/agent-apps/installers/shell-script.js.map +0 -1
- package/dist/services/agent-apps/types.d.ts +0 -128
- package/dist/services/agent-apps/types.js +0 -17
- package/dist/services/agent-apps/types.js.map +0 -1
- package/dist/services/app/app-compiler.js +0 -185
- package/dist/services/app/app-compiler.js.map +0 -1
- package/dist/services/app/app-manager.d.ts +0 -184
- package/dist/services/app/app-manager.js +0 -2933
- package/dist/services/app/app-manager.js.map +0 -1
- package/dist/services/app/custom-manager.d.ts +0 -27
- package/dist/services/app/custom-manager.js +0 -382
- package/dist/services/app/custom-manager.js.map +0 -1
- package/dist/services/app/hermes-agent-manager.d.ts +0 -20
- package/dist/services/app/hermes-agent-manager.js +0 -299
- package/dist/services/app/hermes-agent-manager.js.map +0 -1
- package/dist/services/app/id-normalizer.d.ts +0 -27
- package/dist/services/app/id-normalizer.js +0 -77
- package/dist/services/app/id-normalizer.js.map +0 -1
- package/dist/services/app/ollama-manager.d.ts +0 -18
- package/dist/services/app/ollama-manager.js +0 -224
- package/dist/services/app/ollama-manager.js.map +0 -1
- package/dist/services/app/openclaw-manager.d.ts +0 -63
- package/dist/services/app/openclaw-manager.js +0 -1215
- package/dist/services/app/openclaw-manager.js.map +0 -1
- package/dist/services/app/paths.d.ts +0 -27
- package/dist/services/app/paths.js +0 -40
- package/dist/services/app/paths.js.map +0 -1
- package/dist/services/app/platform-transform.d.ts +0 -32
- package/dist/services/app/platform-transform.js +0 -65
- package/dist/services/app/platform-transform.js.map +0 -1
- package/dist/services/app/provide-resolver.d.ts +0 -29
- package/dist/services/app/provide-resolver.js +0 -135
- package/dist/services/app/provide-resolver.js.map +0 -1
- package/dist/services/app/registry.d.ts +0 -17
- package/dist/services/app/registry.js +0 -31
- package/dist/services/app/registry.js.map +0 -1
- package/dist/services/app/remote-spec.d.ts +0 -14
- package/dist/services/app/remote-spec.js +0 -58
- package/dist/services/app/remote-spec.js.map +0 -1
- package/dist/services/app/terminal-session-manager.js +0 -157
- package/dist/services/app/terminal-session-manager.js.map +0 -1
- package/dist/services/app/types.d.ts +0 -74
- package/dist/services/app/types.js +0 -16
- package/dist/services/app/types.js.map +0 -1
- package/dist/services/app-config-admin.d.ts +0 -17
- package/dist/services/app-config-admin.js +0 -177
- package/dist/services/app-config-admin.js.map +0 -1
- package/dist/services/app-create-from-installed.d.ts +0 -23
- package/dist/services/app-create-from-installed.js +0 -75
- package/dist/services/app-create-from-installed.js.map +0 -1
- package/dist/services/app-passwords.js +0 -173
- package/dist/services/app-passwords.js.map +0 -1
- package/dist/services/backup-admin.d.ts +0 -101
- package/dist/services/backup-admin.js +0 -259
- package/dist/services/backup-admin.js.map +0 -1
- package/dist/services/backup-manager.d.ts +0 -264
- package/dist/services/backup-manager.js +0 -2263
- package/dist/services/backup-manager.js.map +0 -1
- package/dist/services/backup-verify.js +0 -240
- package/dist/services/backup-verify.js.map +0 -1
- package/dist/services/capability-endpoint-validator.d.ts +0 -41
- package/dist/services/capability-endpoint-validator.js +0 -114
- package/dist/services/capability-endpoint-validator.js.map +0 -1
- package/dist/services/capability-health.d.ts +0 -16
- package/dist/services/capability-health.js +0 -121
- package/dist/services/capability-health.js.map +0 -1
- package/dist/services/capability-registry.d.ts +0 -29
- package/dist/services/capability-registry.js +0 -176
- package/dist/services/capability-registry.js.map +0 -1
- package/dist/services/capability-sync.d.ts +0 -4
- package/dist/services/capability-sync.js +0 -220
- package/dist/services/capability-sync.js.map +0 -1
- package/dist/services/connection-admin.d.ts +0 -74
- package/dist/services/connection-admin.js +0 -287
- package/dist/services/connection-admin.js.map +0 -1
- package/dist/services/connection-apply.d.ts +0 -91
- package/dist/services/connection-apply.js +0 -471
- package/dist/services/connection-apply.js.map +0 -1
- package/dist/services/connection-resolver.d.ts +0 -65
- package/dist/services/connection-resolver.js +0 -281
- package/dist/services/connection-resolver.js.map +0 -1
- package/dist/services/connection-transactor.d.ts +0 -39
- package/dist/services/connection-transactor.js +0 -354
- package/dist/services/connection-transactor.js.map +0 -1
- package/dist/services/core-manager.d.ts +0 -50
- package/dist/services/core-manager.js +0 -411
- package/dist/services/core-manager.js.map +0 -1
- package/dist/services/external-mounts.js +0 -187
- package/dist/services/external-mounts.js.map +0 -1
- package/dist/services/files-manager.d.ts +0 -252
- package/dist/services/files-manager.js +0 -1156
- package/dist/services/files-manager.js.map +0 -1
- package/dist/services/files-mounts.d.ts +0 -42
- package/dist/services/files-mounts.js +0 -207
- package/dist/services/files-mounts.js.map +0 -1
- package/dist/services/instance-admin.d.ts +0 -26
- package/dist/services/instance-admin.js +0 -218
- package/dist/services/instance-admin.js.map +0 -1
- package/dist/services/instance-manager.d.ts +0 -192
- package/dist/services/instance-manager.js +0 -1289
- package/dist/services/instance-manager.js.map +0 -1
- package/dist/services/macos-launchd.js +0 -312
- package/dist/services/macos-launchd.js.map +0 -1
- package/dist/services/nomad-manager.d.ts +0 -307
- package/dist/services/nomad-manager.js +0 -3958
- package/dist/services/nomad-manager.js.map +0 -1
- package/dist/services/organize/applier.js +0 -218
- package/dist/services/organize/applier.js.map +0 -1
- package/dist/services/organize/rules.js +0 -286
- package/dist/services/organize/rules.js.map +0 -1
- package/dist/services/organize/scanner.js +0 -366
- package/dist/services/organize/scanner.js.map +0 -1
- package/dist/services/organize/store.js +0 -82
- package/dist/services/organize/store.js.map +0 -1
- package/dist/services/plugin-installer.js +0 -128
- package/dist/services/plugin-installer.js.map +0 -1
- package/dist/services/process-manager.d.ts +0 -25
- package/dist/services/process-manager.js +0 -568
- package/dist/services/process-manager.js.map +0 -1
- package/dist/services/runtime/adapters/custom.d.ts +0 -20
- package/dist/services/runtime/adapters/custom.js +0 -188
- package/dist/services/runtime/adapters/custom.js.map +0 -1
- package/dist/services/runtime/adapters/hermes.d.ts +0 -204
- package/dist/services/runtime/adapters/hermes.js +0 -1684
- package/dist/services/runtime/adapters/hermes.js.map +0 -1
- package/dist/services/runtime/adapters/openclaw-mcporter.d.ts +0 -45
- package/dist/services/runtime/adapters/openclaw-mcporter.js +0 -108
- package/dist/services/runtime/adapters/openclaw-mcporter.js.map +0 -1
- package/dist/services/runtime/adapters/openclaw.d.ts +0 -426
- package/dist/services/runtime/adapters/openclaw.js +0 -3975
- package/dist/services/runtime/adapters/openclaw.js.map +0 -1
- package/dist/services/runtime/index.d.ts +0 -34
- package/dist/services/runtime/index.js +0 -51
- package/dist/services/runtime/index.js.map +0 -1
- package/dist/services/runtime/mcp-shims/anythingllm-shim.d.ts +0 -46
- package/dist/services/runtime/mcp-shims/anythingllm-shim.js +0 -281
- package/dist/services/runtime/mcp-shims/anythingllm-shim.js.map +0 -1
- package/dist/services/runtime/mcp-shims/drive-shim.js +0 -490
- package/dist/services/runtime/mcp-shims/drive-shim.js.map +0 -1
- package/dist/services/runtime/mcp-shims/jishukb-shim.d.ts +0 -48
- package/dist/services/runtime/mcp-shims/jishukb-shim.js +0 -723
- package/dist/services/runtime/mcp-shims/jishukb-shim.js.map +0 -1
- package/dist/services/runtime/mcp-shims/mcporter-lite.js +0 -276
- package/dist/services/runtime/mcp-shims/mcporter-lite.js.map +0 -1
- package/dist/services/runtime/migrations.d.ts +0 -23
- package/dist/services/runtime/migrations.js +0 -125
- package/dist/services/runtime/migrations.js.map +0 -1
- package/dist/services/runtime/registry.d.ts +0 -13
- package/dist/services/runtime/registry.js +0 -32
- package/dist/services/runtime/registry.js.map +0 -1
- package/dist/services/runtime-identity.d.ts +0 -13
- package/dist/services/runtime-identity.js +0 -166
- package/dist/services/runtime-identity.js.map +0 -1
- package/dist/services/runtime-repair.d.ts +0 -52
- package/dist/services/runtime-repair.js +0 -352
- package/dist/services/runtime-repair.js.map +0 -1
- package/dist/services/setup-manager.d.ts +0 -158
- package/dist/services/setup-manager.js +0 -2740
- package/dist/services/setup-manager.js.map +0 -1
- package/dist/services/suggestions.d.ts +0 -27
- package/dist/services/suggestions.js +0 -133
- package/dist/services/suggestions.js.map +0 -1
- package/dist/services/system-monitor.js +0 -79
- package/dist/services/system-monitor.js.map +0 -1
- package/dist/services/system-ollama-provider.d.ts +0 -14
- package/dist/services/system-ollama-provider.js +0 -125
- package/dist/services/system-ollama-provider.js.map +0 -1
- package/dist/services/system-reconciler.d.ts +0 -72
- package/dist/services/system-reconciler.js +0 -600
- package/dist/services/system-reconciler.js.map +0 -1
- package/dist/services/task-registry.d.ts +0 -44
- package/dist/services/task-registry.js +0 -76
- package/dist/services/task-registry.js.map +0 -1
- package/dist/services/types-shim.d.ts +0 -16
- package/dist/services/types-shim.js +0 -2
- package/dist/services/types-shim.js.map +0 -1
- package/dist/services/update-manager.d.ts +0 -47
- package/dist/services/update-manager.js +0 -351
- package/dist/services/update-manager.js.map +0 -1
- package/dist/services/webdav/server.d.ts +0 -24
- package/dist/services/webdav/server.js +0 -420
- package/dist/services/webdav/server.js.map +0 -1
- package/dist/services/webdav/xml-builder.js.map +0 -1
- package/dist/services/workspace-builder.d.ts +0 -29
- package/dist/services/workspace-builder.js +0 -188
- package/dist/services/workspace-builder.js.map +0 -1
- package/node_modules/@fastify/static/.github/stale.yml +0 -21
- package/node_modules/@isaacs/cliui/LICENSE.md +0 -63
- package/node_modules/@isaacs/cliui/README.md +0 -151
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts +0 -4
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js +0 -16
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts +0 -34
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js +0 -170
- package/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts +0 -6
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js +0 -307
- package/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts +0 -2
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js +0 -7
- package/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts +0 -41
- package/node_modules/@isaacs/cliui/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/index.js +0 -322
- package/node_modules/@isaacs/cliui/dist/commonjs/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/index.min.js +0 -12
- package/node_modules/@isaacs/cliui/dist/commonjs/index.min.js.map +0 -7
- package/node_modules/@isaacs/cliui/dist/commonjs/package.json +0 -3
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts +0 -5
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js +0 -49
- package/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts +0 -2
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js +0 -8
- package/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts +0 -7
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js +0 -176
- package/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts +0 -4
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js +0 -12
- package/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts +0 -34
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js +0 -167
- package/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts +0 -6
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js +0 -299
- package/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts +0 -2
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js +0 -3
- package/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/index.d.ts +0 -41
- package/node_modules/@isaacs/cliui/dist/esm/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/index.js +0 -317
- package/node_modules/@isaacs/cliui/dist/esm/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/index.min.js +0 -12
- package/node_modules/@isaacs/cliui/dist/esm/index.min.js.map +0 -7
- package/node_modules/@isaacs/cliui/dist/esm/package.json +0 -3
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts +0 -5
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.js +0 -46
- package/node_modules/@isaacs/cliui/dist/esm/string-width/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts +0 -2
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js +0 -4
- package/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts +0 -7
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.d.ts.map +0 -1
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js +0 -172
- package/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js.map +0 -1
- package/node_modules/@isaacs/cliui/package.json +0 -163
- package/node_modules/content-disposition/HISTORY.md +0 -60
- package/node_modules/cross-spawn/LICENSE +0 -21
- package/node_modules/cross-spawn/README.md +0 -89
- package/node_modules/cross-spawn/index.js +0 -39
- package/node_modules/cross-spawn/lib/enoent.js +0 -59
- package/node_modules/cross-spawn/lib/parse.js +0 -91
- package/node_modules/cross-spawn/lib/util/escape.js +0 -47
- package/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
- package/node_modules/cross-spawn/package.json +0 -73
- package/node_modules/foreground-child/LICENSE +0 -15
- package/node_modules/foreground-child/README.md +0 -128
- package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts +0 -2
- package/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map +0 -1
- package/node_modules/foreground-child/dist/commonjs/all-signals.js +0 -58
- package/node_modules/foreground-child/dist/commonjs/all-signals.js.map +0 -1
- package/node_modules/foreground-child/dist/commonjs/index.d.ts +0 -58
- package/node_modules/foreground-child/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/foreground-child/dist/commonjs/index.js +0 -123
- package/node_modules/foreground-child/dist/commonjs/index.js.map +0 -1
- package/node_modules/foreground-child/dist/commonjs/package.json +0 -3
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts +0 -6
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map +0 -1
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.js +0 -38
- package/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map +0 -1
- package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts +0 -10
- package/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map +0 -1
- package/node_modules/foreground-child/dist/commonjs/watchdog.js +0 -50
- package/node_modules/foreground-child/dist/commonjs/watchdog.js.map +0 -1
- package/node_modules/foreground-child/dist/esm/all-signals.d.ts +0 -2
- package/node_modules/foreground-child/dist/esm/all-signals.d.ts.map +0 -1
- package/node_modules/foreground-child/dist/esm/all-signals.js +0 -52
- package/node_modules/foreground-child/dist/esm/all-signals.js.map +0 -1
- package/node_modules/foreground-child/dist/esm/index.d.ts +0 -58
- package/node_modules/foreground-child/dist/esm/index.d.ts.map +0 -1
- package/node_modules/foreground-child/dist/esm/index.js +0 -115
- package/node_modules/foreground-child/dist/esm/index.js.map +0 -1
- package/node_modules/foreground-child/dist/esm/package.json +0 -3
- package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts +0 -6
- package/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map +0 -1
- package/node_modules/foreground-child/dist/esm/proxy-signals.js +0 -34
- package/node_modules/foreground-child/dist/esm/proxy-signals.js.map +0 -1
- package/node_modules/foreground-child/dist/esm/watchdog.d.ts +0 -10
- package/node_modules/foreground-child/dist/esm/watchdog.d.ts.map +0 -1
- package/node_modules/foreground-child/dist/esm/watchdog.js +0 -46
- package/node_modules/foreground-child/dist/esm/watchdog.js.map +0 -1
- package/node_modules/foreground-child/package.json +0 -106
- package/node_modules/glob/dist/esm/bin.d.mts +0 -3
- package/node_modules/glob/dist/esm/bin.d.mts.map +0 -1
- package/node_modules/glob/dist/esm/bin.mjs +0 -346
- package/node_modules/glob/dist/esm/bin.mjs.map +0 -1
- package/node_modules/isexe/.npmignore +0 -2
- package/node_modules/isexe/LICENSE +0 -15
- package/node_modules/isexe/README.md +0 -51
- package/node_modules/isexe/index.js +0 -57
- package/node_modules/isexe/mode.js +0 -41
- package/node_modules/isexe/package.json +0 -31
- package/node_modules/isexe/test/basic.js +0 -221
- package/node_modules/isexe/windows.js +0 -42
- package/node_modules/jackspeak/LICENSE.md +0 -55
- package/node_modules/jackspeak/README.md +0 -394
- package/node_modules/jackspeak/dist/commonjs/index.d.ts +0 -323
- package/node_modules/jackspeak/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/jackspeak/dist/commonjs/index.js +0 -944
- package/node_modules/jackspeak/dist/commonjs/index.js.map +0 -1
- package/node_modules/jackspeak/dist/commonjs/index.min.js +0 -33
- package/node_modules/jackspeak/dist/commonjs/index.min.js.map +0 -7
- package/node_modules/jackspeak/dist/commonjs/package.json +0 -3
- package/node_modules/jackspeak/dist/esm/index.d.ts +0 -323
- package/node_modules/jackspeak/dist/esm/index.d.ts.map +0 -1
- package/node_modules/jackspeak/dist/esm/index.js +0 -936
- package/node_modules/jackspeak/dist/esm/index.js.map +0 -1
- package/node_modules/jackspeak/dist/esm/index.min.js +0 -33
- package/node_modules/jackspeak/dist/esm/index.min.js.map +0 -7
- package/node_modules/jackspeak/dist/esm/package.json +0 -3
- package/node_modules/jackspeak/package.json +0 -115
- package/node_modules/jishushell-panel/output/public/assets/ApiKeyField-D1i7zWXR.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/Dashboard-sWIvL43F.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/HermesChatPanel-DQ8RyvQY.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/HermesConfigForm-tIbPP1sB.js +0 -4
- package/node_modules/jishushell-panel/output/public/assets/InitPassword-C3Slq3Dd.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/InstanceDetail-7JqY9tq4.js +0 -92
- package/node_modules/jishushell-panel/output/public/assets/Login-BXLDJlQN.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/NewInstance-dLc5Xrpx.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/ProviderRecommendations-DIAXxesl.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/Settings-Bd5utbBh.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/Setup-Yn9_20FL.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/WeixinLoginPanel-C21doQTJ.js +0 -9
- package/node_modules/jishushell-panel/output/public/assets/index-CCkaIEjn.js +0 -20
- package/node_modules/jishushell-panel/output/public/assets/index-D7qxy-Vh.css +0 -1
- package/node_modules/jishushell-panel/output/public/assets/registry-B2ZQZXWL.js +0 -2
- package/node_modules/jishushell-panel/output/public/assets/usePolling-BFZm4do_.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/vendor-i18n-DqPtOicc.js +0 -9
- package/node_modules/jishushell-panel/output/public/assets/vendor-react-DW5juQin.js +0 -59
- package/node_modules/package-json-from-dist/LICENSE.md +0 -63
- package/node_modules/package-json-from-dist/README.md +0 -110
- package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts +0 -89
- package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/package-json-from-dist/dist/commonjs/index.js +0 -134
- package/node_modules/package-json-from-dist/dist/commonjs/index.js.map +0 -1
- package/node_modules/package-json-from-dist/dist/commonjs/package.json +0 -3
- package/node_modules/package-json-from-dist/dist/esm/index.d.ts +0 -89
- package/node_modules/package-json-from-dist/dist/esm/index.d.ts.map +0 -1
- package/node_modules/package-json-from-dist/dist/esm/index.js +0 -129
- package/node_modules/package-json-from-dist/dist/esm/index.js.map +0 -1
- package/node_modules/package-json-from-dist/dist/esm/package.json +0 -3
- package/node_modules/package-json-from-dist/package.json +0 -68
- package/node_modules/path-key/index.d.ts +0 -40
- package/node_modules/path-key/index.js +0 -16
- package/node_modules/path-key/license +0 -9
- package/node_modules/path-key/package.json +0 -39
- package/node_modules/path-key/readme.md +0 -61
- package/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/safe-buffer/index.js +0 -65
- package/node_modules/safe-buffer/package.json +0 -51
- package/node_modules/shebang-command/index.js +0 -19
- package/node_modules/shebang-command/license +0 -9
- package/node_modules/shebang-command/package.json +0 -34
- package/node_modules/shebang-command/readme.md +0 -34
- package/node_modules/shebang-regex/index.d.ts +0 -22
- package/node_modules/shebang-regex/index.js +0 -2
- package/node_modules/shebang-regex/license +0 -9
- package/node_modules/shebang-regex/package.json +0 -35
- package/node_modules/shebang-regex/readme.md +0 -33
- package/node_modules/signal-exit/LICENSE.txt +0 -16
- package/node_modules/signal-exit/README.md +0 -74
- package/node_modules/signal-exit/dist/cjs/browser.d.ts +0 -12
- package/node_modules/signal-exit/dist/cjs/browser.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/cjs/browser.js +0 -10
- package/node_modules/signal-exit/dist/cjs/browser.js.map +0 -1
- package/node_modules/signal-exit/dist/cjs/index.d.ts +0 -48
- package/node_modules/signal-exit/dist/cjs/index.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/cjs/index.js +0 -279
- package/node_modules/signal-exit/dist/cjs/index.js.map +0 -1
- package/node_modules/signal-exit/dist/cjs/package.json +0 -3
- package/node_modules/signal-exit/dist/cjs/signals.d.ts +0 -29
- package/node_modules/signal-exit/dist/cjs/signals.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/cjs/signals.js +0 -42
- package/node_modules/signal-exit/dist/cjs/signals.js.map +0 -1
- package/node_modules/signal-exit/dist/mjs/browser.d.ts +0 -12
- package/node_modules/signal-exit/dist/mjs/browser.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/mjs/browser.js +0 -4
- package/node_modules/signal-exit/dist/mjs/browser.js.map +0 -1
- package/node_modules/signal-exit/dist/mjs/index.d.ts +0 -48
- package/node_modules/signal-exit/dist/mjs/index.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/mjs/index.js +0 -275
- package/node_modules/signal-exit/dist/mjs/index.js.map +0 -1
- package/node_modules/signal-exit/dist/mjs/package.json +0 -3
- package/node_modules/signal-exit/dist/mjs/signals.d.ts +0 -29
- package/node_modules/signal-exit/dist/mjs/signals.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/mjs/signals.js +0 -39
- package/node_modules/signal-exit/dist/mjs/signals.js.map +0 -1
- package/node_modules/signal-exit/package.json +0 -106
- package/node_modules/which/CHANGELOG.md +0 -166
- package/node_modules/which/LICENSE +0 -15
- package/node_modules/which/README.md +0 -54
- package/node_modules/which/bin/node-which +0 -52
- package/node_modules/which/package.json +0 -43
- package/node_modules/which/which.js +0 -125
- package/scripts/check-adapter-isolation.ts +0 -293
- /package/dist/services/{app → app-common}/app-compiler.d.ts +0 -0
- /package/dist/services/{app → app-common}/terminal-session-manager.d.ts +0 -0
- /package/dist/services/{backup-verify.d.ts → backup/backup-verify.d.ts} +0 -0
- /package/dist/services/{external-mounts.d.ts → files/external-mounts.d.ts} +0 -0
- /package/dist/services/{organize → files/organize}/applier.d.ts +0 -0
- /package/dist/services/{organize → files/organize}/rules.d.ts +0 -0
- /package/dist/services/{organize → files/organize}/scanner.d.ts +0 -0
- /package/dist/services/{organize → files/organize}/store.d.ts +0 -0
- /package/dist/services/{webdav → files/webdav}/xml-builder.d.ts +0 -0
- /package/dist/services/{webdav → files/webdav}/xml-builder.js +0 -0
- /package/dist/services/{app-passwords.d.ts → instances/passwords.d.ts} +0 -0
- /package/dist/services/{agent-apps → integrations/installable}/installers/registry-probe.d.ts +0 -0
- /package/dist/services/{agent-apps → integrations/installable}/installers/registry-probe.js +0 -0
- /package/dist/services/{runtime/mcp-shims → integrations/openclaw}/drive-shim.d.ts +0 -0
- /package/dist/services/{runtime/mcp-shims → integrations/openclaw}/mcporter-lite.d.ts +0 -0
- /package/dist/services/{plugin-installer.d.ts → setup/plugin-installer.d.ts} +0 -0
- /package/dist/services/{macos-launchd.d.ts → system/macos-launchd.d.ts} +0 -0
- /package/dist/services/{system-monitor.d.ts → system/system-monitor.d.ts} +0 -0
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* src/services/system/system-reconciler.ts
|
|
3
|
+
*
|
|
4
|
+
* Compares the system state rendered by the currently installed code against
|
|
5
|
+
* host files/services, then applies the shared setup-manager installers when
|
|
6
|
+
* privileged, domain-specific changes are needed.
|
|
7
|
+
*/
|
|
8
|
+
import { execFileSync } from "child_process";
|
|
9
|
+
import { createHash } from "crypto";
|
|
10
|
+
import { existsSync, lstatSync, readFileSync, readlinkSync, symlinkSync, writeFileSync } from "fs";
|
|
11
|
+
import { userInfo } from "os";
|
|
12
|
+
import { dirname, join, resolve } from "path";
|
|
13
|
+
import { JISHUSHELL_HOME, getCoreConfig, getCorePort, getIntegrationRuntimeEntry } from "../../config.js";
|
|
14
|
+
import { ensureDirHost } from "../../utils/fs.js";
|
|
15
|
+
import { createInvalidSudoPasswordError, isSudoAuthenticationError, isSudoNoNewPrivilegesError, runSudoAskpassCommand, } from "../../utils/sudo-askpass.js";
|
|
16
|
+
import { buildSudoDisplayCommand, buildSudoJishushellCommand, getJishushellWrapper } from "./cli-command.js";
|
|
17
|
+
import * as setupManager from "../setup/setup-manager.js";
|
|
18
|
+
import { resolveIntegrationKindFromMetadata } from "../app-common/integration-refs.js";
|
|
19
|
+
import { listRegisteredIntegrations } from "../integrations/index.js";
|
|
20
|
+
import { chownToServiceUser, listInstances } from "../instances/manager.js";
|
|
21
|
+
const RECONCILE_STATE_FILE = join(JISHUSHELL_HOME, "reconcile-state.json");
|
|
22
|
+
const SYSTEM_CLI_LINK = "/usr/local/bin/jishushell";
|
|
23
|
+
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
24
|
+
function hasSudoAccess() {
|
|
25
|
+
if (typeof process.getuid === "function" && process.getuid() === 0)
|
|
26
|
+
return true;
|
|
27
|
+
try {
|
|
28
|
+
execFileSync("sudo", ["-n", "true"], { stdio: "ignore", timeout: 3000 });
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function isRoot() {
|
|
36
|
+
return typeof process.getuid === "function" && process.getuid() === 0;
|
|
37
|
+
}
|
|
38
|
+
function resolveCurrentCliTarget(candidate) {
|
|
39
|
+
const cliPath = candidate?.trim();
|
|
40
|
+
if (!cliPath || !existsSync(cliPath))
|
|
41
|
+
return null;
|
|
42
|
+
const args = ["system", "reload"];
|
|
43
|
+
if (cliPath.endsWith(".js")) {
|
|
44
|
+
return {
|
|
45
|
+
command: process.execPath,
|
|
46
|
+
args: [cliPath, ...args],
|
|
47
|
+
displayCommand: buildSudoDisplayCommand(process.execPath, [cliPath, ...args]),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
command: cliPath,
|
|
52
|
+
args,
|
|
53
|
+
displayCommand: buildSudoDisplayCommand(cliPath, args),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function resolveSystemReloadTarget() {
|
|
57
|
+
const wrapper = getJishushellWrapper();
|
|
58
|
+
if (existsSync(wrapper)) {
|
|
59
|
+
return {
|
|
60
|
+
command: wrapper,
|
|
61
|
+
args: ["system", "reload"],
|
|
62
|
+
displayCommand: buildSudoDisplayCommand(wrapper, ["system", "reload"]),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return resolveCurrentCliTarget(process.env.JISHUSHELL_CORE_BIN)
|
|
66
|
+
?? resolveCurrentCliTarget(process.argv[1]);
|
|
67
|
+
}
|
|
68
|
+
function getSystemReloadCommand() {
|
|
69
|
+
return resolveSystemReloadTarget()?.displayCommand
|
|
70
|
+
?? buildSudoJishushellCommand(["system", "reload"]);
|
|
71
|
+
}
|
|
72
|
+
export function getStoredReconcileState() {
|
|
73
|
+
if (!existsSync(RECONCILE_STATE_FILE))
|
|
74
|
+
return null;
|
|
75
|
+
try {
|
|
76
|
+
const raw = JSON.parse(readFileSync(RECONCILE_STATE_FILE, "utf-8"));
|
|
77
|
+
if (!raw || !Array.isArray(raw.items))
|
|
78
|
+
return null;
|
|
79
|
+
// Rebuild the public shape instead of spreading disk JSON. Older releases
|
|
80
|
+
// stored instance restart advisories in this system-level file; those
|
|
81
|
+
// fields are intentionally ignored by the current host-only reconciler.
|
|
82
|
+
return {
|
|
83
|
+
timestamp: typeof raw.timestamp === "string" ? raw.timestamp : new Date(0).toISOString(),
|
|
84
|
+
items: raw.items,
|
|
85
|
+
hasPendingSudoActions: raw.hasPendingSudoActions === true,
|
|
86
|
+
reloadRequired: raw.reloadRequired === true,
|
|
87
|
+
manualRequired: raw.manualRequired === true,
|
|
88
|
+
canAutoReload: raw.canAutoReload === true,
|
|
89
|
+
command: typeof raw.command === "string" ? raw.command : getSystemReloadCommand(),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function createSystemReloadSudoError(result) {
|
|
97
|
+
const message = (result.stderr || result.stdout).trim();
|
|
98
|
+
if (isSudoAuthenticationError(message)) {
|
|
99
|
+
return createInvalidSudoPasswordError();
|
|
100
|
+
}
|
|
101
|
+
if (isSudoNoNewPrivilegesError(message)) {
|
|
102
|
+
const err = new Error("当前运行环境禁止 sudo 提权(no new privileges),请在系统终端执行推荐的 reload 命令。");
|
|
103
|
+
err.code = "SUDO_NO_NEW_PRIVILEGES";
|
|
104
|
+
return err;
|
|
105
|
+
}
|
|
106
|
+
if (/systemd-run.*not found|No such file or directory/i.test(message)) {
|
|
107
|
+
const err = new Error("当前系统缺少 systemd-run,无法从网页安全启动后台 reload。请在系统终端执行推荐命令。");
|
|
108
|
+
err.code = "SYSTEM_RELOAD_UNSUPPORTED";
|
|
109
|
+
return err;
|
|
110
|
+
}
|
|
111
|
+
if (message)
|
|
112
|
+
return new Error(message);
|
|
113
|
+
return new Error("无法启动系统 reload,请在系统终端执行推荐命令。");
|
|
114
|
+
}
|
|
115
|
+
function buildSystemdRunReloadArgs(unit, includeCollect, target) {
|
|
116
|
+
const currentUser = userInfo();
|
|
117
|
+
const sudoEnv = typeof process.getuid === "function" && process.getuid() > 0
|
|
118
|
+
? [
|
|
119
|
+
`--setenv=SUDO_UID=${process.getuid()}`,
|
|
120
|
+
...(typeof process.getgid === "function" ? [`--setenv=SUDO_GID=${process.getgid()}`] : []),
|
|
121
|
+
`--setenv=SUDO_USER=${currentUser.username}`,
|
|
122
|
+
]
|
|
123
|
+
: [];
|
|
124
|
+
const args = [
|
|
125
|
+
"systemd-run",
|
|
126
|
+
"--quiet",
|
|
127
|
+
`--unit=${unit}`,
|
|
128
|
+
`--setenv=JISHUSHELL_HOME=${JISHUSHELL_HOME}`,
|
|
129
|
+
`--setenv=HOME=${dirname(JISHUSHELL_HOME)}`,
|
|
130
|
+
...sudoEnv,
|
|
131
|
+
target.command,
|
|
132
|
+
...target.args,
|
|
133
|
+
];
|
|
134
|
+
if (includeCollect)
|
|
135
|
+
args.splice(2, 0, "--collect");
|
|
136
|
+
return args;
|
|
137
|
+
}
|
|
138
|
+
function normalizeText(content) {
|
|
139
|
+
return content
|
|
140
|
+
.replace(/\r\n/g, "\n")
|
|
141
|
+
.replace(/\r/g, "\n")
|
|
142
|
+
.split("\n")
|
|
143
|
+
.map((line) => line.trimEnd())
|
|
144
|
+
.join("\n")
|
|
145
|
+
.replace(/\n*$/, "\n");
|
|
146
|
+
}
|
|
147
|
+
function hashText(content) {
|
|
148
|
+
return createHash("sha256").update(normalizeText(content)).digest("hex");
|
|
149
|
+
}
|
|
150
|
+
function readActualFile(path, sudoAvailable) {
|
|
151
|
+
try {
|
|
152
|
+
return { content: readFileSync(path, "utf-8") };
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
if (e?.code === "ENOENT")
|
|
156
|
+
return { content: null };
|
|
157
|
+
if (e?.code === "EACCES" && sudoAvailable) {
|
|
158
|
+
try {
|
|
159
|
+
return { content: execFileSync("sudo", ["-n", "cat", path], { encoding: "utf-8", timeout: 3000 }) };
|
|
160
|
+
}
|
|
161
|
+
catch (sudoError) {
|
|
162
|
+
return { content: null, error: sudoError?.message || String(sudoError), errorCode: sudoError?.code };
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return { content: null, error: e?.message || String(e), errorCode: e?.code };
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function checkExpectedFile(resource, sudoAvailable) {
|
|
169
|
+
let isSymlink = false;
|
|
170
|
+
try {
|
|
171
|
+
isSymlink = lstatSync(resource.path).isSymbolicLink();
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
if (e?.code !== "ENOENT") {
|
|
175
|
+
return {
|
|
176
|
+
resource,
|
|
177
|
+
drift: true,
|
|
178
|
+
missing: false,
|
|
179
|
+
expectedHash: hashText(resource.content),
|
|
180
|
+
error: e?.message || String(e),
|
|
181
|
+
errorCode: e?.code,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const actual = readActualFile(resource.path, sudoAvailable);
|
|
186
|
+
const expectedHash = hashText(resource.content);
|
|
187
|
+
if (actual.error) {
|
|
188
|
+
return {
|
|
189
|
+
resource,
|
|
190
|
+
drift: true,
|
|
191
|
+
missing: false,
|
|
192
|
+
expectedHash,
|
|
193
|
+
error: actual.error,
|
|
194
|
+
errorCode: actual.errorCode,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
if (actual.content === null) {
|
|
198
|
+
return {
|
|
199
|
+
resource,
|
|
200
|
+
drift: true,
|
|
201
|
+
missing: true,
|
|
202
|
+
expectedHash,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const actualHash = hashText(actual.content);
|
|
206
|
+
return {
|
|
207
|
+
resource,
|
|
208
|
+
drift: expectedHash !== actualHash || isSymlink,
|
|
209
|
+
missing: false,
|
|
210
|
+
expectedHash,
|
|
211
|
+
actualHash,
|
|
212
|
+
isSymlink,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function statusForDrift(check, sudoAvailable) {
|
|
216
|
+
if (!check.drift)
|
|
217
|
+
return "ok";
|
|
218
|
+
if (check.error)
|
|
219
|
+
return check.errorCode === "EACCES" && !sudoAvailable ? "skipped" : "error";
|
|
220
|
+
if (check.resource.requiresSudo && !sudoAvailable)
|
|
221
|
+
return "skipped";
|
|
222
|
+
return "skipped";
|
|
223
|
+
}
|
|
224
|
+
function requiresOperatorReload(resource, sudoAvailable) {
|
|
225
|
+
if (!resource.reloadRequired)
|
|
226
|
+
return false;
|
|
227
|
+
if (resource.requiresSudo && !sudoAvailable)
|
|
228
|
+
return true;
|
|
229
|
+
return !sudoAvailable && process.platform !== "darwin";
|
|
230
|
+
}
|
|
231
|
+
function buildFileItem(check, sudoAvailable) {
|
|
232
|
+
const resource = check.resource;
|
|
233
|
+
if (!check.drift) {
|
|
234
|
+
return {
|
|
235
|
+
component: resource.id,
|
|
236
|
+
id: resource.id,
|
|
237
|
+
path: resource.path,
|
|
238
|
+
status: "ok",
|
|
239
|
+
message: `${resource.path} matches expected ${resource.component} state`,
|
|
240
|
+
requiresSudo: false,
|
|
241
|
+
reloadRequired: false,
|
|
242
|
+
manualRequired: false,
|
|
243
|
+
fix: "none",
|
|
244
|
+
expectedHash: check.expectedHash,
|
|
245
|
+
actualHash: check.actualHash,
|
|
246
|
+
severity: "info",
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
const manualRequired = requiresOperatorReload(resource, sudoAvailable);
|
|
250
|
+
const status = statusForDrift(check, sudoAvailable);
|
|
251
|
+
const missingOrDifferent = check.missing
|
|
252
|
+
? "is missing"
|
|
253
|
+
: check.isSymlink
|
|
254
|
+
? "is a symlink; expected a managed file"
|
|
255
|
+
: "differs from expected state";
|
|
256
|
+
const message = check.error
|
|
257
|
+
? `Cannot read ${resource.path}: ${check.error}`
|
|
258
|
+
: `${resource.path} ${missingOrDifferent}`;
|
|
259
|
+
return {
|
|
260
|
+
component: resource.id,
|
|
261
|
+
id: resource.id,
|
|
262
|
+
path: resource.path,
|
|
263
|
+
status,
|
|
264
|
+
message,
|
|
265
|
+
requiresSudo: resource.requiresSudo || manualRequired,
|
|
266
|
+
reloadRequired: resource.reloadRequired,
|
|
267
|
+
manualRequired,
|
|
268
|
+
fix: resource.fix,
|
|
269
|
+
command: resource.reloadRequired ? getSystemReloadCommand() : undefined,
|
|
270
|
+
expectedHash: check.expectedHash,
|
|
271
|
+
actualHash: check.actualHash,
|
|
272
|
+
details: check.error,
|
|
273
|
+
severity: status === "error" ? "error" : "warning",
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function applyScope(scope, corePort) {
|
|
277
|
+
switch (scope) {
|
|
278
|
+
case "core":
|
|
279
|
+
return setupManager.installJishushellSystemd(corePort, false);
|
|
280
|
+
case "panel":
|
|
281
|
+
return setupManager.installJishushellPanelSystemd(corePort, undefined, false);
|
|
282
|
+
case "nomad":
|
|
283
|
+
return setupManager.installNomadSystemd();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function groupedByScope(checks) {
|
|
287
|
+
const groups = new Map();
|
|
288
|
+
for (const check of checks) {
|
|
289
|
+
const existing = groups.get(check.resource.installScope) ?? [];
|
|
290
|
+
existing.push(check);
|
|
291
|
+
groups.set(check.resource.installScope, existing);
|
|
292
|
+
}
|
|
293
|
+
return groups;
|
|
294
|
+
}
|
|
295
|
+
function scopeRequiresSudo(scope, checks) {
|
|
296
|
+
if (process.platform === "darwin") {
|
|
297
|
+
return checks.some((check) => check.resource.requiresSudo);
|
|
298
|
+
}
|
|
299
|
+
return scope === "core" || scope === "panel" || scope === "nomad";
|
|
300
|
+
}
|
|
301
|
+
function pushAppliedScopeResult(items, scope, checks, result) {
|
|
302
|
+
const ids = checks.map((check) => check.resource.id);
|
|
303
|
+
const reloadRequired = checks.some((check) => check.resource.reloadRequired);
|
|
304
|
+
if (!result.ok) {
|
|
305
|
+
items.push({
|
|
306
|
+
component: `${scope}.expected-state`,
|
|
307
|
+
status: "error",
|
|
308
|
+
message: result.message,
|
|
309
|
+
requiresSudo: checks.some((check) => check.resource.requiresSudo),
|
|
310
|
+
reloadRequired,
|
|
311
|
+
manualRequired: true,
|
|
312
|
+
fix: reloadRequired ? "system-reload" : "manual",
|
|
313
|
+
command: reloadRequired ? getSystemReloadCommand() : undefined,
|
|
314
|
+
details: [result.error, `Resources: ${ids.join(", ")}`].filter(Boolean).join("\n"),
|
|
315
|
+
severity: "error",
|
|
316
|
+
});
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const postChecks = checks.map((check) => checkExpectedFile(check.resource, true));
|
|
320
|
+
const remaining = postChecks.filter((check) => check.drift);
|
|
321
|
+
if (remaining.length > 0) {
|
|
322
|
+
items.push({
|
|
323
|
+
component: `${scope}.expected-state`,
|
|
324
|
+
status: "error",
|
|
325
|
+
message: `${scope} installer completed but ${remaining.length} resource(s) still drift`,
|
|
326
|
+
requiresSudo: checks.some((check) => check.resource.requiresSudo),
|
|
327
|
+
reloadRequired,
|
|
328
|
+
manualRequired: true,
|
|
329
|
+
fix: reloadRequired ? "system-reload" : "manual",
|
|
330
|
+
command: reloadRequired ? getSystemReloadCommand() : undefined,
|
|
331
|
+
details: remaining.map((check) => `${check.resource.id}: ${check.resource.path}`).join("\n"),
|
|
332
|
+
severity: "error",
|
|
333
|
+
});
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
items.push({
|
|
337
|
+
component: `${scope}.expected-state`,
|
|
338
|
+
status: "updated",
|
|
339
|
+
message: result.message,
|
|
340
|
+
requiresSudo: false,
|
|
341
|
+
reloadRequired,
|
|
342
|
+
manualRequired: false,
|
|
343
|
+
fix: reloadRequired ? "system-reload" : "none",
|
|
344
|
+
command: reloadRequired ? getSystemReloadCommand() : undefined,
|
|
345
|
+
details: `Resources: ${ids.join(", ")}`,
|
|
346
|
+
severity: "info",
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
function reconcileExpectedFiles(items, options, sudoAvailable) {
|
|
350
|
+
const corePort = getCorePort();
|
|
351
|
+
let files;
|
|
352
|
+
try {
|
|
353
|
+
files = setupManager.getExpectedSystemFiles({ corePort });
|
|
354
|
+
}
|
|
355
|
+
catch (e) {
|
|
356
|
+
items.push({
|
|
357
|
+
component: "expected-state",
|
|
358
|
+
status: "error",
|
|
359
|
+
message: "Failed to render expected system state",
|
|
360
|
+
manualRequired: true,
|
|
361
|
+
fix: "manual",
|
|
362
|
+
details: e?.message || String(e),
|
|
363
|
+
severity: "error",
|
|
364
|
+
});
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const checks = files.map((file) => checkExpectedFile(file, sudoAvailable));
|
|
368
|
+
const clean = checks.filter((check) => !check.drift);
|
|
369
|
+
for (const check of clean) {
|
|
370
|
+
items.push(buildFileItem(check, sudoAvailable));
|
|
371
|
+
}
|
|
372
|
+
const drifted = checks.filter((check) => check.drift);
|
|
373
|
+
if (drifted.length === 0)
|
|
374
|
+
return;
|
|
375
|
+
if (!options.apply) {
|
|
376
|
+
for (const check of drifted) {
|
|
377
|
+
items.push(buildFileItem(check, sudoAvailable));
|
|
378
|
+
}
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
const groups = groupedByScope(drifted);
|
|
382
|
+
for (const [scope, scopedChecks] of groups) {
|
|
383
|
+
const requiresSudo = scopeRequiresSudo(scope, scopedChecks);
|
|
384
|
+
if (requiresSudo && !sudoAvailable) {
|
|
385
|
+
for (const check of scopedChecks) {
|
|
386
|
+
items.push(buildFileItem(check, sudoAvailable));
|
|
387
|
+
}
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
const result = applyScope(scope, corePort);
|
|
391
|
+
pushAppliedScopeResult(items, scope, scopedChecks, result);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
// ── Reconcile: system CLI path ─────────────────────────────────────────────
|
|
395
|
+
function normalizeSymlinkTarget(linkPath, target) {
|
|
396
|
+
return target.startsWith("/") ? target : resolve(dirname(linkPath), target);
|
|
397
|
+
}
|
|
398
|
+
function createSystemCliSymlink(expected) {
|
|
399
|
+
if (isRoot()) {
|
|
400
|
+
symlinkSync(expected, SYSTEM_CLI_LINK);
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
execFileSync("sudo", ["-n", "ln", "-s", expected, SYSTEM_CLI_LINK], { stdio: "ignore", timeout: 5000 });
|
|
404
|
+
}
|
|
405
|
+
function reconcileSystemCliLink(items, apply, sudoAvailable) {
|
|
406
|
+
if (process.platform === "win32")
|
|
407
|
+
return;
|
|
408
|
+
const expected = getJishushellWrapper();
|
|
409
|
+
const command = getSystemReloadCommand();
|
|
410
|
+
let exists = false;
|
|
411
|
+
let isSymlink = false;
|
|
412
|
+
let target = "";
|
|
413
|
+
let targetMatches = false;
|
|
414
|
+
try {
|
|
415
|
+
const stat = lstatSync(SYSTEM_CLI_LINK);
|
|
416
|
+
exists = true;
|
|
417
|
+
isSymlink = stat.isSymbolicLink();
|
|
418
|
+
if (isSymlink) {
|
|
419
|
+
target = readlinkSync(SYSTEM_CLI_LINK);
|
|
420
|
+
targetMatches = normalizeSymlinkTarget(SYSTEM_CLI_LINK, target) === expected;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
catch (e) {
|
|
424
|
+
if (e?.code !== "ENOENT") {
|
|
425
|
+
items.push({
|
|
426
|
+
component: "core.system-cli-link",
|
|
427
|
+
id: "core.system-cli-link",
|
|
428
|
+
path: SYSTEM_CLI_LINK,
|
|
429
|
+
status: "skipped",
|
|
430
|
+
message: `Cannot inspect ${SYSTEM_CLI_LINK}: ${e?.message || String(e)}`,
|
|
431
|
+
requiresSudo: false,
|
|
432
|
+
reloadRequired: false,
|
|
433
|
+
manualRequired: false,
|
|
434
|
+
fix: "none",
|
|
435
|
+
command,
|
|
436
|
+
severity: "warning",
|
|
437
|
+
});
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
if (exists && isSymlink && targetMatches) {
|
|
442
|
+
items.push({
|
|
443
|
+
component: "core.system-cli-link",
|
|
444
|
+
id: "core.system-cli-link",
|
|
445
|
+
path: SYSTEM_CLI_LINK,
|
|
446
|
+
status: "ok",
|
|
447
|
+
message: `${SYSTEM_CLI_LINK} points to ${expected}`,
|
|
448
|
+
requiresSudo: false,
|
|
449
|
+
reloadRequired: false,
|
|
450
|
+
manualRequired: false,
|
|
451
|
+
fix: "none",
|
|
452
|
+
severity: "info",
|
|
453
|
+
});
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if (exists) {
|
|
457
|
+
const details = isSymlink
|
|
458
|
+
? `${SYSTEM_CLI_LINK} points to ${target}; expected ${expected}`
|
|
459
|
+
: `${SYSTEM_CLI_LINK} exists and is not a symlink`;
|
|
460
|
+
items.push({
|
|
461
|
+
component: "core.system-cli-link",
|
|
462
|
+
id: "core.system-cli-link",
|
|
463
|
+
path: SYSTEM_CLI_LINK,
|
|
464
|
+
status: "skipped",
|
|
465
|
+
message: `${SYSTEM_CLI_LINK} is reserved by another command`,
|
|
466
|
+
requiresSudo: false,
|
|
467
|
+
reloadRequired: false,
|
|
468
|
+
manualRequired: false,
|
|
469
|
+
fix: "none",
|
|
470
|
+
command,
|
|
471
|
+
details,
|
|
472
|
+
severity: "warning",
|
|
473
|
+
});
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
if (!apply || !sudoAvailable) {
|
|
477
|
+
items.push({
|
|
478
|
+
component: "core.system-cli-link",
|
|
479
|
+
id: "core.system-cli-link",
|
|
480
|
+
path: SYSTEM_CLI_LINK,
|
|
481
|
+
status: "skipped",
|
|
482
|
+
message: `${SYSTEM_CLI_LINK} is missing; repair will create it when privileged access is available`,
|
|
483
|
+
requiresSudo: false,
|
|
484
|
+
reloadRequired: false,
|
|
485
|
+
manualRequired: false,
|
|
486
|
+
fix: "none",
|
|
487
|
+
command,
|
|
488
|
+
details: `Create symlink: ${SYSTEM_CLI_LINK} -> ${expected}`,
|
|
489
|
+
severity: "info",
|
|
490
|
+
});
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
try {
|
|
494
|
+
createSystemCliSymlink(expected);
|
|
495
|
+
items.push({
|
|
496
|
+
component: "core.system-cli-link",
|
|
497
|
+
id: "core.system-cli-link",
|
|
498
|
+
path: SYSTEM_CLI_LINK,
|
|
499
|
+
status: "updated",
|
|
500
|
+
message: `Created ${SYSTEM_CLI_LINK} -> ${expected}`,
|
|
501
|
+
requiresSudo: false,
|
|
502
|
+
reloadRequired: false,
|
|
503
|
+
manualRequired: false,
|
|
504
|
+
fix: "none",
|
|
505
|
+
severity: "info",
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
catch (e) {
|
|
509
|
+
items.push({
|
|
510
|
+
component: "core.system-cli-link",
|
|
511
|
+
id: "core.system-cli-link",
|
|
512
|
+
path: SYSTEM_CLI_LINK,
|
|
513
|
+
status: "skipped",
|
|
514
|
+
message: `Failed to create ${SYSTEM_CLI_LINK}: ${e?.message || String(e)}`,
|
|
515
|
+
requiresSudo: false,
|
|
516
|
+
reloadRequired: false,
|
|
517
|
+
manualRequired: false,
|
|
518
|
+
fix: "none",
|
|
519
|
+
command,
|
|
520
|
+
details: `Expected symlink target: ${expected}`,
|
|
521
|
+
severity: "warning",
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
// ── Reconcile: Docker images ───────────────────────────────────────────────
|
|
526
|
+
function integrationKindsUsedByInstances() {
|
|
527
|
+
const kinds = new Set();
|
|
528
|
+
for (const instance of listInstances()) {
|
|
529
|
+
try {
|
|
530
|
+
const kind = resolveIntegrationKindFromMetadata(instance);
|
|
531
|
+
if (kind)
|
|
532
|
+
kinds.add(kind);
|
|
533
|
+
}
|
|
534
|
+
catch {
|
|
535
|
+
// Invalid/legacy instance identity is owned by migration or repair. The
|
|
536
|
+
// system reconciler must not guess an Integration from old fields.
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return kinds;
|
|
540
|
+
}
|
|
541
|
+
async function reconcileDockerImages(results, apply) {
|
|
542
|
+
const config = getCoreConfig();
|
|
543
|
+
if (config.service_manager !== "nomad") {
|
|
544
|
+
results.push({
|
|
545
|
+
component: "docker-images",
|
|
546
|
+
status: "skipped",
|
|
547
|
+
message: "Not using Nomad/Docker runtime",
|
|
548
|
+
reloadRequired: false,
|
|
549
|
+
manualRequired: false,
|
|
550
|
+
fix: "none",
|
|
551
|
+
severity: "info",
|
|
552
|
+
});
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
try {
|
|
556
|
+
execFileSync("docker", ["info"], { stdio: "ignore", timeout: 8000 });
|
|
557
|
+
}
|
|
558
|
+
catch (e) {
|
|
559
|
+
results.push({
|
|
560
|
+
component: "docker-images",
|
|
561
|
+
status: "skipped",
|
|
562
|
+
message: "Docker not available",
|
|
563
|
+
reloadRequired: false,
|
|
564
|
+
manualRequired: true,
|
|
565
|
+
fix: "manual",
|
|
566
|
+
severity: "warning",
|
|
567
|
+
details: e?.message || "Cannot connect to Docker daemon. Ensure Docker is installed and running.",
|
|
568
|
+
});
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
const usedIntegrationKinds = integrationKindsUsedByInstances();
|
|
572
|
+
for (const integration of listRegisteredIntegrations()) {
|
|
573
|
+
// Registration means Core knows how to integrate with an App; it does not
|
|
574
|
+
// mean the user chose to install that optional App. Always maintain the
|
|
575
|
+
// required baseline image, and maintain optional images only when a
|
|
576
|
+
// canonical instance actually uses that Integration.
|
|
577
|
+
const shouldMaintainImage = integration.manifest?.requiredForSetupReady === true
|
|
578
|
+
|| usedIntegrationKinds.has(integration.kind);
|
|
579
|
+
if (!shouldMaintainImage)
|
|
580
|
+
continue;
|
|
581
|
+
const catalogEntry = getIntegrationRuntimeEntry(integration.kind);
|
|
582
|
+
const expectedImage = catalogEntry?.image || catalogEntry?.defaultImage;
|
|
583
|
+
if (!expectedImage)
|
|
584
|
+
continue;
|
|
585
|
+
try {
|
|
586
|
+
execFileSync("docker", ["image", "inspect", expectedImage], { timeout: 10000, stdio: "ignore" });
|
|
587
|
+
results.push({
|
|
588
|
+
component: `docker.${integration.kind}`,
|
|
589
|
+
id: expectedImage,
|
|
590
|
+
status: "ok",
|
|
591
|
+
message: `Image ${expectedImage} present`,
|
|
592
|
+
reloadRequired: false,
|
|
593
|
+
manualRequired: false,
|
|
594
|
+
fix: "none",
|
|
595
|
+
severity: "info",
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
catch {
|
|
599
|
+
if (!apply) {
|
|
600
|
+
results.push({
|
|
601
|
+
component: `docker.${integration.kind}`,
|
|
602
|
+
id: expectedImage,
|
|
603
|
+
status: "skipped",
|
|
604
|
+
message: `Image ${expectedImage} missing`,
|
|
605
|
+
reloadRequired: false,
|
|
606
|
+
manualRequired: false,
|
|
607
|
+
fix: "docker-pull",
|
|
608
|
+
details: `Run: docker pull ${expectedImage}`,
|
|
609
|
+
severity: "warning",
|
|
610
|
+
});
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
try {
|
|
614
|
+
execFileSync("docker", ["pull", expectedImage], { timeout: 120000, stdio: "ignore" });
|
|
615
|
+
results.push({
|
|
616
|
+
component: `docker.${integration.kind}`,
|
|
617
|
+
id: expectedImage,
|
|
618
|
+
status: "updated",
|
|
619
|
+
message: `Pulled image ${expectedImage}`,
|
|
620
|
+
reloadRequired: false,
|
|
621
|
+
manualRequired: false,
|
|
622
|
+
fix: "none",
|
|
623
|
+
severity: "info",
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
catch (e) {
|
|
627
|
+
results.push({
|
|
628
|
+
component: `docker.${integration.kind}`,
|
|
629
|
+
id: expectedImage,
|
|
630
|
+
status: "error",
|
|
631
|
+
message: `Failed to pull ${expectedImage}: ${e?.message || "timeout"}`,
|
|
632
|
+
reloadRequired: false,
|
|
633
|
+
manualRequired: true,
|
|
634
|
+
fix: "docker-pull",
|
|
635
|
+
details: "Check network connectivity and Docker permissions.",
|
|
636
|
+
severity: "error",
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
// ── Main entry points ──────────────────────────────────────────────────────
|
|
643
|
+
function persistResult(result) {
|
|
644
|
+
try {
|
|
645
|
+
ensureDirHost(JISHUSHELL_HOME);
|
|
646
|
+
writeFileSync(RECONCILE_STATE_FILE, `${JSON.stringify(result, null, 2)}\n`, "utf-8");
|
|
647
|
+
chownToServiceUser(RECONCILE_STATE_FILE);
|
|
648
|
+
}
|
|
649
|
+
catch { }
|
|
650
|
+
}
|
|
651
|
+
function finalizeResult(items, sudoAvailable) {
|
|
652
|
+
const hasPendingSudoActions = items.some((item) => item.requiresSudo && item.status !== "ok" && item.status !== "updated");
|
|
653
|
+
const reloadRequired = items.some((item) => item.reloadRequired && item.status !== "ok");
|
|
654
|
+
const manualRequired = hasPendingSudoActions || items.some((item) => item.manualRequired && item.status !== "ok" && item.status !== "updated");
|
|
655
|
+
return {
|
|
656
|
+
timestamp: new Date().toISOString(),
|
|
657
|
+
items,
|
|
658
|
+
hasPendingSudoActions,
|
|
659
|
+
reloadRequired,
|
|
660
|
+
manualRequired,
|
|
661
|
+
canAutoReload: reloadRequired && !manualRequired && sudoAvailable,
|
|
662
|
+
command: getSystemReloadCommand(),
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
async function runSystemReconciliation(options) {
|
|
666
|
+
const items = [];
|
|
667
|
+
const sudoAvailable = hasSudoAccess();
|
|
668
|
+
reconcileExpectedFiles(items, options, sudoAvailable);
|
|
669
|
+
reconcileSystemCliLink(items, options.apply, sudoAvailable);
|
|
670
|
+
await reconcileDockerImages(items, options.apply);
|
|
671
|
+
const result = finalizeResult(items, sudoAvailable);
|
|
672
|
+
persistResult(result);
|
|
673
|
+
return result;
|
|
674
|
+
}
|
|
675
|
+
export async function inspectSystemDrift() {
|
|
676
|
+
return runSystemReconciliation({ apply: false });
|
|
677
|
+
}
|
|
678
|
+
export async function reconcileSystem() {
|
|
679
|
+
return runSystemReconciliation({ apply: true });
|
|
680
|
+
}
|
|
681
|
+
export async function startSystemReloadWithSudo(sudoPassword) {
|
|
682
|
+
if (!sudoPassword) {
|
|
683
|
+
throw new Error("请输入 sudo 密码");
|
|
684
|
+
}
|
|
685
|
+
if (process.platform === "darwin") {
|
|
686
|
+
const err = new Error("macOS 暂不支持从网页执行系统 reload,请在终端执行推荐命令。");
|
|
687
|
+
err.code = "SYSTEM_RELOAD_UNSUPPORTED";
|
|
688
|
+
throw err;
|
|
689
|
+
}
|
|
690
|
+
const target = resolveSystemReloadTarget();
|
|
691
|
+
if (!target) {
|
|
692
|
+
throw new Error(`找不到可执行的 JishuShell reload 命令:${getJishushellWrapper()}`);
|
|
693
|
+
}
|
|
694
|
+
const unit = `jishushell-web-reload-${process.pid}-${Date.now()}`;
|
|
695
|
+
let result = await runSudoAskpassCommand(sudoPassword, buildSystemdRunReloadArgs(unit, true, target), { timeoutMs: 20_000 });
|
|
696
|
+
if (result.code !== 0 && /(?:unrecognized|unknown|invalid) option.*collect|collect.*(?:unrecognized|unknown|invalid)/i.test(result.stderr)) {
|
|
697
|
+
result = await runSudoAskpassCommand(sudoPassword, buildSystemdRunReloadArgs(unit, false, target), { timeoutMs: 20_000 });
|
|
698
|
+
}
|
|
699
|
+
if (result.code !== 0) {
|
|
700
|
+
throw createSystemReloadSudoError(result);
|
|
701
|
+
}
|
|
702
|
+
return {
|
|
703
|
+
accepted: true,
|
|
704
|
+
command: target.displayCommand,
|
|
705
|
+
message: "系统 reload 已在后台启动,服务会短暂重启。",
|
|
706
|
+
state: getStoredReconcileState(),
|
|
707
|
+
unit,
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
//# sourceMappingURL=system-reconciler.js.map
|