From 087b3ae079e426f808946fedf46124ca75a0695e Mon Sep 17 00:00:00 2001 From: fabri Date: Mon, 23 Dec 2024 18:49:31 -0300 Subject: [PATCH 1/8] git --- packages/client/src/components/Chat.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/client/src/components/Chat.tsx b/packages/client/src/components/Chat.tsx index 68eb777d4..afabd3bc9 100644 --- a/packages/client/src/components/Chat.tsx +++ b/packages/client/src/components/Chat.tsx @@ -37,8 +37,6 @@ function Chat({ user }: { user: UserInfo }) { const [processedMessageIds] = useState(new Set()); useEffect(() => { - console.log("useEffect triggered with user:", user); - const init = async () => { try { setRecipientInfo(user); @@ -64,7 +62,6 @@ function Chat({ user }: { user: UserInfo }) { const onMessage = async (message: Message | undefined) => { if (message) { - console.log("onMessage", message); setMessages((prevMessages) => [...prevMessages, message]); } }; @@ -88,7 +85,6 @@ function Chat({ user }: { user: UserInfo }) { receivers: [recipientInfo.address], originalMessage: undefined, })) as Message; - console.log("message", message); setMessages((prevMessages) => [...prevMessages, message]); setNewMessage(""); From da4faeb535591d05a3e0d314c1c2ad5dcd5cc6cd Mon Sep 17 00:00:00 2001 From: fabri Date: Mon, 23 Dec 2024 19:58:56 -0300 Subject: [PATCH 2/8] readme --- README.md | 2 - packages/create-message-kit/package.json | 2 +- packages/xmtp/package.json | 2 +- yarn.lock | 190 ++++++++++++++++++++++- 4 files changed, 186 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 350444e63..6b4bd1f14 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ A set of tools for AI developers to build on top of [XMTP](https://xmtp.org) -## What's inside? - ### MessageKit - [`message-kit`](/packages/message-kit): A kit for quickly building messaging apps diff --git a/packages/create-message-kit/package.json b/packages/create-message-kit/package.json index bbcaf5355..ecbfb132b 100644 --- a/packages/create-message-kit/package.json +++ b/packages/create-message-kit/package.json @@ -36,4 +36,4 @@ "access": "public", "registry": "https://registry.npmjs.org/" } -} \ No newline at end of file +} diff --git a/packages/xmtp/package.json b/packages/xmtp/package.json index ca2eb22fe..1091b668a 100644 --- a/packages/xmtp/package.json +++ b/packages/xmtp/package.json @@ -59,4 +59,4 @@ "access": "public", "registry": "https://registry.npmjs.org/" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 43e33d02d..8a42a3c2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -36,7 +36,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.25.9, @babel/code-frame@npm:^7.26.0, @babel/code-frame@npm:^7.26.2": +"@babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.25.9, @babel/code-frame@npm:^7.26.0, @babel/code-frame@npm:^7.26.2": version: 7.26.2 resolution: "@babel/code-frame@npm:7.26.2" dependencies: @@ -1644,6 +1644,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/source-map@npm:^0.3.3": + version: 0.3.6 + resolution: "@jridgewell/source-map@npm:0.3.6" + dependencies: + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + checksum: 10/0a9aca9320dc9044014ba0ef989b3a8411b0d778895553e3b7ca2ac0a75a20af4a5ad3f202acfb1879fa40466036a4417e1d5b38305baed8b9c1ebe6e4b3e7f5 + languageName: node + linkType: hard + "@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0": version: 1.5.0 resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" @@ -2708,6 +2718,44 @@ __metadata: languageName: node linkType: hard +"@rollup/plugin-commonjs@npm:^28.0.2": + version: 28.0.2 + resolution: "@rollup/plugin-commonjs@npm:28.0.2" + dependencies: + "@rollup/pluginutils": "npm:^5.0.1" + commondir: "npm:^1.0.1" + estree-walker: "npm:^2.0.2" + fdir: "npm:^6.2.0" + is-reference: "npm:1.2.1" + magic-string: "npm:^0.30.3" + picomatch: "npm:^4.0.2" + peerDependencies: + rollup: ^2.68.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10/07365e28628e65bacae714dc6ebfbadaa11bdd8291ec27f6633bf5a20f73faa9e6b4b0c6f65a05e3deac0d42f61c83174f8d5a38e4cb93e83112a1fca4d60a09 + languageName: node + linkType: hard + +"@rollup/plugin-node-resolve@npm:^16.0.0": + version: 16.0.0 + resolution: "@rollup/plugin-node-resolve@npm:16.0.0" + dependencies: + "@rollup/pluginutils": "npm:^5.0.1" + "@types/resolve": "npm:1.20.2" + deepmerge: "npm:^4.2.2" + is-module: "npm:^1.0.0" + resolve: "npm:^1.22.1" + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10/018a97667d68bd78d6b1de5597680dcc5785f9339a936984a5715ad2cd7c6f2c85fb9448552b94e6903db35e2d3b218b54e5e9ca048257f2d3bdea2e05d886c7 + languageName: node + linkType: hard + "@rollup/plugin-typescript@npm:^11.1.6": version: 11.1.6 resolution: "@rollup/plugin-typescript@npm:11.1.6" @@ -2727,7 +2775,7 @@ __metadata: languageName: node linkType: hard -"@rollup/pluginutils@npm:^5.0.0, @rollup/pluginutils@npm:^5.1.0": +"@rollup/pluginutils@npm:^5.0.0, @rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.1.0": version: 5.1.4 resolution: "@rollup/pluginutils@npm:5.1.4" dependencies: @@ -3317,6 +3365,13 @@ __metadata: languageName: node linkType: hard +"@types/resolve@npm:1.20.2": + version: 1.20.2 + resolution: "@types/resolve@npm:1.20.2" + checksum: 10/1bff0d3875e7e1557b6c030c465beca9bf3b1173ebc6937cac547654b0af3bb3ff0f16470e9c4d7c5dc308ad9ac8627c38dbff24ef698b66673ff5bd4ead7f7e + languageName: node + linkType: hard + "@types/send@npm:*": version: 0.17.4 resolution: "@types/send@npm:0.17.4" @@ -3834,7 +3889,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.0, acorn@npm:^8.11.0, acorn@npm:^8.14.0, acorn@npm:^8.4.1": +"acorn@npm:^8.0.0, acorn@npm:^8.11.0, acorn@npm:^8.14.0, acorn@npm:^8.4.1, acorn@npm:^8.8.2": version: 8.14.0 resolution: "acorn@npm:8.14.0" bin: @@ -4326,6 +4381,13 @@ __metadata: languageName: node linkType: hard +"buffer-from@npm:^1.0.0": + version: 1.1.2 + resolution: "buffer-from@npm:1.1.2" + checksum: 10/0448524a562b37d4d7ed9efd91685a5b77a50672c556ea254ac9a6d30e3403a517d8981f10e565db24e8339413b43c97ca2951f10e399c6125a0d8911f5679bb + languageName: node + linkType: hard + "buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" @@ -4807,6 +4869,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^2.20.0": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: 10/90c5b6898610cd075984c58c4f88418a4fb44af08c1b1415e9854c03171bec31b336b7f3e4cefe33de994b3f12b03c5e2d638da4316df83593b9e82554e7e95b + languageName: node + linkType: hard + "commander@npm:^4.0.0": version: 4.1.1 resolution: "commander@npm:4.1.1" @@ -4814,6 +4883,13 @@ __metadata: languageName: node linkType: hard +"commondir@npm:^1.0.1": + version: 1.0.1 + resolution: "commondir@npm:1.0.1" + checksum: 10/4620bc4936a4ef12ce7dfcd272bb23a99f2ad68889a4e4ad766c9f8ad21af982511934d6f7050d4a8bde90011b1c15d56e61a1b4576d9913efbf697a20172d6c + languageName: node + linkType: hard + "compressible@npm:~2.0.18": version: 2.0.18 resolution: "compressible@npm:2.0.18" @@ -6096,7 +6172,7 @@ __metadata: languageName: node linkType: hard -"fdir@npm:^6.4.2": +"fdir@npm:^6.2.0, fdir@npm:^6.4.2": version: 6.4.2 resolution: "fdir@npm:6.4.2" peerDependencies: @@ -7070,6 +7146,13 @@ __metadata: languageName: node linkType: hard +"is-module@npm:^1.0.0": + version: 1.0.0 + resolution: "is-module@npm:1.0.0" + checksum: 10/8cd5390730c7976fb4e8546dd0b38865ee6f7bacfa08dfbb2cc07219606755f0b01709d9361e01f13009bbbd8099fa2927a8ed665118a6105d66e40f1b838c3f + languageName: node + linkType: hard + "is-number@npm:^7.0.0": version: 7.0.0 resolution: "is-number@npm:7.0.0" @@ -7084,6 +7167,15 @@ __metadata: languageName: node linkType: hard +"is-reference@npm:1.2.1": + version: 1.2.1 + resolution: "is-reference@npm:1.2.1" + dependencies: + "@types/estree": "npm:*" + checksum: 10/e7b48149f8abda2c10849ea51965904d6a714193d68942ad74e30522231045acf06cbfae5a4be2702fede5d232e61bf50b3183acdc056e6e3afe07fcf4f4b2bc + languageName: node + linkType: hard + "is-retry-allowed@npm:^2.2.0": version: 2.2.0 resolution: "is-retry-allowed@npm:2.2.0" @@ -7224,6 +7316,17 @@ __metadata: languageName: node linkType: hard +"jest-worker@npm:^26.2.1": + version: 26.6.2 + resolution: "jest-worker@npm:26.6.2" + dependencies: + "@types/node": "npm:*" + merge-stream: "npm:^2.0.0" + supports-color: "npm:^7.0.0" + checksum: 10/5f6b94cf0e8701392a9402fc7af34a1324d334fc6a440d4d55d2d9348114659c035b8d9b259930f9c9e40cbdda0ef9bfe4d7c780e1107057bbe1202672b38533 + languageName: node + linkType: hard + "jiti@npm:^1.21.6": version: 1.21.6 resolution: "jiti@npm:1.21.6" @@ -7479,6 +7582,15 @@ __metadata: languageName: node linkType: hard +"magic-string@npm:^0.30.3": + version: 0.30.17 + resolution: "magic-string@npm:0.30.17" + dependencies: + "@jridgewell/sourcemap-codec": "npm:^1.5.0" + checksum: 10/2f71af2b0afd78c2e9012a29b066d2c8ba45a9cd0c8070f7fd72de982fb1c403b4e3afdb1dae00691d56885ede66b772ef6bedf765e02e3a7066208fe2fec4aa + languageName: node + linkType: hard + "magicast@npm:^0.3.5": version: 0.3.5 resolution: "magicast@npm:0.3.5" @@ -9632,6 +9744,15 @@ __metadata: languageName: node linkType: hard +"randombytes@npm:^2.1.0": + version: 2.1.0 + resolution: "randombytes@npm:2.1.0" + dependencies: + safe-buffer: "npm:^5.1.0" + checksum: 10/4efd1ad3d88db77c2d16588dc54c2b52fd2461e70fe5724611f38d283857094fe09040fa2c9776366803c3152cf133171b452ef717592b65631ce5dc3a2bdafc + languageName: node + linkType: hard + "range-parser@npm:~1.2.1": version: 1.2.1 resolution: "range-parser@npm:1.2.1" @@ -10243,6 +10364,20 @@ __metadata: languageName: node linkType: hard +"rollup-plugin-terser@npm:^7.0.2": + version: 7.0.2 + resolution: "rollup-plugin-terser@npm:7.0.2" + dependencies: + "@babel/code-frame": "npm:^7.10.4" + jest-worker: "npm:^26.2.1" + serialize-javascript: "npm:^4.0.0" + terser: "npm:^5.0.0" + peerDependencies: + rollup: ^2.0.0 + checksum: 10/af84bb7a7a894cd00852b6486528dfb8653cf94df4c126f95f389a346f401d054b08c46bee519a2ab6a22b33804d1d6ac6d8c90b1b2bf8fffb097eed73fc3c72 + languageName: node + linkType: hard + "rollup@npm:^4.18.0, rollup@npm:^4.20.0": version: 4.28.1 resolution: "rollup@npm:4.28.1" @@ -10340,7 +10475,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:^5.2.1, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:^5.2.1, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: 10/32872cd0ff68a3ddade7a7617b8f4c2ae8764d8b7d884c651b74457967a9e0e886267d3ecc781220629c44a865167b61c375d2da6c720c840ecd73f45d5d9451 @@ -10437,6 +10572,15 @@ __metadata: languageName: node linkType: hard +"serialize-javascript@npm:^4.0.0": + version: 4.0.0 + resolution: "serialize-javascript@npm:4.0.0" + dependencies: + randombytes: "npm:^2.1.0" + checksum: 10/df6809168973a84facade7d73e2d6dc418f5dee704d1e6cbe79e92fdb4c10af55237e99d2e67881ae3b29aa96ba596a0dfec4e609bd289ab8ec93c5ae78ede8e + languageName: node + linkType: hard + "serve-static@npm:1.16.2, serve-static@npm:^1.15.0": version: 1.16.2 resolution: "serve-static@npm:1.16.2" @@ -10766,6 +10910,23 @@ __metadata: languageName: node linkType: hard +"source-map-support@npm:~0.5.20": + version: 0.5.21 + resolution: "source-map-support@npm:0.5.21" + dependencies: + buffer-from: "npm:^1.0.0" + source-map: "npm:^0.6.0" + checksum: 10/8317e12d84019b31e34b86d483dd41d6f832f389f7417faf8fc5c75a66a12d9686e47f589a0554a868b8482f037e23df9d040d29387eb16fa14cb85f091ba207 + languageName: node + linkType: hard + +"source-map@npm:^0.6.0": + version: 0.6.1 + resolution: "source-map@npm:0.6.1" + checksum: 10/59ef7462f1c29d502b3057e822cdbdae0b0e565302c4dd1a95e11e793d8d9d62006cdc10e0fd99163ca33ff2071360cf50ee13f90440806e7ed57d81cba2f7ff + languageName: node + linkType: hard + "source-map@npm:^0.7.0": version: 0.7.4 resolution: "source-map@npm:0.7.4" @@ -11007,7 +11168,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^7.1.0": +"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" dependencies: @@ -11094,6 +11255,20 @@ __metadata: languageName: node linkType: hard +"terser@npm:^5.0.0": + version: 5.37.0 + resolution: "terser@npm:5.37.0" + dependencies: + "@jridgewell/source-map": "npm:^0.3.3" + acorn: "npm:^8.8.2" + commander: "npm:^2.20.0" + source-map-support: "npm:~0.5.20" + bin: + terser: bin/terser + checksum: 10/3afacf7c38c47a5a25dbe1ba2e7aafd61166474d4377ec0af490bd41ab3686ab12679818d5fe4a3e7f76efee26f639c92ac334940c378bbc31176520a38379c3 + languageName: node + linkType: hard + "test-exclude@npm:^7.0.1": version: 7.0.1 resolution: "test-exclude@npm:7.0.1" @@ -12300,6 +12475,8 @@ __metadata: dependencies: "@changesets/changelog-git": "npm:^0.2.0" "@changesets/cli": "npm:^2.27.5" + "@rollup/plugin-commonjs": "npm:^28.0.2" + "@rollup/plugin-node-resolve": "npm:^16.0.0" "@rollup/plugin-typescript": "npm:^11.1.6" "@types/node": "npm:^20.14.2" "@vitest/coverage-v8": "npm:^2.1.4" @@ -12314,6 +12491,7 @@ __metadata: prettier: "npm:^3.3.1" rollup: "npm:^4.18.0" rollup-plugin-dts: "npm:^6.1.1" + rollup-plugin-terser: "npm:^7.0.2" ts-node: "npm:^10.9.2" turbo: "npm:^2.2.3" typescript: "npm:^5.4.5" From 820d1f7c2c254f68de5187d0f9f6ac6f80160fa4 Mon Sep 17 00:00:00 2001 From: fabri Date: Tue, 24 Dec 2024 08:40:40 -0300 Subject: [PATCH 3/8] deploy --- packages/docs/pages/concepts/xmtp.mdx | 2 +- packages/docs/pages/plugins/xmtp.mdx | 8 ++++++-- packages/xmtp-e2ee/README.md | 2 +- packages/xmtp/README.md | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/docs/pages/concepts/xmtp.mdx b/packages/docs/pages/concepts/xmtp.mdx index 24c8ff5ac..d429b97b4 100644 --- a/packages/docs/pages/concepts/xmtp.mdx +++ b/packages/docs/pages/concepts/xmtp.mdx @@ -2,7 +2,7 @@ [XMTP](https://xmtp.org/) is the protocol that MessageKit uses to send and receive messages. -> Check out the [XMTP AI](/plugins/xmtp) plugins for more information. +> Check out the [xmtp e2ee](/plugins/xmtp) plugins for more information. ## Context diff --git a/packages/docs/pages/plugins/xmtp.mdx b/packages/docs/pages/plugins/xmtp.mdx index 47dae8f9e..e2d69f684 100644 --- a/packages/docs/pages/plugins/xmtp.mdx +++ b/packages/docs/pages/plugins/xmtp.mdx @@ -1,4 +1,4 @@ -# End-to-end encrypted messaging +# Secure agent messaging AI is transforming consumer tech, with messaging becoming the main channel for interacting with agent services. This shift will scale message traffic astronomically, analogous to the web’s rise in the 2000s. Just as Cloud-flare secured web traffic, messaging will need robust scalable end-to-end encrypted messages to protect sensitive information. @@ -108,7 +108,11 @@ const onMessage = async (message, user) => { ### React example -This is how you can use the `xmtp-e2ee` package to create a client and handle messages. +xmtp-e2ee is a light wrapper around the xmtp package to make it easier to use in react and web. Doesnt support groups yet. + +```bash [cmd] +bun install xmtp-e2ee +``` ```tsx import { XMTP, Message } from "xmtp-e2ee"; diff --git a/packages/xmtp-e2ee/README.md b/packages/xmtp-e2ee/README.md index d34724a87..bfa1fd12b 100644 --- a/packages/xmtp-e2ee/README.md +++ b/packages/xmtp-e2ee/README.md @@ -1,6 +1,6 @@ # XMTP -> See [XMTP AI](https://message-kit.org/plugins/xmtp) plugin +> See [xmtp e2ee](https://message-kit.org/plugins/xmtp) plugin ### Installation diff --git a/packages/xmtp/README.md b/packages/xmtp/README.md index d3d318ba5..49a50af9b 100644 --- a/packages/xmtp/README.md +++ b/packages/xmtp/README.md @@ -1,6 +1,6 @@ # XMTP -> See [XMTP AI](https://message-kit.org/plugins/xmtp) plugin +> See [xmtp e2ee](https://message-kit.org/plugins/xmtp) plugin ### Installation From d84b987990c2ad098cca399d720b5be1fd952861 Mon Sep 17 00:00:00 2001 From: fabri Date: Tue, 24 Dec 2024 15:23:47 -0300 Subject: [PATCH 4/8] logs --- packages/xmtp-e2ee/package.json | 4 ++-- packages/xmtp-e2ee/src/lib/xmtp.ts | 3 ++- packages/xmtp/package.json | 2 +- packages/xmtp/src/lib/xmtp.ts | 7 ++----- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/xmtp-e2ee/package.json b/packages/xmtp-e2ee/package.json index c6c801ce0..d0cd99237 100644 --- a/packages/xmtp-e2ee/package.json +++ b/packages/xmtp-e2ee/package.json @@ -1,6 +1,6 @@ { "name": "xmtp-e2ee", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "type": "module", "exports": { @@ -61,4 +61,4 @@ "access": "public", "registry": "https://registry.npmjs.org/" } -} \ No newline at end of file +} diff --git a/packages/xmtp-e2ee/src/lib/xmtp.ts b/packages/xmtp-e2ee/src/lib/xmtp.ts index c00b3d53d..6b0409438 100644 --- a/packages/xmtp-e2ee/src/lib/xmtp.ts +++ b/packages/xmtp-e2ee/src/lib/xmtp.ts @@ -237,7 +237,8 @@ async function streamMessages( while (true) { try { const stream = await client.conversations.streamAllMessages(); - console.log(`Stream started`); + console.log(`XMTP: [v2] Stream started`); + for await (const message of stream) { if (message) { try { diff --git a/packages/xmtp/package.json b/packages/xmtp/package.json index 1091b668a..0453f7284 100644 --- a/packages/xmtp/package.json +++ b/packages/xmtp/package.json @@ -1,6 +1,6 @@ { "name": "xmtp", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "type": "module", "exports": { diff --git a/packages/xmtp/src/lib/xmtp.ts b/packages/xmtp/src/lib/xmtp.ts index 222a1d5ec..c9b407a80 100644 --- a/packages/xmtp/src/lib/xmtp.ts +++ b/packages/xmtp/src/lib/xmtp.ts @@ -238,7 +238,6 @@ export class XMTP { contentType = ContentTypeAgentMessage; } - console.log(`message`, message); if (userMessage.originalMessage?.version == "v2") { let v2Conversation = await this.getV2ConversationByAddress( userMessage.originalMessage.client?.address, @@ -359,7 +358,7 @@ async function streamMessages( await v3client.conversations.sync(); await v3client.conversations.list(); const stream = await v3client.conversations.streamAllMessages(); - console.warn(`XMTP: [v3] Stream started`); + console.log(`XMTP: [v3] Stream started`); for await (const message of stream) { let conversation = await xmtp.getConversationFromMessage(message); if (message && conversation) { @@ -378,7 +377,6 @@ async function streamMessages( conversation, client, ); - console.log(`parsedMessage`, parsedMessage); await onMessage(parsedMessage as Message); } catch (e) { console.log(`error`, e); @@ -390,7 +388,7 @@ async function streamMessages( typeof v2client.conversations.streamAllMessages === "function" ) { const stream = await v2client.conversations.streamAllMessages(); - console.warn(`XMTP: [v2] Stream started`); + console.log(`XMTP: [v2] Stream started`); for await (const message of stream) { let conversation = await xmtp.getConversationFromMessage(message); if (message && conversation) { @@ -408,7 +406,6 @@ async function streamMessages( conversation, client, ); - console.log(`parsedMessage`, parsedMessage); await onMessage(parsedMessage as Message); } catch (e) { console.log(`error`, e); From b71bdfe39435ed805d955e11a9f7eea288800c57 Mon Sep 17 00:00:00 2001 From: fabri Date: Tue, 24 Dec 2024 16:06:13 -0300 Subject: [PATCH 5/8] build --- .../client/src/components/Chat.module.css | 8 + packages/client/src/components/Chat.tsx | 3 + yarn.lock | 190 +----------------- 3 files changed, 17 insertions(+), 184 deletions(-) diff --git a/packages/client/src/components/Chat.module.css b/packages/client/src/components/Chat.module.css index 095b5425e..57fd8f1f9 100644 --- a/packages/client/src/components/Chat.module.css +++ b/packages/client/src/components/Chat.module.css @@ -231,3 +231,11 @@ color: var(--accent); font-size: 0.9rem; } +.encryptionInfo { + text-align: center !important; + width: 100%; + font-size: 0.7rem; + padding: 0rem; + padding-top: 0.4rem; + display: block !important; +} diff --git a/packages/client/src/components/Chat.tsx b/packages/client/src/components/Chat.tsx index afabd3bc9..e98223238 100644 --- a/packages/client/src/components/Chat.tsx +++ b/packages/client/src/components/Chat.tsx @@ -244,6 +244,9 @@ function Chat({ user }: { user: UserInfo }) { Send +
+ End-to-end encrypted powered by XMTP +
); diff --git a/yarn.lock b/yarn.lock index 8a42a3c2c..43e33d02d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -36,7 +36,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.25.9, @babel/code-frame@npm:^7.26.0, @babel/code-frame@npm:^7.26.2": +"@babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.25.9, @babel/code-frame@npm:^7.26.0, @babel/code-frame@npm:^7.26.2": version: 7.26.2 resolution: "@babel/code-frame@npm:7.26.2" dependencies: @@ -1644,16 +1644,6 @@ __metadata: languageName: node linkType: hard -"@jridgewell/source-map@npm:^0.3.3": - version: 0.3.6 - resolution: "@jridgewell/source-map@npm:0.3.6" - dependencies: - "@jridgewell/gen-mapping": "npm:^0.3.5" - "@jridgewell/trace-mapping": "npm:^0.3.25" - checksum: 10/0a9aca9320dc9044014ba0ef989b3a8411b0d778895553e3b7ca2ac0a75a20af4a5ad3f202acfb1879fa40466036a4417e1d5b38305baed8b9c1ebe6e4b3e7f5 - languageName: node - linkType: hard - "@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0": version: 1.5.0 resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" @@ -2718,44 +2708,6 @@ __metadata: languageName: node linkType: hard -"@rollup/plugin-commonjs@npm:^28.0.2": - version: 28.0.2 - resolution: "@rollup/plugin-commonjs@npm:28.0.2" - dependencies: - "@rollup/pluginutils": "npm:^5.0.1" - commondir: "npm:^1.0.1" - estree-walker: "npm:^2.0.2" - fdir: "npm:^6.2.0" - is-reference: "npm:1.2.1" - magic-string: "npm:^0.30.3" - picomatch: "npm:^4.0.2" - peerDependencies: - rollup: ^2.68.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - checksum: 10/07365e28628e65bacae714dc6ebfbadaa11bdd8291ec27f6633bf5a20f73faa9e6b4b0c6f65a05e3deac0d42f61c83174f8d5a38e4cb93e83112a1fca4d60a09 - languageName: node - linkType: hard - -"@rollup/plugin-node-resolve@npm:^16.0.0": - version: 16.0.0 - resolution: "@rollup/plugin-node-resolve@npm:16.0.0" - dependencies: - "@rollup/pluginutils": "npm:^5.0.1" - "@types/resolve": "npm:1.20.2" - deepmerge: "npm:^4.2.2" - is-module: "npm:^1.0.0" - resolve: "npm:^1.22.1" - peerDependencies: - rollup: ^2.78.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - checksum: 10/018a97667d68bd78d6b1de5597680dcc5785f9339a936984a5715ad2cd7c6f2c85fb9448552b94e6903db35e2d3b218b54e5e9ca048257f2d3bdea2e05d886c7 - languageName: node - linkType: hard - "@rollup/plugin-typescript@npm:^11.1.6": version: 11.1.6 resolution: "@rollup/plugin-typescript@npm:11.1.6" @@ -2775,7 +2727,7 @@ __metadata: languageName: node linkType: hard -"@rollup/pluginutils@npm:^5.0.0, @rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.1.0": +"@rollup/pluginutils@npm:^5.0.0, @rollup/pluginutils@npm:^5.1.0": version: 5.1.4 resolution: "@rollup/pluginutils@npm:5.1.4" dependencies: @@ -3365,13 +3317,6 @@ __metadata: languageName: node linkType: hard -"@types/resolve@npm:1.20.2": - version: 1.20.2 - resolution: "@types/resolve@npm:1.20.2" - checksum: 10/1bff0d3875e7e1557b6c030c465beca9bf3b1173ebc6937cac547654b0af3bb3ff0f16470e9c4d7c5dc308ad9ac8627c38dbff24ef698b66673ff5bd4ead7f7e - languageName: node - linkType: hard - "@types/send@npm:*": version: 0.17.4 resolution: "@types/send@npm:0.17.4" @@ -3889,7 +3834,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.0, acorn@npm:^8.11.0, acorn@npm:^8.14.0, acorn@npm:^8.4.1, acorn@npm:^8.8.2": +"acorn@npm:^8.0.0, acorn@npm:^8.11.0, acorn@npm:^8.14.0, acorn@npm:^8.4.1": version: 8.14.0 resolution: "acorn@npm:8.14.0" bin: @@ -4381,13 +4326,6 @@ __metadata: languageName: node linkType: hard -"buffer-from@npm:^1.0.0": - version: 1.1.2 - resolution: "buffer-from@npm:1.1.2" - checksum: 10/0448524a562b37d4d7ed9efd91685a5b77a50672c556ea254ac9a6d30e3403a517d8981f10e565db24e8339413b43c97ca2951f10e399c6125a0d8911f5679bb - languageName: node - linkType: hard - "buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" @@ -4869,13 +4807,6 @@ __metadata: languageName: node linkType: hard -"commander@npm:^2.20.0": - version: 2.20.3 - resolution: "commander@npm:2.20.3" - checksum: 10/90c5b6898610cd075984c58c4f88418a4fb44af08c1b1415e9854c03171bec31b336b7f3e4cefe33de994b3f12b03c5e2d638da4316df83593b9e82554e7e95b - languageName: node - linkType: hard - "commander@npm:^4.0.0": version: 4.1.1 resolution: "commander@npm:4.1.1" @@ -4883,13 +4814,6 @@ __metadata: languageName: node linkType: hard -"commondir@npm:^1.0.1": - version: 1.0.1 - resolution: "commondir@npm:1.0.1" - checksum: 10/4620bc4936a4ef12ce7dfcd272bb23a99f2ad68889a4e4ad766c9f8ad21af982511934d6f7050d4a8bde90011b1c15d56e61a1b4576d9913efbf697a20172d6c - languageName: node - linkType: hard - "compressible@npm:~2.0.18": version: 2.0.18 resolution: "compressible@npm:2.0.18" @@ -6172,7 +6096,7 @@ __metadata: languageName: node linkType: hard -"fdir@npm:^6.2.0, fdir@npm:^6.4.2": +"fdir@npm:^6.4.2": version: 6.4.2 resolution: "fdir@npm:6.4.2" peerDependencies: @@ -7146,13 +7070,6 @@ __metadata: languageName: node linkType: hard -"is-module@npm:^1.0.0": - version: 1.0.0 - resolution: "is-module@npm:1.0.0" - checksum: 10/8cd5390730c7976fb4e8546dd0b38865ee6f7bacfa08dfbb2cc07219606755f0b01709d9361e01f13009bbbd8099fa2927a8ed665118a6105d66e40f1b838c3f - languageName: node - linkType: hard - "is-number@npm:^7.0.0": version: 7.0.0 resolution: "is-number@npm:7.0.0" @@ -7167,15 +7084,6 @@ __metadata: languageName: node linkType: hard -"is-reference@npm:1.2.1": - version: 1.2.1 - resolution: "is-reference@npm:1.2.1" - dependencies: - "@types/estree": "npm:*" - checksum: 10/e7b48149f8abda2c10849ea51965904d6a714193d68942ad74e30522231045acf06cbfae5a4be2702fede5d232e61bf50b3183acdc056e6e3afe07fcf4f4b2bc - languageName: node - linkType: hard - "is-retry-allowed@npm:^2.2.0": version: 2.2.0 resolution: "is-retry-allowed@npm:2.2.0" @@ -7316,17 +7224,6 @@ __metadata: languageName: node linkType: hard -"jest-worker@npm:^26.2.1": - version: 26.6.2 - resolution: "jest-worker@npm:26.6.2" - dependencies: - "@types/node": "npm:*" - merge-stream: "npm:^2.0.0" - supports-color: "npm:^7.0.0" - checksum: 10/5f6b94cf0e8701392a9402fc7af34a1324d334fc6a440d4d55d2d9348114659c035b8d9b259930f9c9e40cbdda0ef9bfe4d7c780e1107057bbe1202672b38533 - languageName: node - linkType: hard - "jiti@npm:^1.21.6": version: 1.21.6 resolution: "jiti@npm:1.21.6" @@ -7582,15 +7479,6 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.3": - version: 0.30.17 - resolution: "magic-string@npm:0.30.17" - dependencies: - "@jridgewell/sourcemap-codec": "npm:^1.5.0" - checksum: 10/2f71af2b0afd78c2e9012a29b066d2c8ba45a9cd0c8070f7fd72de982fb1c403b4e3afdb1dae00691d56885ede66b772ef6bedf765e02e3a7066208fe2fec4aa - languageName: node - linkType: hard - "magicast@npm:^0.3.5": version: 0.3.5 resolution: "magicast@npm:0.3.5" @@ -9744,15 +9632,6 @@ __metadata: languageName: node linkType: hard -"randombytes@npm:^2.1.0": - version: 2.1.0 - resolution: "randombytes@npm:2.1.0" - dependencies: - safe-buffer: "npm:^5.1.0" - checksum: 10/4efd1ad3d88db77c2d16588dc54c2b52fd2461e70fe5724611f38d283857094fe09040fa2c9776366803c3152cf133171b452ef717592b65631ce5dc3a2bdafc - languageName: node - linkType: hard - "range-parser@npm:~1.2.1": version: 1.2.1 resolution: "range-parser@npm:1.2.1" @@ -10364,20 +10243,6 @@ __metadata: languageName: node linkType: hard -"rollup-plugin-terser@npm:^7.0.2": - version: 7.0.2 - resolution: "rollup-plugin-terser@npm:7.0.2" - dependencies: - "@babel/code-frame": "npm:^7.10.4" - jest-worker: "npm:^26.2.1" - serialize-javascript: "npm:^4.0.0" - terser: "npm:^5.0.0" - peerDependencies: - rollup: ^2.0.0 - checksum: 10/af84bb7a7a894cd00852b6486528dfb8653cf94df4c126f95f389a346f401d054b08c46bee519a2ab6a22b33804d1d6ac6d8c90b1b2bf8fffb097eed73fc3c72 - languageName: node - linkType: hard - "rollup@npm:^4.18.0, rollup@npm:^4.20.0": version: 4.28.1 resolution: "rollup@npm:4.28.1" @@ -10475,7 +10340,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:^5.2.1, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:^5.2.1, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: 10/32872cd0ff68a3ddade7a7617b8f4c2ae8764d8b7d884c651b74457967a9e0e886267d3ecc781220629c44a865167b61c375d2da6c720c840ecd73f45d5d9451 @@ -10572,15 +10437,6 @@ __metadata: languageName: node linkType: hard -"serialize-javascript@npm:^4.0.0": - version: 4.0.0 - resolution: "serialize-javascript@npm:4.0.0" - dependencies: - randombytes: "npm:^2.1.0" - checksum: 10/df6809168973a84facade7d73e2d6dc418f5dee704d1e6cbe79e92fdb4c10af55237e99d2e67881ae3b29aa96ba596a0dfec4e609bd289ab8ec93c5ae78ede8e - languageName: node - linkType: hard - "serve-static@npm:1.16.2, serve-static@npm:^1.15.0": version: 1.16.2 resolution: "serve-static@npm:1.16.2" @@ -10910,23 +10766,6 @@ __metadata: languageName: node linkType: hard -"source-map-support@npm:~0.5.20": - version: 0.5.21 - resolution: "source-map-support@npm:0.5.21" - dependencies: - buffer-from: "npm:^1.0.0" - source-map: "npm:^0.6.0" - checksum: 10/8317e12d84019b31e34b86d483dd41d6f832f389f7417faf8fc5c75a66a12d9686e47f589a0554a868b8482f037e23df9d040d29387eb16fa14cb85f091ba207 - languageName: node - linkType: hard - -"source-map@npm:^0.6.0": - version: 0.6.1 - resolution: "source-map@npm:0.6.1" - checksum: 10/59ef7462f1c29d502b3057e822cdbdae0b0e565302c4dd1a95e11e793d8d9d62006cdc10e0fd99163ca33ff2071360cf50ee13f90440806e7ed57d81cba2f7ff - languageName: node - linkType: hard - "source-map@npm:^0.7.0": version: 0.7.4 resolution: "source-map@npm:0.7.4" @@ -11168,7 +11007,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0": +"supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" dependencies: @@ -11255,20 +11094,6 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.0.0": - version: 5.37.0 - resolution: "terser@npm:5.37.0" - dependencies: - "@jridgewell/source-map": "npm:^0.3.3" - acorn: "npm:^8.8.2" - commander: "npm:^2.20.0" - source-map-support: "npm:~0.5.20" - bin: - terser: bin/terser - checksum: 10/3afacf7c38c47a5a25dbe1ba2e7aafd61166474d4377ec0af490bd41ab3686ab12679818d5fe4a3e7f76efee26f639c92ac334940c378bbc31176520a38379c3 - languageName: node - linkType: hard - "test-exclude@npm:^7.0.1": version: 7.0.1 resolution: "test-exclude@npm:7.0.1" @@ -12475,8 +12300,6 @@ __metadata: dependencies: "@changesets/changelog-git": "npm:^0.2.0" "@changesets/cli": "npm:^2.27.5" - "@rollup/plugin-commonjs": "npm:^28.0.2" - "@rollup/plugin-node-resolve": "npm:^16.0.0" "@rollup/plugin-typescript": "npm:^11.1.6" "@types/node": "npm:^20.14.2" "@vitest/coverage-v8": "npm:^2.1.4" @@ -12491,7 +12314,6 @@ __metadata: prettier: "npm:^3.3.1" rollup: "npm:^4.18.0" rollup-plugin-dts: "npm:^6.1.1" - rollup-plugin-terser: "npm:^7.0.2" ts-node: "npm:^10.9.2" turbo: "npm:^2.2.3" typescript: "npm:^5.4.5" From 2f0bb99d39ebeadff0f0791c522b2ad49a5fb186 Mon Sep 17 00:00:00 2001 From: fabri Date: Tue, 24 Dec 2024 18:27:08 -0300 Subject: [PATCH 6/8] Mobile links --- packages/client/src/components/Chat.module.css | 5 +---- packages/client/src/components/Chat.tsx | 10 ++++++---- packages/client/src/components/UrlPreview.tsx | 8 +------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/client/src/components/Chat.module.css b/packages/client/src/components/Chat.module.css index 57fd8f1f9..e380600be 100644 --- a/packages/client/src/components/Chat.module.css +++ b/packages/client/src/components/Chat.module.css @@ -169,16 +169,13 @@ } .urlContainer { - margin: 8px 0; display: flex; flex-direction: column; - gap: 8px; + border-radius: 8px 8px 0 0; max-width: 300px; - background: #e0e0e0; } .urlPreview { - border-radius: 8px 8px 0 0; overflow: hidden; background: #ffffff; border: 1px solid #b0b0b0; diff --git a/packages/client/src/components/Chat.tsx b/packages/client/src/components/Chat.tsx index e98223238..53df33297 100644 --- a/packages/client/src/components/Chat.tsx +++ b/packages/client/src/components/Chat.tsx @@ -140,17 +140,19 @@ function Chat({ user }: { user: UserInfo }) { if (urlRegex.test(part)) { try { const urlType = getUrlType(part); - const isMessageKitUrl = part.includes("message-kit.org"); - + const isMessageKitUrl = + part.includes("message-kit.org") || + part.includes("baselinks.vercel.app"); + const isMobile = window.innerWidth < 768; return (
- {isMessageKitUrl && } + {isMessageKitUrl && }
{urlType === "payment" && (