@lobu/runtime-device 24.10.0 → 24.11.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/dist/component.json +1 -1
- package/dist/dependencies.bun.lock +5 -5
- package/npm-shrinkwrap.json +23 -23
- package/package.json +1 -1
- package/vendor/cli/dist/connectors/linkedin-inbox-adapter.js +13 -3
- package/vendor/cli/dist/connectors/whatsapp-web-adapter.js +14 -13
- package/vendor/cli/dist/connectors/whatsapp-web-helpers.ts +37 -1
- package/vendor/cli/dist/connectors/whatsapp_web.ts +5 -5
- package/vendor/cli/dist/connectors/x-dm-adapter.js +17 -3
- package/vendor/cli/dist/runtime-components.json +4 -4
- package/vendor/cli/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/connector-worker/dist/agent-turn/guest.bundle.js +1 -1
- package/vendor/connector-worker/package.json +1 -1
- package/vendor/core/package.json +1 -1
- package/vendor/views/package.json +1 -1
package/dist/component.json
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
"@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.91.1", "", { "dependencies": { "json-schema-to-ts": "^3.1.1" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" }, "optionalPeers": ["zod"], "bin": { "anthropic-ai-sdk": "bin/cli" } }, "sha512-LAmu761tSN9r66ixvmciswUj/ZC+1Q4iAfpedTfSVLeswRwnY3n2Nb6Tsk+cLPP28aLOPWeMgIuTuCcMC6W/iw=="],
|
|
38
38
|
|
|
39
|
-
"@aws-sdk/client-bedrock-runtime": ["@aws-sdk/client-bedrock-runtime@3.
|
|
39
|
+
"@aws-sdk/client-bedrock-runtime": ["@aws-sdk/client-bedrock-runtime@3.1169.0", "", { "dependencies": { "@aws-sdk/core": "^3.981.0", "@aws-sdk/credential-provider-node": "^3.972.97", "@aws-sdk/eventstream-handler-node": "^3.972.42", "@aws-sdk/middleware-eventstream": "^3.972.38", "@aws-sdk/middleware-websocket": "^3.972.66", "@aws-sdk/token-providers": "3.1169.0", "@aws-sdk/types": "^3.975.1", "@smithy/core": "^3.40.0", "@smithy/fetch-http-handler": "^5.8.1", "@smithy/node-http-handler": "^4.14.2", "@smithy/types": "^4.20.0", "tslib": "^2.6.2" } }, "sha512-KkMuq9IW+H8VHTEw/qV+ArI70w1WoqDuM/ZLX87MXB0yV31ihqY+2lwZ+zeD5spcZpmlLuUzXTPyMpWE2ZnbtA=="],
|
|
40
40
|
|
|
41
41
|
"@aws-sdk/core": ["@aws-sdk/core@3.981.0", "", { "dependencies": { "@aws-sdk/types": "^3.975.1", "@aws-sdk/xml-builder": "^3.972.43", "@aws/lambda-invoke-store": "^0.3.0", "@smithy/core": "^3.40.0", "@smithy/signature-v4": "^5.7.5", "@smithy/types": "^4.20.0", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, "sha512-Mnu7gaDrC5UCdyH8uLxLfB2eWbjE/HbjKX1U1J2VQxG3TTATUDObW2wU3I8iH3e9YH5NN2CY6w1mlAIe2XJ3jg=="],
|
|
42
42
|
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
|
|
67
67
|
"@aws-sdk/signature-v4-multi-region": ["@aws-sdk/signature-v4-multi-region@3.996.52", "", { "dependencies": { "@aws-sdk/types": "^3.975.1", "@smithy/signature-v4": "^5.7.5", "@smithy/types": "^4.20.0", "tslib": "^2.6.2" } }, "sha512-6W6SjGc8OXUhMzNxU1X922ghD+PP1XvzmCk5Scui0jaYsLezycMYR1RaLp5xTIOUrhTXyb4DnAbPr3fBgmdnzg=="],
|
|
68
68
|
|
|
69
|
-
"@aws-sdk/token-providers": ["@aws-sdk/token-providers@3.
|
|
69
|
+
"@aws-sdk/token-providers": ["@aws-sdk/token-providers@3.1169.0", "", { "dependencies": { "@aws-sdk/core": "^3.981.0", "@aws-sdk/nested-clients": "^3.998.3", "@aws-sdk/types": "^3.975.1", "@smithy/core": "^3.40.0", "@smithy/types": "^4.20.0", "tslib": "^2.6.2" } }, "sha512-ScQiQuJIAFevAHjCh/E159qaWeQtw8KUZ4PGUfHMeJU0VXaF4HE8PSgNXY/y4nmqrT8/gD3SoFhuFT5dy1cisA=="],
|
|
70
70
|
|
|
71
71
|
"@aws-sdk/types": ["@aws-sdk/types@3.975.1", "", { "dependencies": { "@smithy/types": "^4.20.0", "tslib": "^2.6.2" } }, "sha512-7rGxUkCB2QPoQOeJmonmAICTN2zrH+fpmi1p4Iwu72lnxNaMhOgqcbpyddifnM1DBb19TWQ1u6z/XjkaFNEDWw=="],
|
|
72
72
|
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
|
|
345
345
|
"crc-32": ["crc-32@1.2.2", "", { "bin": { "crc32": "bin/crc32.njs" } }, "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="],
|
|
346
346
|
|
|
347
|
-
"cron-parser": ["cron-parser@5.10.
|
|
347
|
+
"cron-parser": ["cron-parser@5.10.6", "", { "dependencies": { "luxon": "^3.7.2" } }, "sha512-kpoxgQyveO1l29nw+FWdvmotyV7eOSzGHQpxiXOEZIDOjqO1iR6kfgJ0PVHTuV26uBemKq3ppzma7dHFAG7viw=="],
|
|
348
348
|
|
|
349
349
|
"data-uri-to-buffer": ["data-uri-to-buffer@6.0.2", "", {}, "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw=="],
|
|
350
350
|
|
|
@@ -514,7 +514,7 @@
|
|
|
514
514
|
|
|
515
515
|
"isolated-vm": ["isolated-vm@7.0.2", "", { "dependencies": { "node-gyp-build": "^4.8.4" }, "hasInstallScript": true }, "sha512-Z1sYxpptGyGiKblG16EJEdP5x9/68C6AuqFFsewnrxlwSlrTLHKqtRMogOjcYZ0f8/cijMaRi+XwiHVQ1+uG+g=="],
|
|
516
516
|
|
|
517
|
-
"isomorphic-git": ["isomorphic-git@1.44.
|
|
517
|
+
"isomorphic-git": ["isomorphic-git@1.44.14", "", { "dependencies": { "async-lock": "^1.4.1", "clean-git-ref": "^2.0.1", "crc-32": "^1.2.0", "diff3": "0.0.3", "ignore": "^5.1.4", "minimisted": "^2.0.0", "pako": "^1.0.10", "pify": "^4.0.1", "sha.js": "^2.4.12", "simple-get": "^4.0.1" }, "bin": { "isogit": "cli.cjs" } }, "sha512-ZSVmLOUvzjnUrPBEpVcVOZ6w4N6NSFte2CEZ4ruTYpEIb19iwykPs7lgmh+y9+3qwmDgQePcOQzsMShcSrW5jA=="],
|
|
518
518
|
|
|
519
519
|
"jiti": ["jiti@2.7.0", "", { "bin": "lib/jiti-cli.mjs" }, "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ=="],
|
|
520
520
|
|
|
@@ -724,7 +724,7 @@
|
|
|
724
724
|
|
|
725
725
|
"strnum": ["strnum@2.5.1", "", { "dependencies": { "anynum": "^1.0.1" } }, "sha512-UM4nTLWzQiDBseVxUGxN0wJzIk0UU89Qi7pKXz9qISo+lhviJikTuikBsK/oFRlpvYHvSdz0TVoLyQ+sEpYwxA=="],
|
|
726
726
|
|
|
727
|
-
"strtok3": ["strtok3@10.
|
|
727
|
+
"strtok3": ["strtok3@10.8.0", "", { "dependencies": { "@tokenizer/token": "^0.3.0" } }, "sha512-e6bW3fD6V01DPmcbLfNtn0cjsiHvTKS/hivgbzqYMfHb/nLes4QQ0H5QBxlkPQayF4xv08AvlSgptGwN86Eemw=="],
|
|
728
728
|
|
|
729
729
|
"supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
|
|
730
730
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/runtime-device",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.11.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@lobu/runtime-device",
|
|
9
|
-
"version": "24.
|
|
9
|
+
"version": "24.11.0",
|
|
10
10
|
"license": "BUSL-1.1",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@lobu/cli": "file:vendor/cli",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"node_modules/@aws-sdk/client-bedrock-runtime": {
|
|
65
|
-
"version": "3.
|
|
66
|
-
"resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.
|
|
67
|
-
"integrity": "sha512-
|
|
65
|
+
"version": "3.1169.0",
|
|
66
|
+
"resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.1169.0.tgz",
|
|
67
|
+
"integrity": "sha512-KkMuq9IW+H8VHTEw/qV+ArI70w1WoqDuM/ZLX87MXB0yV31ihqY+2lwZ+zeD5spcZpmlLuUzXTPyMpWE2ZnbtA==",
|
|
68
68
|
"license": "Apache-2.0",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@aws-sdk/core": "^3.981.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@aws-sdk/eventstream-handler-node": "^3.972.42",
|
|
73
73
|
"@aws-sdk/middleware-eventstream": "^3.972.38",
|
|
74
74
|
"@aws-sdk/middleware-websocket": "^3.972.66",
|
|
75
|
-
"@aws-sdk/token-providers": "3.
|
|
75
|
+
"@aws-sdk/token-providers": "3.1169.0",
|
|
76
76
|
"@aws-sdk/types": "^3.975.1",
|
|
77
77
|
"@smithy/core": "^3.40.0",
|
|
78
78
|
"@smithy/fetch-http-handler": "^5.8.1",
|
|
@@ -351,9 +351,9 @@
|
|
|
351
351
|
}
|
|
352
352
|
},
|
|
353
353
|
"node_modules/@aws-sdk/token-providers": {
|
|
354
|
-
"version": "3.
|
|
355
|
-
"resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.
|
|
356
|
-
"integrity": "sha512-
|
|
354
|
+
"version": "3.1169.0",
|
|
355
|
+
"resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1169.0.tgz",
|
|
356
|
+
"integrity": "sha512-ScQiQuJIAFevAHjCh/E159qaWeQtw8KUZ4PGUfHMeJU0VXaF4HE8PSgNXY/y4nmqrT8/gD3SoFhuFT5dy1cisA==",
|
|
357
357
|
"license": "Apache-2.0",
|
|
358
358
|
"dependencies": {
|
|
359
359
|
"@aws-sdk/core": "^3.981.0",
|
|
@@ -2307,9 +2307,9 @@
|
|
|
2307
2307
|
}
|
|
2308
2308
|
},
|
|
2309
2309
|
"node_modules/cron-parser": {
|
|
2310
|
-
"version": "5.10.
|
|
2311
|
-
"resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-5.10.
|
|
2312
|
-
"integrity": "sha512-
|
|
2310
|
+
"version": "5.10.6",
|
|
2311
|
+
"resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-5.10.6.tgz",
|
|
2312
|
+
"integrity": "sha512-kpoxgQyveO1l29nw+FWdvmotyV7eOSzGHQpxiXOEZIDOjqO1iR6kfgJ0PVHTuV26uBemKq3ppzma7dHFAG7viw==",
|
|
2313
2313
|
"license": "MIT",
|
|
2314
2314
|
"dependencies": {
|
|
2315
2315
|
"luxon": "^3.7.2"
|
|
@@ -3351,9 +3351,9 @@
|
|
|
3351
3351
|
}
|
|
3352
3352
|
},
|
|
3353
3353
|
"node_modules/isomorphic-git": {
|
|
3354
|
-
"version": "1.44.
|
|
3355
|
-
"resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.44.
|
|
3356
|
-
"integrity": "sha512-
|
|
3354
|
+
"version": "1.44.14",
|
|
3355
|
+
"resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.44.14.tgz",
|
|
3356
|
+
"integrity": "sha512-ZSVmLOUvzjnUrPBEpVcVOZ6w4N6NSFte2CEZ4ruTYpEIb19iwykPs7lgmh+y9+3qwmDgQePcOQzsMShcSrW5jA==",
|
|
3357
3357
|
"license": "MIT",
|
|
3358
3358
|
"dependencies": {
|
|
3359
3359
|
"async-lock": "^1.4.1",
|
|
@@ -4682,9 +4682,9 @@
|
|
|
4682
4682
|
}
|
|
4683
4683
|
},
|
|
4684
4684
|
"node_modules/strtok3": {
|
|
4685
|
-
"version": "10.
|
|
4686
|
-
"resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.
|
|
4687
|
-
"integrity": "sha512-
|
|
4685
|
+
"version": "10.8.0",
|
|
4686
|
+
"resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.8.0.tgz",
|
|
4687
|
+
"integrity": "sha512-e6bW3fD6V01DPmcbLfNtn0cjsiHvTKS/hivgbzqYMfHb/nLes4QQ0H5QBxlkPQayF4xv08AvlSgptGwN86Eemw==",
|
|
4688
4688
|
"license": "MIT",
|
|
4689
4689
|
"dependencies": {
|
|
4690
4690
|
"@tokenizer/token": "^0.3.0"
|
|
@@ -5278,7 +5278,7 @@
|
|
|
5278
5278
|
},
|
|
5279
5279
|
"vendor/cli": {
|
|
5280
5280
|
"name": "@lobu/cli",
|
|
5281
|
-
"version": "24.
|
|
5281
|
+
"version": "24.11.0",
|
|
5282
5282
|
"license": "Apache-2.0",
|
|
5283
5283
|
"dependencies": {
|
|
5284
5284
|
"@clack/prompts": "^1.2.0",
|
|
@@ -5310,7 +5310,7 @@
|
|
|
5310
5310
|
},
|
|
5311
5311
|
"vendor/connector-sdk": {
|
|
5312
5312
|
"name": "@lobu/connector-sdk",
|
|
5313
|
-
"version": "24.
|
|
5313
|
+
"version": "24.11.0",
|
|
5314
5314
|
"license": "BUSL-1.1",
|
|
5315
5315
|
"dependencies": {
|
|
5316
5316
|
"@lobu/core": "file:../core",
|
|
@@ -5325,7 +5325,7 @@
|
|
|
5325
5325
|
},
|
|
5326
5326
|
"vendor/connector-worker": {
|
|
5327
5327
|
"name": "@lobu/connector-worker",
|
|
5328
|
-
"version": "24.
|
|
5328
|
+
"version": "24.11.0",
|
|
5329
5329
|
"license": "BUSL-1.1",
|
|
5330
5330
|
"dependencies": {
|
|
5331
5331
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
@@ -5350,7 +5350,7 @@
|
|
|
5350
5350
|
},
|
|
5351
5351
|
"vendor/core": {
|
|
5352
5352
|
"name": "@lobu/core",
|
|
5353
|
-
"version": "24.
|
|
5353
|
+
"version": "24.11.0",
|
|
5354
5354
|
"license": "Apache-2.0",
|
|
5355
5355
|
"dependencies": {
|
|
5356
5356
|
"@opentelemetry/api": "^1.9.0",
|
|
@@ -5417,7 +5417,7 @@
|
|
|
5417
5417
|
},
|
|
5418
5418
|
"vendor/views": {
|
|
5419
5419
|
"name": "@lobu/views",
|
|
5420
|
-
"version": "24.
|
|
5420
|
+
"version": "24.11.0",
|
|
5421
5421
|
"license": "Apache-2.0",
|
|
5422
5422
|
"dependencies": {
|
|
5423
5423
|
"@lobu/core": "file:../core"
|
package/package.json
CHANGED
|
@@ -20,6 +20,12 @@ export function linkedInInboxProgram() {
|
|
|
20
20
|
function fail(message) {
|
|
21
21
|
throw new Error(`LinkedIn inbox: ${message}`);
|
|
22
22
|
}
|
|
23
|
+
// A stop reason is durable evidence: keep the underlying failure instead of
|
|
24
|
+
// reporting only that the listener could not attach.
|
|
25
|
+
function errorDetail(error) {
|
|
26
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
27
|
+
return clean(message.replace(/^LinkedIn inbox: /, "")).slice(0, 300);
|
|
28
|
+
}
|
|
23
29
|
function headers() {
|
|
24
30
|
const cookie = document.cookie
|
|
25
31
|
.split("; ")
|
|
@@ -1018,6 +1024,7 @@ export function linkedInInboxProgram() {
|
|
|
1018
1024
|
clearTimeout(listener.timer);
|
|
1019
1025
|
window.removeEventListener("message", listener.onReply);
|
|
1020
1026
|
listeners.delete(listener.id);
|
|
1027
|
+
listener.stopReason = reason;
|
|
1021
1028
|
if (reason)
|
|
1022
1029
|
post(listener, {
|
|
1023
1030
|
id: `linkedin:${listener.feed}:source-observation-error`,
|
|
@@ -1053,10 +1060,10 @@ export function linkedInInboxProgram() {
|
|
|
1053
1060
|
listener.batches = await batchesOf(feed, checkpoint, result);
|
|
1054
1061
|
}
|
|
1055
1062
|
if (active(listener)) post(listener, listener.batches[0]);
|
|
1056
|
-
} catch {
|
|
1063
|
+
} catch (error) {
|
|
1057
1064
|
stop(
|
|
1058
1065
|
listener,
|
|
1059
|
-
|
|
1066
|
+
`LinkedIn source observation failed (${errorDetail(error)}); reconnect to recover without skipping changes`
|
|
1060
1067
|
);
|
|
1061
1068
|
}
|
|
1062
1069
|
if (active(listener))
|
|
@@ -1246,7 +1253,10 @@ export function linkedInInboxProgram() {
|
|
|
1246
1253
|
window.addEventListener("message", listener.onReply);
|
|
1247
1254
|
await poll(listener);
|
|
1248
1255
|
if (!listeners.has(listener.id))
|
|
1249
|
-
fail(
|
|
1256
|
+
fail(
|
|
1257
|
+
"Unable to attach source subscription: " +
|
|
1258
|
+
(listener.stopReason ?? "listener stopped")
|
|
1259
|
+
);
|
|
1250
1260
|
return { listening: true };
|
|
1251
1261
|
}
|
|
1252
1262
|
globalThis[key] = { version, read, listen, send, detach };
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
* module shapes are load-bearing.
|
|
10
10
|
*
|
|
11
11
|
* How it gets into the page: the connector serialises this function with
|
|
12
|
-
* Function.prototype.toString() and runs `(<source>)()` through the
|
|
13
|
-
* chrome `evaluate` op, which executes in the page's MAIN world. That is
|
|
14
|
-
* same mechanism the extension used with chrome.scripting.executeScript({func}),
|
|
15
|
-
* minus the extension. The
|
|
16
|
-
*
|
|
12
|
+
* Function.prototype.toString() and runs `(<source>)("<version>")` through the
|
|
13
|
+
* generic chrome `evaluate` op, which executes in the page's MAIN world. That is
|
|
14
|
+
* the same mechanism the extension used with chrome.scripting.executeScript({func}),
|
|
15
|
+
* minus the extension. The version is a fingerprint of that exact source,
|
|
16
|
+
* computed by the connector (WHATSAPP_ADAPTER_INSTALL in whatsapp-web-helpers.ts),
|
|
17
|
+
* so the adapter is idempotent per program text and re-injecting is safe.
|
|
17
18
|
*
|
|
18
19
|
* INVARIANT — every binding this function needs must live INSIDE it. A constant
|
|
19
20
|
* hoisted to module scope would vanish from toString() output and the page would
|
|
@@ -26,14 +27,14 @@
|
|
|
26
27
|
* and cost a @ts-nocheck plus a set of `declare const` shims.
|
|
27
28
|
*/
|
|
28
29
|
|
|
29
|
-
export function whatsAppWebAdapterProgram() {
|
|
30
|
+
export function whatsAppWebAdapterProgram(adapterVersion) {
|
|
30
31
|
const GLOBAL_KEY = "__owlettoWhatsAppAdapterV1";
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
// A WhatsApp tab outlives a deploy, so a resident adapter is replaced only
|
|
33
|
+
// when this version differs. The connector derives it from this program's
|
|
34
|
+
// own source, so any change to the program replaces it with no manual bump.
|
|
35
|
+
const ADAPTER_VERSION = adapterVersion;
|
|
36
|
+
if (typeof ADAPTER_VERSION !== "string" || !ADAPTER_VERSION)
|
|
37
|
+
throw new Error("WhatsApp adapter must be installed with its content version");
|
|
37
38
|
const SOURCE_ERROR_ID = "whatsapp-web:source-observation-error";
|
|
38
39
|
// Storage rows one `chat:` read examines; a whole personal history is
|
|
39
40
|
// usually under this, so one read answers.
|
|
@@ -1562,7 +1563,7 @@ export function whatsAppWebAdapterProgram() {
|
|
|
1562
1563
|
|
|
1563
1564
|
async function invoke(request) {
|
|
1564
1565
|
try {
|
|
1565
|
-
if (
|
|
1566
|
+
if (request?.adapter_version !== ADAPTER_VERSION) {
|
|
1566
1567
|
return {
|
|
1567
1568
|
ok: false,
|
|
1568
1569
|
error: {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* that live reads and searches return. These helpers do not ingest events.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import { whatsAppWebAdapterProgram } from "./whatsapp-web-adapter.js";
|
|
10
11
|
import {
|
|
11
12
|
normalizeWhatsAppUserJid,
|
|
12
13
|
WHATSAPP_GROUP_SUFFIX,
|
|
@@ -14,7 +15,42 @@ import {
|
|
|
14
15
|
WHATSAPP_PHONE_SERVER,
|
|
15
16
|
} from "./whatsapp-web-identity.js";
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
/**
|
|
19
|
+
* A short fingerprint of a program's source (cyrb53, base 36). It only has to
|
|
20
|
+
* tell two program texts apart, so a non-cryptographic hash is enough, and it
|
|
21
|
+
* runs synchronously wherever the connector does.
|
|
22
|
+
*/
|
|
23
|
+
function sourceFingerprint(source: string): string {
|
|
24
|
+
let h1 = 0xdeadbeef;
|
|
25
|
+
let h2 = 0x41c6ce57;
|
|
26
|
+
for (let index = 0; index < source.length; index++) {
|
|
27
|
+
const code = source.charCodeAt(index);
|
|
28
|
+
h1 = Math.imul(h1 ^ code, 2654435761);
|
|
29
|
+
h2 = Math.imul(h2 ^ code, 1597334677);
|
|
30
|
+
}
|
|
31
|
+
h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);
|
|
32
|
+
h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);
|
|
33
|
+
h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);
|
|
34
|
+
h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);
|
|
35
|
+
return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The page adapter's expression and version, both derived from the program
|
|
40
|
+
* text this build injects. An open tab keeps a resident adapter only while the
|
|
41
|
+
* versions match, so any change to the program reaches every open tab without
|
|
42
|
+
* a hand-maintained number two concurrent changes could both claim.
|
|
43
|
+
*/
|
|
44
|
+
export function whatsAppAdapterInstall(
|
|
45
|
+
source: string = whatsAppWebAdapterProgram.toString()
|
|
46
|
+
): { version: string; expression: string } {
|
|
47
|
+
const version = `src-${sourceFingerprint(source)}`;
|
|
48
|
+
return { version, expression: `(${source})(${JSON.stringify(version)})` };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const ADAPTER_INSTALL = whatsAppAdapterInstall();
|
|
52
|
+
export const WHATSAPP_ADAPTER_VERSION = ADAPTER_INSTALL.version;
|
|
53
|
+
export const WHATSAPP_ADAPTER_INSTALL = ADAPTER_INSTALL.expression;
|
|
18
54
|
export const WHATSAPP_ORIGIN = "https://web.whatsapp.com";
|
|
19
55
|
|
|
20
56
|
export type ChatFilter = "all" | "individual" | "group";
|
|
@@ -31,10 +31,10 @@ import {
|
|
|
31
31
|
messageTitle,
|
|
32
32
|
normalizeRelayedMessage,
|
|
33
33
|
type ObservationCheckpoint,
|
|
34
|
+
WHATSAPP_ADAPTER_INSTALL,
|
|
34
35
|
WHATSAPP_ADAPTER_VERSION,
|
|
35
36
|
WHATSAPP_ORIGIN,
|
|
36
37
|
} from "./whatsapp-web-helpers.js";
|
|
37
|
-
import { whatsAppWebAdapterProgram } from "./whatsapp-web-adapter.js";
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* How long a run waits for WhatsApp Web to finish hydrating before giving up.
|
|
@@ -119,7 +119,7 @@ async function adapterInstalled(
|
|
|
119
119
|
tab_id: tabId,
|
|
120
120
|
expression: `(() => {
|
|
121
121
|
const a = globalThis.__owlettoWhatsAppAdapterV1;
|
|
122
|
-
return !!a && typeof a.invoke === 'function' && a.version === ${WHATSAPP_ADAPTER_VERSION};
|
|
122
|
+
return !!a && typeof a.invoke === 'function' && a.version === ${JSON.stringify(WHATSAPP_ADAPTER_VERSION)};
|
|
123
123
|
})()`,
|
|
124
124
|
await_promise: false,
|
|
125
125
|
});
|
|
@@ -144,7 +144,7 @@ async function injectAdapter(
|
|
|
144
144
|
exception?: unknown;
|
|
145
145
|
}>("evaluate", {
|
|
146
146
|
tab_id: tabId,
|
|
147
|
-
expression:
|
|
147
|
+
expression: WHATSAPP_ADAPTER_INSTALL,
|
|
148
148
|
await_promise: false,
|
|
149
149
|
});
|
|
150
150
|
if (result.exception) {
|
|
@@ -372,9 +372,9 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
372
372
|
accountProbe: {
|
|
373
373
|
url: `${WHATSAPP_ORIGIN}/`,
|
|
374
374
|
expression: `(async () => {
|
|
375
|
-
|
|
375
|
+
${WHATSAPP_ADAPTER_INSTALL};
|
|
376
376
|
for (let i = 0; i < 40; i++) {
|
|
377
|
-
const identity = await globalThis.__owlettoWhatsAppAdapterV1.invoke({ op: "account_identity", adapter_version: ${WHATSAPP_ADAPTER_VERSION} });
|
|
377
|
+
const identity = await globalThis.__owlettoWhatsAppAdapterV1.invoke({ op: "account_identity", adapter_version: ${JSON.stringify(WHATSAPP_ADAPTER_VERSION)} });
|
|
378
378
|
if (identity?.accountId) return identity;
|
|
379
379
|
await new Promise(resolve => setTimeout(resolve, 250));
|
|
380
380
|
}
|
|
@@ -43,6 +43,16 @@ export function xDirectMessagesProgram() {
|
|
|
43
43
|
if (status !== undefined) error.status = status;
|
|
44
44
|
throw error;
|
|
45
45
|
}
|
|
46
|
+
// A stop reason is durable evidence: keep the underlying failure instead of
|
|
47
|
+
// reporting only that the listener could not attach.
|
|
48
|
+
function errorDetail(error) {
|
|
49
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
50
|
+
return message
|
|
51
|
+
.replace(/^X direct messages: /, "")
|
|
52
|
+
.replace(/\s+/g, " ")
|
|
53
|
+
.trim()
|
|
54
|
+
.slice(0, 300);
|
|
55
|
+
}
|
|
46
56
|
function cookie(name) {
|
|
47
57
|
const raw = document.cookie
|
|
48
58
|
.split("; ")
|
|
@@ -525,6 +535,7 @@ export function xDirectMessagesProgram() {
|
|
|
525
535
|
clearTimeout(listener.timer);
|
|
526
536
|
window.removeEventListener("message", listener.onReply);
|
|
527
537
|
listeners.delete(listener.id);
|
|
538
|
+
listener.stopReason = reason;
|
|
528
539
|
if (reason)
|
|
529
540
|
post(listener, {
|
|
530
541
|
id: "x:live_messages:source-observation-error",
|
|
@@ -552,10 +563,10 @@ export function xDirectMessagesProgram() {
|
|
|
552
563
|
}
|
|
553
564
|
account(listener.account);
|
|
554
565
|
if (active(listener)) post(listener, listener.batches[0]);
|
|
555
|
-
} catch {
|
|
566
|
+
} catch (error) {
|
|
556
567
|
stop(
|
|
557
568
|
listener,
|
|
558
|
-
|
|
569
|
+
`X source observation failed (${errorDetail(error)}); reconnect to recover without skipping messages`,
|
|
559
570
|
);
|
|
560
571
|
}
|
|
561
572
|
if (active(listener))
|
|
@@ -618,7 +629,10 @@ export function xDirectMessagesProgram() {
|
|
|
618
629
|
window.addEventListener("message", listener.onReply);
|
|
619
630
|
await poll(listener);
|
|
620
631
|
if (!listeners.has(listener.id))
|
|
621
|
-
fail(
|
|
632
|
+
fail(
|
|
633
|
+
"Unable to attach source subscription: " +
|
|
634
|
+
(listener.stopReason ?? "listener stopped"),
|
|
635
|
+
);
|
|
622
636
|
return { listening: true };
|
|
623
637
|
}
|
|
624
638
|
// X serves at most 50 entries per notifications page (`count=50`); the
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"server": "dist/server.bundle.mjs",
|
|
6
6
|
"embeddingsServer": "dist/embeddings-server.mjs"
|
|
7
7
|
},
|
|
8
|
-
"version": "24.
|
|
8
|
+
"version": "24.11.0",
|
|
9
9
|
"verify": "dist/verify.mjs"
|
|
10
10
|
},
|
|
11
11
|
"device": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"connector": "node_modules/@lobu/cli/dist/commands/connector.js",
|
|
17
17
|
"worker": "node_modules/@lobu/connector-worker/dist/bin.js"
|
|
18
18
|
},
|
|
19
|
-
"version": "24.
|
|
19
|
+
"version": "24.11.0",
|
|
20
20
|
"verify": "dist/verify.mjs"
|
|
21
21
|
},
|
|
22
22
|
"postgres": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"entries": {
|
|
25
25
|
"postgres": "dist/index.mjs"
|
|
26
26
|
},
|
|
27
|
-
"version": "24.
|
|
27
|
+
"version": "24.11.0",
|
|
28
28
|
"verify": "dist/verify.mjs"
|
|
29
29
|
},
|
|
30
30
|
"embeddings": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"entries": {
|
|
33
33
|
"embeddings": "dist/embeddings.js"
|
|
34
34
|
},
|
|
35
|
-
"version": "24.
|
|
35
|
+
"version": "24.11.0",
|
|
36
36
|
"verify": "dist/verify.mjs"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/vendor/cli/package.json
CHANGED
|
@@ -16769,7 +16769,7 @@ var require_dist3 = __commonJS({
|
|
|
16769
16769
|
if (error)
|
|
16770
16770
|
return error;
|
|
16771
16771
|
hooks?.onPosted?.();
|
|
16772
|
-
return (0, plugin_toolkit_1.textResult)("Question posted
|
|
16772
|
+
return (0, plugin_toolkit_1.textResult)("Question posted. Your turn is now ending \u2014 the user's answer will arrive as a new inbound message that resumes this session: a tapped option, or, on chats that cannot show buttons, a typed reply that may be just an option's number from the list (1 = your first option). Do not call ask_user again.");
|
|
16773
16773
|
});
|
|
16774
16774
|
}
|
|
16775
16775
|
async function listConversations(gateway) {
|
package/vendor/core/package.json
CHANGED