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
|
@@ -1,723 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JishuShell-KB MCP shim — exposes the user's installed jishu-kb as a
|
|
3
|
-
* typed MCP toolset for OpenClaw.
|
|
4
|
-
*
|
|
5
|
-
* Why a shim, not direct MCP:
|
|
6
|
-
* jishu-kb speaks HTTP REST (`/api/kb/*`, `/api/admin/*`, `handbook.md`),
|
|
7
|
-
* not MCP. This shim translates a narrow tool surface into those REST calls
|
|
8
|
-
* and returns model-friendly text blocks or JSON summaries.
|
|
9
|
-
*
|
|
10
|
-
* Scope intentionally stays typed and bounded:
|
|
11
|
-
* - Read/search: list KBs, search, list documents, read handbook, read
|
|
12
|
-
* sanitized config
|
|
13
|
-
* - Write: create KBs, upload documents into a chosen KB
|
|
14
|
-
* - Dangerous delete operations require explicit confirmation arguments
|
|
15
|
-
* - No raw admin/provider passthrough: secrets and arbitrary provider edits
|
|
16
|
-
* remain outside the agent surface
|
|
17
|
-
*
|
|
18
|
-
* Wiring: the OpenClaw adapter writes this shim into
|
|
19
|
-
* `__mcp_shims__/jishukb/jishukb-shim.js` per instance and registers it under
|
|
20
|
-
* the stable `kb` server name.
|
|
21
|
-
*
|
|
22
|
-
* Non-secret config (baseUrl + default kbId + allowed upload roots) is baked into the
|
|
23
|
-
* source by `substituteJishukbShimPlaceholders` because OpenClaw scrubs env
|
|
24
|
-
* when spawning MCP subprocesses.
|
|
25
|
-
*
|
|
26
|
-
* Stdio framing: NDJSON JSON-RPC 2.0 (MCP standard). Pure Node builtins, no
|
|
27
|
-
* npm install needed inside the runtime image.
|
|
28
|
-
*/
|
|
29
|
-
export const JISHUKB_MCP_SHIM_VERSION = "0.2.0";
|
|
30
|
-
/** Default topK when the caller doesn't specify one. Mirrors the manifest
|
|
31
|
-
* `JISHU_KB_TOPK` default so the agent and the backend agree on page size. */
|
|
32
|
-
export const JISHUKB_DEFAULT_TOPK = 6;
|
|
33
|
-
/** Per-request upstream timeout. */
|
|
34
|
-
export const JISHUKB_FETCH_TIMEOUT_MS = 60_000;
|
|
35
|
-
/** Soft guard for upload memory use. */
|
|
36
|
-
export const JISHUKB_MAX_UPLOAD_BYTES = 30 * 1024 * 1024;
|
|
37
|
-
export const JISHUKB_MCP_SHIM_SOURCE = `#!/usr/bin/env node
|
|
38
|
-
// jishushell-jishukb-shim — generated, do not edit by hand.
|
|
39
|
-
// Source: src/services/runtime/mcp-shims/jishukb-shim.ts
|
|
40
|
-
|
|
41
|
-
const BASE_URL_LIT = "__JS_BASE_URL__";
|
|
42
|
-
const KB_ID_LIT = "__JS_KB_ID__";
|
|
43
|
-
const ALLOWED_UPLOAD_ROOTS_LIT = "__JS_ALLOWED_UPLOAD_ROOTS__";
|
|
44
|
-
|
|
45
|
-
const fs = require("node:fs");
|
|
46
|
-
const path = require("node:path");
|
|
47
|
-
|
|
48
|
-
const BASE_URL = (BASE_URL_LIT.startsWith("__JS_") ? (process.env.JISHUKB_BASE_URL || "") : BASE_URL_LIT).replace(/\\/+$/, "");
|
|
49
|
-
const KB_ID = KB_ID_LIT.startsWith("__JS_") ? trimString(process.env.JISHUKB_KB_ID || "") : trimString(KB_ID_LIT);
|
|
50
|
-
const ALLOWED_UPLOAD_ROOTS = (
|
|
51
|
-
ALLOWED_UPLOAD_ROOTS_LIT.startsWith("__JS_")
|
|
52
|
-
? JSON.parse(process.env.JISHUKB_ALLOWED_UPLOAD_ROOTS || "[]")
|
|
53
|
-
: JSON.parse(ALLOWED_UPLOAD_ROOTS_LIT)
|
|
54
|
-
).map((value) => path.resolve(String(value)));
|
|
55
|
-
const DEFAULT_TOPK = ${JISHUKB_DEFAULT_TOPK};
|
|
56
|
-
const FETCH_TIMEOUT = ${JISHUKB_FETCH_TIMEOUT_MS};
|
|
57
|
-
const MAX_UPLOAD_BYTES = ${JISHUKB_MAX_UPLOAD_BYTES};
|
|
58
|
-
const OPEN_UPLOAD_FLAGS = fs.constants.O_RDONLY
|
|
59
|
-
| (typeof fs.constants.O_NOFOLLOW === "number" ? fs.constants.O_NOFOLLOW : 0)
|
|
60
|
-
| (typeof fs.constants.O_NONBLOCK === "number" ? fs.constants.O_NONBLOCK : 0);
|
|
61
|
-
|
|
62
|
-
function envCheck() {
|
|
63
|
-
if (!BASE_URL) {
|
|
64
|
-
throw new Error("jishukb-shim: missing env: JISHUKB_BASE_URL");
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function trimString(raw) {
|
|
69
|
-
return typeof raw === "string" ? raw.trim() : "";
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function jsonText(value) {
|
|
73
|
-
return JSON.stringify(value, null, 2);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function clampTopK(raw) {
|
|
77
|
-
const n = Number(raw);
|
|
78
|
-
if (!Number.isFinite(n)) return DEFAULT_TOPK;
|
|
79
|
-
const i = Math.floor(n);
|
|
80
|
-
if (i < 1) return 1;
|
|
81
|
-
if (i > 20) return 20;
|
|
82
|
-
return i;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function defaultKbId(raw, toolName) {
|
|
86
|
-
const kbId = trimString(raw) || KB_ID;
|
|
87
|
-
if (!kbId) {
|
|
88
|
-
throw new Error(toolName + ": missing 'kbId' argument and no default KB is configured");
|
|
89
|
-
}
|
|
90
|
-
return kbId;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function requireKbId(raw, toolName) {
|
|
94
|
-
const kbId = trimString(raw);
|
|
95
|
-
if (!kbId) throw new Error(toolName + ": missing 'kbId' argument");
|
|
96
|
-
return kbId;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function requireConfirm(actual, expected, toolName, fieldName) {
|
|
100
|
-
if (trimString(actual) !== expected) {
|
|
101
|
-
throw new Error(toolName + ": confirmation field '" + fieldName + "' must exactly match '" + expected + "'");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function assertUploadRootsConfigured() {
|
|
106
|
-
if (!Array.isArray(ALLOWED_UPLOAD_ROOTS) || ALLOWED_UPLOAD_ROOTS.length === 0) {
|
|
107
|
-
throw new Error("jishukb-shim: missing configured upload roots");
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function sameInode(left, right) {
|
|
112
|
-
return !!left && !!right && left.dev === right.dev && left.ino === right.ino;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function assertStableUploadRead(opened, buf) {
|
|
116
|
-
const afterStat = fs.fstatSync(opened.fd);
|
|
117
|
-
if (!sameInode(opened.stat, afterStat)) {
|
|
118
|
-
throw new Error("kb_upload: file changed during read");
|
|
119
|
-
}
|
|
120
|
-
if (afterStat.size !== opened.stat.size || buf.length !== opened.stat.size) {
|
|
121
|
-
throw new Error("kb_upload: file size changed during read");
|
|
122
|
-
}
|
|
123
|
-
if (buf.length > MAX_UPLOAD_BYTES) {
|
|
124
|
-
throw new Error("kb_upload: file exceeds soft limit of " + MAX_UPLOAD_BYTES + " bytes");
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function readBoundedUploadBuffer(fd, size) {
|
|
129
|
-
if (!Number.isSafeInteger(size) || size < 0) {
|
|
130
|
-
throw new Error("kb_upload: invalid file size");
|
|
131
|
-
}
|
|
132
|
-
const buf = Buffer.alloc(size);
|
|
133
|
-
let offset = 0;
|
|
134
|
-
while (offset < size) {
|
|
135
|
-
const bytesRead = fs.readSync(fd, buf, offset, size - offset, offset);
|
|
136
|
-
if (bytesRead === 0) break;
|
|
137
|
-
offset += bytesRead;
|
|
138
|
-
}
|
|
139
|
-
return offset === size ? buf : buf.subarray(0, offset);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function findAllowedUploadRoot(absPath) {
|
|
143
|
-
for (const root of ALLOWED_UPLOAD_ROOTS) {
|
|
144
|
-
if (absPath === root || absPath.startsWith(root + path.sep)) {
|
|
145
|
-
return root;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function sanitizeBaseUrl(raw) {
|
|
152
|
-
const value = trimString(raw);
|
|
153
|
-
if (!value) return null;
|
|
154
|
-
try {
|
|
155
|
-
const parsed = new URL(value);
|
|
156
|
-
parsed.username = "";
|
|
157
|
-
parsed.password = "";
|
|
158
|
-
parsed.search = "";
|
|
159
|
-
parsed.hash = "";
|
|
160
|
-
return parsed.toString();
|
|
161
|
-
} catch {
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function openUploadFile(absPath) {
|
|
167
|
-
assertUploadRootsConfigured();
|
|
168
|
-
const input = trimString(absPath);
|
|
169
|
-
if (!input) throw new Error("kb_upload: missing 'path' argument");
|
|
170
|
-
if (!path.isAbsolute(input)) throw new Error("kb_upload: path must be absolute");
|
|
171
|
-
const normalized = path.resolve(input);
|
|
172
|
-
const lexicalRoot = findAllowedUploadRoot(normalized);
|
|
173
|
-
if (!lexicalRoot) {
|
|
174
|
-
throw new Error("kb_upload: path must stay under this instance's mounted files roots");
|
|
175
|
-
}
|
|
176
|
-
let fd;
|
|
177
|
-
try {
|
|
178
|
-
fd = fs.openSync(normalized, OPEN_UPLOAD_FLAGS);
|
|
179
|
-
} catch (error) {
|
|
180
|
-
if (error && (error.code === "ENOENT" || error.code === "ENOTDIR")) {
|
|
181
|
-
throw new Error("kb_upload: file not found: " + normalized);
|
|
182
|
-
}
|
|
183
|
-
if (error && (error.code === "ELOOP" || error.code === "EMLINK")) {
|
|
184
|
-
throw new Error("kb_upload: symlink targets are not allowed");
|
|
185
|
-
}
|
|
186
|
-
throw error;
|
|
187
|
-
}
|
|
188
|
-
try {
|
|
189
|
-
const realRoot = fs.realpathSync(lexicalRoot);
|
|
190
|
-
const realPath = fs.realpathSync(normalized);
|
|
191
|
-
if (!(realPath === realRoot || realPath.startsWith(realRoot + path.sep))) {
|
|
192
|
-
throw new Error("kb_upload: resolved path escapes this instance's mounted files roots");
|
|
193
|
-
}
|
|
194
|
-
const stat = fs.fstatSync(fd);
|
|
195
|
-
if (!stat.isFile()) throw new Error("kb_upload: not a regular file: " + realPath);
|
|
196
|
-
if (stat.nlink > 1) {
|
|
197
|
-
throw new Error("kb_upload: files with multiple hard links are not allowed");
|
|
198
|
-
}
|
|
199
|
-
if (stat.size > MAX_UPLOAD_BYTES) {
|
|
200
|
-
throw new Error("kb_upload: file exceeds soft limit of " + MAX_UPLOAD_BYTES + " bytes");
|
|
201
|
-
}
|
|
202
|
-
const pathStat = fs.statSync(realPath);
|
|
203
|
-
if (!sameInode(stat, pathStat)) {
|
|
204
|
-
throw new Error("kb_upload: file changed during validation");
|
|
205
|
-
}
|
|
206
|
-
return { absPath: realPath, stat, fd };
|
|
207
|
-
} catch (error) {
|
|
208
|
-
fs.closeSync(fd);
|
|
209
|
-
throw error;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
async function fetchWithTimeout(toolName, relativePath, options) {
|
|
214
|
-
envCheck();
|
|
215
|
-
const ctrl = new AbortController();
|
|
216
|
-
const timer = setTimeout(() => ctrl.abort(), FETCH_TIMEOUT);
|
|
217
|
-
try {
|
|
218
|
-
return await fetch(BASE_URL + relativePath, {
|
|
219
|
-
...options,
|
|
220
|
-
signal: ctrl.signal,
|
|
221
|
-
});
|
|
222
|
-
} catch (e) {
|
|
223
|
-
if (e && e.name === "AbortError") {
|
|
224
|
-
throw new Error(toolName + ": upstream timeout after " + Math.round(FETCH_TIMEOUT / 1000) + "s");
|
|
225
|
-
}
|
|
226
|
-
throw e;
|
|
227
|
-
} finally {
|
|
228
|
-
clearTimeout(timer);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
async function readJson(toolName, relativePath, options) {
|
|
233
|
-
const res = await fetchWithTimeout(toolName, relativePath, options);
|
|
234
|
-
if (!res.ok) {
|
|
235
|
-
const txt = await res.text();
|
|
236
|
-
throw new Error(toolName + ": upstream " + res.status + ": " + txt.slice(0, 400));
|
|
237
|
-
}
|
|
238
|
-
return await res.json();
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
async function readText(toolName, relativePath, options) {
|
|
242
|
-
const res = await fetchWithTimeout(toolName, relativePath, options);
|
|
243
|
-
if (!res.ok) {
|
|
244
|
-
const txt = await res.text();
|
|
245
|
-
throw new Error(toolName + ": upstream " + res.status + ": " + txt.slice(0, 400));
|
|
246
|
-
}
|
|
247
|
-
return await res.text();
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function normalizeChunksResponse(payload) {
|
|
251
|
-
const j = payload && typeof payload === "object" ? payload : {};
|
|
252
|
-
const rawChunks = Array.isArray(j.chunks) ? j.chunks
|
|
253
|
-
: Array.isArray(j.citations) ? j.citations
|
|
254
|
-
: Array.isArray(j.results) ? j.results
|
|
255
|
-
: Array.isArray(j.hits) ? j.hits
|
|
256
|
-
: [];
|
|
257
|
-
return rawChunks.map((raw, idx) => {
|
|
258
|
-
const item = raw && typeof raw === "object" ? raw : { text: String(raw ?? "") };
|
|
259
|
-
const src = item.source && typeof item.source === "object" ? item.source : {};
|
|
260
|
-
const title = src.title
|
|
261
|
-
|| src.filename
|
|
262
|
-
|| src.docId
|
|
263
|
-
|| item.docTitle
|
|
264
|
-
|| item.filename
|
|
265
|
-
|| item.docId
|
|
266
|
-
|| src.url
|
|
267
|
-
|| item.url
|
|
268
|
-
|| ("chunk#" + (idx + 1));
|
|
269
|
-
return {
|
|
270
|
-
...item,
|
|
271
|
-
source: {
|
|
272
|
-
...src,
|
|
273
|
-
title,
|
|
274
|
-
},
|
|
275
|
-
text: item.text || item.content || item.chunk || item.context || "",
|
|
276
|
-
score: item.score != null ? item.score : item.relevanceScore,
|
|
277
|
-
};
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
function fmtChunk(c, idx) {
|
|
282
|
-
const src = c.source || {};
|
|
283
|
-
const title = src.title || src.filename || src.docId || src.url || ("chunk#" + (idx + 1));
|
|
284
|
-
const scoreStr = c.score != null && Number.isFinite(Number(c.score))
|
|
285
|
-
? " [score " + Number(c.score).toFixed(3) + "]"
|
|
286
|
-
: "";
|
|
287
|
-
const body = (c.text || c.content || c.chunk || "").toString();
|
|
288
|
-
const capped = body.length > 1200 ? body.slice(0, 1200) + "…" : body;
|
|
289
|
-
return "[" + (idx + 1) + "] " + title + scoreStr + "\\n" + capped;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
function fmtSearchResult(chunks) {
|
|
293
|
-
if (!chunks.length) return "(no results)";
|
|
294
|
-
return chunks.map(fmtChunk).join("\\n\\n");
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function normalizeHeading(text) {
|
|
298
|
-
return trimString(text).toLowerCase().replace(/\\s+/g, " ");
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
function extractMarkdownSection(markdown, section) {
|
|
302
|
-
const headingRe = /^(#{1,6})\\s+(.+)$/gm;
|
|
303
|
-
const headings = [];
|
|
304
|
-
let match;
|
|
305
|
-
while ((match = headingRe.exec(markdown)) !== null) {
|
|
306
|
-
headings.push({
|
|
307
|
-
level: match[1].length,
|
|
308
|
-
title: trimString(match[2]),
|
|
309
|
-
index: match.index,
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
const wanted = normalizeHeading(section);
|
|
313
|
-
const idx = headings.findIndex((h) => normalizeHeading(h.title) === wanted);
|
|
314
|
-
if (idx < 0) {
|
|
315
|
-
return {
|
|
316
|
-
found: false,
|
|
317
|
-
headings: headings.map((h) => h.title),
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
const current = headings[idx];
|
|
321
|
-
let end = markdown.length;
|
|
322
|
-
for (let i = idx + 1; i < headings.length; i++) {
|
|
323
|
-
if (headings[i].level <= current.level) {
|
|
324
|
-
end = headings[i].index;
|
|
325
|
-
break;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
return {
|
|
329
|
-
found: true,
|
|
330
|
-
headings: headings.map((h) => h.title),
|
|
331
|
-
text: markdown.slice(current.index, end).trim(),
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
function sanitizeConfig(config) {
|
|
336
|
-
const cfg = config && typeof config === "object" ? config : {};
|
|
337
|
-
const generation = cfg.generation && typeof cfg.generation === "object" ? cfg.generation : {};
|
|
338
|
-
const retrieval = cfg.retrieval && typeof cfg.retrieval === "object" ? cfg.retrieval : {};
|
|
339
|
-
const embed = cfg.embed && typeof cfg.embed === "object" ? cfg.embed : {};
|
|
340
|
-
const rerank = cfg.rerank && typeof cfg.rerank === "object" ? cfg.rerank : {};
|
|
341
|
-
return {
|
|
342
|
-
version: cfg.version || null,
|
|
343
|
-
defaultKbId: KB_ID || null,
|
|
344
|
-
answerableGate: !!cfg.answerableGate,
|
|
345
|
-
dataDir: cfg.dataDir || null,
|
|
346
|
-
retrieval: {
|
|
347
|
-
topK: retrieval.topK ?? null,
|
|
348
|
-
candidatePool: retrieval.candidatePool ?? null,
|
|
349
|
-
rerankPool: retrieval.rerankPool ?? null,
|
|
350
|
-
rejectThreshold: retrieval.rejectThreshold ?? null,
|
|
351
|
-
chunkMode: retrieval.chunkMode || null,
|
|
352
|
-
parentChunkChars: retrieval.parentChunkChars ?? null,
|
|
353
|
-
childChunkChars: retrieval.childChunkChars ?? null,
|
|
354
|
-
},
|
|
355
|
-
embed: {
|
|
356
|
-
backend: embed.backend || null,
|
|
357
|
-
model: embed.model || null,
|
|
358
|
-
dim: embed.dim ?? null,
|
|
359
|
-
ollamaModel: embed.ollamaModel || null,
|
|
360
|
-
},
|
|
361
|
-
rerank: {
|
|
362
|
-
enabled: !!rerank.enabled,
|
|
363
|
-
external: !!rerank.external,
|
|
364
|
-
model: rerank.model || null,
|
|
365
|
-
},
|
|
366
|
-
generation: {
|
|
367
|
-
configured: !!(generation.baseUrl || generation.model || generation.apiKey),
|
|
368
|
-
baseUrl: sanitizeBaseUrl(generation.baseUrl),
|
|
369
|
-
model: generation.model || null,
|
|
370
|
-
apiKeyConfigured: !!generation.apiKey,
|
|
371
|
-
},
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
async function kbList() {
|
|
376
|
-
const payload = await readJson("kb_list", "/api/kb");
|
|
377
|
-
if (!Array.isArray(payload)) {
|
|
378
|
-
throw new Error("kb_list: upstream returned a non-array payload");
|
|
379
|
-
}
|
|
380
|
-
return payload.map((item) => ({
|
|
381
|
-
id: item?.id || null,
|
|
382
|
-
name: item?.name || null,
|
|
383
|
-
description: item?.description ?? null,
|
|
384
|
-
chunks: item?.chunks ?? null,
|
|
385
|
-
createdAt: item?.created_at ?? null,
|
|
386
|
-
}));
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
async function kbCreate(name, kbId, description) {
|
|
390
|
-
const trimmedName = trimString(name);
|
|
391
|
-
if (!trimmedName) throw new Error("kb_create: missing 'name' argument");
|
|
392
|
-
const payload = { name: trimmedName };
|
|
393
|
-
const explicitId = trimString(kbId);
|
|
394
|
-
const explicitDescription = trimString(description);
|
|
395
|
-
if (explicitId) payload.id = explicitId;
|
|
396
|
-
if (explicitDescription) payload.description = explicitDescription;
|
|
397
|
-
const result = await readJson("kb_create", "/api/kb", {
|
|
398
|
-
method: "POST",
|
|
399
|
-
headers: { "Content-Type": "application/json" },
|
|
400
|
-
body: JSON.stringify(payload),
|
|
401
|
-
});
|
|
402
|
-
return {
|
|
403
|
-
id: result?.id || payload.id || null,
|
|
404
|
-
name: result?.name || trimmedName,
|
|
405
|
-
description: result?.description ?? payload.description ?? null,
|
|
406
|
-
createdAt: result?.created_at ?? null,
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
async function kbSearch(query, kbIdRaw, topK) {
|
|
411
|
-
const trimmedQuery = trimString(query);
|
|
412
|
-
if (!trimmedQuery) throw new Error("kb_search: missing 'query' argument");
|
|
413
|
-
const kbId = defaultKbId(kbIdRaw, "kb_search");
|
|
414
|
-
const payload = await readJson(
|
|
415
|
-
"kb_search",
|
|
416
|
-
"/api/kb/" + encodeURIComponent(kbId) + "/search",
|
|
417
|
-
{
|
|
418
|
-
method: "POST",
|
|
419
|
-
headers: { "Content-Type": "application/json" },
|
|
420
|
-
body: JSON.stringify({ query: trimmedQuery, topK: clampTopK(topK) }),
|
|
421
|
-
},
|
|
422
|
-
);
|
|
423
|
-
return normalizeChunksResponse(payload);
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
async function kbUpload(absPath, kbIdRaw) {
|
|
427
|
-
const kbId = requireKbId(kbIdRaw, "kb_upload");
|
|
428
|
-
const checked = openUploadFile(absPath);
|
|
429
|
-
const filename = path.basename(checked.absPath);
|
|
430
|
-
let buf;
|
|
431
|
-
try {
|
|
432
|
-
buf = readBoundedUploadBuffer(checked.fd, checked.stat.size);
|
|
433
|
-
assertStableUploadRead(checked, buf);
|
|
434
|
-
} finally {
|
|
435
|
-
fs.closeSync(checked.fd);
|
|
436
|
-
}
|
|
437
|
-
const fd = new FormData();
|
|
438
|
-
fd.append("file", new Blob([buf]), filename);
|
|
439
|
-
const payload = await readJson(
|
|
440
|
-
"kb_upload",
|
|
441
|
-
"/api/kb/" + encodeURIComponent(kbId) + "/documents",
|
|
442
|
-
{
|
|
443
|
-
method: "POST",
|
|
444
|
-
body: fd,
|
|
445
|
-
},
|
|
446
|
-
);
|
|
447
|
-
const doc = payload?.doc && typeof payload.doc === "object" ? payload.doc : {};
|
|
448
|
-
return {
|
|
449
|
-
kbId,
|
|
450
|
-
documentId: doc.id || null,
|
|
451
|
-
title: doc.title || filename,
|
|
452
|
-
bytes: doc.bytes ?? checked.stat.size,
|
|
453
|
-
status: doc.status || null,
|
|
454
|
-
chunks: payload?.chunks ?? null,
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
async function kbListDocuments(kbIdRaw) {
|
|
459
|
-
const kbId = defaultKbId(kbIdRaw, "kb_list_documents");
|
|
460
|
-
const payload = await readJson(
|
|
461
|
-
"kb_list_documents",
|
|
462
|
-
"/api/kb/" + encodeURIComponent(kbId) + "/documents",
|
|
463
|
-
);
|
|
464
|
-
if (!Array.isArray(payload)) {
|
|
465
|
-
throw new Error("kb_list_documents: upstream returned a non-array payload");
|
|
466
|
-
}
|
|
467
|
-
return payload.map((item) => ({
|
|
468
|
-
id: item?.id || null,
|
|
469
|
-
kbId: item?.kb_id || kbId,
|
|
470
|
-
title: item?.title || null,
|
|
471
|
-
bytes: item?.bytes ?? null,
|
|
472
|
-
status: item?.status || null,
|
|
473
|
-
createdAt: item?.created_at ?? null,
|
|
474
|
-
}));
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
async function kbReadHandbook(section) {
|
|
478
|
-
const markdown = await readText("kb_read_handbook", "/handbook.md");
|
|
479
|
-
const wanted = trimString(section);
|
|
480
|
-
if (!wanted) return markdown;
|
|
481
|
-
const extracted = extractMarkdownSection(markdown, wanted);
|
|
482
|
-
if (!extracted.found) {
|
|
483
|
-
throw new Error(
|
|
484
|
-
"kb_read_handbook: section not found: " + wanted +
|
|
485
|
-
". Available sections: " + extracted.headings.join(", "),
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
return extracted.text;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
async function kbGetConfig() {
|
|
492
|
-
const payload = await readJson("kb_get_config", "/api/admin/config");
|
|
493
|
-
return sanitizeConfig(payload);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
async function kbDeleteDocument(kbIdRaw, documentIdRaw, confirmDocumentIdRaw) {
|
|
497
|
-
const kbId = requireKbId(kbIdRaw, "kb_delete_document");
|
|
498
|
-
const documentId = trimString(documentIdRaw);
|
|
499
|
-
if (!documentId) throw new Error("kb_delete_document: missing 'documentId' argument");
|
|
500
|
-
requireConfirm(confirmDocumentIdRaw, documentId, "kb_delete_document", "confirmDocumentId");
|
|
501
|
-
const payload = await readJson(
|
|
502
|
-
"kb_delete_document",
|
|
503
|
-
"/api/kb/" + encodeURIComponent(kbId) + "/documents/" + encodeURIComponent(documentId),
|
|
504
|
-
{ method: "DELETE" },
|
|
505
|
-
);
|
|
506
|
-
return {
|
|
507
|
-
ok: payload?.ok !== false,
|
|
508
|
-
kbId,
|
|
509
|
-
documentId,
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
async function kbDeleteKb(kbIdRaw, confirmKbIdRaw) {
|
|
514
|
-
const kbId = requireKbId(kbIdRaw, "kb_delete_kb");
|
|
515
|
-
requireConfirm(confirmKbIdRaw, kbId, "kb_delete_kb", "confirmKbId");
|
|
516
|
-
const payload = await readJson(
|
|
517
|
-
"kb_delete_kb",
|
|
518
|
-
"/api/kb/" + encodeURIComponent(kbId),
|
|
519
|
-
{ method: "DELETE" },
|
|
520
|
-
);
|
|
521
|
-
return {
|
|
522
|
-
ok: payload?.ok !== false,
|
|
523
|
-
kbId,
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
const TOOLS = [
|
|
528
|
-
{
|
|
529
|
-
name: "kb_list",
|
|
530
|
-
description: "List available knowledge bases. Use this before any write/delete operation or whenever the user names a KB but you need its exact id.",
|
|
531
|
-
inputSchema: { type: "object", properties: {} },
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
name: "kb_create",
|
|
535
|
-
description: "Create a new knowledge base. Use when the user asks to create a new KB before uploading or organizing documents.",
|
|
536
|
-
inputSchema: {
|
|
537
|
-
type: "object",
|
|
538
|
-
properties: {
|
|
539
|
-
name: { type: "string", description: "Human-readable KB name" },
|
|
540
|
-
id: { type: "string", description: "Optional explicit KB id" },
|
|
541
|
-
description: { type: "string", description: "Optional KB description" },
|
|
542
|
-
},
|
|
543
|
-
required: ["name"],
|
|
544
|
-
},
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
name: "kb_search",
|
|
548
|
-
description: "Search a knowledge base for chunks relevant to a question. Use whenever the user asks something likely answered by indexed documents. If kbId is omitted the default KB is used.",
|
|
549
|
-
inputSchema: {
|
|
550
|
-
type: "object",
|
|
551
|
-
properties: {
|
|
552
|
-
query: { type: "string", description: "The user question, in their original language" },
|
|
553
|
-
kbId: { type: "string", description: "Optional explicit KB id; defaults to the wired default KB" },
|
|
554
|
-
topK: { type: "number", description: "Optional number of chunks to retrieve (1-20, default 6)" },
|
|
555
|
-
},
|
|
556
|
-
required: ["query"],
|
|
557
|
-
},
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
name: "kb_upload",
|
|
561
|
-
description: "Upload and index a host-side file into a specific knowledge base. Use after drive_resolve_local_path. Only files under this instance's mounted files roots are accepted.",
|
|
562
|
-
inputSchema: {
|
|
563
|
-
type: "object",
|
|
564
|
-
properties: {
|
|
565
|
-
path: { type: "string", description: "Absolute host path from drive_resolve_local_path" },
|
|
566
|
-
kbId: { type: "string", description: "Target KB id (required for writes)" },
|
|
567
|
-
},
|
|
568
|
-
required: ["path", "kbId"],
|
|
569
|
-
},
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
name: "kb_list_documents",
|
|
573
|
-
description: "List indexed documents in a knowledge base. Use before document deletion or when the user asks what a KB currently contains.",
|
|
574
|
-
inputSchema: {
|
|
575
|
-
type: "object",
|
|
576
|
-
properties: {
|
|
577
|
-
kbId: { type: "string", description: "Optional KB id; defaults to the wired default KB" },
|
|
578
|
-
},
|
|
579
|
-
},
|
|
580
|
-
},
|
|
581
|
-
{
|
|
582
|
-
name: "kb_read_handbook",
|
|
583
|
-
description: "Read the JishuShell-KB handbook. Use this to answer how the KB settings work or what a handbook section says. Section matching uses exact heading text after whitespace normalization.",
|
|
584
|
-
inputSchema: {
|
|
585
|
-
type: "object",
|
|
586
|
-
properties: {
|
|
587
|
-
section: { type: "string", description: "Optional exact handbook heading to extract" },
|
|
588
|
-
},
|
|
589
|
-
},
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
name: "kb_get_config",
|
|
593
|
-
description: "Read a sanitized summary of the current JishuShell-KB configuration. Secrets are redacted; this is safe for explaining retrieval/model settings to the user.",
|
|
594
|
-
inputSchema: { type: "object", properties: {} },
|
|
595
|
-
},
|
|
596
|
-
{
|
|
597
|
-
name: "kb_delete_document",
|
|
598
|
-
description: "Delete a document from a specific knowledge base. Only use after explicit user confirmation. The confirmation field must exactly equal the target document id.",
|
|
599
|
-
inputSchema: {
|
|
600
|
-
type: "object",
|
|
601
|
-
properties: {
|
|
602
|
-
kbId: { type: "string", description: "Target KB id" },
|
|
603
|
-
documentId: { type: "string", description: "Document id to delete" },
|
|
604
|
-
confirmDocumentId: { type: "string", description: "Must exactly equal documentId" },
|
|
605
|
-
},
|
|
606
|
-
required: ["kbId", "documentId", "confirmDocumentId"],
|
|
607
|
-
},
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
name: "kb_delete_kb",
|
|
611
|
-
description: "Delete an entire knowledge base. Only use after explicit user confirmation. The confirmation field must exactly equal the target kbId.",
|
|
612
|
-
inputSchema: {
|
|
613
|
-
type: "object",
|
|
614
|
-
properties: {
|
|
615
|
-
kbId: { type: "string", description: "KB id to delete" },
|
|
616
|
-
confirmKbId: { type: "string", description: "Must exactly equal kbId" },
|
|
617
|
-
},
|
|
618
|
-
required: ["kbId", "confirmKbId"],
|
|
619
|
-
},
|
|
620
|
-
},
|
|
621
|
-
];
|
|
622
|
-
|
|
623
|
-
function reply(id, result, error) {
|
|
624
|
-
const msg = { jsonrpc: "2.0", id: id };
|
|
625
|
-
if (error) msg.error = { code: -32603, message: error.message || String(error) };
|
|
626
|
-
else msg.result = result;
|
|
627
|
-
process.stdout.write(JSON.stringify(msg) + "\\n");
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
async function handle(req) {
|
|
631
|
-
const { id, method, params } = req;
|
|
632
|
-
try {
|
|
633
|
-
if (method === "initialize") {
|
|
634
|
-
reply(id, {
|
|
635
|
-
protocolVersion: "2024-11-05",
|
|
636
|
-
capabilities: { tools: {} },
|
|
637
|
-
serverInfo: { name: "jishukb-shim", version: ${JSON.stringify(JISHUKB_MCP_SHIM_VERSION)} },
|
|
638
|
-
});
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
if (method === "tools/list") {
|
|
642
|
-
reply(id, { tools: TOOLS });
|
|
643
|
-
return;
|
|
644
|
-
}
|
|
645
|
-
if (method === "tools/call") {
|
|
646
|
-
const tool = params?.name;
|
|
647
|
-
const a = params?.arguments || {};
|
|
648
|
-
if (tool === "kb_list") {
|
|
649
|
-
reply(id, { content: [{ type: "text", text: jsonText(await kbList()) }] });
|
|
650
|
-
} else if (tool === "kb_create") {
|
|
651
|
-
reply(id, { content: [{ type: "text", text: jsonText(await kbCreate(a.name, a.id, a.description)) }] });
|
|
652
|
-
} else if (tool === "kb_search") {
|
|
653
|
-
reply(id, { content: [{ type: "text", text: fmtSearchResult(await kbSearch(a.query, a.kbId, a.topK)) }] });
|
|
654
|
-
} else if (tool === "kb_upload") {
|
|
655
|
-
const result = await kbUpload(a.path, a.kbId);
|
|
656
|
-
reply(id, {
|
|
657
|
-
content: [{ type: "text", text:
|
|
658
|
-
"✅ indexed into KB " + result.kbId +
|
|
659
|
-
": " + result.title +
|
|
660
|
-
" (documentId=" + (result.documentId || "?") +
|
|
661
|
-
", bytes=" + result.bytes +
|
|
662
|
-
", chunks=" + (result.chunks != null ? result.chunks : "?") + ")"
|
|
663
|
-
}],
|
|
664
|
-
});
|
|
665
|
-
} else if (tool === "kb_list_documents") {
|
|
666
|
-
reply(id, { content: [{ type: "text", text: jsonText(await kbListDocuments(a.kbId)) }] });
|
|
667
|
-
} else if (tool === "kb_read_handbook") {
|
|
668
|
-
reply(id, { content: [{ type: "text", text: await kbReadHandbook(a.section) }] });
|
|
669
|
-
} else if (tool === "kb_get_config") {
|
|
670
|
-
reply(id, { content: [{ type: "text", text: jsonText(await kbGetConfig()) }] });
|
|
671
|
-
} else if (tool === "kb_delete_document") {
|
|
672
|
-
reply(id, { content: [{ type: "text", text: jsonText(await kbDeleteDocument(a.kbId, a.documentId, a.confirmDocumentId)) }] });
|
|
673
|
-
} else if (tool === "kb_delete_kb") {
|
|
674
|
-
reply(id, { content: [{ type: "text", text: jsonText(await kbDeleteKb(a.kbId, a.confirmKbId)) }] });
|
|
675
|
-
} else {
|
|
676
|
-
throw new Error("unknown tool: " + tool);
|
|
677
|
-
}
|
|
678
|
-
return;
|
|
679
|
-
}
|
|
680
|
-
if (method === "notifications/initialized") {
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
if (typeof method === "string" && method.startsWith("notifications/")) {
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
if (id !== undefined) {
|
|
687
|
-
reply(id, null, new Error("method not implemented: " + method));
|
|
688
|
-
}
|
|
689
|
-
} catch (e) {
|
|
690
|
-
reply(id, null, e);
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
let inbuf = "";
|
|
695
|
-
process.stdin.setEncoding("utf-8");
|
|
696
|
-
process.stdin.on("data", (chunk) => {
|
|
697
|
-
inbuf += chunk;
|
|
698
|
-
let idx;
|
|
699
|
-
while ((idx = inbuf.indexOf("\\n")) >= 0) {
|
|
700
|
-
const line = inbuf.slice(0, idx).trim();
|
|
701
|
-
inbuf = inbuf.slice(idx + 1);
|
|
702
|
-
if (!line) continue;
|
|
703
|
-
let req;
|
|
704
|
-
try { req = JSON.parse(line); } catch { continue; }
|
|
705
|
-
void handle(req);
|
|
706
|
-
}
|
|
707
|
-
});
|
|
708
|
-
process.stdin.on("end", () => process.exit(0));
|
|
709
|
-
`;
|
|
710
|
-
/**
|
|
711
|
-
* Substitute baked-in NON-SECRET values into the shim source.
|
|
712
|
-
*
|
|
713
|
-
* Same pattern as `substituteAnythingllmShimPlaceholders` — done at install
|
|
714
|
-
* time because OpenClaw scrubs env on MCP subprocess spawn.
|
|
715
|
-
*/
|
|
716
|
-
export function substituteJishukbShimPlaceholders(params) {
|
|
717
|
-
const escapeStr = (s) => s.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
718
|
-
return JISHUKB_MCP_SHIM_SOURCE
|
|
719
|
-
.replace(/__JS_BASE_URL__/g, escapeStr(params.baseUrl))
|
|
720
|
-
.replace(/__JS_KB_ID__/g, escapeStr(params.kbId || ""))
|
|
721
|
-
.replace(/__JS_ALLOWED_UPLOAD_ROOTS__/g, escapeStr(JSON.stringify(params.allowedUploadRoots)));
|
|
722
|
-
}
|
|
723
|
-
//# sourceMappingURL=jishukb-shim.js.map
|