jishushell 0.6.18 → 0.7.3
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 +1 -0
- package/apps/browserless-chromium-container.yaml +1 -0
- package/apps/filebrowser-container.yaml +1 -0
- package/apps/hermes-container.yaml +1 -7
- package/apps/immich-container-lite.yaml +337 -0
- package/apps/immich-container.yaml +371 -0
- package/apps/jishu-kb-container.yaml +26 -21
- package/apps/ollama-binary.yaml +1 -0
- package/apps/ollama-cpu-container.yaml +1 -0
- package/apps/ollama-with-hollama-binary.yaml +2 -0
- package/apps/openclaw-binary.yaml +4 -8
- package/apps/openclaw-container.yaml +1 -7
- package/apps/openclaw-with-ollama-container.yaml +1 -0
- package/apps/openclaw-with-searxng-container.yaml +20 -0
- package/apps/searxng-container.yaml +20 -0
- package/apps/weknora-container.yaml +5 -0
- package/dependencies/jishushell-panel-0.7.3.tgz +0 -0
- package/dist/cli/core.js +1 -1
- package/dist/cli/core.js.map +1 -1
- package/dist/cli/doctor.js +96 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/config.d.ts +9 -1
- package/dist/config.js +72 -2
- package/dist/config.js.map +1 -1
- package/dist/install.js +60 -19
- package/dist/install.js.map +1 -1
- package/dist/routes/admin.d.ts +2 -0
- package/dist/routes/admin.js +72 -0
- package/dist/routes/admin.js.map +1 -0
- package/dist/routes/docker.d.ts +2 -0
- package/dist/routes/docker.js +58 -0
- package/dist/routes/docker.js.map +1 -0
- package/dist/routes/file-mounts.js +5 -8
- package/dist/routes/file-mounts.js.map +1 -1
- package/dist/routes/instances.d.ts +0 -14
- package/dist/routes/instances.js +44 -1184
- package/dist/routes/instances.js.map +1 -1
- package/dist/server.d.ts +6 -0
- package/dist/server.js +53 -20
- package/dist/server.js.map +1 -1
- package/dist/services/app-common/catalog-service.js +15 -5
- package/dist/services/app-common/catalog-service.js.map +1 -1
- package/dist/services/app-common/delete-service.js +5 -0
- package/dist/services/app-common/delete-service.js.map +1 -1
- package/dist/services/app-common/instance-store.js +3 -0
- package/dist/services/app-common/instance-store.js.map +1 -1
- package/dist/services/app-common/lifecycle-service.js +12 -4
- package/dist/services/app-common/lifecycle-service.js.map +1 -1
- package/dist/services/app-common/ownership.d.ts +3 -0
- package/dist/services/app-common/ownership.js +11 -0
- package/dist/services/app-common/ownership.js.map +1 -0
- package/dist/services/app-common/runtime-facts.js +2 -0
- package/dist/services/app-common/runtime-facts.js.map +1 -1
- package/dist/services/app-common/spec-materializer.d.ts +0 -1
- package/dist/services/app-common/spec-materializer.js +21 -87
- package/dist/services/app-common/spec-materializer.js.map +1 -1
- package/dist/services/app-common/status-refresh.js +25 -13
- package/dist/services/app-common/status-refresh.js.map +1 -1
- package/dist/services/app-modules/browserless/routes.js +5 -3
- package/dist/services/app-modules/browserless/routes.js.map +1 -1
- package/dist/services/capabilities/contract.d.ts +1 -2
- package/dist/services/capabilities/contract.js +0 -10
- package/dist/services/capabilities/contract.js.map +1 -1
- package/dist/services/capabilities/endpoint-validator.js +0 -1
- package/dist/services/capabilities/endpoint-validator.js.map +1 -1
- package/dist/services/capabilities/health.js +1 -1
- package/dist/services/capabilities/health.js.map +1 -1
- package/dist/services/capability-proxy/http.d.ts +7 -0
- package/dist/services/capability-proxy/http.js +555 -0
- package/dist/services/capability-proxy/http.js.map +1 -0
- package/dist/services/capability-proxy/terminal.d.ts +4 -0
- package/dist/services/capability-proxy/terminal.js +179 -0
- package/dist/services/capability-proxy/terminal.js.map +1 -0
- package/dist/services/connections/admin.js +19 -9
- package/dist/services/connections/admin.js.map +1 -1
- package/dist/services/connections/apply.d.ts +3 -9
- package/dist/services/connections/apply.js +0 -29
- package/dist/services/connections/apply.js.map +1 -1
- package/dist/services/connections/transactor.js +2 -2
- package/dist/services/connections/transactor.js.map +1 -1
- package/dist/services/files/bootstrap.d.ts +7 -0
- package/dist/services/files/bootstrap.js +16 -0
- package/dist/services/files/bootstrap.js.map +1 -0
- package/dist/services/files/photos/upload-page.d.ts +2 -0
- package/dist/services/files/photos/upload-page.js +248 -0
- package/dist/services/files/photos/upload-page.js.map +1 -0
- package/dist/services/files/photos/upload-store.d.ts +74 -0
- package/dist/services/files/photos/upload-store.js +432 -0
- package/dist/services/files/photos/upload-store.js.map +1 -0
- package/dist/services/http/proxy-utils.d.ts +7 -0
- package/dist/services/http/proxy-utils.js +29 -0
- package/dist/services/http/proxy-utils.js.map +1 -0
- package/dist/services/http/request-utils.d.ts +3 -0
- package/dist/services/http/request-utils.js +23 -0
- package/dist/services/http/request-utils.js.map +1 -0
- package/dist/services/instances/manager.d.ts +6 -5
- package/dist/services/instances/manager.js +45 -51
- package/dist/services/instances/manager.js.map +1 -1
- package/dist/services/instances/pairing.d.ts +17 -0
- package/dist/services/instances/pairing.js +53 -0
- package/dist/services/instances/pairing.js.map +1 -0
- package/dist/services/instances/status.d.ts +2 -0
- package/dist/services/instances/status.js +11 -0
- package/dist/services/instances/status.js.map +1 -0
- package/dist/services/integrations/hermes/integration.d.ts +1 -1
- package/dist/services/integrations/hermes/integration.js +7 -8
- package/dist/services/integrations/hermes/integration.js.map +1 -1
- package/dist/services/integrations/immich/client.d.ts +93 -0
- package/dist/services/integrations/immich/client.js +458 -0
- package/dist/services/integrations/immich/client.js.map +1 -0
- package/dist/services/integrations/immich/config.d.ts +15 -0
- package/dist/services/integrations/immich/config.js +178 -0
- package/dist/services/integrations/immich/config.js.map +1 -0
- package/dist/services/integrations/immich/discovery.d.ts +9 -0
- package/dist/services/integrations/immich/discovery.js +101 -0
- package/dist/services/integrations/immich/discovery.js.map +1 -0
- package/dist/services/integrations/immich/gallery-renderer.d.ts +5 -0
- package/dist/services/integrations/immich/gallery-renderer.js +150 -0
- package/dist/services/integrations/immich/gallery-renderer.js.map +1 -0
- package/dist/services/integrations/immich/immich-shim.d.ts +11 -0
- package/dist/services/integrations/immich/immich-shim.js +439 -0
- package/dist/services/integrations/immich/immich-shim.js.map +1 -0
- package/dist/services/integrations/immich/integration.d.ts +18 -0
- package/dist/services/integrations/immich/integration.js +64 -0
- package/dist/services/integrations/immich/integration.js.map +1 -0
- package/dist/services/integrations/immich/photo-library.d.ts +4 -0
- package/dist/services/integrations/immich/photo-library.js +63 -0
- package/dist/services/integrations/immich/photo-library.js.map +1 -0
- package/dist/services/integrations/immich/review-executor.d.ts +3 -0
- package/dist/services/integrations/immich/review-executor.js +41 -0
- package/dist/services/integrations/immich/review-executor.js.map +1 -0
- package/dist/services/integrations/immich/review-session-service.d.ts +27 -0
- package/dist/services/integrations/immich/review-session-service.js +206 -0
- package/dist/services/integrations/immich/review-session-service.js.map +1 -0
- package/dist/services/integrations/immich/review-store.d.ts +47 -0
- package/dist/services/integrations/immich/review-store.js +347 -0
- package/dist/services/integrations/immich/review-store.js.map +1 -0
- package/dist/services/integrations/immich/routes.d.ts +7 -0
- package/dist/services/integrations/immich/routes.js +363 -0
- package/dist/services/integrations/immich/routes.js.map +1 -0
- package/dist/services/integrations/immich/types.d.ts +186 -0
- package/dist/services/integrations/immich/types.js +2 -0
- package/dist/services/integrations/immich/types.js.map +1 -0
- package/dist/services/integrations/index.d.ts +1 -0
- package/dist/services/integrations/index.js +1 -0
- package/dist/services/integrations/index.js.map +1 -1
- package/dist/services/integrations/installable/installers/integration.js +113 -7
- package/dist/services/integrations/installable/installers/integration.js.map +1 -1
- package/dist/services/integrations/jishukb/integration.d.ts +3 -1
- package/dist/services/integrations/jishukb/integration.js +121 -10
- package/dist/services/integrations/jishukb/integration.js.map +1 -1
- package/dist/services/integrations/openclaw/integration.d.ts +21 -7
- package/dist/services/integrations/openclaw/integration.js +385 -158
- package/dist/services/integrations/openclaw/integration.js.map +1 -1
- package/dist/services/integrations/openclaw/jishukb-native-mcp.d.ts +58 -0
- package/dist/services/integrations/openclaw/jishukb-native-mcp.js +373 -0
- package/dist/services/integrations/openclaw/jishukb-native-mcp.js.map +1 -0
- package/dist/services/integrations/openclaw/jishukb-shim.d.ts +8 -4
- package/dist/services/integrations/openclaw/jishukb-shim.js +624 -17
- package/dist/services/integrations/openclaw/jishukb-shim.js.map +1 -1
- package/dist/services/integrations/openclaw/mcporter.d.ts +13 -0
- package/dist/services/integrations/openclaw/mcporter.js +31 -0
- package/dist/services/integrations/openclaw/mcporter.js.map +1 -1
- package/dist/services/integrations/openclaw/native-mcp.d.ts +48 -0
- package/dist/services/integrations/openclaw/native-mcp.js +125 -0
- package/dist/services/integrations/openclaw/native-mcp.js.map +1 -0
- package/dist/services/integrations/openclaw/routes.js +4 -1
- package/dist/services/integrations/openclaw/routes.js.map +1 -1
- package/dist/services/integrations/types.d.ts +5 -17
- package/dist/services/repair/runtime-repair.js +68 -1
- package/dist/services/repair/runtime-repair.js.map +1 -1
- package/dist/services/runtime/docker-network.d.ts +8 -0
- package/dist/services/runtime/docker-network.js +123 -0
- package/dist/services/runtime/docker-network.js.map +1 -0
- package/dist/services/runtime/driver-registry.d.ts +4 -0
- package/dist/services/runtime/driver-registry.js.map +1 -1
- package/dist/services/runtime/drivers/nomad.d.ts +1 -0
- package/dist/services/runtime/drivers/nomad.js +35 -5
- package/dist/services/runtime/drivers/nomad.js.map +1 -1
- package/dist/services/runtime/service-manager.d.ts +2 -0
- package/dist/services/runtime/service-manager.js +18 -0
- package/dist/services/runtime/service-manager.js.map +1 -0
- package/dist/services/runtime/types.d.ts +1 -0
- package/dist/services/runtime/workload-compiler.js +29 -4
- package/dist/services/runtime/workload-compiler.js.map +1 -1
- package/dist/services/setup/setup-manager.js +29 -73
- package/dist/services/setup/setup-manager.js.map +1 -1
- package/dist/services/system/runtime-ownership.d.ts +36 -0
- package/dist/services/system/runtime-ownership.js +250 -0
- package/dist/services/system/runtime-ownership.js.map +1 -0
- package/dist/services/system/system-reconciler.js +53 -0
- package/dist/services/system/system-reconciler.js.map +1 -1
- package/dist/types.d.ts +19 -3
- package/dist/utils/path-safety.js +1 -1
- package/dist/utils/service-user.d.ts +13 -0
- package/dist/utils/service-user.js +129 -0
- package/dist/utils/service-user.js.map +1 -0
- package/install/jishu-install.sh +0 -1
- package/node_modules/brace-expansion/dist/commonjs/index.js +24 -14
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +24 -14
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +2 -2
- package/node_modules/fast-uri/index.js +1 -1
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/security.test.js +28 -0
- package/node_modules/fastify/SECURITY.md +1 -1
- package/node_modules/fastify/SPONSORS.md +6 -4
- package/node_modules/fastify/docs/Guides/Database.md +0 -28
- package/node_modules/fastify/docs/Guides/Ecosystem.md +13 -2
- package/node_modules/fastify/docs/Guides/Serverless.md +2 -2
- package/node_modules/fastify/docs/Guides/Write-Plugin.md +1 -1
- package/node_modules/fastify/docs/Reference/Encapsulation.md +27 -26
- package/node_modules/fastify/docs/Reference/Errors.md +10 -4
- package/node_modules/fastify/docs/Reference/HTTP2.md +10 -10
- package/node_modules/fastify/docs/Reference/Hooks.md +4 -4
- package/node_modules/fastify/docs/Reference/Index.md +14 -16
- package/node_modules/fastify/docs/Reference/LTS.md +12 -13
- package/node_modules/fastify/docs/Reference/Lifecycle.md +9 -8
- package/node_modules/fastify/docs/Reference/Logging.md +44 -39
- package/node_modules/fastify/docs/Reference/Middleware.md +21 -25
- package/node_modules/fastify/docs/Reference/Principles.md +2 -2
- package/node_modules/fastify/docs/Reference/Reply.md +6 -1
- package/node_modules/fastify/docs/Reference/Request.md +27 -16
- package/node_modules/fastify/docs/Reference/Routes.md +5 -2
- package/node_modules/fastify/docs/Reference/Server.md +31 -3
- package/node_modules/fastify/docs/Reference/Type-Providers.md +29 -5
- package/node_modules/fastify/docs/Reference/Validation-and-Serialization.md +15 -2
- package/node_modules/fastify/docs/Reference/Warnings.md +7 -6
- package/node_modules/fastify/eslint.config.js +7 -2
- package/node_modules/fastify/fastify.d.ts +8 -3
- package/node_modules/fastify/fastify.js +43 -14
- package/node_modules/fastify/lib/content-type-parser.js +13 -1
- package/node_modules/fastify/lib/decorate.js +11 -3
- package/node_modules/fastify/lib/error-handler.js +4 -3
- package/node_modules/fastify/lib/error-serializer.js +59 -59
- package/node_modules/fastify/lib/errors.js +16 -1
- package/node_modules/fastify/lib/four-oh-four.js +14 -9
- package/node_modules/fastify/lib/handle-request.js +11 -5
- package/node_modules/fastify/lib/plugin-override.js +2 -1
- package/node_modules/fastify/lib/plugin-utils.js +5 -5
- package/node_modules/fastify/lib/reply.js +63 -8
- package/node_modules/fastify/lib/request.js +14 -4
- package/node_modules/fastify/lib/route.js +20 -6
- package/node_modules/fastify/lib/schema-controller.js +1 -1
- package/node_modules/fastify/lib/schemas.js +37 -30
- package/node_modules/fastify/lib/symbols.js +3 -1
- package/node_modules/fastify/lib/validation.js +1 -13
- package/node_modules/fastify/lib/warnings.js +3 -3
- package/node_modules/fastify/package.json +13 -15
- package/node_modules/fastify/scripts/validate-ecosystem-links.js +1 -0
- package/node_modules/fastify/test/bundler/esbuild/package.json +1 -1
- package/node_modules/fastify/test/close-pipelining.test.js +1 -2
- package/node_modules/fastify/test/custom-http-server.test.js +38 -0
- package/node_modules/fastify/test/decorator-instance-properties.test.js +63 -0
- package/node_modules/fastify/test/diagnostics-channel/async-error-handler.test.js +74 -0
- package/node_modules/fastify/test/hooks.test.js +23 -0
- package/node_modules/fastify/test/http-methods/get.test.js +1 -1
- package/node_modules/fastify/test/http2/plain.test.js +135 -0
- package/node_modules/fastify/test/http2/secure-with-fallback.test.js +1 -1
- package/node_modules/fastify/test/https/https.test.js +1 -2
- package/node_modules/fastify/test/internals/errors.test.js +31 -1
- package/node_modules/fastify/test/internals/plugin.test.js +3 -1
- package/node_modules/fastify/test/internals/request.test.js +27 -3
- package/node_modules/fastify/test/internals/schema-controller-perf.test.js +33 -0
- package/node_modules/fastify/test/logger/logging.test.js +18 -1
- package/node_modules/fastify/test/logger/options.test.js +38 -1
- package/node_modules/fastify/test/reply-error.test.js +1 -1
- package/node_modules/fastify/test/reply-trailers.test.js +70 -0
- package/node_modules/fastify/test/request-media-type.test.js +105 -0
- package/node_modules/fastify/test/route-prefix.test.js +34 -0
- package/node_modules/fastify/test/router-options.test.js +222 -11
- package/node_modules/fastify/test/schema-serialization.test.js +108 -0
- package/node_modules/fastify/test/schema-validation.test.js +24 -0
- package/node_modules/fastify/test/scripts/validate-ecosystem-links.test.js +40 -57
- package/node_modules/fastify/test/throw.test.js +14 -0
- package/node_modules/fastify/test/trust-proxy.test.js +21 -0
- package/node_modules/fastify/test/types/content-type-parser.tst.ts +70 -0
- package/node_modules/fastify/test/types/{decorate-request-reply.test-d.ts → decorate-request-reply.tst.ts} +4 -4
- package/node_modules/fastify/test/types/{dummy-plugin.ts → dummy-plugin.mts} +1 -1
- package/node_modules/fastify/test/types/errors.tst.ts +91 -0
- package/node_modules/fastify/test/types/fastify.tst.ts +351 -0
- package/node_modules/fastify/test/types/hooks.tst.ts +578 -0
- package/node_modules/fastify/test/types/instance.tst.ts +597 -0
- package/node_modules/fastify/test/types/{logger.test-d.ts → logger.tst.ts} +61 -62
- package/node_modules/fastify/test/types/plugin.tst.ts +96 -0
- package/node_modules/fastify/test/types/register.tst.ts +245 -0
- package/node_modules/fastify/test/types/reply.tst.ts +297 -0
- package/node_modules/fastify/test/types/request.tst.ts +199 -0
- package/node_modules/fastify/test/types/route.tst.ts +576 -0
- package/node_modules/fastify/test/types/{schema.test-d.ts → schema.tst.ts} +22 -22
- package/node_modules/fastify/test/types/{serverFactory.test-d.ts → serverFactory.tst.ts} +4 -4
- package/node_modules/fastify/test/types/tsconfig.json +9 -0
- package/node_modules/fastify/test/types/{type-provider.test-d.ts → type-provider.tst.ts} +256 -250
- package/node_modules/fastify/test/types/using.tst.ts +14 -0
- package/node_modules/fastify/types/errors.d.ts +3 -0
- package/node_modules/fastify/types/request.d.ts +23 -2
- package/node_modules/jishushell-panel/output/public/assets/{ApiKeyField-NKcbHjNz.js → ApiKeyField-Ce5d1xna.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{Dashboard-Da1fL38t.js → Dashboard-BXame3yg.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{HermesChatPanel-DZvmYsoh.js → HermesChatPanel-BHZtPCJd.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{HermesConfigForm-BLUWlKwm.js → HermesConfigForm-CB3GbNX9.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{InitPassword-BAKsshzk.js → InitPassword-Boab9F6g.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/InstanceDetail-DrIWCqo-.js +14 -0
- package/node_modules/jishushell-panel/output/public/assets/{Login-DHeOmwI8.js → Login-CzpOkNau.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/NewInstance-CANXyCcL.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/{ProviderRecommendations-H0ByEYF0.js → ProviderRecommendations-BABo9VOC.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/Settings-CKp5XxFh.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/Setup-C7xVDPow.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/{WeixinLoginPanel-D-T6BxkQ.js → WeixinLoginPanel-B765Xz4C.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{index-ERt6_ngA.js → index-Bs6DSbiR.js} +6 -6
- package/node_modules/jishushell-panel/output/public/assets/{registry-DF93EzIb.js → registry-sWIZsIEF.js} +2 -2
- package/node_modules/jishushell-panel/output/public/assets/{usePolling-DeoThIQn.js → usePolling-D4IDOQd_.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/vendor-i18n-Df8aUdv8.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/{vendor-react-Cc84NArf.js → vendor-react-0L0rjmYG.js} +3 -3
- package/node_modules/jishushell-panel/output/public/index.html +3 -3
- package/node_modules/jishushell-panel/package.json +1 -1
- package/node_modules/semver/classes/range.js +6 -2
- package/node_modules/semver/package.json +1 -1
- package/package.json +4 -4
- package/scripts/check-app-spec.mjs +4 -12
- package/scripts/check-architecture-boundaries.mjs +178 -0
- package/scripts/pack-gui-and-send-pi.sh +5 -3
- package/dependencies/jishushell-panel-0.6.18.tgz +0 -0
- package/dist/services/connections/suggestions.d.ts +0 -27
- package/dist/services/connections/suggestions.js +0 -124
- package/dist/services/connections/suggestions.js.map +0 -1
- package/node_modules/fastify/test/types/content-type-parser.test-d.ts +0 -72
- package/node_modules/fastify/test/types/errors.test-d.ts +0 -90
- package/node_modules/fastify/test/types/fastify.test-d.ts +0 -352
- package/node_modules/fastify/test/types/hooks.test-d.ts +0 -550
- package/node_modules/fastify/test/types/import.ts +0 -2
- package/node_modules/fastify/test/types/instance.test-d.ts +0 -588
- package/node_modules/fastify/test/types/plugin.test-d.ts +0 -97
- package/node_modules/fastify/test/types/register.test-d.ts +0 -237
- package/node_modules/fastify/test/types/reply.test-d.ts +0 -254
- package/node_modules/fastify/test/types/request.test-d.ts +0 -188
- package/node_modules/fastify/test/types/route.test-d.ts +0 -553
- package/node_modules/fastify/test/types/using.test-d.ts +0 -17
- package/node_modules/jishushell-panel/output/public/assets/InstanceDetail-Dgyc_TX5.js +0 -14
- package/node_modules/jishushell-panel/output/public/assets/NewInstance-CIy0cYtp.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/Settings-DAT-UMfP.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/Setup-g3uckFYR.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/vendor-i18n-CS8DFbkQ.js +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export async function executeImmichReview(client, plan) {
|
|
2
|
+
switch (plan.action) {
|
|
3
|
+
case "add_assets_to_album": {
|
|
4
|
+
const albumId = requireBoundParam(plan.boundParams, "album_id");
|
|
5
|
+
await client.addAssetsToAlbum(albumId, plan.assetIds);
|
|
6
|
+
return { applied: true, asset_count: plan.assetIds.length, album_id: albumId };
|
|
7
|
+
}
|
|
8
|
+
case "remove_assets_from_album": {
|
|
9
|
+
const albumId = requireBoundParam(plan.boundParams, "album_id");
|
|
10
|
+
await client.removeAssetsFromAlbum(albumId, plan.assetIds);
|
|
11
|
+
return { applied: true, asset_count: plan.assetIds.length, album_id: albumId };
|
|
12
|
+
}
|
|
13
|
+
case "tag_assets": {
|
|
14
|
+
const tagId = requireBoundParam(plan.boundParams, "tag_id");
|
|
15
|
+
await client.tagAssets(tagId, plan.assetIds);
|
|
16
|
+
return { applied: true, asset_count: plan.assetIds.length, tag_id: tagId };
|
|
17
|
+
}
|
|
18
|
+
case "untag_assets": {
|
|
19
|
+
const tagId = requireBoundParam(plan.boundParams, "tag_id");
|
|
20
|
+
await client.untagAssets(tagId, plan.assetIds);
|
|
21
|
+
return { applied: true, asset_count: plan.assetIds.length, tag_id: tagId };
|
|
22
|
+
}
|
|
23
|
+
case "delete_assets_to_trash":
|
|
24
|
+
await client.deleteAssetsToTrash(plan.assetIds);
|
|
25
|
+
return { applied: true, moved_to_trash: plan.assetIds.length };
|
|
26
|
+
case "resolve_duplicates":
|
|
27
|
+
await client.deleteAssetsToTrash(plan.assetIds);
|
|
28
|
+
return {
|
|
29
|
+
applied: true,
|
|
30
|
+
moved_to_trash: plan.assetIds.length,
|
|
31
|
+
duplicate_decisions: plan.duplicateDecisions.length,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function requireBoundParam(params, key) {
|
|
36
|
+
const value = params[key]?.trim();
|
|
37
|
+
if (!value)
|
|
38
|
+
throw new Error(`review is missing bound parameter: ${key}`);
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=review-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-executor.js","sourceRoot":"","sources":["../../../../src/services/integrations/immich/review-executor.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAoB,EACpB,IAA+B;IAE/B,QAAQ,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;YAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QAC7E,CAAC;QACD,KAAK,wBAAwB;YAC3B,MAAM,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACjE,KAAK,oBAAoB;YACvB,MAAM,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAChD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM;gBACpC,mBAAmB,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM;aACpD,CAAC;IACN,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,MAA8B,EAAE,GAAW;IACpE,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IAClC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,GAAG,EAAE,CAAC,CAAC;IACzE,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ImmichClient } from "./client.js";
|
|
2
|
+
import { ImmichReviewStore } from "./review-store.js";
|
|
3
|
+
import type { ImmichGenerateReviewGalleryArgs, ImmichReviewInteractionDescriptor, ImmichReviewManifest, ImmichReviewSession } from "./types.js";
|
|
4
|
+
export type CreateImmichReviewSessionInput = ImmichGenerateReviewGalleryArgs & {
|
|
5
|
+
ttlMs?: number;
|
|
6
|
+
};
|
|
7
|
+
export type CreateImmichReviewSessionOptions = {
|
|
8
|
+
client: ImmichClient;
|
|
9
|
+
store: ImmichReviewStore;
|
|
10
|
+
publicBaseUrl: string;
|
|
11
|
+
now?: Date;
|
|
12
|
+
};
|
|
13
|
+
export type BuildImmichReviewManifestOptions = {
|
|
14
|
+
client: ImmichClient;
|
|
15
|
+
store: ImmichReviewStore;
|
|
16
|
+
publicBaseUrl: string;
|
|
17
|
+
reviewId: string;
|
|
18
|
+
now?: Date;
|
|
19
|
+
};
|
|
20
|
+
export declare function createImmichReviewSession(input: CreateImmichReviewSessionInput, options: CreateImmichReviewSessionOptions): Promise<ImmichReviewInteractionDescriptor>;
|
|
21
|
+
export declare function buildImmichReviewManifest(options: BuildImmichReviewManifestOptions): Promise<ImmichReviewManifest>;
|
|
22
|
+
export declare function reviewDescriptor(input: {
|
|
23
|
+
session: ImmichReviewSession;
|
|
24
|
+
candidateCount: number;
|
|
25
|
+
publicBaseUrl: string;
|
|
26
|
+
}): ImmichReviewInteractionDescriptor;
|
|
27
|
+
export declare function requireLiveSession(store: ImmichReviewStore, reviewId: string, now?: Date): ImmichReviewSession;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { IMMICH_GALLERY_LIMIT } from "./config.js";
|
|
2
|
+
import { IMMICH_CONFIRM_TOKENS, } from "./review-store.js";
|
|
3
|
+
export async function createImmichReviewSession(input, options) {
|
|
4
|
+
const action = normalizeReviewAction(input);
|
|
5
|
+
const candidates = await resolveCandidateAssets(input, options.client);
|
|
6
|
+
const session = options.store.create({
|
|
7
|
+
action,
|
|
8
|
+
title: typeof input.title === "string" && input.title.trim()
|
|
9
|
+
? input.title.trim()
|
|
10
|
+
: `Immich ${action.replace(/_/g, " ")}`,
|
|
11
|
+
candidateAssetIds: candidates.candidateIds,
|
|
12
|
+
preselectedAssetIds: uniqueStrings(input.preselected_asset_ids ?? []),
|
|
13
|
+
boundParams: boundParamsForReview(action, input),
|
|
14
|
+
duplicateGroups: candidates.duplicateGroups,
|
|
15
|
+
ttlMs: input.ttlMs,
|
|
16
|
+
now: options.now,
|
|
17
|
+
});
|
|
18
|
+
return reviewDescriptor({
|
|
19
|
+
session,
|
|
20
|
+
candidateCount: session.candidateAssetIds.length,
|
|
21
|
+
publicBaseUrl: options.publicBaseUrl,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export async function buildImmichReviewManifest(options) {
|
|
25
|
+
const session = requireLiveSession(options.store, options.reviewId, options.now);
|
|
26
|
+
const previewIds = session.candidateAssetIds.slice(0, IMMICH_GALLERY_LIMIT);
|
|
27
|
+
const assets = [];
|
|
28
|
+
for (const assetId of previewIds) {
|
|
29
|
+
try {
|
|
30
|
+
assets.push(manifestAsset(await options.client.getAsset(assetId), session.id, options.publicBaseUrl));
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
assets.push(manifestAsset({ id: assetId }, session.id, options.publicBaseUrl));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
type: "jishushell.immich.review_manifest.v1",
|
|
38
|
+
review_id: session.id,
|
|
39
|
+
title: session.title,
|
|
40
|
+
action: session.action,
|
|
41
|
+
candidate_count: session.candidateAssetIds.length,
|
|
42
|
+
expires_at: session.expiresAt,
|
|
43
|
+
confirm_text: IMMICH_CONFIRM_TOKENS[session.action],
|
|
44
|
+
bound_params: session.boundParams,
|
|
45
|
+
assets,
|
|
46
|
+
preselected_asset_ids: uniqueStrings(session.preselectedAssetIds ?? [])
|
|
47
|
+
.filter((id) => previewIds.includes(id)),
|
|
48
|
+
truncated_count: Math.max(0, session.candidateAssetIds.length - assets.length),
|
|
49
|
+
duplicate_groups: session.duplicateGroups,
|
|
50
|
+
execute_url: `${options.publicBaseUrl}/api/integrations/immich/reviews/${session.id}/execute`,
|
|
51
|
+
execution_url: `${options.publicBaseUrl}/api/integrations/immich/reviews/${session.id}/execution`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export function reviewDescriptor(input) {
|
|
55
|
+
const base = `${input.publicBaseUrl}/api/integrations/immich/reviews/${input.session.id}`;
|
|
56
|
+
return {
|
|
57
|
+
type: "jishushell.interaction.v1",
|
|
58
|
+
kind: "immich.review",
|
|
59
|
+
review_id: input.session.id,
|
|
60
|
+
title: input.session.title,
|
|
61
|
+
summary: `${input.candidateCount} candidate photo${input.candidateCount === 1 ? "" : "s"} need review.`,
|
|
62
|
+
action: input.session.action,
|
|
63
|
+
candidate_count: input.candidateCount,
|
|
64
|
+
expires_at: input.session.expiresAt,
|
|
65
|
+
urls: {
|
|
66
|
+
web: `${base}/gallery`,
|
|
67
|
+
manifest: `${base}/manifest`,
|
|
68
|
+
execute: `${base}/execute`,
|
|
69
|
+
execution: `${base}/execution`,
|
|
70
|
+
},
|
|
71
|
+
instruction: "Give the web URL to the user. Do not list all candidate photos and do not execute until the user confirms in the review UI.",
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function requireLiveSession(store, reviewId, now = new Date()) {
|
|
75
|
+
const session = store.get(reviewId);
|
|
76
|
+
if (!session)
|
|
77
|
+
throw Object.assign(new Error("review not found"), { statusCode: 404 });
|
|
78
|
+
if (Date.parse(session.expiresAt) <= now.getTime()) {
|
|
79
|
+
throw Object.assign(new Error("review expired"), { statusCode: 410 });
|
|
80
|
+
}
|
|
81
|
+
return session;
|
|
82
|
+
}
|
|
83
|
+
async function resolveCandidateAssets(input, client) {
|
|
84
|
+
if (Array.isArray(input.asset_ids) && input.asset_ids.length) {
|
|
85
|
+
const candidateIds = uniqueStrings(input.asset_ids);
|
|
86
|
+
return {
|
|
87
|
+
candidateIds,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (typeof input.album_id === "string" && input.album_id.trim()) {
|
|
91
|
+
const album = await client.getAlbum(input.album_id.trim());
|
|
92
|
+
const assets = Array.isArray(album.assets) ? album.assets : [];
|
|
93
|
+
return {
|
|
94
|
+
candidateIds: uniqueStrings(assets.map((asset) => asset.id)),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (typeof input.duplicate_id === "string" && input.duplicate_id.trim()) {
|
|
98
|
+
const duplicateId = input.duplicate_id.trim();
|
|
99
|
+
const groups = await client.getDuplicates();
|
|
100
|
+
const group = groups.find((candidate) => String(candidate.id || candidate.duplicateId || "") === duplicateId);
|
|
101
|
+
const assets = (Array.isArray(group?.assets) ? group.assets : [])
|
|
102
|
+
.map((asset) => compactDuplicateAsset(asset));
|
|
103
|
+
const candidateIds = uniqueStrings(assets.map((asset) => asset.id));
|
|
104
|
+
return {
|
|
105
|
+
candidateIds,
|
|
106
|
+
duplicateGroups: [{ duplicateId, candidateAssetIds: candidateIds }],
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
throw new Error("review creation requires asset_ids, album_id, or duplicate_id");
|
|
110
|
+
}
|
|
111
|
+
function boundParamsForReview(action, input) {
|
|
112
|
+
const out = {};
|
|
113
|
+
if (action === "add_assets_to_album" || action === "remove_assets_from_album") {
|
|
114
|
+
out.album_id = requireBoundString(input.album_id, "album_id");
|
|
115
|
+
}
|
|
116
|
+
if (action === "tag_assets" || action === "untag_assets") {
|
|
117
|
+
out.tag_id = requireBoundString(input.tag_id, "tag_id");
|
|
118
|
+
}
|
|
119
|
+
return out;
|
|
120
|
+
}
|
|
121
|
+
function requireBoundString(value, field) {
|
|
122
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
123
|
+
throw new Error(`review creation requires ${field} for this action`);
|
|
124
|
+
}
|
|
125
|
+
return value.trim();
|
|
126
|
+
}
|
|
127
|
+
function manifestAsset(asset, reviewId, publicBaseUrl) {
|
|
128
|
+
const exif = asset.exifInfo;
|
|
129
|
+
return {
|
|
130
|
+
id: asset.id,
|
|
131
|
+
type: asset.type,
|
|
132
|
+
filename: asset.originalFileName || asset.id,
|
|
133
|
+
taken_at: asset.fileCreatedAt || exif?.dateTimeOriginal,
|
|
134
|
+
modified_at: asset.fileModifiedAt,
|
|
135
|
+
favorite: asset.isFavorite,
|
|
136
|
+
archived: asset.isArchived,
|
|
137
|
+
trashed: asset.isTrashed,
|
|
138
|
+
location: [exif?.city, exif?.state, exif?.country].filter(Boolean).join(", ") || undefined,
|
|
139
|
+
thumbnail_url: `${publicBaseUrl}/api/integrations/immich/reviews/${reviewId}/assets/${encodeURIComponent(asset.id)}/thumbnail`,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function compactDuplicateAsset(input) {
|
|
143
|
+
const raw = input && typeof input === "object" ? input : {};
|
|
144
|
+
return {
|
|
145
|
+
id: String(raw.id || ""),
|
|
146
|
+
type: typeof raw.type === "string" ? raw.type : undefined,
|
|
147
|
+
originalFileName: typeof raw.originalFileName === "string" ? raw.originalFileName : undefined,
|
|
148
|
+
fileCreatedAt: typeof raw.fileCreatedAt === "string" ? raw.fileCreatedAt : undefined,
|
|
149
|
+
fileModifiedAt: typeof raw.fileModifiedAt === "string" ? raw.fileModifiedAt : undefined,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function normalizeReviewAction(input) {
|
|
153
|
+
const action = typeof input.action === "string" ? input.action.trim() : "";
|
|
154
|
+
if (Object.hasOwn(IMMICH_CONFIRM_TOKENS, action)) {
|
|
155
|
+
return action;
|
|
156
|
+
}
|
|
157
|
+
const normalized = action.toLowerCase().replace(/[\s-]+/g, "_");
|
|
158
|
+
if (Object.hasOwn(IMMICH_CONFIRM_TOKENS, normalized)) {
|
|
159
|
+
return normalized;
|
|
160
|
+
}
|
|
161
|
+
const directAliases = {
|
|
162
|
+
add_to_album: "add_assets_to_album",
|
|
163
|
+
add_assets_to_album: "add_assets_to_album",
|
|
164
|
+
album_add: "add_assets_to_album",
|
|
165
|
+
remove_from_album: "remove_assets_from_album",
|
|
166
|
+
remove_assets_from_album: "remove_assets_from_album",
|
|
167
|
+
album_remove: "remove_assets_from_album",
|
|
168
|
+
bulk_tag: "tag_assets",
|
|
169
|
+
tag: "tag_assets",
|
|
170
|
+
add_tag: "tag_assets",
|
|
171
|
+
tag_assets: "tag_assets",
|
|
172
|
+
bulk_untag: "untag_assets",
|
|
173
|
+
untag: "untag_assets",
|
|
174
|
+
remove_tag: "untag_assets",
|
|
175
|
+
untag_assets: "untag_assets",
|
|
176
|
+
delete: "delete_assets_to_trash",
|
|
177
|
+
trash: "delete_assets_to_trash",
|
|
178
|
+
move_to_trash: "delete_assets_to_trash",
|
|
179
|
+
delete_assets: "delete_assets_to_trash",
|
|
180
|
+
delete_to_trash: "delete_assets_to_trash",
|
|
181
|
+
delete_assets_to_trash: "delete_assets_to_trash",
|
|
182
|
+
resolve_duplicates: "resolve_duplicates",
|
|
183
|
+
resolve_duplicate: "resolve_duplicates",
|
|
184
|
+
duplicates: "resolve_duplicates",
|
|
185
|
+
};
|
|
186
|
+
const direct = directAliases[normalized];
|
|
187
|
+
if (direct)
|
|
188
|
+
return direct;
|
|
189
|
+
if (hasBoundString(input.album_id) &&
|
|
190
|
+
["add", "select_assets", "select", "manage_album"].includes(normalized)) {
|
|
191
|
+
return "add_assets_to_album";
|
|
192
|
+
}
|
|
193
|
+
if (hasBoundString(input.tag_id) &&
|
|
194
|
+
["add", "select_assets", "select", "bulk", "bulk_action"].includes(normalized)) {
|
|
195
|
+
return "tag_assets";
|
|
196
|
+
}
|
|
197
|
+
const supported = Object.keys(IMMICH_CONFIRM_TOKENS).join(", ");
|
|
198
|
+
throw new Error(`unsupported review action: ${String(input.action)}. Supported actions: ${supported}`);
|
|
199
|
+
}
|
|
200
|
+
function hasBoundString(value) {
|
|
201
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
202
|
+
}
|
|
203
|
+
function uniqueStrings(input) {
|
|
204
|
+
return [...new Set(input.filter((item) => typeof item === "string" && item.trim().length > 0))];
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=review-session-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-session-service.js","sourceRoot":"","sources":["../../../../src/services/integrations/immich/review-session-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,qBAAqB,GAEtB,MAAM,mBAAmB,CAAC;AAmC3B,MAAM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C,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAClH,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ImmichReviewAction, ImmichReviewConfirmation, ImmichReviewExecutionPlan, ImmichReviewExecutionStatus, ImmichReviewSession } from "./types.js";
|
|
2
|
+
export declare const IMMICH_CONFIRM_TOKENS: Record<ImmichReviewAction, string>;
|
|
3
|
+
export type CreateReviewSessionInput = {
|
|
4
|
+
action: ImmichReviewAction;
|
|
5
|
+
title: string;
|
|
6
|
+
candidateAssetIds: string[];
|
|
7
|
+
preselectedAssetIds?: string[];
|
|
8
|
+
boundParams?: Record<string, string>;
|
|
9
|
+
duplicateGroups?: ImmichReviewSession["duplicateGroups"];
|
|
10
|
+
ttlMs?: number;
|
|
11
|
+
now?: Date;
|
|
12
|
+
};
|
|
13
|
+
export declare class ImmichReviewStore {
|
|
14
|
+
private readonly rootDir;
|
|
15
|
+
constructor(rootDir: string);
|
|
16
|
+
create(input: CreateReviewSessionInput): ImmichReviewSession;
|
|
17
|
+
get(reviewId: string): ImmichReviewSession | null;
|
|
18
|
+
getExecution(reviewId: string): ImmichReviewExecutionStatus | null;
|
|
19
|
+
claimExecution(reviewId: string, action: ImmichReviewAction, options?: {
|
|
20
|
+
now?: Date;
|
|
21
|
+
}): {
|
|
22
|
+
claimed: true;
|
|
23
|
+
execution: ImmichReviewExecutionStatus;
|
|
24
|
+
} | {
|
|
25
|
+
claimed: false;
|
|
26
|
+
execution: ImmichReviewExecutionStatus;
|
|
27
|
+
};
|
|
28
|
+
completeExecution(reviewId: string, result: Record<string, unknown>, options?: {
|
|
29
|
+
now?: Date;
|
|
30
|
+
}): ImmichReviewExecutionStatus;
|
|
31
|
+
failExecution(reviewId: string, error: string, options?: {
|
|
32
|
+
now?: Date;
|
|
33
|
+
}): ImmichReviewExecutionStatus;
|
|
34
|
+
validate(confirmation: ImmichReviewConfirmation, options?: {
|
|
35
|
+
now?: Date;
|
|
36
|
+
}): ImmichReviewExecutionPlan;
|
|
37
|
+
deleteExpired(options?: {
|
|
38
|
+
now?: Date;
|
|
39
|
+
}): number;
|
|
40
|
+
private writeSession;
|
|
41
|
+
private reviewDir;
|
|
42
|
+
private sessionPath;
|
|
43
|
+
private executionPath;
|
|
44
|
+
private executionLockPath;
|
|
45
|
+
private writeExecution;
|
|
46
|
+
private releaseExecutionLock;
|
|
47
|
+
}
|