A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Respect the Enter preference in the desktop app composer
klarkxye252cbbba9d5
diff --git a/app/package-lock.json b/app/package-lock.jsonindex 4230a857..4430583f 100644--- a/app/package-lock.json+++ b/app/package-lock.json@@ -55,6 +55,7 @@"devDependencies": {"electron": "44.7.0","electron-builder": "26.17.0",+ "esbuild": "0.28.2","extract-zip": "2.0.1","papaparse": "5.5.3","react": "19.3.0",@@ -6219,28 +6220,6 @@}}},- "node_modules/@earendil-works/pi-ai/node_modules/ws": {- "version": "8.22.1",- "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.1.tgz",- "integrity": "sha512-oyL6OPYme/CmiFvNuGzeoxCJ4nOrZE2O1FwM9MWM1AsGri6nLXB2pg+lNA8aLeXMSav0J6eIVS1j6vUPzUtK9g==",- "extraneous": true,- "license": "MIT",- "engines": {- "node": ">=10.0.0"- },- "peerDependencies": {- "bufferutil": "^4.0.1",- "utf-8-validate": ">=5.0.2"- },- "peerDependenciesMeta": {- "bufferutil": {- "optional": true- },- "utf-8-validate": {- "optional": true- }- }- },"node_modules/@earendil-works/pi-telemetry": {"version": "1.4.0","resolved": "https://registry.npmjs.org/@earendil-works/pi-telemetry/-/pi-telemetry-1.4.0.tgz",@@ -6739,6 +6718,448 @@"tslib": "^2.4.0"}},+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",+ "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.28.2.tgz",+ "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz",+ "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.28.2.tgz",+ "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz",+ "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz",+ "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz",+ "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz",+ "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz",+ "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz",+ "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz",+ "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz",+ "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz",+ "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz",+ "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz",+ "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",+ "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz",+ "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz",+ "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz",+ "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz",+ "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz",+ "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openharmony-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz",+ "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz",+ "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz",+ "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz",+ "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz",+ "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },"node_modules/@eslint-community/regexpp": {"version": "4.12.2","resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",@@ -6883,9 +7304,6 @@"cpu": ["arm"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -6902,9 +7320,6 @@"cpu": ["arm64"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -6921,9 +7336,6 @@"cpu": ["ppc64"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -6940,9 +7352,6 @@"cpu": ["riscv64"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -6959,9 +7368,6 @@"cpu": ["s390x"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -6978,9 +7384,6 @@"cpu": ["x64"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -6997,9 +7400,6 @@"cpu": ["arm64"],- "libc": [- "musl"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -7016,9 +7416,6 @@"cpu": ["x64"],- "libc": [- "musl"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -7035,9 +7432,6 @@"cpu": ["arm"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -7060,9 +7454,6 @@"cpu": ["arm64"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -7085,9 +7476,6 @@"cpu": ["ppc64"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -7110,9 +7498,6 @@"cpu": ["riscv64"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -7135,9 +7520,6 @@"cpu": ["s390x"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -7160,9 +7542,6 @@"cpu": ["x64"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -7185,9 +7564,6 @@"cpu": ["arm64"],- "libc": [- "musl"- ],"license": "Apache-2.0","optional": true,"os": [@@ -7210,9 +7586,6 @@"cpu": ["x64"],- "libc": [- "musl"- ],"license": "Apache-2.0","optional": true,"os": [@@ -8106,9 +8479,6 @@"arm64"],"dev": true,- "libc": [- "glibc"- ],"license": "MIT","optional": true,"os": [@@ -8126,9 +8496,6 @@"arm64"],"dev": true,- "libc": [- "musl"- ],"license": "MIT","optional": true,"os": [@@ -8146,9 +8513,6 @@"ppc64"],"dev": true,- "libc": [- "glibc"- ],"license": "MIT","optional": true,"os": [@@ -8166,9 +8530,6 @@"s390x"],"dev": true,- "libc": [- "glibc"- ],"license": "MIT","optional": true,"os": [@@ -8186,9 +8547,6 @@"x64"],"dev": true,- "libc": [- "glibc"- ],"license": "MIT","optional": true,"os": [@@ -8206,9 +8564,6 @@"x64"],"dev": true,- "libc": [- "musl"- ],"license": "MIT","optional": true,"os": [@@ -10671,6 +11026,48 @@"license": "MIT","optional": true},+ "node_modules/esbuild": {+ "version": "0.28.2",+ "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.28.2.tgz",+ "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.28.2",+ "@esbuild/android-arm": "0.28.2",+ "@esbuild/android-arm64": "0.28.2",+ "@esbuild/android-x64": "0.28.2",+ "@esbuild/darwin-arm64": "0.28.2",+ "@esbuild/darwin-x64": "0.28.2",+ "@esbuild/freebsd-arm64": "0.28.2",+ "@esbuild/freebsd-x64": "0.28.2",+ "@esbuild/linux-arm": "0.28.2",+ "@esbuild/linux-arm64": "0.28.2",+ "@esbuild/linux-ia32": "0.28.2",+ "@esbuild/linux-loong64": "0.28.2",+ "@esbuild/linux-mips64el": "0.28.2",+ "@esbuild/linux-ppc64": "0.28.2",+ "@esbuild/linux-riscv64": "0.28.2",+ "@esbuild/linux-s390x": "0.28.2",+ "@esbuild/linux-x64": "0.28.2",+ "@esbuild/netbsd-arm64": "0.28.2",+ "@esbuild/netbsd-x64": "0.28.2",+ "@esbuild/openbsd-arm64": "0.28.2",+ "@esbuild/openbsd-x64": "0.28.2",+ "@esbuild/openharmony-arm64": "0.28.2",+ "@esbuild/sunos-x64": "0.28.2",+ "@esbuild/win32-arm64": "0.28.2",+ "@esbuild/win32-ia32": "0.28.2",+ "@esbuild/win32-x64": "0.28.2"+ }+ },"node_modules/escalade": {"version": "3.2.0","resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",@@ -12227,9 +12624,6 @@"arm64"],"dev": true,- "libc": [- "glibc"- ],"license": "MPL-2.0","optional": true,"os": [@@ -12251,9 +12645,6 @@"arm64"],"dev": true,- "libc": [- "musl"- ],"license": "MPL-2.0","optional": true,"os": [@@ -12275,9 +12666,6 @@"x64"],"dev": true,- "libc": [- "glibc"- ],"license": "MPL-2.0","optional": true,"os": [@@ -12299,9 +12687,6 @@"x64"],"dev": true,- "libc": [- "musl"- ],"license": "MPL-2.0","optional": true,"os": [@@ -13649,9 +14034,6 @@"cpu": ["arm64"],- "libc": [- "glibc"- ],"license": "MIT","optional": true,"os": [@@ -13671,9 +14053,6 @@"cpu": ["arm64"],- "libc": [- "musl"- ],"license": "MIT","optional": true,"os": [@@ -13693,9 +14072,6 @@"cpu": ["x64"],- "libc": [- "glibc"- ],"license": "MIT","optional": true,"os": [@@ -13715,9 +14091,6 @@"cpu": ["x64"],- "libc": [- "musl"- ],"license": "MIT","optional": true,"os": [diff --git a/app/package.json b/app/package.jsonindex f07cb261..d4bf886c 100644--- a/app/package.json+++ b/app/package.json@@ -69,6 +69,7 @@"devDependencies": {"electron": "44.7.0","electron-builder": "26.17.0",+ "esbuild": "0.28.2","extract-zip": "2.0.1","papaparse": "5.5.3","react": "19.3.0",diff --git a/app/test/chat.test.mjs b/app/test/chat.test.mjsnew file mode 100644index 00000000..0c1c2c82--- /dev/null+++ b/app/test/chat.test.mjs@@ -0,0 +1,184 @@+import assert from 'node:assert/strict'+import { test } from 'node:test'+import { fileURLToPath } from 'node:url'+import { runInNewContext } from 'node:vm'+import { build } from 'esbuild'++// The app's composer shares the Enter preference with the plugin's: the voice+// buttons read it from the roster, and a plain Enter submits only while it says+// Enter sends; off, the field's own newline stands and the send button submits.+// Parts of the page outside the composer are stubbed: this checks the wiring+// from the chat's hooks down to the textarea and the plugin's voice buttons.+const stubs = {+ 'cells.js': 'export const Bubbles = () => null\nexport const ChatRows = () => null\nexport const Shimmer = () => null\n',+ 'model-menu.js': 'export const ModelChoiceDock = () => null\n',+ 'questions.js': 'export const PendingQuestion = () => null\n',+ 'api.js': "export const call = async () => ({ sessionId: 'b1', items: [], cursor: null })\n",+}+const { outputFiles } = await build({+ entryPoints: [fileURLToPath(new URL('../ui/src/chat.js', import.meta.url))],+ bundle: true, format: 'cjs', platform: 'browser', write: false, logLevel: 'silent',+ external: ['react', 'react-dom'],+ plugins: [{+ name: 'app-chat-stubs',+ setup(bundler) {+ bundler.onResolve({ filter: /src\/client\/(cells|model-menu|questions|api)\.js$/ }, args => ({ path: args.path.split('/').pop(), namespace: 'app-chat-stub' }))+ bundler.onLoad({ filter: /.*/, namespace: 'app-chat-stub' }, args => ({ contents: stubs[args.path], loader: 'js' }))+ },+ }],+})+let current+const slot = (make) => {+ const index = current.index+++ return current.slots[index] ??= make()+}+const effect = (make, deps) => {+ const cell = slot(() => ({}))+ if (!cell.deps || deps === undefined || deps.some((value, index) => value !== cell.deps[index])) {+ current.effects.push(() => { cell.stop?.(); cell.stop = make(); cell.deps = deps })+ }+}+// Null refs get a field stand-in: the composer's own effects touch its style,+// focus and caret before the browser would have attached the real textarea.+const field = {+ style: {}, scrollHeight: 0, selectionStart: 0, selectionEnd: 0,+ focus() {}, closest: () => null, contains: () => false,+ addEventListener() {}, removeEventListener() {}, abort() {},+}+const react = {+ Fragment: 'fragment',+ createElement: (type, props, ...children) => ({ type, props: { ...props, children } }),+ useState: (initial) => {+ const cell = slot(() => ({ value: typeof initial === 'function' ? initial() : initial }))+ return [cell.value, next => { cell.value = typeof next === 'function' ? next(cell.value) : next }]+ },+ useRef: initial => slot(() => ({ current: initial === null ? field : initial })),+ useEffect: effect, useLayoutEffect: effect,+ useMemo: make => make(),+ useCallback: fn => fn,+}+const module = { exports: {} }+runInNewContext(outputFiles[0].text, {+ module, exports: module.exports,+ require: (name) => {+ if (name === 'react') return react+ if (name === 'react-dom') return { createPortal: node => node }+ throw new Error(`no platform module ${name}`)+ },+ window: { addEventListener() {}, removeEventListener() {}, innerHeight: 800 },+ document: { querySelector: () => null, body: {}, documentElement: { addEventListener() {}, removeEventListener() {} } },+ navigator: { language: 'en' },+ setTimeout: () => 0, clearTimeout() {},+ requestAnimationFrame: () => 0, cancelAnimationFrame() {}, performance: { now: () => 0 },+ fetch: () => { throw new Error('no fetch in test') },+})+const { Chat } = module.exports++// Function children stay inert in the React stand-in, so the tree is expanded by+// calling them: Composer, ComposerPlus and ComposerVoice really run, in order,+// sharing the hook slots the way React would.+const expand = (node) => {+ if (Array.isArray(node)) return node.map(expand)+ if (!node || typeof node !== 'object') return node+ if (typeof node.type === 'function') return expand(node.type(node.props))+ return { ...node, props: { ...node.props, children: node.props.children.map(expand) } }+}+const mount = (props) => {+ const instance = {+ slots: [], effects: [], props,+ render(next = instance.props) {+ instance.props = next+ instance.index = 0+ current = instance+ const out = expand(Chat(next))+ current = undefined+ for (const run of instance.effects.splice(0)) run()+ return out+ },+ }+ return instance+}+const all = (node, check) => {+ if (Array.isArray(node)) return node.flatMap(child => all(child, check))+ if (!node || typeof node !== 'object') return []+ return [...(check(node) ? [node] : []), ...all(node.props.children, check)]+}+const textarea = node => all(node, child => child.type === 'textarea')[0]+const sendButton = node => all(node, child => child.type === 'button' && child.props?.className === 'dsb-send')[0]+const enter = (extra = {}) => ({+ key: 'Enter', shiftKey: false, nativeEvent: { isComposing: false }, prevented: false,+ preventDefault() { this.prevented = true }, ...extra,+})+const tick = () => new Promise(resolve => setImmediate(resolve))+const plain = value => JSON.parse(JSON.stringify(value))++// Mounts a Bot's chat with `prefs` in the roster, types a draft, and returns the+// send log plus the rendered tree accessor.+const view = (prefs, ready = true) => {+ const sent = []+ const roster = { ready, prefs, byId: { b1: { id: 'b1', name: 'Bot' } }, roomsById: {}, questions: {} }+ const team = {+ actions: {+ noteSent() {},+ send: async (sessionId, text) => { sent.push([sessionId, text]) },+ speech: () => undefined,+ openVoice() {},+ clearQuote() {},+ canReferenceChat: () => false,+ },+ hooks: {+ useRoster: select => select(roster),+ useUi: select => select({}),+ useSessionStatus: select => select(new Map()),+ },+ chat: { on: () => () => {} },+ }+ const instance = mount({ sessionId: 'b1', team })+ textarea(instance.render()).props.onChange({ target: { value: 'hi' } })+ return { sent, tree: () => instance.render() }+}++test('with Enter sending on, a plain Enter sends the draft and clears it', async () => {+ const { sent, tree } = view({ enterToSend: true })+ const event = enter()+ textarea(tree()).props.onKeyDown(event)+ await tick()+ assert.equal(event.prevented, true)+ assert.deepEqual(plain(sent), [['b1', 'hi']])+ assert.equal(textarea(tree()).props.value, '')+})++test('with Enter sending off, a plain Enter is a newline and the send button sends', async () => {+ const { sent, tree } = view({ enterToSend: false })+ const event = enter()+ textarea(tree()).props.onKeyDown(event)+ await tick()+ assert.equal(event.prevented, false)+ assert.deepEqual(plain(sent), [])+ assert.equal(textarea(tree()).props.value, 'hi')+ // The explicit send control carries the same send.+ sendButton(tree()).props.onClick()+ await tick()+ assert.deepEqual(plain(sent), [['b1', 'hi']])+ assert.equal(textarea(tree()).props.value, '')+})++test('a roster without the flag keeps the default: Enter sends', async () => {+ const { sent, tree } = view({})+ const event = enter()+ textarea(tree()).props.onKeyDown(event)+ await tick()+ assert.equal(event.prevented, true)+ assert.deepEqual(plain(sent), [['b1', 'hi']])+})++test('Shift+Enter and IME confirmation keep their default behavior', async () => {+ for (const extra of [{ shiftKey: true }, { nativeEvent: { isComposing: true } }]) {+ const { sent, tree } = view({ enterToSend: true })+ const event = enter(extra)+ textarea(tree()).props.onKeyDown(event)+ await tick()+ assert.equal(event.prevented, false)+ assert.deepEqual(plain(sent), [])+ }+})diff --git a/app/ui/src/chat.js b/app/ui/src/chat.jsindex 09a31729..3575988a 100644--- a/app/ui/src/chat.js+++ b/app/ui/src/chat.js@@ -2,6 +2,7 @@ import { createElement as h, useCallback, useEffect, useLayoutEffect, useMemo, uimport { call } from '../../../ds-bot/src/client/api.js'import { Bubbles, ChatRows, Shimmer } from '../../../ds-bot/src/client/cells.js'import { ComposerPlus, ComposerVoice } from '../../../ds-bot/src/client/composer.js'+import { sendsOnEnter } from '../../../ds-bot/src/client/enter-key.js'import { t } from '../../../ds-bot/src/client/i18n.js'import { ArrowUpIcon } from '../../../ds-bot/src/client/icons.js'import { ModelChoiceDock } from '../../../ds-bot/src/client/model-menu.js'@@ -103,6 +104,7 @@ function Composer({ sessionId, placeholder, disabled, onSend, actions, useUi, usconst [error, setError] = useState(null)const field = useRef(null)const inputActions = useInput(field, setText)+ const enterToSend = useRoster(state => sendsOnEnter(state.prefs))useLayoutEffect(() => {const node = field.currentnode.style.height = 'auto'@@ -136,14 +138,14 @@ function Composer({ sessionId, placeholder, disabled, onSend, actions, useUi, us'data-composer-input': '',onChange: event => setText(event.target.value),onKeyDown: (event) => {- if (event.key === 'Enter' && !event.shiftKey && !event.nativeEvent.isComposing) {+ if (event.key === 'Enter' && enterToSend && !event.shiftKey && !event.nativeEvent.isComposing) {event.preventDefault()void submit()}},})),h('div', { className: 'dsb-composer-trailing' },- h(ComposerVoice, { sessionId, inputActions, actions, useUi }),+ h(ComposerVoice, { sessionId, inputActions, actions, useUi, useRoster }),h('button', { type: 'button', className: 'dsb-send', disabled: disabled || text.trim() === '', 'aria-label': t('Send message'), title: t('Send message'), onClick: () => { void submit() } }, h(ArrowUpIcon)))))}