@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,430 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime plugins kit — scaffold UI + wrappers discover (N1).
|
|
3
|
-
*
|
|
4
|
-
* Types / parse / discover purs → `@creezio/platform-core`.
|
|
5
|
-
* Scaffold (CSS kit + index.js proxy CRM) porté depuis TF gold plugin-runtime.ts
|
|
6
|
-
* avec injection `envPrefix` / `productName` via brand-bindings.
|
|
7
|
-
*/
|
|
8
|
-
import fs from "node:fs";
|
|
9
|
-
import path from "node:path";
|
|
10
|
-
import { PLUGIN_MANIFEST_FILE, discoverPlugins as discoverPluginsCore, hasPluginPermission, isValidPluginId, parsePluginManifest, pluginEnabledFlagPath, pluginSiteId, pluginsRootDir as pluginsRootDirCore, setPluginEnabled, } from "@creezio/platform-core";
|
|
11
|
-
import { getPluginHostBindings, tryGetPluginHostBindings, } from "./brand-bindings.js";
|
|
12
|
-
export { PLUGIN_MANIFEST_FILE, hasPluginPermission, isValidPluginId, parsePluginManifest, pluginEnabledFlagPath, pluginSiteId, setPluginEnabled, };
|
|
13
|
-
export function pluginsRootDir(userDataDir) {
|
|
14
|
-
if (userDataDir)
|
|
15
|
-
return pluginsRootDirCore(userDataDir);
|
|
16
|
-
const b = tryGetPluginHostBindings();
|
|
17
|
-
if (b)
|
|
18
|
-
return pluginsRootDirCore(b.userDataDir());
|
|
19
|
-
throw new Error("pluginsRootDir: passer userDataDir ou appeler configurePluginHost()");
|
|
20
|
-
}
|
|
21
|
-
export function discoverPlugins(root) {
|
|
22
|
-
return discoverPluginsCore(root || pluginsRootDir());
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* CSS kit plugin (classes tf- — contrat G5 accept-check, inchangé TF gold).
|
|
26
|
-
* Écrit uniquement au scaffold.
|
|
27
|
-
*/
|
|
28
|
-
export function scaffoldPluginUiCss() {
|
|
29
|
-
return `/* Creezio / TempoFlow plugin UI kit — thème clair (classes tf-) */
|
|
30
|
-
:root {
|
|
31
|
-
--tf-bg: #faf7f1;
|
|
32
|
-
--tf-surface: #ffffff;
|
|
33
|
-
--tf-border: #e2e8f0;
|
|
34
|
-
--tf-text: #14182f;
|
|
35
|
-
--tf-muted: #64748b;
|
|
36
|
-
--tf-primary: #0f172a;
|
|
37
|
-
--tf-primary-hover: #1e293b;
|
|
38
|
-
--tf-primary-fg: #ffffff;
|
|
39
|
-
--tf-danger: #dc2626;
|
|
40
|
-
--tf-danger-bg: #fef2f2;
|
|
41
|
-
--tf-success: #047857;
|
|
42
|
-
--tf-success-bg: #ecfdf5;
|
|
43
|
-
--tf-radius: 8px;
|
|
44
|
-
--tf-radius-sm: 6px;
|
|
45
|
-
--tf-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
46
|
-
--tf-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
47
|
-
}
|
|
48
|
-
* { box-sizing: border-box; }
|
|
49
|
-
body {
|
|
50
|
-
margin: 0;
|
|
51
|
-
font-family: var(--tf-font);
|
|
52
|
-
background: var(--tf-bg);
|
|
53
|
-
color: var(--tf-text);
|
|
54
|
-
padding: 24px;
|
|
55
|
-
line-height: 1.5;
|
|
56
|
-
font-size: 14px;
|
|
57
|
-
}
|
|
58
|
-
h1 { font-size: 1.25rem; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.01em; }
|
|
59
|
-
h2 { font-size: 1rem; margin: 16px 0 8px; font-weight: 600; }
|
|
60
|
-
code { font-size: 0.85em; background: #f1f5f9; border-radius: 4px; padding: 1px 4px; }
|
|
61
|
-
|
|
62
|
-
.tf-muted { color: var(--tf-muted); font-size: 0.875rem; }
|
|
63
|
-
.tf-err { color: var(--tf-danger); font-size: 0.875rem; }
|
|
64
|
-
|
|
65
|
-
.tf-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; align-items: center; }
|
|
66
|
-
|
|
67
|
-
.tf-btn, button {
|
|
68
|
-
display: inline-flex;
|
|
69
|
-
align-items: center;
|
|
70
|
-
gap: 6px;
|
|
71
|
-
background: var(--tf-surface);
|
|
72
|
-
color: var(--tf-text);
|
|
73
|
-
border: 1px solid var(--tf-border);
|
|
74
|
-
border-radius: var(--tf-radius-sm);
|
|
75
|
-
padding: 7px 14px;
|
|
76
|
-
font: inherit;
|
|
77
|
-
font-size: 0.875rem;
|
|
78
|
-
font-weight: 500;
|
|
79
|
-
cursor: pointer;
|
|
80
|
-
box-shadow: var(--tf-shadow);
|
|
81
|
-
}
|
|
82
|
-
.tf-btn:hover, button:hover { background: #f8fafc; }
|
|
83
|
-
.tf-btn-primary, button.tf-btn-primary {
|
|
84
|
-
background: var(--tf-primary);
|
|
85
|
-
color: var(--tf-primary-fg);
|
|
86
|
-
border-color: var(--tf-primary);
|
|
87
|
-
}
|
|
88
|
-
.tf-btn-primary:hover, button.tf-btn-primary:hover { background: var(--tf-primary-hover); }
|
|
89
|
-
.tf-btn-danger, button.tf-btn-danger {
|
|
90
|
-
background: var(--tf-danger);
|
|
91
|
-
color: #ffffff;
|
|
92
|
-
border-color: var(--tf-danger);
|
|
93
|
-
}
|
|
94
|
-
.tf-btn:disabled, button:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
95
|
-
|
|
96
|
-
.tf-card {
|
|
97
|
-
background: var(--tf-surface);
|
|
98
|
-
border: 1px solid var(--tf-border);
|
|
99
|
-
border-radius: var(--tf-radius);
|
|
100
|
-
padding: 14px 16px;
|
|
101
|
-
margin-top: 8px;
|
|
102
|
-
box-shadow: var(--tf-shadow);
|
|
103
|
-
}
|
|
104
|
-
.tf-card-title { font-size: 0.9rem; font-weight: 600; margin: 0 0 8px; }
|
|
105
|
-
|
|
106
|
-
.tf-badge {
|
|
107
|
-
display: inline-block;
|
|
108
|
-
border-radius: 9999px;
|
|
109
|
-
padding: 2px 10px;
|
|
110
|
-
font-size: 0.75rem;
|
|
111
|
-
font-weight: 500;
|
|
112
|
-
background: #f1f5f9;
|
|
113
|
-
color: #334155;
|
|
114
|
-
}
|
|
115
|
-
.tf-badge-success { background: var(--tf-success-bg); color: var(--tf-success); }
|
|
116
|
-
.tf-badge-danger { background: var(--tf-danger-bg); color: var(--tf-danger); }
|
|
117
|
-
|
|
118
|
-
.tf-input, .tf-select, .tf-textarea,
|
|
119
|
-
input[type="text"], input[type="number"], input[type="date"], select, textarea {
|
|
120
|
-
width: 100%;
|
|
121
|
-
max-width: 420px;
|
|
122
|
-
background: var(--tf-surface);
|
|
123
|
-
color: var(--tf-text);
|
|
124
|
-
border: 1px solid var(--tf-border);
|
|
125
|
-
border-radius: var(--tf-radius-sm);
|
|
126
|
-
padding: 7px 10px;
|
|
127
|
-
font: inherit;
|
|
128
|
-
font-size: 0.875rem;
|
|
129
|
-
}
|
|
130
|
-
.tf-input:focus, .tf-select:focus, .tf-textarea:focus,
|
|
131
|
-
input:focus, select:focus, textarea:focus {
|
|
132
|
-
outline: 2px solid #94a3b8;
|
|
133
|
-
outline-offset: 1px;
|
|
134
|
-
}
|
|
135
|
-
label { font-size: 0.8rem; font-weight: 500; color: #334155; display: block; margin-bottom: 4px; }
|
|
136
|
-
|
|
137
|
-
.tf-table { width: 100%; border-collapse: collapse; background: var(--tf-surface); border: 1px solid var(--tf-border); border-radius: var(--tf-radius); overflow: hidden; }
|
|
138
|
-
.tf-table th {
|
|
139
|
-
text-align: left;
|
|
140
|
-
font-size: 0.75rem;
|
|
141
|
-
font-weight: 500;
|
|
142
|
-
color: var(--tf-muted);
|
|
143
|
-
background: #f8fafc;
|
|
144
|
-
padding: 8px 12px;
|
|
145
|
-
border-bottom: 1px solid var(--tf-border);
|
|
146
|
-
}
|
|
147
|
-
.tf-table td { padding: 8px 12px; border-bottom: 1px solid var(--tf-border); font-size: 0.875rem; }
|
|
148
|
-
.tf-table tr:last-child td { border-bottom: 0; }
|
|
149
|
-
|
|
150
|
-
.tf-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--tf-border); margin: 16px 0 12px; }
|
|
151
|
-
.tf-tab {
|
|
152
|
-
background: transparent;
|
|
153
|
-
border: 0;
|
|
154
|
-
border-bottom: 2px solid transparent;
|
|
155
|
-
border-radius: 0;
|
|
156
|
-
box-shadow: none;
|
|
157
|
-
padding: 8px 12px;
|
|
158
|
-
font-size: 0.875rem;
|
|
159
|
-
color: var(--tf-muted);
|
|
160
|
-
cursor: pointer;
|
|
161
|
-
}
|
|
162
|
-
.tf-tab:hover { background: transparent; color: var(--tf-text); }
|
|
163
|
-
.tf-tab.active { color: var(--tf-text); font-weight: 600; border-bottom-color: var(--tf-primary); }
|
|
164
|
-
|
|
165
|
-
.tf-list { list-style: none; padding: 0; margin: 0; }
|
|
166
|
-
.tf-list li { border-bottom: 1px solid var(--tf-border); padding: 8px 0; font-size: 0.875rem; }
|
|
167
|
-
.tf-list li:last-child { border-bottom: 0; }
|
|
168
|
-
.tf-empty {
|
|
169
|
-
border: 1px dashed var(--tf-border);
|
|
170
|
-
border-radius: var(--tf-radius);
|
|
171
|
-
padding: 20px;
|
|
172
|
-
text-align: center;
|
|
173
|
-
color: var(--tf-muted);
|
|
174
|
-
font-size: 0.875rem;
|
|
175
|
-
background: var(--tf-surface);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.muted { color: var(--tf-muted); font-size: 0.875rem; }
|
|
179
|
-
.err { color: var(--tf-danger); }
|
|
180
|
-
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
|
|
181
|
-
.card {
|
|
182
|
-
background: var(--tf-surface);
|
|
183
|
-
border: 1px solid var(--tf-border);
|
|
184
|
-
border-radius: var(--tf-radius);
|
|
185
|
-
padding: 12px 14px;
|
|
186
|
-
margin-top: 8px;
|
|
187
|
-
}
|
|
188
|
-
ul.list { list-style: none; padding: 0; margin: 0; }
|
|
189
|
-
ul.list li { border-bottom: 1px solid var(--tf-border); padding: 8px 0; font-size: 0.9rem; }
|
|
190
|
-
ul.list li:last-child { border-bottom: 0; }
|
|
191
|
-
`;
|
|
192
|
-
}
|
|
193
|
-
function scaffoldIndexJs(manifest, envPrefix, productName) {
|
|
194
|
-
const idJson = JSON.stringify(manifest.id);
|
|
195
|
-
const nameJson = JSON.stringify(manifest.name);
|
|
196
|
-
const siteId = pluginSiteId(manifest.id);
|
|
197
|
-
const prefixJson = JSON.stringify(envPrefix);
|
|
198
|
-
const productJson = JSON.stringify(productName);
|
|
199
|
-
return `#!/usr/bin/env node
|
|
200
|
-
"use strict";
|
|
201
|
-
// Plugin ${manifest.id} — scaffold Creezio (proxy CRM + UI kit)
|
|
202
|
-
const http = require("http");
|
|
203
|
-
const fs = require("fs");
|
|
204
|
-
const path = require("path");
|
|
205
|
-
const ENV_PREFIX = ${prefixJson};
|
|
206
|
-
const PRODUCT_NAME = ${productJson};
|
|
207
|
-
const port = Number(process.env[ENV_PREFIX + "_PLUGIN_PORT"] || 0) || 0;
|
|
208
|
-
const pluginId = process.env[ENV_PREFIX + "_PLUGIN_ID"] || ${idJson};
|
|
209
|
-
const crmBase = (process.env[ENV_PREFIX + "_API_URL"] || "").replace(/\\/+$/, "");
|
|
210
|
-
const crmKey = process.env[ENV_PREFIX + "_API_KEY"] || "";
|
|
211
|
-
|
|
212
|
-
function send(res, code, body, type) {
|
|
213
|
-
const t = type || "application/json";
|
|
214
|
-
const data = typeof body === "string" ? body : JSON.stringify(body);
|
|
215
|
-
res.writeHead(code, { "Content-Type": t + (t.includes("charset") ? "" : "; charset=utf-8") });
|
|
216
|
-
res.end(data);
|
|
217
|
-
}
|
|
218
|
-
function readBody(req) {
|
|
219
|
-
return new Promise((resolve) => {
|
|
220
|
-
const chunks = [];
|
|
221
|
-
req.on("data", (c) => chunks.push(c));
|
|
222
|
-
req.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
async function proxyCrm(reqPath, req) {
|
|
226
|
-
if (!crmBase || !crmKey) {
|
|
227
|
-
return { status: 503, body: { ok: false, error: ENV_PREFIX + "_API_* absent (permission crm:read ?)" } };
|
|
228
|
-
}
|
|
229
|
-
const suffix = reqPath.replace(/^\\/api\\/crm\\/?/, "");
|
|
230
|
-
const target = crmBase + "/api/v1/" + suffix + (req.url && req.url.includes("?") ? req.url.slice(req.url.indexOf("?")) : "");
|
|
231
|
-
const headers = {
|
|
232
|
-
Authorization: "Bearer " + crmKey,
|
|
233
|
-
Accept: "application/json",
|
|
234
|
-
};
|
|
235
|
-
let body;
|
|
236
|
-
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
237
|
-
body = await readBody(req);
|
|
238
|
-
headers["Content-Type"] = req.headers["content-type"] || "application/json";
|
|
239
|
-
}
|
|
240
|
-
const res = await fetch(target, {
|
|
241
|
-
method: req.method || "GET",
|
|
242
|
-
headers,
|
|
243
|
-
body,
|
|
244
|
-
signal: AbortSignal.timeout(12000),
|
|
245
|
-
});
|
|
246
|
-
const text = await res.text();
|
|
247
|
-
let parsed;
|
|
248
|
-
try { parsed = JSON.parse(text); } catch { parsed = { raw: text.slice(0, 2000) }; }
|
|
249
|
-
return { status: res.status, body: parsed };
|
|
250
|
-
}
|
|
251
|
-
async function proxyLlm(req) {
|
|
252
|
-
const raw = await readBody(req);
|
|
253
|
-
let payload = {};
|
|
254
|
-
try { payload = raw ? JSON.parse(raw) : {}; } catch {
|
|
255
|
-
return { status: 400, body: { ok: false, error: "JSON invalide" } };
|
|
256
|
-
}
|
|
257
|
-
const provider = String(payload.provider || "openai");
|
|
258
|
-
const model = String(payload.model || (provider === "anthropic" ? "claude-sonnet-4-20250514" : "gpt-4o-mini"));
|
|
259
|
-
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
|
260
|
-
if (!messages.length) {
|
|
261
|
-
return { status: 400, body: { ok: false, error: "messages requis" } };
|
|
262
|
-
}
|
|
263
|
-
if (provider === "anthropic") {
|
|
264
|
-
const key = process.env.ANTHROPIC_API_KEY || "";
|
|
265
|
-
if (!key) return { status: 503, body: { ok: false, error: "ANTHROPIC_API_KEY absent (permission llm:use + BYOK)" } };
|
|
266
|
-
const system = messages.filter((m) => m.role === "system").map((m) => m.content).join("\\n");
|
|
267
|
-
const userMsgs = messages.filter((m) => m.role !== "system").map((m) => ({
|
|
268
|
-
role: m.role === "assistant" ? "assistant" : "user",
|
|
269
|
-
content: String(m.content || ""),
|
|
270
|
-
}));
|
|
271
|
-
const res = await fetch("https://api.anthropic.com/v1/messages", {
|
|
272
|
-
method: "POST",
|
|
273
|
-
headers: {
|
|
274
|
-
"x-api-key": key,
|
|
275
|
-
"anthropic-version": "2023-06-01",
|
|
276
|
-
"content-type": "application/json",
|
|
277
|
-
},
|
|
278
|
-
body: JSON.stringify({
|
|
279
|
-
model,
|
|
280
|
-
max_tokens: Number(payload.max_tokens) || 1024,
|
|
281
|
-
system: system || undefined,
|
|
282
|
-
messages: userMsgs,
|
|
283
|
-
}),
|
|
284
|
-
signal: AbortSignal.timeout(60000),
|
|
285
|
-
});
|
|
286
|
-
const data = await res.json().catch(() => ({}));
|
|
287
|
-
return { status: res.status, body: { ok: res.ok, provider, model, data } };
|
|
288
|
-
}
|
|
289
|
-
const key = process.env.OPENAI_API_KEY || "";
|
|
290
|
-
if (!key) return { status: 503, body: { ok: false, error: "OPENAI_API_KEY absent (permission llm:use + BYOK)" } };
|
|
291
|
-
const res = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
292
|
-
method: "POST",
|
|
293
|
-
headers: {
|
|
294
|
-
Authorization: "Bearer " + key,
|
|
295
|
-
"Content-Type": "application/json",
|
|
296
|
-
},
|
|
297
|
-
body: JSON.stringify({
|
|
298
|
-
model,
|
|
299
|
-
messages: messages.map((m) => ({ role: m.role, content: String(m.content || "") })),
|
|
300
|
-
temperature: payload.temperature,
|
|
301
|
-
}),
|
|
302
|
-
signal: AbortSignal.timeout(60000),
|
|
303
|
-
});
|
|
304
|
-
const data = await res.json().catch(() => ({}));
|
|
305
|
-
return { status: res.status, body: { ok: res.ok, provider, model, data } };
|
|
306
|
-
}
|
|
307
|
-
function panelHtml() {
|
|
308
|
-
return "<!doctype html><html lang=\\"fr\\"><head><meta charset=utf-8><title>" + ${nameJson} +
|
|
309
|
-
"</title><link rel=\\"stylesheet\\" href=\\"/plugin-ui.css\\"></head><body>" +
|
|
310
|
-
"<h1>" + ${nameJson} + "</h1>" +
|
|
311
|
-
"<p class=\\"tf-muted\\">Module <code>" + pluginId + "</code> · Mes produits = stack via proxy Node</p>" +
|
|
312
|
-
"<div class=\\"tf-row\\"><button id=\\"load\\" type=\\"button\\" class=\\"tf-btn tf-btn-primary\\">Charger mes produits</button>" +
|
|
313
|
-
"<span id=\\"status\\" class=\\"tf-muted\\">Prêt.</span></div>" +
|
|
314
|
-
"<div id=\\"out\\"></div>" +
|
|
315
|
-
"<script>(function(){" +
|
|
316
|
-
"var btn=document.getElementById('load');" +
|
|
317
|
-
"var st=document.getElementById('status');" +
|
|
318
|
-
"var out=document.getElementById('out');" +
|
|
319
|
-
"btn.onclick=async function(){" +
|
|
320
|
-
"btn.disabled=true;st.textContent='Chargement…';st.className='tf-muted';out.innerHTML='';" +
|
|
321
|
-
"try{" +
|
|
322
|
-
"var r=await fetch('/api/crm/stack/items');" +
|
|
323
|
-
"var j=await r.json();" +
|
|
324
|
-
"if(!r.ok){throw new Error((j&&j.error)||('HTTP '+r.status));}" +
|
|
325
|
-
"var items=j.items||j||[];" +
|
|
326
|
-
"if(!Array.isArray(items))items=[];" +
|
|
327
|
-
"st.textContent=items.length? (items.length+' produit(s)') : 'Aucun produit dans Mes produits (stack vide)';" +
|
|
328
|
-
"if(!items.length){out.innerHTML='<div class=\\"tf-empty\\">Stack vide — ajoute des produits dans ' + PRODUCT_NAME + ' → Mes produits.</div>';}" +
|
|
329
|
-
"else{out.innerHTML='<div class=\\"tf-card\\"><table class=\\"tf-table\\"><thead><tr><th>Produit</th><th>Réf.</th></tr></thead><tbody>'+items.map(function(it){" +
|
|
330
|
-
"return '<tr><td><strong>'+ (it.nom||it.sku||('#'+it.sku_id)) +'</strong></td><td><span class=\\"tf-badge\\">'+(it.sku||'—')+'</span></td></tr>';" +
|
|
331
|
-
"}).join('')+'</tbody></table></div>';}" +
|
|
332
|
-
"}catch(e){st.className='tf-err';st.textContent=String(e.message||e);}" +
|
|
333
|
-
"finally{btn.disabled=false;}" +
|
|
334
|
-
"};" +
|
|
335
|
-
"})();</script></body></html>";
|
|
336
|
-
}
|
|
337
|
-
const server = http.createServer(async (req, res) => {
|
|
338
|
-
const url = new URL(req.url || "/", "http://127.0.0.1");
|
|
339
|
-
const p = url.pathname;
|
|
340
|
-
try {
|
|
341
|
-
if (req.method === "GET" && (p === "/" || p === "/panel")) {
|
|
342
|
-
send(res, 200, panelHtml(), "text/html; charset=utf-8");
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
if (req.method === "GET" && p === "/plugin-ui.css") {
|
|
346
|
-
let css = "";
|
|
347
|
-
try { css = fs.readFileSync(path.join(__dirname, "plugin-ui.css"), "utf8"); } catch { css = "body{font-family:Inter,system-ui;padding:24px;background:#faf7f1;color:#14182f}"; }
|
|
348
|
-
send(res, 200, css, "text/css; charset=utf-8");
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
if (req.method === "GET" && p === "/health") {
|
|
352
|
-
send(res, 200, {
|
|
353
|
-
ok: true,
|
|
354
|
-
plugin: pluginId,
|
|
355
|
-
crm: Boolean(crmBase && crmKey),
|
|
356
|
-
llm: Boolean(process.env.OPENAI_API_KEY || process.env.ANTHROPIC_API_KEY),
|
|
357
|
-
});
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
if (p.startsWith("/api/crm/")) {
|
|
361
|
-
const r = await proxyCrm(p, req);
|
|
362
|
-
send(res, r.status, r.body);
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
if (req.method === "POST" && p === "/api/llm/chat") {
|
|
366
|
-
const r = await proxyLlm(req);
|
|
367
|
-
send(res, r.status, r.body);
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
if (req.method === "POST" && p.startsWith("/hooks/")) {
|
|
371
|
-
const event = decodeURIComponent(p.slice("/hooks/".length));
|
|
372
|
-
const body = await readBody(req);
|
|
373
|
-
console.log(JSON.stringify({ event: "hook", name: event, body: body.slice(0, 2000) }));
|
|
374
|
-
send(res, 200, { ok: true, plugin: pluginId, hook: event });
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
if (req.method === "POST" && p === "/webhooks/n8n") {
|
|
378
|
-
const body = await readBody(req);
|
|
379
|
-
console.log(JSON.stringify({ event: "n8n-webhook", body: body.slice(0, 2000) }));
|
|
380
|
-
send(res, 200, { ok: true, plugin: pluginId, source: "n8n" });
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
send(res, 404, { ok: false, error: "not found", path: p });
|
|
384
|
-
} catch (e) {
|
|
385
|
-
send(res, 500, { ok: false, error: e instanceof Error ? e.message : String(e) });
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
server.listen(port || 0, "127.0.0.1", () => {
|
|
389
|
-
const addr = server.address();
|
|
390
|
-
const p = typeof addr === "object" && addr ? addr.port : port;
|
|
391
|
-
console.log(JSON.stringify({ event: "ready", plugin: pluginId, port: p, siteId: ${siteId} }));
|
|
392
|
-
});
|
|
393
|
-
`;
|
|
394
|
-
}
|
|
395
|
-
/** Scaffold minimal pour Hermes / import — proxy CRM + kit UI + smokes. */
|
|
396
|
-
export function scaffoldPlugin(opts) {
|
|
397
|
-
const bindings = getPluginHostBindings();
|
|
398
|
-
if (!isValidPluginId(opts.id)) {
|
|
399
|
-
throw new Error(`id invalide: ${opts.id}`);
|
|
400
|
-
}
|
|
401
|
-
const dir = path.join(pluginsRootDir(), opts.id);
|
|
402
|
-
if (fs.existsSync(dir)) {
|
|
403
|
-
throw new Error(`plugin déjà présent: ${opts.id}`);
|
|
404
|
-
}
|
|
405
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
406
|
-
const name = opts.name || opts.id;
|
|
407
|
-
const manifest = {
|
|
408
|
-
id: opts.id,
|
|
409
|
-
name,
|
|
410
|
-
version: "0.1.0",
|
|
411
|
-
description: opts.description || `Plugin ${bindings.productName}`,
|
|
412
|
-
main: "index.js",
|
|
413
|
-
permissions: ["crm:read", "net:loopback", "ui:panel"],
|
|
414
|
-
hooks: ["panier.updated", "panier.closed", "commande.created"],
|
|
415
|
-
panel: { title: name, path: "/" },
|
|
416
|
-
acceptance: {
|
|
417
|
-
smoke: [
|
|
418
|
-
{ method: "GET", path: "/health", expectStatus: 200 },
|
|
419
|
-
{ method: "GET", path: "/api/crm/stack/items", expectStatus: 200 },
|
|
420
|
-
],
|
|
421
|
-
},
|
|
422
|
-
source: opts.source || "hermes",
|
|
423
|
-
};
|
|
424
|
-
fs.writeFileSync(path.join(dir, PLUGIN_MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}\n`, "utf8");
|
|
425
|
-
fs.writeFileSync(path.join(dir, "plugin-ui.css"), scaffoldPluginUiCss(), "utf8");
|
|
426
|
-
fs.writeFileSync(path.join(dir, "index.js"), scaffoldIndexJs(manifest, bindings.envPrefix, bindings.productName), "utf8");
|
|
427
|
-
setPluginEnabled(dir, true);
|
|
428
|
-
return { dir, manifest };
|
|
429
|
-
}
|
|
430
|
-
//# sourceMappingURL=runtime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/host/plugins/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,eAAe,IAAI,mBAAmB,EACtC,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,cAAc,IAAI,kBAAkB,EACpC,gBAAgB,GAOjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,GACjB,CAAC;AAUF,MAAM,UAAU,cAAc,CAAC,WAAoB;IACjD,IAAI,WAAW;QAAE,OAAO,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACxD,MAAM,CAAC,GAAG,wBAAwB,EAA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Y,EAAE,GAAG,EAAE;gBACrD,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,YAAY,EAAE,GAAG,EAAE;aACnE;SACF;QACD,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,QAAQ;KAChC,CAAC;IACF,EAAE,CAAC,aAAa,CACd,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,EACpC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EACxC,MAAM,CACP,CAAC;IACF,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,EAAE,mBAAmB,EAAE,EAAE,MAAM,CAAC,CAAC;IACjF,EAAE,CAAC,aAAa,CACd,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,EAC1B,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,EACnE,MAAM,CACP,CAAC;IACF,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC5B,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runner tests plugins (`node --test`) — port TF gold plugin-test-runner.ts (N1).
|
|
3
|
-
*/
|
|
4
|
-
export type PluginTestResult = {
|
|
5
|
-
ok: boolean;
|
|
6
|
-
pluginId: string;
|
|
7
|
-
files: string[];
|
|
8
|
-
exitCode: number | null;
|
|
9
|
-
timedOut: boolean;
|
|
10
|
-
stdout: string;
|
|
11
|
-
stderr: string;
|
|
12
|
-
durationMs: number;
|
|
13
|
-
};
|
|
14
|
-
export declare function runPluginTests(pluginId: string): Promise<PluginTestResult>;
|
|
15
|
-
//# sourceMappingURL=test-runner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-runner.d.ts","sourceRoot":"","sources":["../../../src/host/plugins/test-runner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAyCF,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,CAAC,CAkE3B"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runner tests plugins (`node --test`) — port TF gold plugin-test-runner.ts (N1).
|
|
3
|
-
*/
|
|
4
|
-
import fs from "node:fs";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import { spawn } from "node:child_process";
|
|
7
|
-
import { assignPluginEnv, getPluginHostBindings } from "./brand-bindings.js";
|
|
8
|
-
import { discoverPlugins } from "./runtime.js";
|
|
9
|
-
function safeTestFiles(pluginDir) {
|
|
10
|
-
const testsDir = path.join(pluginDir, "tests");
|
|
11
|
-
let timeoutMs = 30_000;
|
|
12
|
-
let configured = [];
|
|
13
|
-
const manifestPath = path.join(pluginDir, "test-manifest.json");
|
|
14
|
-
if (fs.existsSync(manifestPath)) {
|
|
15
|
-
const parsed = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
16
|
-
configured = Array.isArray(parsed.tests) ? parsed.tests.map(String) : [];
|
|
17
|
-
if (Number.isFinite(parsed.timeoutMs)) {
|
|
18
|
-
timeoutMs = Math.min(120_000, Math.max(1_000, Number(parsed.timeoutMs)));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else if (fs.existsSync(testsDir)) {
|
|
22
|
-
configured = fs
|
|
23
|
-
.readdirSync(testsDir)
|
|
24
|
-
.filter((name) => name.endsWith(".test.mjs"))
|
|
25
|
-
.map((name) => `tests/${name}`);
|
|
26
|
-
}
|
|
27
|
-
const files = configured.map((relative) => {
|
|
28
|
-
if (!/^tests\/[A-Za-z0-9_.-]+\.test\.mjs$/.test(relative)) {
|
|
29
|
-
throw new Error(`chemin de test refusé: ${relative}`);
|
|
30
|
-
}
|
|
31
|
-
const absolute = path.resolve(pluginDir, relative);
|
|
32
|
-
if (!absolute.startsWith(`${path.resolve(pluginDir)}${path.sep}`) ||
|
|
33
|
-
!fs.existsSync(absolute)) {
|
|
34
|
-
throw new Error(`test introuvable: ${relative}`);
|
|
35
|
-
}
|
|
36
|
-
return absolute;
|
|
37
|
-
});
|
|
38
|
-
return { files, timeoutMs };
|
|
39
|
-
}
|
|
40
|
-
export async function runPluginTests(pluginId) {
|
|
41
|
-
const bindings = getPluginHostBindings();
|
|
42
|
-
const plugin = discoverPlugins().find((row) => row.manifest.id === pluginId);
|
|
43
|
-
if (!plugin || plugin.error) {
|
|
44
|
-
throw new Error(plugin?.error || "plugin introuvable");
|
|
45
|
-
}
|
|
46
|
-
const { files, timeoutMs } = safeTestFiles(plugin.dir);
|
|
47
|
-
if (!files.length) {
|
|
48
|
-
return {
|
|
49
|
-
ok: true,
|
|
50
|
-
pluginId,
|
|
51
|
-
files: [],
|
|
52
|
-
exitCode: 0,
|
|
53
|
-
timedOut: false,
|
|
54
|
-
stdout: "Aucun test déclaré.",
|
|
55
|
-
stderr: "",
|
|
56
|
-
durationMs: 0,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
const started = Date.now();
|
|
60
|
-
return new Promise((resolve, reject) => {
|
|
61
|
-
const env = {
|
|
62
|
-
PATH: process.env.PATH,
|
|
63
|
-
NODE_ENV: "test",
|
|
64
|
-
};
|
|
65
|
-
assignPluginEnv(env, bindings, "PLUGIN_ID", pluginId);
|
|
66
|
-
const child = spawn(bindings.nodeBinary(), ["--test", ...files], {
|
|
67
|
-
cwd: plugin.dir,
|
|
68
|
-
env,
|
|
69
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
70
|
-
windowsHide: true,
|
|
71
|
-
shell: false,
|
|
72
|
-
});
|
|
73
|
-
let stdout = "";
|
|
74
|
-
let stderr = "";
|
|
75
|
-
let timedOut = false;
|
|
76
|
-
const append = (current, chunk) => (current + chunk.toString("utf8")).slice(-256_000);
|
|
77
|
-
child.stdout.on("data", (chunk) => {
|
|
78
|
-
stdout = append(stdout, chunk);
|
|
79
|
-
});
|
|
80
|
-
child.stderr.on("data", (chunk) => {
|
|
81
|
-
stderr = append(stderr, chunk);
|
|
82
|
-
});
|
|
83
|
-
const timer = setTimeout(() => {
|
|
84
|
-
timedOut = true;
|
|
85
|
-
child.kill("SIGKILL");
|
|
86
|
-
}, timeoutMs);
|
|
87
|
-
child.on("error", (error) => {
|
|
88
|
-
clearTimeout(timer);
|
|
89
|
-
reject(error);
|
|
90
|
-
});
|
|
91
|
-
child.on("close", (exitCode) => {
|
|
92
|
-
clearTimeout(timer);
|
|
93
|
-
resolve({
|
|
94
|
-
ok: exitCode === 0 && !timedOut,
|
|
95
|
-
pluginId,
|
|
96
|
-
files: files.map((file) => path.relative(plugin.dir, file)),
|
|
97
|
-
exitCode,
|
|
98
|
-
timedOut,
|
|
99
|
-
stdout,
|
|
100
|
-
stderr,
|
|
101
|
-
durationMs: Date.now() - started,
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=test-runner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-runner.js","sourceRoot":"","sources":["../../../src/host/plugins/test-runner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE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AAC,CAAC;QACH,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;YACxC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,QAAQ,GAAG,IAAI,CAAC;YAChB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxB,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1B,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE;YAC7B,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC;gBACN,EAAE,EAAE,QAAQ,KAAK,CAAC,IAAI,CAAC,QAAQ;gBAC/B,QAAQ;gBACR,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;gBAC3D,QAAQ;gBACR,QAAQ;gBACR,MAAM;gBACN,MAAM;gBACN,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO;aACjC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Abstraction safeStorage Electron — chiffrement secrets local-config.
|
|
3
|
-
* Fallback plain si backend OS indisponible (documenté TF2).
|
|
4
|
-
*/
|
|
5
|
-
import { type StoredValue } from "@creezio/platform-core";
|
|
6
|
-
export type SafeStorageBackend = {
|
|
7
|
-
isEncryptionAvailable: () => boolean;
|
|
8
|
-
encryptString: (plain: string) => Buffer;
|
|
9
|
-
decryptString: (buffer: Buffer) => string;
|
|
10
|
-
};
|
|
11
|
-
/** Backend Electron `safeStorage` (chargé à la demande). */
|
|
12
|
-
export declare function loadElectronSafeStorage(): Promise<SafeStorageBackend>;
|
|
13
|
-
/**
|
|
14
|
-
* Variante sync pour `createLocalConfigStoreSync({ encryption: "electron" })`.
|
|
15
|
-
* Échec (hors Electron / module absent) → null (fallback plain).
|
|
16
|
-
*/
|
|
17
|
-
export declare function loadElectronSafeStorageSync(): SafeStorageBackend | null;
|
|
18
|
-
export declare function canEncrypt(backend: SafeStorageBackend | null): boolean;
|
|
19
|
-
export declare function sealValue(backend: SafeStorageBackend | null, value: string): StoredValue;
|
|
20
|
-
export declare function openValue(backend: SafeStorageBackend | null, v: StoredValue | undefined): string | null;
|
|
21
|
-
//# sourceMappingURL=safe-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"safe-storage.d.ts","sourceRoot":"","sources":["../../src/host/safe-storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,qBAAqB,EAAE,MAAM,OAAO,CAAC;IACrC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C,CAAC;AAEF,4DAA4D;AAC5D,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAG3E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,kBAAkB,GAAG,IAAI,CAQvE;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,GAAG,OAAO,CAOtE;AAED,wBAAgB,SAAS,CACvB,OAAO,EAAE,kBAAkB,GAAG,IAAI,EAClC,KAAK,EAAE,MAAM,GACZ,WAAW,CAKb;AAED,wBAAgB,SAAS,CACvB,OAAO,EAAE,kBAAkB,GAAG,IAAI,EAClC,CAAC,EAAE,WAAW,GAAG,SAAS,GACzB,MAAM,GAAG,IAAI,CASf"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Abstraction safeStorage Electron — chiffrement secrets local-config.
|
|
3
|
-
* Fallback plain si backend OS indisponible (documenté TF2).
|
|
4
|
-
*/
|
|
5
|
-
import { createAppRequire, } from "@creezio/platform-core";
|
|
6
|
-
/** Backend Electron `safeStorage` (chargé à la demande). */
|
|
7
|
-
export async function loadElectronSafeStorage() {
|
|
8
|
-
const { safeStorage } = await import("electron");
|
|
9
|
-
return safeStorage;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Variante sync pour `createLocalConfigStoreSync({ encryption: "electron" })`.
|
|
13
|
-
* Échec (hors Electron / module absent) → null (fallback plain).
|
|
14
|
-
*/
|
|
15
|
-
export function loadElectronSafeStorageSync() {
|
|
16
|
-
try {
|
|
17
|
-
const req = createAppRequire();
|
|
18
|
-
const electron = req("electron");
|
|
19
|
-
return electron.safeStorage ?? null;
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export function canEncrypt(backend) {
|
|
26
|
-
if (!backend)
|
|
27
|
-
return false;
|
|
28
|
-
try {
|
|
29
|
-
return backend.isEncryptionAvailable();
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export function sealValue(backend, value) {
|
|
36
|
-
if (canEncrypt(backend) && backend) {
|
|
37
|
-
return { enc: backend.encryptString(value).toString("base64") };
|
|
38
|
-
}
|
|
39
|
-
return { plain: value };
|
|
40
|
-
}
|
|
41
|
-
export function openValue(backend, v) {
|
|
42
|
-
if (!v)
|
|
43
|
-
return null;
|
|
44
|
-
if ("plain" in v)
|
|
45
|
-
return v.plain;
|
|
46
|
-
if (!backend)
|
|
47
|
-
return null;
|
|
48
|
-
try {
|
|
49
|
-
return backend.decryptString(Buffer.from(v.enc, "base64"));
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=safe-storage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"safe-storage.js","sourceRoot":"","sources":["../../src/host/safe-storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,gBAAgB,GAEjB,MAAM,wBAAwB,CAAC;AAQhC,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAC3C,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IACjD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B;IACzC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAyC,CAAC;QACzE,OAAO,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAkC;IAC3D,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,qBAAqB,EAAE,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,OAAkC,EAClC,KAAa;IAEb,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,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