Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.
Rust ai-agentsai-assistantai-botautomationbotbots-teamchatbotclaude-duetgrokgrok-botgrok-bot-alternativeharnessllmmulti-agentopenai-dotsopenbotpersonal-agentrustself-hostedselfhosted-ai
Flight School panel: no form nested in the Edit bot form
Pixel (kwant bot)3e9cf192f5bd
diff --git a/frontend/package-lock.json b/frontend/package-lock.jsonindex f14c2cf9..65ad1286 100644--- a/frontend/package-lock.json+++ b/frontend/package-lock.json@@ -21,6 +21,7 @@"@types/react-dom": "^18.3.1","@vitejs/plugin-react": "^4.3.3","autoprefixer": "^10.4.20",+ "jsdom": "^26.1.0","postcss": "^8.4.49","tailwindcss": "^3.4.15","typescript": "^5.6.3",@@ -39,6 +40,27 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/@asamuzakjp/css-color": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz",+ "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@csstools/css-calc": "^2.1.3",+ "@csstools/css-color-parser": "^3.0.9",+ "@csstools/css-parser-algorithms": "^3.0.4",+ "@csstools/css-tokenizer": "^3.0.3",+ "lru-cache": "^10.4.3"+ }+ },+ "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": {+ "version": "10.4.3",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",+ "dev": true,+ "license": "ISC"+ },"node_modules/@babel/code-frame": {"version": "7.29.7","resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",@@ -302,6 +324,121 @@"node": ">=6.9.0"}},+ "node_modules/@csstools/color-helpers": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz",+ "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/csstools"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/csstools"+ }+ ],+ "license": "MIT-0",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@csstools/css-calc": {+ "version": "2.1.4",+ "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz",+ "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/csstools"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/csstools"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@csstools/css-parser-algorithms": "^3.0.5",+ "@csstools/css-tokenizer": "^3.0.4"+ }+ },+ "node_modules/@csstools/css-color-parser": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz",+ "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/csstools"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/csstools"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "@csstools/color-helpers": "^5.1.0",+ "@csstools/css-calc": "^2.1.4"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@csstools/css-parser-algorithms": "^3.0.5",+ "@csstools/css-tokenizer": "^3.0.4"+ }+ },+ "node_modules/@csstools/css-parser-algorithms": {+ "version": "3.0.5",+ "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz",+ "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/csstools"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/csstools"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@csstools/css-tokenizer": "^3.0.4"+ }+ },+ "node_modules/@csstools/css-tokenizer": {+ "version": "3.0.4",+ "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz",+ "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/csstools"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/csstools"+ }+ ],+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },"node_modules/@esbuild/aix-ppc64": {"version": "0.25.12","resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",@@ -1307,6 +1444,16 @@"vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"}},+ "node_modules/agent-base": {+ "version": "7.1.4",+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 14"+ }+ },"node_modules/any-promise": {"version": "1.3.0","resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",@@ -1592,11 +1739,39 @@"node": ">=4"}},+ "node_modules/cssstyle": {+ "version": "4.6.0",+ "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz",+ "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@asamuzakjp/css-color": "^3.2.0",+ "rrweb-cssom": "^0.8.0"+ },+ "engines": {+ "node": ">=18"+ }+ },"node_modules/csstype": {"version": "3.2.3","resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz","integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="},+ "node_modules/data-urls": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz",+ "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "whatwg-mimetype": "^4.0.0",+ "whatwg-url": "^14.0.0"+ },+ "engines": {+ "node": ">=18"+ }+ },"node_modules/debug": {"version": "4.4.3","resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",@@ -1613,6 +1788,13 @@}}},+ "node_modules/decimal.js": {+ "version": "10.6.0",+ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz",+ "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",+ "dev": true,+ "license": "MIT"+ },"node_modules/decode-named-character-reference": {"version": "1.3.0","resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz",@@ -1663,6 +1845,19 @@"integrity": "sha512-8hboqI6xesozteFb8aa7OGknvxUtTeRJLz0FoePysUEh/oWbddykIGdgpEJRbPRg/nIMfBf2DFos+H2MtvJl2A==","dev": true},+ "node_modules/entities": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",+ "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",+ "dev": true,+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=0.12"+ },+ "funding": {+ "url": "https://github.com/fb55/entities?sponsor=1"+ }+ },"node_modules/es-errors": {"version": "1.3.0","resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",@@ -1904,6 +2099,19 @@"url": "https://opencollective.com/unified"}},+ "node_modules/html-encoding-sniffer": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz",+ "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "whatwg-encoding": "^3.1.1"+ },+ "engines": {+ "node": ">=18"+ }+ },"node_modules/html-url-attributes": {"version": "3.0.1","resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz",@@ -1913,6 +2121,47 @@"url": "https://opencollective.com/unified"}},+ "node_modules/http-proxy-agent": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",+ "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.0",+ "debug": "^4.3.4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/https-proxy-agent": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "agent-base": "^7.1.2",+ "debug": "4"+ },+ "engines": {+ "node": ">= 14"+ }+ },+ "node_modules/iconv-lite": {+ "version": "0.6.3",+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "safer-buffer": ">= 2.1.2 < 3.0.0"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },"node_modules/inline-style-parser": {"version": "0.2.7","resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz",@@ -2026,6 +2275,13 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/is-potential-custom-element-name": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",+ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",+ "dev": true,+ "license": "MIT"+ },"node_modules/jiti": {"version": "1.21.7","resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz",@@ -2040,6 +2296,46 @@"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz","integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="},+ "node_modules/jsdom": {+ "version": "26.1.0",+ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz",+ "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "cssstyle": "^4.2.1",+ "data-urls": "^5.0.0",+ "decimal.js": "^10.5.0",+ "html-encoding-sniffer": "^4.0.0",+ "http-proxy-agent": "^7.0.2",+ "https-proxy-agent": "^7.0.6",+ "is-potential-custom-element-name": "^1.0.1",+ "nwsapi": "^2.2.16",+ "parse5": "^7.2.1",+ "rrweb-cssom": "^0.8.0",+ "saxes": "^6.0.0",+ "symbol-tree": "^3.2.4",+ "tough-cookie": "^5.1.1",+ "w3c-xmlserializer": "^5.0.0",+ "webidl-conversions": "^7.0.0",+ "whatwg-encoding": "^3.1.1",+ "whatwg-mimetype": "^4.0.0",+ "whatwg-url": "^14.1.1",+ "ws": "^8.18.0",+ "xml-name-validator": "^5.0.0"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "canvas": "^3.0.0"+ },+ "peerDependenciesMeta": {+ "canvas": {+ "optional": true+ }+ }+ },"node_modules/jsesc": {"version": "3.1.0","resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",@@ -3014,6 +3310,13 @@"node": ">=0.10.0"}},+ "node_modules/nwsapi": {+ "version": "2.2.28",+ "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.28.tgz",+ "integrity": "sha512-IlVB7OS7qrOsVYlpnFIkETjMwT9jwvmocJmmM+GZU/PAB3uGi9Ezd7vcWhWBUnSc0ya4ppmQITOyP1ez9gg8cg==",+ "dev": true,+ "license": "MIT"+ },"node_modules/object-assign": {"version": "4.1.1","resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",@@ -3055,6 +3358,19 @@"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz","integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="},+ "node_modules/parse5": {+ "version": "7.3.0",+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",+ "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "entities": "^6.0.0"+ },+ "funding": {+ "url": "https://github.com/inikulin/parse5?sponsor=1"+ }+ },"node_modules/path-parse": {"version": "1.0.7","resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",@@ -3254,6 +3570,16 @@"url": "https://github.com/sponsors/wooorm"}},+ "node_modules/punycode": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },"node_modules/queue-microtask": {"version": "1.2.3","resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",@@ -3488,6 +3814,13 @@"fsevents": "~2.3.2"}},+ "node_modules/rrweb-cssom": {+ "version": "0.8.0",+ "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz",+ "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==",+ "dev": true,+ "license": "MIT"+ },"node_modules/run-parallel": {"version": "1.2.0","resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",@@ -3511,6 +3844,26 @@"queue-microtask": "^1.2.2"}},+ "node_modules/safer-buffer": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/saxes": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz",+ "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "xmlchars": "^2.2.0"+ },+ "engines": {+ "node": ">=v12.22.7"+ }+ },"node_modules/scheduler": {"version": "0.23.2","resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",@@ -3609,6 +3962,13 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/symbol-tree": {+ "version": "3.2.4",+ "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",+ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",+ "dev": true,+ "license": "MIT"+ },"node_modules/tailwindcss": {"version": "3.4.19","resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz",@@ -3712,6 +4072,26 @@"url": "https://github.com/sponsors/jonschlinkert"}},+ "node_modules/tldts": {+ "version": "6.1.86",+ "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz",+ "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "tldts-core": "^6.1.86"+ },+ "bin": {+ "tldts": "bin/cli.js"+ }+ },+ "node_modules/tldts-core": {+ "version": "6.1.86",+ "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz",+ "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==",+ "dev": true,+ "license": "MIT"+ },"node_modules/to-regex-range": {"version": "5.0.1","resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",@@ -3724,6 +4104,32 @@"node": ">=8.0"}},+ "node_modules/tough-cookie": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz",+ "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==",+ "dev": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "tldts": "^6.1.32"+ },+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/tr46": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz",+ "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "punycode": "^2.3.1"+ },+ "engines": {+ "node": ">=18"+ }+ },"node_modules/trim-lines": {"version": "3.0.1","resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",@@ -4016,6 +4422,106 @@"url": "https://github.com/sponsors/jonschlinkert"}},+ "node_modules/w3c-xmlserializer": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz",+ "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "xml-name-validator": "^5.0.0"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/webidl-conversions": {+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",+ "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",+ "dev": true,+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/whatwg-encoding": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz",+ "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==",+ "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "iconv-lite": "0.6.3"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/whatwg-mimetype": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz",+ "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/whatwg-url": {+ "version": "14.2.0",+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz",+ "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "tr46": "^5.1.0",+ "webidl-conversions": "^7.0.0"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/ws": {+ "version": "8.22.0",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz",+ "integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==",+ "dev": 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/xml-name-validator": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz",+ "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/xmlchars": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",+ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",+ "dev": true,+ "license": "MIT"+ },"node_modules/yallist": {"version": "3.1.1","resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",diff --git a/frontend/package.json b/frontend/package.jsonindex c5110e86..559b06a5 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -23,6 +23,7 @@"@types/react-dom": "^18.3.1","@vitejs/plugin-react": "^4.3.3","autoprefixer": "^10.4.20",+ "jsdom": "^26.1.0","postcss": "^8.4.49","tailwindcss": "^3.4.15","typescript": "^5.6.3",diff --git a/frontend/src/components/FlightSchoolPanel.tsx b/frontend/src/components/FlightSchoolPanel.tsxindex f37e751b..619458dd 100644--- a/frontend/src/components/FlightSchoolPanel.tsx+++ b/frontend/src/components/FlightSchoolPanel.tsx@@ -109,11 +109,17 @@ export const FlightSchoolPanel: React.FC<{change(() => api.revoke(kwantId, cls, to), `Revoked: ${classLabel(cls)} is now ${TIER_LABELS[to]}. A running task is held to it from its next action.`);const slug = toClass(newClass);- const addClass = async (e: React.FormEvent) => {- e.preventDefault();+ const addClass = async () => {if (!validClass(slug) || busy) return;if (await setTier(slug, newTier)) setNewClass('');};+ // The panel sits inside the Edit bot form, so this row is no form of its own (forms can't nest):+ // Enter here adds the kind of work and must not submit the Edit form.+ const onNewClassKey = (e: React.KeyboardEvent<HTMLInputElement>) => {+ if (e.key !== 'Enter' || e.nativeEvent.isComposing) return;+ e.preventDefault();+ void addClass();+ };return (<section aria-labelledby={`${allId}-h`} className="space-y-2 rounded-xl border border-sky-500/20 bg-sky-950/10 p-3" data-flight-school>@@ -146,7 +152,7 @@ export const FlightSchoolPanel: React.FC<{))}</ul>- <form onSubmit={addClass} className="flex flex-wrap items-center gap-2">+ <div className="flex flex-wrap items-center gap-2" data-add-class><label htmlFor={newId} className="sr-only">Another kind of work</label>@@ -154,18 +160,20 @@ export const FlightSchoolPanel: React.FC<{id={newId}value={newClass}onChange={(e) => setNewClass(e.target.value)}+ onKeyDown={onNewClassKey}placeholder="Another kind of work, e.g. release"className="flex-1 min-w-[10rem] bg-zinc-950 border border-zinc-800 rounded-lg px-2.5 py-1.5 min-h-[36px] text-xs text-zinc-100 placeholder-zinc-600 focus:border-sky-500 focus:outline-none"/><TierSelect label="Tier for the new kind of work" value={newTier} disabled={busy} onChange={setNewTier} /><button- type="submit"+ type="button"+ onClick={() => void addClass()}disabled={busy || !validClass(slug)}className="px-2.5 py-1 min-h-[36px] rounded-lg bg-zinc-800 text-[11px] font-medium text-zinc-100 hover:bg-zinc-700 disabled:opacity-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-sky-400">Set</button>- </form>+ </div><p aria-live="polite" className="min-h-[1rem] text-[11px]">{busy ? (diff --git a/frontend/tests/flightSchoolInEditForm.test.mjs b/frontend/tests/flightSchoolInEditForm.test.mjsnew file mode 100644index 00000000..8810860f--- /dev/null+++ b/frontend/tests/flightSchoolInEditForm.test.mjs@@ -0,0 +1,153 @@+// Flight School tier panel inside the Edit bot form (Rigel eval-16 D1): the panel's "add a kind of+// work" row used to be a form nested in the Edit form, so Set and Enter submitted the Edit form, closed+// the dialog and saved nothing. These render the real NewAgentModal in a DOM and press Set and Enter.+import assert from 'node:assert/strict';+import test from 'node:test';+import { JSDOM } from 'jsdom';+import { loadBundled } from './bundle.mjs';++const dom = new JSDOM('<!doctype html><html><body></body></html>', { url: 'http://localhost/s/s1/b/k_sandy', pretendToBeVisual: true });+const g = globalThis;+for (const k of ['window', 'document', 'navigator', 'HTMLElement', 'Node', 'Event', 'KeyboardEvent', 'MouseEvent', 'SubmitEvent', 'HTMLFormElement', 'requestAnimationFrame', 'cancelAnimationFrame', 'getComputedStyle', 'localStorage', 'sessionStorage', 'matchMedia']) {+ if (!(k in dom.window)) continue;+ Object.defineProperty(g, k, { value: dom.window[k], configurable: true, writable: true });+}+g.window.matchMedia ??= () => ({ matches: false, addEventListener() {}, removeEventListener() {}, addListener() {}, removeListener() {} });+g.matchMedia = g.window.matchMedia;+// jsdom has no layout or audio; the modal only needs these not to throw.+g.window.HTMLElement.prototype.scrollIntoView ??= () => {};+g.window.HTMLMediaElement && (g.window.HTMLMediaElement.prototype.play = () => Promise.resolve());++const caps = {+ flight_school: true,+ kwant_id: 'k_sandy',+ default_tier: 'sandbox',+ policies: [],+ effective: [{ task_class: 'general', tier: 'sandbox', from: 'any_class' }],+ events: [],+};+let posts = [];+const json = (body) => new Response(JSON.stringify(body), { status: 200, headers: { 'Content-Type': 'application/json' } });+g.fetch = async (url, init = {}) => {+ const u = String(url);+ const method = init.method ?? 'GET';+ if (u.startsWith('/api/capabilities') && method === 'POST') {+ const body = JSON.parse(init.body);+ posts.push({ url: u, body });+ const next = { ...caps, effective: [...caps.effective, { task_class: body.task_class, tier: body.tier, from: 'class' }] };+ return json({ capabilities: next, unchanged: false });+ }+ if (u.startsWith('/api/capabilities')) return json(caps);+ return json([]);+};+g.window.fetch = g.fetch;++const { React, createRoot, NewAgentModal } = await loadBundled(`+ export { default as React } from 'react';+ export { createRoot } from 'react-dom/client';+ export { NewAgentModal } from './src/components/NewAgentModal';+`);++// The bundle is React's production build, which has no act(): run the step, then let React and the+// stubbed fetches finish.+const settle = async () => {+ for (let i = 0; i < 10; i++) await new Promise((r) => setTimeout(r, 0));+};+const act = async (fn) => {+ await fn();+ await settle();+};++async function openEdit() {+ posts = [];+ const host = document.createElement('div');+ document.body.appendChild(host);+ const root = createRoot(host);+ const calls = { submit: 0, close: 0, nativeSubmit: 0 };+ await act(async () => {+ root.render(+ React.createElement(NewAgentModal, {+ isOpen: true,+ kwantId: 'k_sandy',+ initial: { name: 'Sandy', title: 'Writer', persona_prompt: 'p', avatar_sprite: 'architect', preferred_model: 'auto' },+ onClose: () => calls.close++,+ onSubmit: () => {+ calls.submit++;+ },+ }),+ );+ });+ await settle();+ const panel = host.querySelector('[data-flight-school]');+ assert.ok(panel, 'the tier panel shows in the Edit form with Flight School on');+ const form = panel.closest('form');+ assert.ok(form, 'the panel sits inside the Edit bot form');+ // A native submit would leave the page; count any submit that React didn't stop.+ form.addEventListener('submit', (e) => {+ if (!e.defaultPrevented) calls.nativeSubmit++;+ });+ const input = panel.querySelector('input[placeholder^="Another kind of work"]');+ const setBtn = [...panel.querySelectorAll('button')].find((b) => b.textContent.trim() === 'Set');+ const type = async (v) => {+ await act(async () => {+ const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set;+ setter.call(input, v);+ input.dispatchEvent(new window.Event('input', { bubbles: true }));+ });+ };+ const done = () => {+ root.unmount();+ host.remove();+ };+ return { panel, form, input, setBtn, type, calls, done };+}++test('the tier panel has no form of its own and every button in it is type="button"', async () => {+ const v = await openEdit();+ assert.equal(v.panel.querySelectorAll('form').length, 0, 'no form nested in the Edit form');+ const buttons = [...v.panel.querySelectorAll('button')];+ assert.ok(buttons.length >= 2);+ for (const b of buttons) assert.equal(b.getAttribute('type'), 'button', `${b.textContent.trim()} can't submit the Edit form`);+ v.done();+});++test('Set inside the Edit form saves the new kind of work and does not submit the Edit form', async () => {+ const v = await openEdit();+ await v.type('Release notes');+ assert.equal(v.setBtn.disabled, false);+ await act(async () => v.setBtn.click());+ await settle();+ assert.deepEqual(posts, [{ url: '/api/capabilities', body: { kwant_id: 'k_sandy', task_class: 'release-notes', tier: 'sandbox' } }]);+ assert.equal(v.calls.submit, 0, 'the Edit form was not saved');+ assert.equal(v.calls.nativeSubmit, 0, 'no page submit');+ assert.equal(v.calls.close, 0, 'the dialog stays open');+ assert.equal(v.input.value, '', 'the field clears after saving');+ assert.ok(v.panel.querySelector('[data-class="release-notes"][data-tier="sandbox"]'), 'the new kind of work is listed');+ v.done();+});++test('Enter in the new kind of work field saves it and does not submit the Edit form', async () => {+ const v = await openEdit();+ await v.type('deploy');+ const ev = new window.KeyboardEvent('keydown', { key: 'Enter', bubbles: true, cancelable: true });+ await act(async () => v.input.dispatchEvent(ev));+ await settle();+ // Browsers submit the enclosing form on Enter unless keydown is cancelled; jsdom doesn't, so check both.+ assert.equal(ev.defaultPrevented, true, 'Enter is kept from submitting the Edit form');+ assert.deepEqual(posts, [{ url: '/api/capabilities', body: { kwant_id: 'k_sandy', task_class: 'deploy', tier: 'sandbox' } }]);+ assert.equal(v.calls.submit, 0);+ assert.equal(v.calls.nativeSubmit, 0);+ assert.equal(v.calls.close, 0);+ v.done();+});++test('Enter with an empty field does nothing and still does not submit the Edit form', async () => {+ const v = await openEdit();+ const ev = new window.KeyboardEvent('keydown', { key: 'Enter', bubbles: true, cancelable: true });+ await act(async () => v.input.dispatchEvent(ev));+ await settle();+ assert.equal(ev.defaultPrevented, true);+ assert.deepEqual(posts, []);+ assert.equal(v.calls.submit, 0);+ v.done();+});