@datalayer/agent-runtimes 1.5.83 → 1.5.84
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-embed/assets/loro_wasm_bg-BNbm0Hvh.wasm +0 -0
- package/dist-embed/chunks/{DeckComponent-9fShp5EH.js → DeckComponent-BsX0HZ91.js} +1 -1
- package/dist-embed/chunks/{DocumentView-DKhM55kg.js → DocumentView-BmxyGq4g.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument-C0_-sZg-.js → EphemeralDocument-CcVCBncn.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-B5qoSnHE.js → ExcalidrawComponent-cxp7jL5I.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-DLDzJz7F.js → ExcalidrawModal-Z5qScZ8e.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-2AkqHLoO.js → JupyterLexicalExtension-l3kTi3SD.js} +46 -46
- package/dist-embed/chunks/{YouTubePlugin-VNlkEtVU.js → YouTubePlugin-Dxt6iAKR.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-Cqss6Q62.js → ar-SA-G6X2FPQ2-Cu47S0ZT.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-lD6kXi4J.js → az-AZ-76LH7QW2-CT2mpVMp.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-2BArB_Ch.js → bg-BG-XCXSNQG7-BiE1sIiQ.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-CBEeK0DN.js → bn-BD-2XOGV67Q--7mObGxR.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-DmhCP7qy.js → ca-ES-6MX7JW3Y-0munSsTm.js} +1 -1
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-jdPxvKmz.js → cs-CZ-2BRQDIVT-GtdOA9j7.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-vjNwrU4T.js → da-DK-5WZEPLOC-BzuoZSIU.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-B6zQ6e3N.js → de-DE-XR44H4JA-BrKnOZry.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-CBhimaPi.js → el-GR-BZB4AONW-CD2Y-ocb.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-COAfPMQS.js → es-ES-U4NZUMDT-B5uAri6Y.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-CiYUAKuY.js → eu-ES-A7QVB2H4-DsuJKD1Y.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-CW2b0s1I.js → fa-IR-HGAKTJCU-BKCZcc-T.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-MCVKKeJl.js → fi-FI-Z5N7JZ37-JKchQy9X.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-DZMkwkhL.js → fr-FR-RHASNOE6-BYK0tD37.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-D8LdswtD.js → gl-ES-HMX3MZ6V-Ddzv-7Ry.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-D4A-WPuC.js → he-IL-6SHJWFNN-suSvxj4e.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-DO3QdFAK.js → hi-IN-IWLTKZ5I-DFSqIUiD.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-BOPacqST.js → hu-HU-A5ZG7DT2-C_jNBqIH.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-BDQ5wEDe.js → id-ID-SAP4L64H-DUSLAWps.js} +1 -1
- package/dist-embed/chunks/{index-B9M5uQX3.js → index-B9aUulrU.js} +1 -1
- package/dist-embed/chunks/{index-DjTtL0TF.js → index-BkiAyyFt.js} +1 -1
- package/dist-embed/chunks/{it-IT-JPQ66NNP-bzbg9EMd.js → it-IT-JPQ66NNP-ByLNFdoz.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-Szvm49iH.js → ja-JP-DBVTYXUO-BC1Z8utO.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-CmjctWJC.js → kaa-6HZHGXH3-DJG4AKJf.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-2neAyT0K.js → kab-KAB-ZGHBKWFO-CKPg6g8j.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-DFBQnc6O.js → kk-KZ-P5N5QNE5-ClOu1LU-.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-BBsrLBf3.js → km-KH-HSX4SM5Z-GQCLal1T.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-BhpsFd8K.js → ko-KR-MTYHY66A-CY1h30YG.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-BkmYi70s.js → ku-TR-6OUDTVRD-Buvmyjwr.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-BQzLQ3IM.js → lt-LT-XHIRWOB4-BLYTzVmh.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-C2uG3w1b.js → lv-LV-5QDEKY6T-ChlIH28N.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-c0ua0Wep.js → mr-IN-CRQNXWMA-BP4GrhX4.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-CHwcQNVK.js → my-MM-5M5IBNSE-D1045-lE.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-ExHLJdKL.js → nb-NO-T6EIAALU-BPsL3nSR.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-BZVh9P58.js → nl-NL-IS3SIHDZ-fVmvrYwv.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-B0Lsdzal.js → nn-NO-6E72VCQL-C8hJ8Vnn.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-6h1IfczT.js → oc-FR-POXYY2M6-vnwtHDEJ.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-BatFUiwy.js → pa-IN-N4M65BXN-BxONE3x2.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-CUieN6MU.js → percentages-BXMCSKIN-2rnvdhJs.js} +3 -3
- package/dist-embed/chunks/{pl-PL-T2D74RX3-DX6A7KgW.js → pl-PL-T2D74RX3-BXHztEmP.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-N7HLFrzO.js → pt-BR-5N22H2LF-Bg7LF_vC.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-DUZk-o8n.js → pt-PT-UZXXM6DQ-8yWtAI3t.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-eOhj0vob.js → ro-RO-JPDTUUEW-DBHu7U0r.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-adV0gXfd.js → ru-RU-B4JR7IUQ-DltJQHCk.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-Bw2cyfz1.js → si-LK-N5RQ5JYF-Ce9hG-1K.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-CKE2DmyW.js → sk-SK-C5VTKIMK-DU_6r5xt.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-CFc8Y3VE.js → sl-SI-NN7IZMDC-CPGKI4cy.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-Dma4VCy8.js → subset-shared.chunk-BAYtuzFM.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-Bz00tIvB.js → subset-worker.chunk-DfQddq4p.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-BbadENuL.js → sv-SE-XGPEYMSR-CZJrL1on.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-DIcMv2m_.js → ta-IN-2NMHFXQM-D7JO_N6W.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-Dg_SsP8U.js → th-TH-HPSO5L25-BZvbjpfz.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-CT-y06oR.js → tr-TR-DEFEU3FU-BAGBU7xX.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-BZ5Ohlyz.js → uk-UA-QMV73CPH-BOVTOMU-.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-BJsFLDTl.js → vi-VN-M7AON7JQ-B-3kWBiP.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-BEBj3lBa.js → zh-CN-LNUGB5OW-0--X2bBG.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-DaP5iF63.js → zh-HK-E62DVLB3-Ds42fL5V.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-Du-01YeM.js → zh-TW-RAJ6MFWO-B4qCaZBc.js} +1 -1
- package/dist-embed/datalayer-app-main.js +55 -55
- package/lib/portable/hosts/contracts.d.ts +1 -1
- package/lib/portable/hosts/contracts.js +1 -1
- package/lib/portable/hosts/contracts.json +59 -1
- package/lib/portable/hosts/forbiddenGraph.js +1 -0
- package/lib/portable/hosts/index.d.ts +1 -1
- package/lib/portable/hosts/index.js +1 -1
- package/lib/portable/hosts/sessionUid.d.ts +3 -1
- package/lib/portable/hosts/sessionUid.js +3 -1
- package/package.json +1 -1
- package/dist-embed/assets/loro_wasm_bg-BjoaHtGs.wasm +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/**
|
|
3
|
-
* The generic Datalayer host contracts, as ai-agents answers them, for every chat host (Slack, Discord).
|
|
3
|
+
* The generic Datalayer host contracts, as ai-agents answers them, for every chat host (Slack, Discord, WhatsApp).
|
|
4
4
|
* These shapes are shared with ai-agents through `contracts.json`, beside
|
|
5
5
|
* this file and byte-identical to ai-agents' `tests/fixtures/hosts/`, which
|
|
6
6
|
* both sides test. A delivery's `target` stays opaque here: each host
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
/**
|
|
8
|
-
* The generic Datalayer host contracts, as ai-agents answers them, for every chat host (Slack, Discord).
|
|
8
|
+
* The generic Datalayer host contracts, as ai-agents answers them, for every chat host (Slack, Discord, WhatsApp).
|
|
9
9
|
* These shapes are shared with ai-agents through `contracts.json`, beside
|
|
10
10
|
* this file and byte-identical to ai-agents' `tests/fixtures/hosts/`, which
|
|
11
11
|
* both sides test. A delivery's `target` stays opaque here: each host
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"about": "The generic host contracts of the chat hosts, as ai-agents and the runtime's session API answer them. Shared verbatim by ai-agents (tests/fixtures/hosts) and agent-runtimes (src/portable/hosts, read by the Slack and
|
|
3
|
+
"about": "The generic host contracts of the chat hosts, as ai-agents and the runtime's session API answer them. Shared verbatim by ai-agents (tests/fixtures/hosts) and agent-runtimes (src/portable/hosts, read by the Slack, Discord and WhatsApp adapters from lib/portable/hosts): each side's tests check its half against this file.",
|
|
4
4
|
"headers": {
|
|
5
5
|
"host_key": "X-Datalayer-Host-Key",
|
|
6
6
|
"signature": "X-Datalayer-Signature",
|
|
@@ -493,5 +493,63 @@
|
|
|
493
493
|
"threadId": "456789012345678901",
|
|
494
494
|
"userId": "567890123456789012"
|
|
495
495
|
}
|
|
496
|
+
},
|
|
497
|
+
"whatsapp": {
|
|
498
|
+
"about": "WhatsApp's forms of the generic contracts: the installation is <waba_id>:<phone_number_id>, one per connected business number; a person is their business-scoped user id (BSUID: a country code, a period and up to 128 characters; never the phone number), which the external id pattern admits as it is, no hash in between; a 1:1 chat is a direct place named by the BSUID, a group a channel named by its group id; the session uid is hostSessionUid(\"whatsapp\", [waba_id, phone_number_id, user_id]) for a chat and [waba_id, phone_number_id, group_id] for a group; a turn's provenance names the message by its wamid.",
|
|
499
|
+
"waba_id": "102290129340398",
|
|
500
|
+
"phone_number_id": "106540352242922",
|
|
501
|
+
"bind_request": {
|
|
502
|
+
"code": "dlhc_…",
|
|
503
|
+
"external_id": "102290129340398:106540352242922",
|
|
504
|
+
"name": "Acme"
|
|
505
|
+
},
|
|
506
|
+
"external_user_id": "US.13491208655302741918",
|
|
507
|
+
"external_user_name": "Alice",
|
|
508
|
+
"external_user_id_longest": "US.11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
|
|
509
|
+
"direct": {
|
|
510
|
+
"place": {
|
|
511
|
+
"kind": "direct",
|
|
512
|
+
"id": "US.13491208655302741918"
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
"group": {
|
|
516
|
+
"id": "120363025246125486",
|
|
517
|
+
"place": {
|
|
518
|
+
"kind": "channel",
|
|
519
|
+
"id": "120363025246125486"
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
"session": {
|
|
523
|
+
"parts": [
|
|
524
|
+
"102290129340398",
|
|
525
|
+
"106540352242922",
|
|
526
|
+
"US.13491208655302741918"
|
|
527
|
+
],
|
|
528
|
+
"uid": "whatsapp-870e7e8165519947ec9c7df03d378b342cee380e"
|
|
529
|
+
},
|
|
530
|
+
"group_session": {
|
|
531
|
+
"parts": [
|
|
532
|
+
"102290129340398",
|
|
533
|
+
"106540352242922",
|
|
534
|
+
"120363025246125486"
|
|
535
|
+
],
|
|
536
|
+
"uid": "whatsapp-49aeadff03b2d02e6359121f9a55bae904640b35"
|
|
537
|
+
},
|
|
538
|
+
"provenance": {
|
|
539
|
+
"host_kind": "whatsapp",
|
|
540
|
+
"place": {
|
|
541
|
+
"kind": "direct",
|
|
542
|
+
"id": "US.13491208655302741918"
|
|
543
|
+
},
|
|
544
|
+
"message_id": "wamid.HBgLMTU1NTEyMzQ1NjcVAgASGBQzQUY3RjU0QjRFRjc2MzBCNkJCNAA="
|
|
545
|
+
},
|
|
546
|
+
"target": {
|
|
547
|
+
"phoneNumberId": "106540352242922",
|
|
548
|
+
"userId": "US.13491208655302741918"
|
|
549
|
+
},
|
|
550
|
+
"group_target": {
|
|
551
|
+
"phoneNumberId": "106540352242922",
|
|
552
|
+
"groupId": "120363025246125486"
|
|
553
|
+
}
|
|
496
554
|
}
|
|
497
555
|
}
|
|
@@ -26,6 +26,7 @@ export const FORBIDDEN = [
|
|
|
26
26
|
/^@datalayer\/reactor$/,
|
|
27
27
|
/^@datalayer\/slack$/,
|
|
28
28
|
/^@datalayer\/discord$/,
|
|
29
|
+
/^@datalayer\/whatsapp$/,
|
|
29
30
|
];
|
|
30
31
|
export const isForbidden = (name) => FORBIDDEN.some(pattern => pattern.test(name));
|
|
31
32
|
/** The package name an import specifier names: `@scope/name/deep` → `@scope/name`. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What a chat host service (Slack, Discord) shares, on Node: the ai-agents
|
|
2
|
+
* What a chat host service (Slack, Discord, WhatsApp) shares, on Node: the ai-agents
|
|
3
3
|
* host contracts and client, the agent client over the session API, the
|
|
4
4
|
* semantic events a turn is reduced to, approval renderers, deliveries, the
|
|
5
5
|
* turn's state, application resolution, the durable queue, quotas, secrets
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* What a chat host service (Slack, Discord) shares, on Node: the ai-agents
|
|
6
|
+
* What a chat host service (Slack, Discord, WhatsApp) shares, on Node: the ai-agents
|
|
7
7
|
* host contracts and client, the agent client over the session API, the
|
|
8
8
|
* semantic events a turn is reduced to, approval renderers, deliveries, the
|
|
9
9
|
* turn's state, application resolution, the durable queue, quotas, secrets
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* `<kind>-<40 hex>`: the SHA-256 of the thread's parts joined by `:`, and
|
|
3
3
|
* `:<generation>` once the thread started over or switched application. The
|
|
4
4
|
* same parts give the same uid (Slack: app, enterprise or `-`, team,
|
|
5
|
-
* channel, thread ts; Discord: application, guild, channel, thread
|
|
5
|
+
* channel, thread ts; Discord: application, guild, channel, thread;
|
|
6
|
+
* WhatsApp: WABA, phone number id, and the person's BSUID for a chat or the
|
|
7
|
+
* group's id for a group).
|
|
6
8
|
*/
|
|
7
9
|
export declare function hostSessionUid(kind: string, parts: readonly string[], generation?: number): string;
|
|
@@ -13,7 +13,9 @@ import { createHash } from 'node:crypto';
|
|
|
13
13
|
* `<kind>-<40 hex>`: the SHA-256 of the thread's parts joined by `:`, and
|
|
14
14
|
* `:<generation>` once the thread started over or switched application. The
|
|
15
15
|
* same parts give the same uid (Slack: app, enterprise or `-`, team,
|
|
16
|
-
* channel, thread ts; Discord: application, guild, channel, thread
|
|
16
|
+
* channel, thread ts; Discord: application, guild, channel, thread;
|
|
17
|
+
* WhatsApp: WABA, phone number id, and the person's BSUID for a chat or the
|
|
18
|
+
* group's id for a group).
|
|
17
19
|
*/
|
|
18
20
|
export function hostSessionUid(kind, parts, generation) {
|
|
19
21
|
if (!/^[a-z][a-z0-9-]{1,31}$/.test(kind)) {
|
package/package.json
CHANGED
|
Binary file
|