@melaya/runner 1.0.91 → 1.0.92
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/dist/connection.js +15 -0
- package/package.json +1 -1
package/dist/connection.js
CHANGED
|
@@ -874,6 +874,14 @@ export async function connect(opts) {
|
|
|
874
874
|
mkdirSync(workDir, { recursive: true });
|
|
875
875
|
const stagedHost = join(workDir, "assistantHost.py");
|
|
876
876
|
copyFileSync(hostScript, stagedHost);
|
|
877
|
+
// If Luma is enabled for this chat, make sure the browser bridge is up so
|
|
878
|
+
// luma_register_event can route /event/register through Playwright and clear
|
|
879
|
+
// Cloudflare's write-bot rule. Without it the tool falls back to aiohttp,
|
|
880
|
+
// which 403s ("cloudflare_mitigation" / "velocity_throttled") on every RSVP.
|
|
881
|
+
// Idempotent + best-effort; only paid when luma is actually selected.
|
|
882
|
+
if (Array.isArray(payload.connectors) && payload.connectors.includes("luma")) {
|
|
883
|
+
await _ensureLumaBridge();
|
|
884
|
+
}
|
|
877
885
|
const sharedDir = getSharedDir();
|
|
878
886
|
const certBundle = (await import("./pythonEnv.js")).getCertBundlePath();
|
|
879
887
|
const sslEnv = certBundle ? { SSL_CERT_FILE: certBundle, REQUESTS_CA_BUNDLE: certBundle } : {};
|
|
@@ -899,6 +907,13 @@ export async function connect(opts) {
|
|
|
899
907
|
MEL_ASSISTANT_CONNECTORS: Array.isArray(payload.connectors) ? payload.connectors.join(",") : "",
|
|
900
908
|
// Gate write connector-tools behind the in-chat approval card (fail-safe).
|
|
901
909
|
MEL_ASSISTANT_CONNECTOR_HITL: Array.isArray(payload.connectors) && payload.connectors.length ? "1" : "",
|
|
910
|
+
// Luma browser bridge (same injection as pipeline runs, line ~431): lets
|
|
911
|
+
// shared/tools/luma.py route /event/register through Playwright and bypass
|
|
912
|
+
// Cloudflare's write rule. Reads keep using aiohttp. Empty when no signed-in
|
|
913
|
+
// Luma session exists (bridge not started) — reads still work, writes 403.
|
|
914
|
+
...(lumaBridge
|
|
915
|
+
? { MEL_LUMA_BROWSER_URL: lumaBridge.url, MEL_LUMA_BROWSER_TOKEN: lumaBridge.token }
|
|
916
|
+
: {}),
|
|
902
917
|
// Per-user creds (incl. MELAYA_API_KEY + the selected connectors' env).
|
|
903
918
|
...(payload.credentials || {}),
|
|
904
919
|
};
|