@creezio/electron-shell 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/.creezio-src-hash.json +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/meili.d.ts +1 -1
- package/dist/meili.d.ts.map +1 -1
- package/dist/meili.js +1 -1
- package/dist/meili.js.map +1 -1
- package/dist-cjs/index.js +6 -8
- package/dist-cjs/index.js.map +1 -1
- package/dist-cjs/meili.js +1 -2
- package/dist-cjs/meili.js.map +1 -1
- package/package.json +9 -9
- package/dist/desktop/legacy-brand-compat.d.ts +0 -45
- package/dist/desktop/legacy-brand-compat.d.ts.map +0 -1
- package/dist/desktop/legacy-brand-compat.js +0 -49
- package/dist/desktop/legacy-brand-compat.js.map +0 -1
- package/dist/factory-reset-runtime.d.ts +0 -11
- package/dist/factory-reset-runtime.d.ts.map +0 -1
- package/dist/factory-reset-runtime.js +0 -77
- package/dist/factory-reset-runtime.js.map +0 -1
- package/dist/host/ai-workspace/actions.d.ts +0 -12
- package/dist/host/ai-workspace/actions.d.ts.map +0 -1
- package/dist/host/ai-workspace/actions.js +0 -243
- package/dist/host/ai-workspace/actions.js.map +0 -1
- package/dist/host/ai-workspace/bindings.d.ts +0 -51
- package/dist/host/ai-workspace/bindings.d.ts.map +0 -1
- package/dist/host/ai-workspace/bindings.js +0 -40
- package/dist/host/ai-workspace/bindings.js.map +0 -1
- package/dist/host/ai-workspace/index.d.ts +0 -11
- package/dist/host/ai-workspace/index.d.ts.map +0 -1
- package/dist/host/ai-workspace/index.js +0 -6
- package/dist/host/ai-workspace/index.js.map +0 -1
- package/dist/host/ai-workspace/manager.d.ts +0 -128
- package/dist/host/ai-workspace/manager.d.ts.map +0 -1
- package/dist/host/ai-workspace/manager.js +0 -519
- package/dist/host/ai-workspace/manager.js.map +0 -1
- package/dist/host/ai-workspace/profile-window.d.ts +0 -37
- package/dist/host/ai-workspace/profile-window.d.ts.map +0 -1
- package/dist/host/ai-workspace/profile-window.js +0 -121
- package/dist/host/ai-workspace/profile-window.js.map +0 -1
- package/dist/host/ai-workspace/screencast.d.ts +0 -56
- package/dist/host/ai-workspace/screencast.d.ts.map +0 -1
- package/dist/host/ai-workspace/screencast.js +0 -245
- package/dist/host/ai-workspace/screencast.js.map +0 -1
- package/dist/host/ai-workspace/types.d.ts +0 -40
- package/dist/host/ai-workspace/types.d.ts.map +0 -1
- package/dist/host/ai-workspace/types.js +0 -6
- package/dist/host/ai-workspace/types.js.map +0 -1
- package/dist/host/brand-host-runtime.d.ts +0 -107
- package/dist/host/brand-host-runtime.d.ts.map +0 -1
- package/dist/host/brand-host-runtime.js +0 -274
- package/dist/host/brand-host-runtime.js.map +0 -1
- package/dist/host/brand-host-stack.d.ts +0 -117
- package/dist/host/brand-host-stack.d.ts.map +0 -1
- package/dist/host/brand-host-stack.js +0 -253
- package/dist/host/brand-host-stack.js.map +0 -1
- package/dist/host/brand-kernel-http.d.ts +0 -34
- package/dist/host/brand-kernel-http.d.ts.map +0 -1
- package/dist/host/brand-kernel-http.js +0 -95
- package/dist/host/brand-kernel-http.js.map +0 -1
- package/dist/host/brand-meili-boot.d.ts +0 -67
- package/dist/host/brand-meili-boot.d.ts.map +0 -1
- package/dist/host/brand-meili-boot.js +0 -100
- package/dist/host/brand-meili-boot.js.map +0 -1
- package/dist/host/bridge-client.d.ts +0 -54
- package/dist/host/bridge-client.d.ts.map +0 -1
- package/dist/host/bridge-client.js +0 -187
- package/dist/host/bridge-client.js.map +0 -1
- package/dist/host/context.d.ts +0 -70
- package/dist/host/context.d.ts.map +0 -1
- package/dist/host/context.js +0 -16
- package/dist/host/context.js.map +0 -1
- package/dist/host/contracts.d.ts +0 -39
- package/dist/host/contracts.d.ts.map +0 -1
- package/dist/host/contracts.js +0 -26
- package/dist/host/contracts.js.map +0 -1
- package/dist/host/crash-reporter.d.ts +0 -65
- package/dist/host/crash-reporter.d.ts.map +0 -1
- package/dist/host/crash-reporter.js +0 -371
- package/dist/host/crash-reporter.js.map +0 -1
- package/dist/host/ensure-kit-binaries.d.ts +0 -17
- package/dist/host/ensure-kit-binaries.d.ts.map +0 -1
- package/dist/host/ensure-kit-binaries.js +0 -205
- package/dist/host/ensure-kit-binaries.js.map +0 -1
- package/dist/host/feature-off-host.d.ts +0 -130
- package/dist/host/feature-off-host.d.ts.map +0 -1
- package/dist/host/feature-off-host.js +0 -138
- package/dist/host/feature-off-host.js.map +0 -1
- package/dist/host/hermes/crm-key.d.ts +0 -49
- package/dist/host/hermes/crm-key.d.ts.map +0 -1
- package/dist/host/hermes/crm-key.js +0 -126
- package/dist/host/hermes/crm-key.js.map +0 -1
- package/dist/host/hermes/ensure-crm-key-db.d.ts +0 -7
- package/dist/host/hermes/ensure-crm-key-db.d.ts.map +0 -1
- package/dist/host/hermes/ensure-crm-key-db.js +0 -84
- package/dist/host/hermes/ensure-crm-key-db.js.map +0 -1
- package/dist/host/hermes/launcher.d.ts +0 -98
- package/dist/host/hermes/launcher.d.ts.map +0 -1
- package/dist/host/hermes/launcher.js +0 -972
- package/dist/host/hermes/launcher.js.map +0 -1
- package/dist/host/hermes/runtime-bootstrap.d.ts +0 -172
- package/dist/host/hermes/runtime-bootstrap.d.ts.map +0 -1
- package/dist/host/hermes/runtime-bootstrap.js +0 -789
- package/dist/host/hermes/runtime-bootstrap.js.map +0 -1
- package/dist/host/hermes/skills-seed.d.ts +0 -40
- package/dist/host/hermes/skills-seed.d.ts.map +0 -1
- package/dist/host/hermes/skills-seed.js +0 -100
- package/dist/host/hermes/skills-seed.js.map +0 -1
- package/dist/host/host-stack.d.ts +0 -35
- package/dist/host/host-stack.d.ts.map +0 -1
- package/dist/host/host-stack.js +0 -38
- package/dist/host/host-stack.js.map +0 -1
- package/dist/host/kit-os-resources.d.ts +0 -6
- package/dist/host/kit-os-resources.d.ts.map +0 -1
- package/dist/host/kit-os-resources.js +0 -88
- package/dist/host/kit-os-resources.js.map +0 -1
- package/dist/host/load-electron.d.ts +0 -2
- package/dist/host/load-electron.d.ts.map +0 -1
- package/dist/host/load-electron.js +0 -44
- package/dist/host/load-electron.js.map +0 -1
- package/dist/host/local-config.d.ts +0 -120
- package/dist/host/local-config.d.ts.map +0 -1
- package/dist/host/local-config.js +0 -633
- package/dist/host/local-config.js.map +0 -1
- package/dist/host/meili/browse.d.ts +0 -58
- package/dist/host/meili/browse.d.ts.map +0 -1
- package/dist/host/meili/browse.js +0 -98
- package/dist/host/meili/browse.js.map +0 -1
- package/dist/host/meili/coherence-db.d.ts +0 -35
- package/dist/host/meili/coherence-db.d.ts.map +0 -1
- package/dist/host/meili/coherence-db.js +0 -129
- package/dist/host/meili/coherence-db.js.map +0 -1
- package/dist/host/meili/coherence-query.d.ts +0 -10
- package/dist/host/meili/coherence-query.d.ts.map +0 -1
- package/dist/host/meili/coherence-query.js +0 -23
- package/dist/host/meili/coherence-query.js.map +0 -1
- package/dist/host/meili/coherence.d.ts +0 -53
- package/dist/host/meili/coherence.d.ts.map +0 -1
- package/dist/host/meili/coherence.js +0 -148
- package/dist/host/meili/coherence.js.map +0 -1
- package/dist/host/meili/feed.d.ts +0 -82
- package/dist/host/meili/feed.d.ts.map +0 -1
- package/dist/host/meili/feed.js +0 -100
- package/dist/host/meili/feed.js.map +0 -1
- package/dist/host/meili/generic-indexer.d.ts +0 -34
- package/dist/host/meili/generic-indexer.d.ts.map +0 -1
- package/dist/host/meili/generic-indexer.js +0 -333
- package/dist/host/meili/generic-indexer.js.map +0 -1
- package/dist/host/meili/index-schema.d.ts +0 -64
- package/dist/host/meili/index-schema.d.ts.map +0 -1
- package/dist/host/meili/index-schema.js +0 -70
- package/dist/host/meili/index-schema.js.map +0 -1
- package/dist/host/meili/index.d.ts +0 -13
- package/dist/host/meili/index.d.ts.map +0 -1
- package/dist/host/meili/index.js +0 -8
- package/dist/host/meili/index.js.map +0 -1
- package/dist/host/meili/indexer.d.ts +0 -31
- package/dist/host/meili/indexer.d.ts.map +0 -1
- package/dist/host/meili/indexer.js +0 -49
- package/dist/host/meili/indexer.js.map +0 -1
- package/dist/host/meili-launcher.d.ts +0 -30
- package/dist/host/meili-launcher.d.ts.map +0 -1
- package/dist/host/meili-launcher.js +0 -115
- package/dist/host/meili-launcher.js.map +0 -1
- package/dist/host/n8n/agent-isolation.d.ts +0 -55
- package/dist/host/n8n/agent-isolation.d.ts.map +0 -1
- package/dist/host/n8n/agent-isolation.js +0 -158
- package/dist/host/n8n/agent-isolation.js.map +0 -1
- package/dist/host/n8n/api-key.d.ts +0 -67
- package/dist/host/n8n/api-key.d.ts.map +0 -1
- package/dist/host/n8n/api-key.js +0 -297
- package/dist/host/n8n/api-key.js.map +0 -1
- package/dist/host/n8n/launcher.d.ts +0 -126
- package/dist/host/n8n/launcher.d.ts.map +0 -1
- package/dist/host/n8n/launcher.js +0 -1170
- package/dist/host/n8n/launcher.js.map +0 -1
- package/dist/host/n8n/runtime-bootstrap.d.ts +0 -44
- package/dist/host/n8n/runtime-bootstrap.d.ts.map +0 -1
- package/dist/host/n8n/runtime-bootstrap.js +0 -230
- package/dist/host/n8n/runtime-bootstrap.js.map +0 -1
- package/dist/host/node-runtime.d.ts +0 -52
- package/dist/host/node-runtime.d.ts.map +0 -1
- package/dist/host/node-runtime.js +0 -257
- package/dist/host/node-runtime.js.map +0 -1
- package/dist/host/npm-cli.d.ts +0 -43
- package/dist/host/npm-cli.d.ts.map +0 -1
- package/dist/host/npm-cli.js +0 -213
- package/dist/host/npm-cli.js.map +0 -1
- package/dist/host/plugins/accept-check.d.ts +0 -19
- package/dist/host/plugins/accept-check.d.ts.map +0 -1
- package/dist/host/plugins/accept-check.js +0 -172
- package/dist/host/plugins/accept-check.js.map +0 -1
- package/dist/host/plugins/brand-bindings.d.ts +0 -103
- package/dist/host/plugins/brand-bindings.d.ts.map +0 -1
- package/dist/host/plugins/brand-bindings.js +0 -65
- package/dist/host/plugins/brand-bindings.js.map +0 -1
- package/dist/host/plugins/control-adapters.d.ts +0 -11
- package/dist/host/plugins/control-adapters.d.ts.map +0 -1
- package/dist/host/plugins/control-adapters.js +0 -83
- package/dist/host/plugins/control-adapters.js.map +0 -1
- package/dist/host/plugins/control-extras.d.ts +0 -61
- package/dist/host/plugins/control-extras.d.ts.map +0 -1
- package/dist/host/plugins/control-extras.js +0 -382
- package/dist/host/plugins/control-extras.js.map +0 -1
- package/dist/host/plugins/control-plane.d.ts +0 -42
- package/dist/host/plugins/control-plane.d.ts.map +0 -1
- package/dist/host/plugins/control-plane.js +0 -124
- package/dist/host/plugins/control-plane.js.map +0 -1
- package/dist/host/plugins/control-token.d.ts +0 -24
- package/dist/host/plugins/control-token.d.ts.map +0 -1
- package/dist/host/plugins/control-token.js +0 -77
- package/dist/host/plugins/control-token.js.map +0 -1
- package/dist/host/plugins/crm-key.d.ts +0 -25
- package/dist/host/plugins/crm-key.d.ts.map +0 -1
- package/dist/host/plugins/crm-key.js +0 -126
- package/dist/host/plugins/crm-key.js.map +0 -1
- package/dist/host/plugins/data.d.ts +0 -21
- package/dist/host/plugins/data.d.ts.map +0 -1
- package/dist/host/plugins/data.js +0 -100
- package/dist/host/plugins/data.js.map +0 -1
- package/dist/host/plugins/events.d.ts +0 -6
- package/dist/host/plugins/events.d.ts.map +0 -1
- package/dist/host/plugins/events.js +0 -6
- package/dist/host/plugins/events.js.map +0 -1
- package/dist/host/plugins/execution-grant.d.ts +0 -6
- package/dist/host/plugins/execution-grant.d.ts.map +0 -1
- package/dist/host/plugins/execution-grant.js +0 -6
- package/dist/host/plugins/execution-grant.js.map +0 -1
- package/dist/host/plugins/git.d.ts +0 -56
- package/dist/host/plugins/git.d.ts.map +0 -1
- package/dist/host/plugins/git.js +0 -357
- package/dist/host/plugins/git.js.map +0 -1
- package/dist/host/plugins/host.d.ts +0 -68
- package/dist/host/plugins/host.d.ts.map +0 -1
- package/dist/host/plugins/host.js +0 -276
- package/dist/host/plugins/host.js.map +0 -1
- package/dist/host/plugins/launcher.d.ts +0 -146
- package/dist/host/plugins/launcher.d.ts.map +0 -1
- package/dist/host/plugins/launcher.js +0 -489
- package/dist/host/plugins/launcher.js.map +0 -1
- package/dist/host/plugins/runtime.d.ts +0 -28
- package/dist/host/plugins/runtime.d.ts.map +0 -1
- package/dist/host/plugins/runtime.js +0 -430
- package/dist/host/plugins/runtime.js.map +0 -1
- package/dist/host/plugins/test-runner.d.ts +0 -15
- package/dist/host/plugins/test-runner.d.ts.map +0 -1
- package/dist/host/plugins/test-runner.js +0 -106
- package/dist/host/plugins/test-runner.js.map +0 -1
- package/dist/host/safe-storage.d.ts +0 -21
- package/dist/host/safe-storage.d.ts.map +0 -1
- package/dist/host/safe-storage.js +0 -55
- package/dist/host/safe-storage.js.map +0 -1
- package/dist/host/sandbox/embed-sandbox.d.ts +0 -133
- package/dist/host/sandbox/embed-sandbox.d.ts.map +0 -1
- package/dist/host/sandbox/embed-sandbox.js +0 -378
- package/dist/host/sandbox/embed-sandbox.js.map +0 -1
- package/dist/host/sandbox/os-sandbox.d.ts +0 -41
- package/dist/host/sandbox/os-sandbox.d.ts.map +0 -1
- package/dist/host/sandbox/os-sandbox.js +0 -98
- package/dist/host/sandbox/os-sandbox.js.map +0 -1
- package/dist/host/server-env.d.ts +0 -50
- package/dist/host/server-env.d.ts.map +0 -1
- package/dist/host/server-env.js +0 -64
- package/dist/host/server-env.js.map +0 -1
- package/dist/host/server-launcher.d.ts +0 -49
- package/dist/host/server-launcher.d.ts.map +0 -1
- package/dist/host/server-launcher.js +0 -43
- package/dist/host/server-launcher.js.map +0 -1
- package/dist/host/tunnel/cloudflared-respawn.d.ts +0 -58
- package/dist/host/tunnel/cloudflared-respawn.d.ts.map +0 -1
- package/dist/host/tunnel/cloudflared-respawn.js +0 -73
- package/dist/host/tunnel/cloudflared-respawn.js.map +0 -1
- package/dist/host/tunnel/tunnel.d.ts +0 -72
- package/dist/host/tunnel/tunnel.d.ts.map +0 -1
- package/dist/host/tunnel/tunnel.js +0 -462
- package/dist/host/tunnel/tunnel.js.map +0 -1
- package/dist/logger.d.ts +0 -44
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -252
- package/dist/logger.js.map +0 -1
- package/dist-cjs/desktop/legacy-brand-compat.js +0 -56
- package/dist-cjs/desktop/legacy-brand-compat.js.map +0 -1
- package/dist-cjs/factory-reset-runtime.js +0 -117
- package/dist-cjs/factory-reset-runtime.js.map +0 -1
- package/dist-cjs/host/ai-workspace/actions.js +0 -247
- package/dist-cjs/host/ai-workspace/actions.js.map +0 -1
- package/dist-cjs/host/ai-workspace/bindings.js +0 -49
- package/dist-cjs/host/ai-workspace/bindings.js.map +0 -1
- package/dist-cjs/host/ai-workspace/index.js +0 -21
- package/dist-cjs/host/ai-workspace/index.js.map +0 -1
- package/dist-cjs/host/ai-workspace/manager.js +0 -528
- package/dist-cjs/host/ai-workspace/manager.js.map +0 -1
- package/dist-cjs/host/ai-workspace/profile-window.js +0 -125
- package/dist-cjs/host/ai-workspace/profile-window.js.map +0 -1
- package/dist-cjs/host/ai-workspace/screencast.js +0 -249
- package/dist-cjs/host/ai-workspace/screencast.js.map +0 -1
- package/dist-cjs/host/ai-workspace/types.js +0 -7
- package/dist-cjs/host/ai-workspace/types.js.map +0 -1
- package/dist-cjs/host/brand-host-runtime.js +0 -286
- package/dist-cjs/host/brand-host-runtime.js.map +0 -1
- package/dist-cjs/host/brand-host-stack.js +0 -259
- package/dist-cjs/host/brand-host-stack.js.map +0 -1
- package/dist-cjs/host/brand-kernel-http.js +0 -101
- package/dist-cjs/host/brand-kernel-http.js.map +0 -1
- package/dist-cjs/host/brand-meili-boot.js +0 -106
- package/dist-cjs/host/brand-meili-boot.js.map +0 -1
- package/dist-cjs/host/bridge-client.js +0 -191
- package/dist-cjs/host/bridge-client.js.map +0 -1
- package/dist-cjs/host/context.js +0 -20
- package/dist-cjs/host/context.js.map +0 -1
- package/dist-cjs/host/contracts.js +0 -32
- package/dist-cjs/host/contracts.js.map +0 -1
- package/dist-cjs/host/crash-reporter.js +0 -422
- package/dist-cjs/host/crash-reporter.js.map +0 -1
- package/dist-cjs/host/ensure-kit-binaries.js +0 -212
- package/dist-cjs/host/ensure-kit-binaries.js.map +0 -1
- package/dist-cjs/host/feature-off-host.js +0 -144
- package/dist-cjs/host/feature-off-host.js.map +0 -1
- package/dist-cjs/host/hermes/crm-key.js +0 -137
- package/dist-cjs/host/hermes/crm-key.js.map +0 -1
- package/dist-cjs/host/hermes/ensure-crm-key-db.js +0 -89
- package/dist-cjs/host/hermes/ensure-crm-key-db.js.map +0 -1
- package/dist-cjs/host/hermes/launcher.js +0 -981
- package/dist-cjs/host/hermes/launcher.js.map +0 -1
- package/dist-cjs/host/hermes/runtime-bootstrap.js +0 -853
- package/dist-cjs/host/hermes/runtime-bootstrap.js.map +0 -1
- package/dist-cjs/host/hermes/skills-seed.js +0 -110
- package/dist-cjs/host/hermes/skills-seed.js.map +0 -1
- package/dist-cjs/host/host-stack.js +0 -42
- package/dist-cjs/host/host-stack.js.map +0 -1
- package/dist-cjs/host/kit-os-resources.js +0 -96
- package/dist-cjs/host/kit-os-resources.js.map +0 -1
- package/dist-cjs/host/load-electron.js +0 -47
- package/dist-cjs/host/load-electron.js.map +0 -1
- package/dist-cjs/host/local-config.js +0 -640
- package/dist-cjs/host/local-config.js.map +0 -1
- package/dist-cjs/host/meili/browse.js +0 -103
- package/dist-cjs/host/meili/browse.js.map +0 -1
- package/dist-cjs/host/meili/coherence-db.js +0 -139
- package/dist-cjs/host/meili/coherence-db.js.map +0 -1
- package/dist-cjs/host/meili/coherence-query.js +0 -25
- package/dist-cjs/host/meili/coherence-query.js.map +0 -1
- package/dist-cjs/host/meili/coherence.js +0 -158
- package/dist-cjs/host/meili/coherence.js.map +0 -1
- package/dist-cjs/host/meili/feed.js +0 -108
- package/dist-cjs/host/meili/feed.js.map +0 -1
- package/dist-cjs/host/meili/generic-indexer.js +0 -340
- package/dist-cjs/host/meili/generic-indexer.js.map +0 -1
- package/dist-cjs/host/meili/index-schema.js +0 -79
- package/dist-cjs/host/meili/index-schema.js.map +0 -1
- package/dist-cjs/host/meili/index.js +0 -45
- package/dist-cjs/host/meili/index.js.map +0 -1
- package/dist-cjs/host/meili/indexer.js +0 -85
- package/dist-cjs/host/meili/indexer.js.map +0 -1
- package/dist-cjs/host/meili-launcher.js +0 -121
- package/dist-cjs/host/meili-launcher.js.map +0 -1
- package/dist-cjs/host/n8n/agent-isolation.js +0 -173
- package/dist-cjs/host/n8n/agent-isolation.js.map +0 -1
- package/dist-cjs/host/n8n/api-key.js +0 -314
- package/dist-cjs/host/n8n/api-key.js.map +0 -1
- package/dist-cjs/host/n8n/launcher.js +0 -1209
- package/dist-cjs/host/n8n/launcher.js.map +0 -1
- package/dist-cjs/host/n8n/runtime-bootstrap.js +0 -244
- package/dist-cjs/host/n8n/runtime-bootstrap.js.map +0 -1
- package/dist-cjs/host/node-runtime.js +0 -274
- package/dist-cjs/host/node-runtime.js.map +0 -1
- package/dist-cjs/host/npm-cli.js +0 -224
- package/dist-cjs/host/npm-cli.js.map +0 -1
- package/dist-cjs/host/plugins/accept-check.js +0 -176
- package/dist-cjs/host/plugins/accept-check.js.map +0 -1
- package/dist-cjs/host/plugins/brand-bindings.js +0 -78
- package/dist-cjs/host/plugins/brand-bindings.js.map +0 -1
- package/dist-cjs/host/plugins/control-adapters.js +0 -89
- package/dist-cjs/host/plugins/control-adapters.js.map +0 -1
- package/dist-cjs/host/plugins/control-extras.js +0 -397
- package/dist-cjs/host/plugins/control-extras.js.map +0 -1
- package/dist-cjs/host/plugins/control-plane.js +0 -130
- package/dist-cjs/host/plugins/control-plane.js.map +0 -1
- package/dist-cjs/host/plugins/control-token.js +0 -90
- package/dist-cjs/host/plugins/control-token.js.map +0 -1
- package/dist-cjs/host/plugins/crm-key.js +0 -135
- package/dist-cjs/host/plugins/crm-key.js.map +0 -1
- package/dist-cjs/host/plugins/data.js +0 -107
- package/dist-cjs/host/plugins/data.js.map +0 -1
- package/dist-cjs/host/plugins/events.js +0 -19
- package/dist-cjs/host/plugins/events.js.map +0 -1
- package/dist-cjs/host/plugins/execution-grant.js +0 -11
- package/dist-cjs/host/plugins/execution-grant.js.map +0 -1
- package/dist-cjs/host/plugins/git.js +0 -371
- package/dist-cjs/host/plugins/git.js.map +0 -1
- package/dist-cjs/host/plugins/host.js +0 -283
- package/dist-cjs/host/plugins/host.js.map +0 -1
- package/dist-cjs/host/plugins/launcher.js +0 -514
- package/dist-cjs/host/plugins/launcher.js.map +0 -1
- package/dist-cjs/host/plugins/runtime.js +0 -446
- package/dist-cjs/host/plugins/runtime.js.map +0 -1
- package/dist-cjs/host/plugins/test-runner.js +0 -112
- package/dist-cjs/host/plugins/test-runner.js.map +0 -1
- package/dist-cjs/host/safe-storage.js +0 -95
- package/dist-cjs/host/safe-storage.js.map +0 -1
- package/dist-cjs/host/sandbox/embed-sandbox.js +0 -396
- package/dist-cjs/host/sandbox/embed-sandbox.js.map +0 -1
- package/dist-cjs/host/sandbox/os-sandbox.js +0 -106
- package/dist-cjs/host/sandbox/os-sandbox.js.map +0 -1
- package/dist-cjs/host/server-env.js +0 -69
- package/dist-cjs/host/server-env.js.map +0 -1
- package/dist-cjs/host/server-launcher.js +0 -52
- package/dist-cjs/host/server-launcher.js.map +0 -1
- package/dist-cjs/host/tunnel/cloudflared-respawn.js +0 -80
- package/dist-cjs/host/tunnel/cloudflared-respawn.js.map +0 -1
- package/dist-cjs/host/tunnel/tunnel.js +0 -470
- package/dist-cjs/host/tunnel/tunnel.js.map +0 -1
- package/dist-cjs/logger.js +0 -269
- package/dist-cjs/logger.js.map +0 -1
|
@@ -1,853 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Bootstrap runtime Hermes (agent CLI + WebUI) — download-on-first-run.
|
|
4
|
-
*
|
|
5
|
-
* Le full Python/venv n’est PAS dans l’exe (taille / remote-build). Au premier
|
|
6
|
-
* Héberger sans CLI, on lance l’installeur officiel NousResearch, puis on
|
|
7
|
-
* récupère l’archive WebUI pinée (checksum SHA-256) sous userData.
|
|
8
|
-
* Chemins injectés via HostRuntimeContext (SoT kit — jumeau marque interdit).
|
|
9
|
-
*/
|
|
10
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(o, k2, desc);
|
|
17
|
-
}) : (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
o[k2] = m[k];
|
|
20
|
-
}));
|
|
21
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
-
}) : function(o, v) {
|
|
24
|
-
o["default"] = v;
|
|
25
|
-
});
|
|
26
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
-
var ownKeys = function(o) {
|
|
28
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
-
var ar = [];
|
|
30
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
-
return ar;
|
|
32
|
-
};
|
|
33
|
-
return ownKeys(o);
|
|
34
|
-
};
|
|
35
|
-
return function (mod) {
|
|
36
|
-
if (mod && mod.__esModule) return mod;
|
|
37
|
-
var result = {};
|
|
38
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
-
__setModuleDefault(result, mod);
|
|
40
|
-
return result;
|
|
41
|
-
};
|
|
42
|
-
})();
|
|
43
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
44
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
|
-
};
|
|
46
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
exports.WEBUI_DEPS_MARKER_LEGACY_FIDU = exports.WEBUI_DEPS_MARKER_LEGACY_CERTIVAN = exports.WEBUI_DEPS_MARKER_LEGACY = exports.WEBUI_DEPS_MARKER = void 0;
|
|
48
|
-
exports.hermesBrowserToolsEnabled = hermesBrowserToolsEnabled;
|
|
49
|
-
exports.getBootstrapPhase = getBootstrapPhase;
|
|
50
|
-
exports.getBootstrapError = getBootstrapError;
|
|
51
|
-
exports.hermesVendorDir = hermesVendorDir;
|
|
52
|
-
exports.loadRuntimeManifest = loadRuntimeManifest;
|
|
53
|
-
exports.vendoredInstallScriptPath = vendoredInstallScriptPath;
|
|
54
|
-
exports.hermesSpaceSafeUserDataRoot = hermesSpaceSafeUserDataRoot;
|
|
55
|
-
exports.hermesRuntimeCacheDir = hermesRuntimeCacheDir;
|
|
56
|
-
exports.hermesInstallLayoutEnv = hermesInstallLayoutEnv;
|
|
57
|
-
exports.hermesFhsFallbackDirs = hermesFhsFallbackDirs;
|
|
58
|
-
exports.patchHermesInstallShForSpaces = patchHermesInstallShForSpaces;
|
|
59
|
-
exports.hermesInstallOsProfileDir = hermesInstallOsProfileDir;
|
|
60
|
-
exports.hermesWebuiInstallDir = hermesWebuiInstallDir;
|
|
61
|
-
exports.hermesAgentDirCandidates = hermesAgentDirCandidates;
|
|
62
|
-
exports.resolveHermesAgentDir = resolveHermesAgentDir;
|
|
63
|
-
exports.resolveHermesPython = resolveHermesPython;
|
|
64
|
-
exports.webuiDepsMarkerPath = webuiDepsMarkerPath;
|
|
65
|
-
exports.readWebuiDepsMarker = readWebuiDepsMarker;
|
|
66
|
-
exports.writeWebuiDepsMarker = writeWebuiDepsMarker;
|
|
67
|
-
exports.isWebuiDepsMarkerCurrent = isWebuiDepsMarkerCurrent;
|
|
68
|
-
exports.webuiPythonDepsReady = webuiPythonDepsReady;
|
|
69
|
-
exports.installHermesAgent = installHermesAgent;
|
|
70
|
-
exports.ensureHermesWebuiTree = ensureHermesWebuiTree;
|
|
71
|
-
exports.ensureHermesRuntime = ensureHermesRuntime;
|
|
72
|
-
exports.__resetBootstrapStateForTests = __resetBootstrapStateForTests;
|
|
73
|
-
const node_child_process_1 = require("node:child_process");
|
|
74
|
-
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
75
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
76
|
-
const node_http_1 = __importDefault(require("node:http"));
|
|
77
|
-
const node_https_1 = __importDefault(require("node:https"));
|
|
78
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
79
|
-
const context_js_1 = require("../context.js");
|
|
80
|
-
const kit_os_resources_js_1 = require("../kit-os-resources.js");
|
|
81
|
-
const embed_sandbox_js_1 = require("../sandbox/embed-sandbox.js");
|
|
82
|
-
const os_sandbox_js_1 = require("../sandbox/os-sandbox.js");
|
|
83
|
-
const node_runtime_js_1 = require("../node-runtime.js");
|
|
84
|
-
/**
|
|
85
|
-
* Browser tools Hermes (Playwright) opt-in : CREEZIO_HERMES_BROWSER=1 retire
|
|
86
|
-
* `--skip-browser` de l'installeur (≈ +400 Mo Chromium Playwright + deps —
|
|
87
|
-
* dimensionner le disque en conséquence). Défaut : skip (desktop léger ; le
|
|
88
|
-
* pilotage web IA passe par le sidecar browser-host côté serveur).
|
|
89
|
-
*/
|
|
90
|
-
function hermesBrowserToolsEnabled() {
|
|
91
|
-
return process.env.CREEZIO_HERMES_BROWSER === "1";
|
|
92
|
-
}
|
|
93
|
-
let phase = "idle";
|
|
94
|
-
let lastBootstrapError = null;
|
|
95
|
-
function getBootstrapPhase() {
|
|
96
|
-
return phase;
|
|
97
|
-
}
|
|
98
|
-
function getBootstrapError() {
|
|
99
|
-
return lastBootstrapError;
|
|
100
|
-
}
|
|
101
|
-
function setPhase(p) {
|
|
102
|
-
phase = p;
|
|
103
|
-
}
|
|
104
|
-
function hermesVendorDir(ctx) {
|
|
105
|
-
// Marque d’abord (packaged resourcesPath/vendor), sinon kit OS Creezio.
|
|
106
|
-
const candidates = [
|
|
107
|
-
node_path_1.default.join(ctx.resourcesRoot, "vendor", "hermes-agent"),
|
|
108
|
-
node_path_1.default.join(ctx.resourcesRoot, "resources", "vendor", "hermes-agent"),
|
|
109
|
-
(0, kit_os_resources_js_1.kitOsVendorDir)("hermes-agent"),
|
|
110
|
-
];
|
|
111
|
-
for (const p of candidates) {
|
|
112
|
-
if (node_fs_1.default.existsSync(node_path_1.default.join(p, "runtime-manifest.json")))
|
|
113
|
-
return p;
|
|
114
|
-
}
|
|
115
|
-
for (const p of candidates) {
|
|
116
|
-
if (node_fs_1.default.existsSync(p))
|
|
117
|
-
return p;
|
|
118
|
-
}
|
|
119
|
-
return candidates[0];
|
|
120
|
-
}
|
|
121
|
-
function loadRuntimeManifest(ctx) {
|
|
122
|
-
const candidates = [
|
|
123
|
-
node_path_1.default.join(hermesVendorDir(ctx), "runtime-manifest.json"),
|
|
124
|
-
];
|
|
125
|
-
for (const p of candidates) {
|
|
126
|
-
if (node_fs_1.default.existsSync(p)) {
|
|
127
|
-
return JSON.parse(node_fs_1.default.readFileSync(p, "utf8"));
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
throw new Error("vendor/hermes-agent/runtime-manifest.json introuvable");
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Script d'install Hermes VENDORISÉ (embarqué dans les ressources).
|
|
134
|
-
* Plus aucun téléchargement au first-run : un changement du script upstream
|
|
135
|
-
* ne peut plus casser les installs (le checksum du manifest reste vérifié
|
|
136
|
-
* comme garde d'intégrité du fichier packagé).
|
|
137
|
-
*/
|
|
138
|
-
function vendoredInstallScriptPath(ctx, name) {
|
|
139
|
-
const candidates = [node_path_1.default.join(hermesVendorDir(ctx), name)];
|
|
140
|
-
for (const p of candidates) {
|
|
141
|
-
if (node_fs_1.default.existsSync(p))
|
|
142
|
-
return p;
|
|
143
|
-
}
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Racine userData sans espaces pour les scripts shell tiers (install.sh).
|
|
148
|
-
* Ex. `…/TempoFlow Server` → `…/TempoFlow-Server` — sinon `$UV_CMD --version`
|
|
149
|
-
* non quoté dans l’installeur officiel sort en exit 126.
|
|
150
|
-
*/
|
|
151
|
-
function hermesSpaceSafeUserDataRoot(userDataDir) {
|
|
152
|
-
if (!/\s/.test(userDataDir))
|
|
153
|
-
return userDataDir;
|
|
154
|
-
const parent = node_path_1.default.dirname(userDataDir);
|
|
155
|
-
const base = node_path_1.default.basename(userDataDir).replace(/\s+/g, "-");
|
|
156
|
-
return node_path_1.default.join(parent, base);
|
|
157
|
-
}
|
|
158
|
-
function hermesRuntimeCacheDir(ctx) {
|
|
159
|
-
// Install/bootstrap Hermes : jamais d’espace dans le chemin (install.sh).
|
|
160
|
-
const root = hermesSpaceSafeUserDataRoot(ctx.userDataDir);
|
|
161
|
-
const dir = node_path_1.default.join(root, "hermes-runtime");
|
|
162
|
-
node_fs_1.default.mkdirSync(dir, { recursive: true });
|
|
163
|
-
// Compat : garder un lien/miroir sous l’ancien chemin à espaces si différent.
|
|
164
|
-
try {
|
|
165
|
-
const legacy = node_path_1.default.join(ctx.userDataDir, "hermes-runtime");
|
|
166
|
-
if (legacy !== dir && !node_fs_1.default.existsSync(legacy)) {
|
|
167
|
-
try {
|
|
168
|
-
node_fs_1.default.symlinkSync(dir, legacy, process.platform === "win32" ? "junction" : "dir");
|
|
169
|
-
}
|
|
170
|
-
catch {
|
|
171
|
-
/* best-effort */
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
catch {
|
|
176
|
-
/* ignore */
|
|
177
|
-
}
|
|
178
|
-
return dir;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Verrou layout d'install Hermes : l'install.sh amont récent bascule en
|
|
182
|
-
* layout FHS quand il tourne en root Linux (containers server-docker) —
|
|
183
|
-
* code sous `/usr/local/lib/hermes-agent`, commande `/usr/local/bin/hermes`
|
|
184
|
-
* — hors du sandbox où le launcher cherche le binaire (« CLI toujours
|
|
185
|
-
* introuvable après install », vécu instance demo). `HERMES_INSTALL_DIR`
|
|
186
|
-
* est honoré par l'installeur et force le layout sandbox historique.
|
|
187
|
-
*/
|
|
188
|
-
function hermesInstallLayoutEnv(profile, platform) {
|
|
189
|
-
if (platform === "win32") {
|
|
190
|
-
return {
|
|
191
|
-
HERMES_HOME: node_path_1.default.join(profile, "AppData", "Local", "hermes"),
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
const home = node_path_1.default.join(profile, ".hermes");
|
|
195
|
-
return {
|
|
196
|
-
HERMES_HOME: home,
|
|
197
|
-
HERMES_INSTALL_DIR: node_path_1.default.join(home, "hermes-agent"),
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Dossiers fallback FHS pour retrouver un CLI Hermes installé AVANT le
|
|
202
|
-
* verrou `HERMES_INSTALL_DIR` (install root Linux → /usr/local). Réservé
|
|
203
|
-
* aux processus root Linux (containers) — jamais sur un desktop utilisateur
|
|
204
|
-
* (sandbox only).
|
|
205
|
-
*/
|
|
206
|
-
function hermesFhsFallbackDirs(platform, uid) {
|
|
207
|
-
if (platform !== "linux" || uid !== 0)
|
|
208
|
-
return [];
|
|
209
|
-
return ["/usr/local/bin", "/usr/local/lib/hermes-agent"];
|
|
210
|
-
}
|
|
211
|
-
/** Corrige les invocations non quotées de $UV_CMD dans install.sh (espaces). */
|
|
212
|
-
function patchHermesInstallShForSpaces(scriptPath) {
|
|
213
|
-
if (!node_fs_1.default.existsSync(scriptPath))
|
|
214
|
-
return;
|
|
215
|
-
const raw = node_fs_1.default.readFileSync(scriptPath, "utf8");
|
|
216
|
-
const patched = raw
|
|
217
|
-
.replace(/UV_VERSION=\$\(\$UV_CMD --version 2>\/dev\/null\)/g, 'UV_VERSION=$("$UV_CMD" --version 2>/dev/null)')
|
|
218
|
-
.replace(/UV_VERSION=\$\(\$UV_CMD --version\)/g, 'UV_VERSION=$("$UV_CMD" --version)');
|
|
219
|
-
if (patched !== raw) {
|
|
220
|
-
node_fs_1.default.writeFileSync(scriptPath, patched, "utf8");
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Profil OS faux pour l’installeur Hermes officiel.
|
|
225
|
-
* Sous Windows l’install écrit typiquement `%USERPROFILE%\.hermes` /
|
|
226
|
-
* `%LOCALAPPDATA%\hermes` — on pointe USERPROFILE + LOCALAPPDATA ici
|
|
227
|
-
* pour rester dans le sandbox desktop.
|
|
228
|
-
*/
|
|
229
|
-
function hermesInstallOsProfileDir(ctx) {
|
|
230
|
-
const dir = node_path_1.default.join(hermesRuntimeCacheDir(ctx), "os-profile");
|
|
231
|
-
node_fs_1.default.mkdirSync(dir, { recursive: true });
|
|
232
|
-
node_fs_1.default.mkdirSync(node_path_1.default.join(dir, "AppData", "Local"), { recursive: true });
|
|
233
|
-
node_fs_1.default.mkdirSync(node_path_1.default.join(dir, "AppData", "Roaming"), { recursive: true });
|
|
234
|
-
return dir;
|
|
235
|
-
}
|
|
236
|
-
function hermesWebuiInstallDir(ctx) {
|
|
237
|
-
return node_path_1.default.join(hermesRuntimeCacheDir(ctx), "webui");
|
|
238
|
-
}
|
|
239
|
-
/** Répertoires candidats pour le checkout hermes-agent (sandbox d’abord). */
|
|
240
|
-
function hermesAgentDirCandidates(ctx) {
|
|
241
|
-
const profile = hermesInstallOsProfileDir(ctx);
|
|
242
|
-
const local = node_path_1.default.join(profile, "AppData", "Local");
|
|
243
|
-
return [
|
|
244
|
-
node_path_1.default.join(hermesRuntimeCacheDir(ctx), "hermes-agent"),
|
|
245
|
-
node_path_1.default.join(profile, ".hermes", "hermes-agent"),
|
|
246
|
-
node_path_1.default.join(local, "hermes", "hermes-agent"),
|
|
247
|
-
node_path_1.default.join(ctx.userDataDir, "hermes-home", "hermes-agent"),
|
|
248
|
-
// Install FHS root Linux antérieure au verrou HERMES_INSTALL_DIR
|
|
249
|
-
// (containers uniquement — voir hermesFhsFallbackDirs).
|
|
250
|
-
...(hermesFhsFallbackDirs(process.platform, typeof process.getuid === "function" ? process.getuid() : null).includes("/usr/local/lib/hermes-agent")
|
|
251
|
-
? ["/usr/local/lib/hermes-agent"]
|
|
252
|
-
: []),
|
|
253
|
-
].filter(Boolean);
|
|
254
|
-
}
|
|
255
|
-
function resolveHermesAgentDir(ctx, existsSync = node_fs_1.default.existsSync) {
|
|
256
|
-
for (const dir of hermesAgentDirCandidates(ctx)) {
|
|
257
|
-
const marker = node_path_1.default.join(dir, "cli.py");
|
|
258
|
-
const marker2 = node_path_1.default.join(dir, "pyproject.toml");
|
|
259
|
-
if (existsSync(marker) || existsSync(marker2))
|
|
260
|
-
return dir;
|
|
261
|
-
}
|
|
262
|
-
return null;
|
|
263
|
-
}
|
|
264
|
-
/** Python du venv Hermes (pour spawner WebUI). */
|
|
265
|
-
function resolveHermesPython(agentDir) {
|
|
266
|
-
if (!agentDir)
|
|
267
|
-
return null;
|
|
268
|
-
const candidates = process.platform === "win32"
|
|
269
|
-
? [
|
|
270
|
-
node_path_1.default.join(agentDir, "venv", "Scripts", "python.exe"),
|
|
271
|
-
node_path_1.default.join(agentDir, ".venv", "Scripts", "python.exe"),
|
|
272
|
-
]
|
|
273
|
-
: [
|
|
274
|
-
node_path_1.default.join(agentDir, "venv", "bin", "python"),
|
|
275
|
-
node_path_1.default.join(agentDir, ".venv", "bin", "python"),
|
|
276
|
-
node_path_1.default.join(agentDir, "venv", "bin", "python3"),
|
|
277
|
-
];
|
|
278
|
-
for (const p of candidates) {
|
|
279
|
-
if (node_fs_1.default.existsSync(p))
|
|
280
|
-
return p;
|
|
281
|
-
}
|
|
282
|
-
return null;
|
|
283
|
-
}
|
|
284
|
-
function downloadToFile(url, dest, onLog) {
|
|
285
|
-
return new Promise((resolve, reject) => {
|
|
286
|
-
node_fs_1.default.mkdirSync(node_path_1.default.dirname(dest), { recursive: true });
|
|
287
|
-
const tmp = `${dest}.part`;
|
|
288
|
-
const file = node_fs_1.default.createWriteStream(tmp);
|
|
289
|
-
const get = url.startsWith("https:") ? node_https_1.default.get : node_http_1.default.get;
|
|
290
|
-
onLog(`download ${url}`);
|
|
291
|
-
const req = get(url, { timeout: 120_000 }, (res) => {
|
|
292
|
-
if (res.statusCode &&
|
|
293
|
-
res.statusCode >= 300 &&
|
|
294
|
-
res.statusCode < 400 &&
|
|
295
|
-
res.headers.location) {
|
|
296
|
-
file.close();
|
|
297
|
-
try {
|
|
298
|
-
node_fs_1.default.unlinkSync(tmp);
|
|
299
|
-
}
|
|
300
|
-
catch {
|
|
301
|
-
/* ignore */
|
|
302
|
-
}
|
|
303
|
-
downloadToFile(res.headers.location, dest, onLog).then(resolve, reject);
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
if (res.statusCode !== 200) {
|
|
307
|
-
file.close();
|
|
308
|
-
reject(new Error(`HTTP ${res.statusCode} pour ${url}`));
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
res.pipe(file);
|
|
312
|
-
file.on("finish", () => {
|
|
313
|
-
file.close(() => {
|
|
314
|
-
node_fs_1.default.renameSync(tmp, dest);
|
|
315
|
-
resolve();
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
});
|
|
319
|
-
req.on("error", (e) => {
|
|
320
|
-
try {
|
|
321
|
-
file.close();
|
|
322
|
-
node_fs_1.default.unlinkSync(tmp);
|
|
323
|
-
}
|
|
324
|
-
catch {
|
|
325
|
-
/* ignore */
|
|
326
|
-
}
|
|
327
|
-
reject(e);
|
|
328
|
-
});
|
|
329
|
-
req.on("timeout", () => {
|
|
330
|
-
req.destroy();
|
|
331
|
-
reject(new Error("download timeout"));
|
|
332
|
-
});
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
function sha256File(filePath) {
|
|
336
|
-
const hash = node_crypto_1.default.createHash("sha256");
|
|
337
|
-
hash.update(node_fs_1.default.readFileSync(filePath));
|
|
338
|
-
return hash.digest("hex");
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Supply-chain : le script d'install distant doit correspondre au pin sha256
|
|
342
|
-
* du manifest. Mismatch = throw (jamais d'exécution d'un script inattendu).
|
|
343
|
-
*/
|
|
344
|
-
function verifyInstallScriptChecksum(scriptPath, expectedSha256, onLog) {
|
|
345
|
-
const digest = sha256File(scriptPath);
|
|
346
|
-
if (!expectedSha256) {
|
|
347
|
-
throw new Error(`script d'install sans pin sha256 dans le manifest (observé ${digest}) — exécution refusée`);
|
|
348
|
-
}
|
|
349
|
-
if (digest !== expectedSha256.toLowerCase()) {
|
|
350
|
-
throw new Error(`checksum script d'install invalide (got ${digest}, want ${expectedSha256}) — exécution refusée`);
|
|
351
|
-
}
|
|
352
|
-
onLog(`checksum script install OK ${digest.slice(0, 12)}…`);
|
|
353
|
-
}
|
|
354
|
-
/** Marker écrit après pip OK / imports OK — skip pip aux boots suivants. */
|
|
355
|
-
exports.WEBUI_DEPS_MARKER = ".desktop-webui-deps";
|
|
356
|
-
/** Legacy marque (upgrade) — lu si le marker desktop est absent. */
|
|
357
|
-
exports.WEBUI_DEPS_MARKER_LEGACY = ".tempoflow-webui-deps";
|
|
358
|
-
/** Legacy Certivan (M6p) — installs ≤ cutover host. */
|
|
359
|
-
exports.WEBUI_DEPS_MARKER_LEGACY_CERTIVAN = ".certivan-webui-deps";
|
|
360
|
-
/** Legacy Fidu (M6p) — installs ≤ cutover host. */
|
|
361
|
-
exports.WEBUI_DEPS_MARKER_LEGACY_FIDU = ".fidu-webui-deps";
|
|
362
|
-
const WEBUI_PIN_FILE = ".desktop-webui-pin";
|
|
363
|
-
const WEBUI_PIN_FILE_LEGACY = ".tempoflow-webui-pin";
|
|
364
|
-
const WEBUI_PIN_FILE_LEGACY_CERTIVAN = ".certivan-webui-pin";
|
|
365
|
-
const WEBUI_PIN_FILE_LEGACY_FIDU = ".fidu-webui-pin";
|
|
366
|
-
const WEBUI_DEPS_MARKER_CANDIDATES = [
|
|
367
|
-
exports.WEBUI_DEPS_MARKER,
|
|
368
|
-
exports.WEBUI_DEPS_MARKER_LEGACY,
|
|
369
|
-
exports.WEBUI_DEPS_MARKER_LEGACY_CERTIVAN,
|
|
370
|
-
exports.WEBUI_DEPS_MARKER_LEGACY_FIDU,
|
|
371
|
-
];
|
|
372
|
-
const WEBUI_PIN_CANDIDATES = [
|
|
373
|
-
WEBUI_PIN_FILE,
|
|
374
|
-
WEBUI_PIN_FILE_LEGACY,
|
|
375
|
-
WEBUI_PIN_FILE_LEGACY_CERTIVAN,
|
|
376
|
-
WEBUI_PIN_FILE_LEGACY_FIDU,
|
|
377
|
-
];
|
|
378
|
-
function webuiDepsMarkerPath(webuiDir) {
|
|
379
|
-
return node_path_1.default.join(webuiDir, exports.WEBUI_DEPS_MARKER);
|
|
380
|
-
}
|
|
381
|
-
function readWebuiDepsMarker(webuiDir) {
|
|
382
|
-
for (const name of WEBUI_DEPS_MARKER_CANDIDATES) {
|
|
383
|
-
const p = node_path_1.default.join(webuiDir, name);
|
|
384
|
-
try {
|
|
385
|
-
if (!node_fs_1.default.existsSync(p))
|
|
386
|
-
continue;
|
|
387
|
-
const v = node_fs_1.default.readFileSync(p, "utf8").trim();
|
|
388
|
-
if (v)
|
|
389
|
-
return v;
|
|
390
|
-
}
|
|
391
|
-
catch {
|
|
392
|
-
/* ignore */
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
return null;
|
|
396
|
-
}
|
|
397
|
-
function writeWebuiDepsMarker(webuiDir, digest) {
|
|
398
|
-
node_fs_1.default.writeFileSync(webuiDepsMarkerPath(webuiDir), `${digest}\n`, "utf8");
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* true si le marker correspond au hash de requirements.txt
|
|
402
|
-
* (deps déjà validées pour ce pin WebUI).
|
|
403
|
-
*/
|
|
404
|
-
function isWebuiDepsMarkerCurrent(webuiDir, requirementsPath, existsSync = node_fs_1.default.existsSync) {
|
|
405
|
-
if (!existsSync(requirementsPath))
|
|
406
|
-
return false;
|
|
407
|
-
const digest = sha256File(requirementsPath);
|
|
408
|
-
return readWebuiDepsMarker(webuiDir) === digest;
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Check rapide (~ms) : imports WebUI requis.
|
|
412
|
-
* Évite `pip install -r` à chaque Héberger quand le venv est déjà prêt.
|
|
413
|
-
*/
|
|
414
|
-
async function webuiPythonDepsReady(pythonPath, opts) {
|
|
415
|
-
const silent = opts?.onLog || (() => undefined);
|
|
416
|
-
try {
|
|
417
|
-
const r = await runCommand(pythonPath, ["-c", "import yaml, cryptography"], {
|
|
418
|
-
onLog: silent,
|
|
419
|
-
timeoutMs: opts?.timeoutMs ?? 15_000,
|
|
420
|
-
});
|
|
421
|
-
return r.code === 0;
|
|
422
|
-
}
|
|
423
|
-
catch {
|
|
424
|
-
return false;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
function runCommand(cmd, args, opts) {
|
|
428
|
-
return new Promise((resolve, reject) => {
|
|
429
|
-
opts.onLog(`$ ${cmd} ${args.join(" ")}`);
|
|
430
|
-
const child = (0, node_child_process_1.spawn)(cmd, args, {
|
|
431
|
-
cwd: opts.cwd,
|
|
432
|
-
env: opts.env || process.env,
|
|
433
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
434
|
-
windowsHide: true,
|
|
435
|
-
shell: false,
|
|
436
|
-
});
|
|
437
|
-
const onData = (buf) => {
|
|
438
|
-
buf
|
|
439
|
-
.toString("utf8")
|
|
440
|
-
.split(/\r?\n/)
|
|
441
|
-
.filter(Boolean)
|
|
442
|
-
.forEach((l) => opts.onLog(l.slice(0, 400)));
|
|
443
|
-
};
|
|
444
|
-
child.stdout?.on("data", onData);
|
|
445
|
-
child.stderr?.on("data", onData);
|
|
446
|
-
const timer = setTimeout(() => {
|
|
447
|
-
try {
|
|
448
|
-
child.kill();
|
|
449
|
-
}
|
|
450
|
-
catch {
|
|
451
|
-
/* ignore */
|
|
452
|
-
}
|
|
453
|
-
reject(new Error(`timeout ${opts.timeoutMs}ms: ${cmd}`));
|
|
454
|
-
}, opts.timeoutMs);
|
|
455
|
-
child.on("error", (e) => {
|
|
456
|
-
clearTimeout(timer);
|
|
457
|
-
reject(e);
|
|
458
|
-
});
|
|
459
|
-
child.on("exit", (code) => {
|
|
460
|
-
clearTimeout(timer);
|
|
461
|
-
resolve({ code });
|
|
462
|
-
});
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Installe Hermes Agent via l’installeur officiel (réseau requis).
|
|
467
|
-
* Idempotent si le CLI est déjà présent ailleurs — le caller vérifie d’abord.
|
|
468
|
-
*/
|
|
469
|
-
async function installHermesAgent(ctx, opts) {
|
|
470
|
-
const manifest = loadRuntimeManifest(ctx);
|
|
471
|
-
const timeoutMs = opts.timeoutMs ?? 15 * 60 * 1000;
|
|
472
|
-
setPhase("installing-agent");
|
|
473
|
-
lastBootstrapError = null;
|
|
474
|
-
const cache = hermesRuntimeCacheDir(ctx);
|
|
475
|
-
const scriptsDir = node_path_1.default.join(cache, "install-scripts");
|
|
476
|
-
node_fs_1.default.mkdirSync(scriptsDir, { recursive: true });
|
|
477
|
-
const product = (0, context_js_1.hostProductName)(ctx);
|
|
478
|
-
try {
|
|
479
|
-
const profile = hermesInstallOsProfileDir(ctx);
|
|
480
|
-
// Node desktop visible dans le PATH confiné : le stage `node` de
|
|
481
|
-
// l'installeur le détecte et n'installe RIEN (ni zip portable, ni winget
|
|
482
|
-
// machine-wide en fallback).
|
|
483
|
-
const desktopNode = (0, node_runtime_js_1.resolveDesktopNodeBinary)(ctx);
|
|
484
|
-
const installToolDirs = node_path_1.default.isAbsolute(desktopNode)
|
|
485
|
-
? [node_path_1.default.dirname(desktopNode)]
|
|
486
|
-
: [];
|
|
487
|
-
const installEnv = (0, embed_sandbox_js_1.applyOsSandboxEnv)({
|
|
488
|
-
env: {
|
|
489
|
-
...process.env,
|
|
490
|
-
LOCALAPPDATA: node_path_1.default.join(profile, "AppData", "Local"),
|
|
491
|
-
APPDATA: node_path_1.default.join(profile, "AppData", "Roaming"),
|
|
492
|
-
},
|
|
493
|
-
profileHome: profile,
|
|
494
|
-
userData: ctx.userDataDir,
|
|
495
|
-
// PATH confiné : Node desktop + System32, rien du PC hôte.
|
|
496
|
-
toolDirs: installToolDirs,
|
|
497
|
-
});
|
|
498
|
-
(0, embed_sandbox_js_1.setSandboxEnvVar)(installEnv, "LOCALAPPDATA", node_path_1.default.join(profile, "AppData", "Local"));
|
|
499
|
-
(0, embed_sandbox_js_1.setSandboxEnvVar)(installEnv, "APPDATA", node_path_1.default.join(profile, "AppData", "Roaming"));
|
|
500
|
-
// Verrou définitif : install.ps1/install.sh donnent à HERMES_HOME la
|
|
501
|
-
// priorité sur %LOCALAPPDATA% / $HOME pour choisir HermesHome, et
|
|
502
|
-
// HERMES_INSTALL_DIR neutralise le layout FHS root Linux (/usr/local)
|
|
503
|
-
// de l'installeur récent — le launcher ne cherche que le sandbox.
|
|
504
|
-
const layout = hermesInstallLayoutEnv(profile, process.platform);
|
|
505
|
-
(0, embed_sandbox_js_1.setSandboxEnvVar)(installEnv, "HERMES_HOME", layout.HERMES_HOME);
|
|
506
|
-
if (layout.HERMES_INSTALL_DIR) {
|
|
507
|
-
(0, embed_sandbox_js_1.setSandboxEnvVar)(installEnv, "HERMES_INSTALL_DIR", layout.HERMES_INSTALL_DIR);
|
|
508
|
-
}
|
|
509
|
-
opts.onLog(`install Hermes dans sandbox ${product} (USERPROFILE=${profile}, HERMES_HOME=${installEnv.HERMES_HOME}${layout.HERMES_INSTALL_DIR ? `, HERMES_INSTALL_DIR=${layout.HERMES_INSTALL_DIR}` : ""})`);
|
|
510
|
-
// Purge des checkouts mis de côté par install.ps1 après un échec
|
|
511
|
-
// (« hermes-agent.broken-<ts> ») — sinon chaque retry laisse des
|
|
512
|
-
// centaines de Mo morts dans le sandbox.
|
|
513
|
-
try {
|
|
514
|
-
const hermesHome = installEnv.HERMES_HOME;
|
|
515
|
-
if (node_fs_1.default.existsSync(hermesHome)) {
|
|
516
|
-
for (const entry of node_fs_1.default.readdirSync(hermesHome)) {
|
|
517
|
-
if (entry.startsWith("hermes-agent.broken-")) {
|
|
518
|
-
opts.onLog(`purge checkout cassé: ${entry}`);
|
|
519
|
-
node_fs_1.default.rmSync(node_path_1.default.join(hermesHome, entry), {
|
|
520
|
-
recursive: true,
|
|
521
|
-
force: true,
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
catch {
|
|
528
|
-
/* best-effort */
|
|
529
|
-
}
|
|
530
|
-
const commitPin = manifest.agentInstall.commitPin;
|
|
531
|
-
if (process.platform === "win32") {
|
|
532
|
-
const win = manifest.agentInstall.windows;
|
|
533
|
-
const ps1 = node_path_1.default.join(scriptsDir, "install.ps1");
|
|
534
|
-
const vendored = vendoredInstallScriptPath(ctx, "install.ps1");
|
|
535
|
-
if (vendored) {
|
|
536
|
-
node_fs_1.default.copyFileSync(vendored, ps1);
|
|
537
|
-
opts.onLog("script install vendorisé (embarqué, aucun téléchargement)");
|
|
538
|
-
}
|
|
539
|
-
else {
|
|
540
|
-
await downloadToFile(win.scriptUrl, ps1, opts.onLog);
|
|
541
|
-
}
|
|
542
|
-
verifyInstallScriptChecksum(ps1, win.scriptSha256, opts.onLog);
|
|
543
|
-
const powershell = (0, os_sandbox_js_1.resolveSystemBinary)("powershell");
|
|
544
|
-
if (!powershell) {
|
|
545
|
-
lastBootstrapError = "PowerShell système introuvable (System32)";
|
|
546
|
-
setPhase("error");
|
|
547
|
-
return { ok: false, detail: lastBootstrapError };
|
|
548
|
-
}
|
|
549
|
-
const baseArgs = [...win.args].filter((a) => !(hermesBrowserToolsEnabled() && a === "-SkipBrowser"));
|
|
550
|
-
if (commitPin)
|
|
551
|
-
baseArgs.push("-Commit", commitPin);
|
|
552
|
-
if (win.stages && win.stages.length > 0) {
|
|
553
|
-
for (const stage of win.stages) {
|
|
554
|
-
opts.onLog(`install stage « ${stage} »…`);
|
|
555
|
-
const r = await runCommand(powershell, [
|
|
556
|
-
"-NoProfile",
|
|
557
|
-
"-ExecutionPolicy",
|
|
558
|
-
"Bypass",
|
|
559
|
-
"-File",
|
|
560
|
-
ps1,
|
|
561
|
-
"-Stage",
|
|
562
|
-
stage,
|
|
563
|
-
...baseArgs,
|
|
564
|
-
], { onLog: opts.onLog, timeoutMs, env: installEnv });
|
|
565
|
-
if (r.code !== 0) {
|
|
566
|
-
lastBootstrapError = `install.ps1 stage ${stage} exit ${r.code}`;
|
|
567
|
-
setPhase("error");
|
|
568
|
-
return { ok: false, detail: lastBootstrapError };
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
else {
|
|
573
|
-
const result = await runCommand(powershell, ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", ps1, ...baseArgs], { onLog: opts.onLog, timeoutMs, env: installEnv });
|
|
574
|
-
if (result.code !== 0) {
|
|
575
|
-
lastBootstrapError = `install.ps1 exit ${result.code}`;
|
|
576
|
-
setPhase("error");
|
|
577
|
-
return { ok: false, detail: lastBootstrapError };
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
else {
|
|
582
|
-
const posix = manifest.agentInstall.posix;
|
|
583
|
-
const sh = node_path_1.default.join(scriptsDir, "install.sh");
|
|
584
|
-
const vendored = vendoredInstallScriptPath(ctx, "install.sh");
|
|
585
|
-
if (vendored) {
|
|
586
|
-
node_fs_1.default.copyFileSync(vendored, sh);
|
|
587
|
-
opts.onLog("script install vendorisé (embarqué, aucun téléchargement)");
|
|
588
|
-
}
|
|
589
|
-
else {
|
|
590
|
-
await downloadToFile(posix.scriptUrl, sh, opts.onLog);
|
|
591
|
-
}
|
|
592
|
-
// Checksum AVANT patch local (le patch quote $UV_CMD — hors amont).
|
|
593
|
-
verifyInstallScriptChecksum(sh, posix.scriptSha256, opts.onLog);
|
|
594
|
-
patchHermesInstallShForSpaces(sh);
|
|
595
|
-
node_fs_1.default.chmodSync(sh, 0o755);
|
|
596
|
-
const bash = (0, os_sandbox_js_1.resolveSystemBinary)("bash");
|
|
597
|
-
if (!bash) {
|
|
598
|
-
lastBootstrapError = "bash système introuvable (/bin, /usr/bin)";
|
|
599
|
-
setPhase("error");
|
|
600
|
-
return { ok: false, detail: lastBootstrapError };
|
|
601
|
-
}
|
|
602
|
-
const posixArgs = [...posix.args].filter((a) => !(hermesBrowserToolsEnabled() && a === "--skip-browser"));
|
|
603
|
-
if (commitPin)
|
|
604
|
-
posixArgs.push("--commit", commitPin);
|
|
605
|
-
const result = await runCommand(bash, [sh, ...posixArgs], {
|
|
606
|
-
onLog: opts.onLog,
|
|
607
|
-
timeoutMs,
|
|
608
|
-
env: installEnv,
|
|
609
|
-
});
|
|
610
|
-
if (result.code !== 0) {
|
|
611
|
-
lastBootstrapError = `install.sh exit ${result.code}`;
|
|
612
|
-
setPhase("error");
|
|
613
|
-
return { ok: false, detail: lastBootstrapError };
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
setPhase("ready");
|
|
617
|
-
return { ok: true, detail: "Hermes Agent installé" };
|
|
618
|
-
}
|
|
619
|
-
catch (e) {
|
|
620
|
-
lastBootstrapError = e instanceof Error ? e.message : String(e);
|
|
621
|
-
setPhase("error");
|
|
622
|
-
return { ok: false, detail: lastBootstrapError };
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
async function extractTarGz(ctx, archive, destParent, onLog) {
|
|
626
|
-
node_fs_1.default.mkdirSync(destParent, { recursive: true });
|
|
627
|
-
const staging = node_path_1.default.join(destParent, "_extract");
|
|
628
|
-
node_fs_1.default.rmSync(staging, { recursive: true, force: true });
|
|
629
|
-
node_fs_1.default.mkdirSync(staging, { recursive: true });
|
|
630
|
-
const tarBin = (0, os_sandbox_js_1.resolveSystemBinary)("tar");
|
|
631
|
-
if (!tarBin) {
|
|
632
|
-
throw new Error("tar système introuvable (System32 / /usr/bin)");
|
|
633
|
-
}
|
|
634
|
-
{
|
|
635
|
-
const r = await runCommand(tarBin, ["-xzf", archive, "-C", staging], {
|
|
636
|
-
onLog,
|
|
637
|
-
timeoutMs: 120_000,
|
|
638
|
-
});
|
|
639
|
-
if (r.code !== 0)
|
|
640
|
-
throw new Error(`tar extraction failed (${tarBin})`);
|
|
641
|
-
}
|
|
642
|
-
const entries = node_fs_1.default.readdirSync(staging).filter((n) => !n.startsWith("."));
|
|
643
|
-
if (entries.length !== 1) {
|
|
644
|
-
throw new Error(`archive layout inattendu: ${entries.join(",")}`);
|
|
645
|
-
}
|
|
646
|
-
const extracted = node_path_1.default.join(staging, entries[0]);
|
|
647
|
-
const finalDir = hermesWebuiInstallDir(ctx);
|
|
648
|
-
node_fs_1.default.rmSync(finalDir, { recursive: true, force: true });
|
|
649
|
-
node_fs_1.default.renameSync(extracted, finalDir);
|
|
650
|
-
node_fs_1.default.rmSync(staging, { recursive: true, force: true });
|
|
651
|
-
return finalDir;
|
|
652
|
-
}
|
|
653
|
-
function readWebuiPin(webuiDir) {
|
|
654
|
-
for (const name of WEBUI_PIN_CANDIDATES) {
|
|
655
|
-
const p = node_path_1.default.join(webuiDir, name);
|
|
656
|
-
try {
|
|
657
|
-
if (!node_fs_1.default.existsSync(p))
|
|
658
|
-
continue;
|
|
659
|
-
const v = node_fs_1.default.readFileSync(p, "utf8").trim();
|
|
660
|
-
if (v)
|
|
661
|
-
return v;
|
|
662
|
-
}
|
|
663
|
-
catch {
|
|
664
|
-
/* ignore */
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
return null;
|
|
668
|
-
}
|
|
669
|
-
/**
|
|
670
|
-
* Télécharge + vérifie + extrait hermes-webui (pin + sha256 du manifest).
|
|
671
|
-
* Installe les deps Python légères dans le venv Hermes **uniquement** si
|
|
672
|
-
* absentes (premier run / repair). Boots suivants : marker ou import check.
|
|
673
|
-
*/
|
|
674
|
-
async function ensureHermesWebuiTree(ctx, opts) {
|
|
675
|
-
const log = opts?.onLog || ((l) => (0, context_js_1.hostLog)(ctx, "hermes-bootstrap", l));
|
|
676
|
-
setPhase("checking");
|
|
677
|
-
lastBootstrapError = null;
|
|
678
|
-
try {
|
|
679
|
-
const manifest = loadRuntimeManifest(ctx);
|
|
680
|
-
const finalDir = hermesWebuiInstallDir(ctx);
|
|
681
|
-
const marker = node_path_1.default.join(finalDir, "server.py");
|
|
682
|
-
const pinRef = readWebuiPin(finalDir);
|
|
683
|
-
const needDownload = !node_fs_1.default.existsSync(marker) ||
|
|
684
|
-
!pinRef ||
|
|
685
|
-
pinRef !== manifest.webui.ref;
|
|
686
|
-
if (needDownload) {
|
|
687
|
-
setPhase("installing-webui");
|
|
688
|
-
const cache = node_path_1.default.join(hermesRuntimeCacheDir(ctx), "downloads");
|
|
689
|
-
node_fs_1.default.mkdirSync(cache, { recursive: true });
|
|
690
|
-
const archive = node_path_1.default.join(cache, `hermes-webui-${manifest.webui.ref}.tar.gz`);
|
|
691
|
-
if (!node_fs_1.default.existsSync(archive) ||
|
|
692
|
-
sha256File(archive) !== manifest.webui.sha256) {
|
|
693
|
-
await downloadToFile(manifest.webui.archiveUrl, archive, log);
|
|
694
|
-
}
|
|
695
|
-
const digest = sha256File(archive);
|
|
696
|
-
if (digest !== manifest.webui.sha256) {
|
|
697
|
-
throw new Error(`checksum WebUI invalide (got ${digest}, want ${manifest.webui.sha256})`);
|
|
698
|
-
}
|
|
699
|
-
log(`checksum OK ${digest.slice(0, 12)}…`);
|
|
700
|
-
await extractTarGz(ctx, archive, hermesRuntimeCacheDir(ctx), log);
|
|
701
|
-
node_fs_1.default.writeFileSync(node_path_1.default.join(finalDir, WEBUI_PIN_FILE), `${manifest.webui.ref}\n`, "utf8");
|
|
702
|
-
}
|
|
703
|
-
const pythonPath = opts?.pythonPath ||
|
|
704
|
-
resolveHermesPython(resolveHermesAgentDir(ctx));
|
|
705
|
-
const req = node_path_1.default.join(finalDir, "requirements.txt");
|
|
706
|
-
if (node_fs_1.default.existsSync(req) && pythonPath) {
|
|
707
|
-
if (isWebuiDepsMarkerCurrent(finalDir, req)) {
|
|
708
|
-
log("démarrage…");
|
|
709
|
-
}
|
|
710
|
-
else {
|
|
711
|
-
const already = await webuiPythonDepsReady(pythonPath);
|
|
712
|
-
const reqDigest = sha256File(req);
|
|
713
|
-
if (already) {
|
|
714
|
-
writeWebuiDepsMarker(finalDir, reqDigest);
|
|
715
|
-
log("démarrage…");
|
|
716
|
-
}
|
|
717
|
-
else {
|
|
718
|
-
setPhase("installing-webui");
|
|
719
|
-
log("pip install WebUI deps (pyyaml, cryptography)…");
|
|
720
|
-
const pipEnv = (0, embed_sandbox_js_1.applyOsSandboxEnv)({
|
|
721
|
-
env: { ...process.env },
|
|
722
|
-
profileHome: hermesInstallOsProfileDir(ctx),
|
|
723
|
-
userData: ctx.userDataDir,
|
|
724
|
-
toolDirs: [node_path_1.default.dirname(pythonPath)],
|
|
725
|
-
});
|
|
726
|
-
const pip = await runCommand(pythonPath, ["-m", "pip", "install", "--disable-pip-version-check", "-r", req], { onLog: log, timeoutMs: 180_000, cwd: finalDir, env: pipEnv });
|
|
727
|
-
if (pip.code === 0) {
|
|
728
|
-
writeWebuiDepsMarker(finalDir, reqDigest);
|
|
729
|
-
}
|
|
730
|
-
else {
|
|
731
|
-
const recovered = await webuiPythonDepsReady(pythonPath);
|
|
732
|
-
if (recovered) {
|
|
733
|
-
writeWebuiDepsMarker(finalDir, reqDigest);
|
|
734
|
-
log("démarrage…");
|
|
735
|
-
}
|
|
736
|
-
else {
|
|
737
|
-
log("deps WebUI manquantes après pip — WebUI peut échouer au spawn");
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
else if (!needDownload) {
|
|
744
|
-
log("démarrage…");
|
|
745
|
-
}
|
|
746
|
-
setPhase("ready");
|
|
747
|
-
return { ok: true, dir: finalDir, detail: "WebUI prêt" };
|
|
748
|
-
}
|
|
749
|
-
catch (e) {
|
|
750
|
-
lastBootstrapError = e instanceof Error ? e.message : String(e);
|
|
751
|
-
setPhase("error");
|
|
752
|
-
return { ok: false, dir: null, detail: lastBootstrapError };
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
/**
|
|
756
|
-
* Si CLI absente → install agent. Puis assure l’arbre WebUI.
|
|
757
|
-
* Appelé au boot Héberger (embedded) ou depuis l’UI « Installer runtime ».
|
|
758
|
-
*/
|
|
759
|
-
async function ensureHermesRuntime(ctx, opts) {
|
|
760
|
-
const log = opts?.onLog || ((l) => (0, context_js_1.hostLog)(ctx, "hermes-bootstrap", l));
|
|
761
|
-
const report = (p) => {
|
|
762
|
-
setPhase(p);
|
|
763
|
-
opts?.onPhase?.(p);
|
|
764
|
-
};
|
|
765
|
-
report("checking");
|
|
766
|
-
lastBootstrapError = null;
|
|
767
|
-
const { resolveHermesBinary } = await Promise.resolve().then(() => __importStar(require("@creezio/platform-core")));
|
|
768
|
-
const profile = hermesInstallOsProfileDir(ctx);
|
|
769
|
-
const defaultSearchDirs = [
|
|
770
|
-
hermesRuntimeCacheDir(ctx),
|
|
771
|
-
node_path_1.default.join(hermesRuntimeCacheDir(ctx), "bin"),
|
|
772
|
-
node_path_1.default.join(profile, "AppData", "Local", "hermes", "bin"),
|
|
773
|
-
node_path_1.default.join(profile, ".hermes", "bin"),
|
|
774
|
-
process.platform === "win32"
|
|
775
|
-
? node_path_1.default.join(profile, "AppData", "Local", "hermes", "hermes-agent", "venv", "Scripts")
|
|
776
|
-
: node_path_1.default.join(profile, ".hermes", "hermes-agent", "venv", "bin"),
|
|
777
|
-
...hermesAgentDirCandidates(ctx),
|
|
778
|
-
node_path_1.default.join(ctx.userDataDir, "hermes-home", "bin"),
|
|
779
|
-
];
|
|
780
|
-
const searchDirs = opts?.searchDirs || defaultSearchDirs;
|
|
781
|
-
const findBinary = opts?.findBinary ||
|
|
782
|
-
(() => resolveHermesBinary({
|
|
783
|
-
platform: process.platform,
|
|
784
|
-
env: process.env,
|
|
785
|
-
searchDirs,
|
|
786
|
-
allowEnvOverride: !ctx.isPackaged,
|
|
787
|
-
envPrefix: ctx.manifest.envPrefix,
|
|
788
|
-
existsSync: node_fs_1.default.existsSync,
|
|
789
|
-
}));
|
|
790
|
-
let binary = findBinary();
|
|
791
|
-
if (!binary && opts?.installAgentIfMissing !== false) {
|
|
792
|
-
log("CLI Hermes absente — bootstrap download-on-first-run…");
|
|
793
|
-
const inst = await installHermesAgent(ctx, {
|
|
794
|
-
onLog: log,
|
|
795
|
-
timeoutMs: opts?.timeoutMs,
|
|
796
|
-
});
|
|
797
|
-
if (!inst.ok) {
|
|
798
|
-
return {
|
|
799
|
-
ok: false,
|
|
800
|
-
binary: null,
|
|
801
|
-
binaryPath: null,
|
|
802
|
-
agentDir: null,
|
|
803
|
-
webuiDir: null,
|
|
804
|
-
detail: inst.detail,
|
|
805
|
-
};
|
|
806
|
-
}
|
|
807
|
-
binary = findBinary();
|
|
808
|
-
}
|
|
809
|
-
if (!binary) {
|
|
810
|
-
lastBootstrapError = "CLI toujours introuvable après install";
|
|
811
|
-
report("error");
|
|
812
|
-
return {
|
|
813
|
-
ok: false,
|
|
814
|
-
binary: null,
|
|
815
|
-
binaryPath: null,
|
|
816
|
-
agentDir: null,
|
|
817
|
-
webuiDir: null,
|
|
818
|
-
detail: lastBootstrapError,
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
const agentDir = resolveHermesAgentDir(ctx);
|
|
822
|
-
const python = resolveHermesPython(agentDir);
|
|
823
|
-
if (!python) {
|
|
824
|
-
lastBootstrapError = "Python venv Hermes introuvable (WebUI impossible)";
|
|
825
|
-
report("error");
|
|
826
|
-
return {
|
|
827
|
-
ok: false,
|
|
828
|
-
binary,
|
|
829
|
-
binaryPath: binary,
|
|
830
|
-
agentDir,
|
|
831
|
-
webuiDir: null,
|
|
832
|
-
detail: lastBootstrapError,
|
|
833
|
-
};
|
|
834
|
-
}
|
|
835
|
-
const webui = await ensureHermesWebuiTree(ctx, {
|
|
836
|
-
onLog: log,
|
|
837
|
-
pythonPath: python,
|
|
838
|
-
});
|
|
839
|
-
report(webui.ok ? "ready" : "error");
|
|
840
|
-
return {
|
|
841
|
-
ok: Boolean(binary) && webui.ok,
|
|
842
|
-
binary,
|
|
843
|
-
binaryPath: binary,
|
|
844
|
-
agentDir,
|
|
845
|
-
webuiDir: webui.dir,
|
|
846
|
-
detail: webui.ok ? "Runtime Hermes + WebUI prêts" : webui.detail,
|
|
847
|
-
};
|
|
848
|
-
}
|
|
849
|
-
function __resetBootstrapStateForTests() {
|
|
850
|
-
phase = "idle";
|
|
851
|
-
lastBootstrapError = null;
|
|
852
|
-
}
|
|
853
|
-
//# sourceMappingURL=runtime-bootstrap.js.map
|