Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
show_html: when asked for a claude.ai Artifact, say it isn't available and offer our pages
AdityaUmalecad5c4ee553b
diff --git a/server/drivers/agents-app-tools.ts b/server/drivers/agents-app-tools.tsindex 0bc407779a..63411cc824 100644--- a/server/drivers/agents-app-tools.ts+++ b/server/drivers/agents-app-tools.ts@@ -2,7 +2,7 @@ export const APP_TOOL_DEFINITIONS = [{name: "show_html",description:- "Show a small self-contained web page in this chat, where the person watches it appear and can point at a part to change: a mini app, a game, a chart, a calculator, a report. For maps, canvases, games or anything that fills the window, pass `height`. For forms and choices use show_widget instead, and for plain data a markdown table. Send `html`, one HTML document (a fragment is wrapped) with inline style and script, or `jsx`, one React component file with a default export: it can import react, lucide-react icons, echarts, and Chart and useTheme from \"mausbot\", and style with Tailwind classes. Or send `path`, a folder in your working folder with index.html and its files (scripts, images, csv, geojson or parquet data; up to 5 MB). It runs in a locked sandbox: no network requests, cookies, storage, popups or form posts. Scripts, styles and fonts load only from cdnjs.cloudflare.com, cdn.jsdelivr.net, unpkg.com and Google Fonts; images must be data: URLs or come from those CDNs. Embed the data you need. Use the CSS variables --color-text-primary, --color-background-primary, --color-border-primary and --font-sans to match the person's theme. In the page, mausbot.send(text) sends text as the person's next message (only after they click in it), mausbot.open(url) opens a link, and mausbot.setContext(text) tells you what they see, with their next message. At most 256 KB. To replace a page you showed, in place, call this again with the app_id it returned and new html, jsx or path (was update_html); it reloads, so anything the person did in it is lost. Never put secrets in it. In rooms everyone sees it, view-only: send and setContext do nothing. For a data dashboard, follow the data-dashboards skill.",+ "Show a small self-contained web page in this chat, where the person watches it appear and can point at a part to change: a mini app, a game, a chart, a calculator, a report. For maps, canvases, games or anything that fills the window, pass `height`. For forms and choices use show_widget instead, and for plain data a markdown table. Send `html`, one HTML document (a fragment is wrapped) with inline style and script, or `jsx`, one React component file with a default export: it can import react, lucide-react icons, echarts, and Chart and useTheme from \"mausbot\", and style with Tailwind classes. Or send `path`, a folder in your working folder with index.html and its files (scripts, images, csv, geojson or parquet data; up to 5 MB). It runs in a locked sandbox: no network requests, cookies, storage, popups or form posts. Scripts, styles and fonts load only from cdnjs.cloudflare.com, cdn.jsdelivr.net, unpkg.com and Google Fonts; images must be data: URLs or come from those CDNs. Embed the data you need. Use the CSS variables --color-text-primary, --color-background-primary, --color-border-primary and --font-sans to match the person's theme. In the page, mausbot.send(text) sends text as the person's next message (only after they click in it), mausbot.open(url) opens a link, and mausbot.setContext(text) tells you what they see, with their next message. At most 256 KB. To replace a page you showed, in place, call this again with the app_id it returned and new html, jsx or path (was update_html); it reloads, so anything the person did in it is lost. Never put secrets in it. In rooms everyone sees it, view-only: send and setContext do nothing. For a data dashboard, follow the data-dashboards skill. Asked for a claude.ai Artifact? Those need Claude's own claude.ai sign-in and are not available to bots here: say so in one line, then make it with this tool, or publish_page for a public link.",inputSchema: {type: "object",additionalProperties: false,diff --git a/server/drivers/agents-call-cards.test.ts b/server/drivers/agents-call-cards.test.tsindex 748cbd8012..605077208d 100644--- a/server/drivers/agents-call-cards.test.ts+++ b/server/drivers/agents-call-cards.test.ts@@ -155,8 +155,10 @@ describe("the chat-app tools", () => {const tools = new Map(availableTools(PROFILE).map((tool) => [tool.name, tool as { description: string; inputSchema: { required: string[] }; annotations?: unknown }]));expect(tools.get("show_html")!.description).toMatch(/^Show a small self-contained web page in this chat, where the person watches it appear and can point at a part to change: /);expect(tools.get("show_html")!.description).toContain("or `jsx`, one React component file with a default export");- // Its last sentence points a dashboard at the bundled data-dashboards skill.- expect(tools.get("show_html")!.description).toMatch(/At most 256 KB\. To replace a page you showed, in place, call this again with the app_id it returned and new html, jsx or path \(was update_html\); it reloads, so anything the person did in it is lost\. Never put secrets in it\. In rooms everyone sees it, view-only: send and setContext do nothing\. For a data dashboard, follow the data-dashboards skill\.$/);+ // It points a dashboard at the bundled data-dashboards skill.+ expect(tools.get("show_html")!.description).toMatch(/At most 256 KB\. To replace a page you showed, in place, call this again with the app_id it returned and new html, jsx or path \(was update_html\); it reloads, so anything the person did in it is lost\. Never put secrets in it\. In rooms everyone sees it, view-only: send and setContext do nothing\. For a data dashboard, follow the data-dashboards skill\. /);+ // A claude.ai Artifact needs Claude's own claude.ai sign-in: the bot says so and offers our own pages instead.+ expect(tools.get("show_html")!.description).toMatch(/Asked for a claude\.ai Artifact\? Those need Claude's own claude\.ai sign-in and are not available to bots here: say so in one line, then make it with this tool, or publish_page for a public link\.$/);expect(tools.get("show_html")!.inputSchema).not.toHaveProperty("required");expect(Object.keys((tools.get("show_html")!.inputSchema as unknown as { properties: object }).properties)).toEqual(expect.arrayContaining(["html", "jsx", "path", "title", "app_id"]));expect(Buffer.byteLength(JSON.stringify(tools.get("show_html")))).toBeLessThan(12 * 1024);diff --git a/server/drivers/agents-catalog-goldens/full.tools-list.json b/server/drivers/agents-catalog-goldens/full.tools-list.jsonindex f4a2ffcd12..894ed3bc21 100644--- a/server/drivers/agents-catalog-goldens/full.tools-list.json+++ b/server/drivers/agents-catalog-goldens/full.tools-list.json@@ -482,7 +482,7 @@},{"name": "show_html",- "description": "Show a small self-contained web page in this chat, where the person watches it appear and can point at a part to change: a mini app, a game, a chart, a calculator, a report. For maps, canvases, games or anything that fills the window, pass `height`. For forms and choices use show_widget instead, and for plain data a markdown table. Send `html`, one HTML document (a fragment is wrapped) with inline style and script, or `jsx`, one React component file with a default export: it can import react, lucide-react icons, echarts, and Chart and useTheme from \"mausbot\", and style with Tailwind classes. Or send `path`, a folder in your working folder with index.html and its files (scripts, images, csv, geojson or parquet data; up to 5 MB). It runs in a locked sandbox: no network requests, cookies, storage, popups or form posts. Scripts, styles and fonts load only from cdnjs.cloudflare.com, cdn.jsdelivr.net, unpkg.com and Google Fonts; images must be data: URLs or come from those CDNs. Embed the data you need. Use the CSS variables --color-text-primary, --color-background-primary, --color-border-primary and --font-sans to match the person's theme. In the page, mausbot.send(text) sends text as the person's next message (only after they click in it), mausbot.open(url) opens a link, and mausbot.setContext(text) tells you what they see, with their next message. At most 256 KB. To replace a page you showed, in place, call this again with the app_id it returned and new html, jsx or path (was update_html); it reloads, so anything the person did in it is lost. Never put secrets in it. In rooms everyone sees it, view-only: send and setContext do nothing. For a data dashboard, follow the data-dashboards skill.",+ "description": "Show a small self-contained web page in this chat, where the person watches it appear and can point at a part to change: a mini app, a game, a chart, a calculator, a report. For maps, canvases, games or anything that fills the window, pass `height`. For forms and choices use show_widget instead, and for plain data a markdown table. Send `html`, one HTML document (a fragment is wrapped) with inline style and script, or `jsx`, one React component file with a default export: it can import react, lucide-react icons, echarts, and Chart and useTheme from \"mausbot\", and style with Tailwind classes. Or send `path`, a folder in your working folder with index.html and its files (scripts, images, csv, geojson or parquet data; up to 5 MB). It runs in a locked sandbox: no network requests, cookies, storage, popups or form posts. Scripts, styles and fonts load only from cdnjs.cloudflare.com, cdn.jsdelivr.net, unpkg.com and Google Fonts; images must be data: URLs or come from those CDNs. Embed the data you need. Use the CSS variables --color-text-primary, --color-background-primary, --color-border-primary and --font-sans to match the person's theme. In the page, mausbot.send(text) sends text as the person's next message (only after they click in it), mausbot.open(url) opens a link, and mausbot.setContext(text) tells you what they see, with their next message. At most 256 KB. To replace a page you showed, in place, call this again with the app_id it returned and new html, jsx or path (was update_html); it reloads, so anything the person did in it is lost. Never put secrets in it. In rooms everyone sees it, view-only: send and setContext do nothing. For a data dashboard, follow the data-dashboards skill. Asked for a claude.ai Artifact? Those need Claude's own claude.ai sign-in and are not available to bots here: say so in one line, then make it with this tool, or publish_page for a public link.","inputSchema": {"type": "object","additionalProperties": false,diff --git a/server/drivers/agents-catalog-goldens/profiles.json b/server/drivers/agents-catalog-goldens/profiles.jsonindex f6b8f59e97..7aea8adb48 100644--- a/server/drivers/agents-catalog-goldens/profiles.json+++ b/server/drivers/agents-catalog-goldens/profiles.json@@ -1,7 +1,7 @@{"default": {- "bytes": 62980,- "sha256": "a1e5bb5f9e8fa1b9f6732f4fe692ab2be406d66586b888346a96edb9d22a6d4e",+ "bytes": 63174,+ "sha256": "187c5dd6ae45bcfb22ef0a8dc8e636c688cfc60b71a73e7278b011a78560ec58","tools": ["tool_result_read","list_room_targets",@@ -54,8 +54,8 @@]},"voice": {- "bytes": 63761,- "sha256": "cc4fd7bd860db9f32db031b78069daee494ff4865fdb1a7abc2f7c65998398e9",+ "bytes": 63955,+ "sha256": "9c18cb5df10ec05afbf7f48adeef07e745a20e66b6d48e70ede54c8df6fd1d90","tools": ["tool_result_read","list_room_targets",@@ -109,8 +109,8 @@]},"shared": {- "bytes": 65245,- "sha256": "c57b84ffb9dc6e5a7abb1cdc504b83156c2a80aaa8e0e9fdd9203f2923a9176c",+ "bytes": 65439,+ "sha256": "59adb58d02226c62357e551900f476e4ad1d21bddbc9ed2d75c99c8b69453435","tools": ["tool_result_read","list_shared_computers",@@ -165,8 +165,8 @@]},"shared+voice": {- "bytes": 66026,- "sha256": "550deca03c99117f0247e2940693d7e245485066b9f69a71221bcd7b8203f757",+ "bytes": 66220,+ "sha256": "3ff8dd37f37f7a26bb6a12caefbef89637fad1d59dedc8a1e6e0c3a5b17839d2","tools": ["tool_result_read","list_shared_computers",@@ -222,8 +222,8 @@]},"skills": {- "bytes": 66056,- "sha256": "c49d63c2bb37a00ef269d9b0e37c2e21df88b2bfbfe0e528c6ee472f009b3338",+ "bytes": 66250,+ "sha256": "745dc91242009d35bdef1c5c190d2aacd0d56ace1356192f8f7ee1beb0917a32","tools": ["tool_result_read","list_room_targets",@@ -278,8 +278,8 @@]},"skills+voice": {- "bytes": 66837,- "sha256": "dd2a3a4d3f39f92d1ea51e7dc25e2722f6b0bd51053e49b54ffff747f92f4a8a",+ "bytes": 67031,+ "sha256": "27568c5ef4dc34f1dd1d7d6bd45242fa243cc54a1d5e4d8cfad623988c370fe6","tools": ["tool_result_read","list_room_targets",@@ -335,8 +335,8 @@]},"skills+shared": {- "bytes": 68321,- "sha256": "85d3c36e68b49d096820201bc71f1852a84dfe04c742e8334777c8886c79858d",+ "bytes": 68515,+ "sha256": "5a1eace73091bf2011a11185ec0cb38dcf0698fe9c6a7ef7fd00cea379ad5580","tools": ["tool_result_read","list_shared_computers",@@ -393,8 +393,8 @@]},"skills+shared+voice": {- "bytes": 69102,- "sha256": "095e7b1a7b10e17ba636acab91ec9ab0fca623024eb2a950d98a8871750d5486",+ "bytes": 69296,+ "sha256": "e00d2d685f1a7dc957503ebe5c603e5193393c2ca5d5a5ca9d22a2af08af2ee6","tools": ["tool_result_read","list_shared_computers",@@ -452,8 +452,8 @@]},"non-chief": {- "bytes": 53631,- "sha256": "e85964e88d9cca707a05758668b955ed46fe3b5c85d0519b6d4cf2e94dcd2b55",+ "bytes": 53825,+ "sha256": "46ecbbf854dc655cd8b18fc799feaab4d0ba13ccd6a8c7a0138a3ebd85d37223","tools": ["tool_result_read","list_room_targets",@@ -499,8 +499,8 @@]},"voice+non-chief": {- "bytes": 54412,- "sha256": "150f5c76f2ab0ecc19d238640152e99631bb33fb6caebf2f8e515b32c0548ed1",+ "bytes": 54606,+ "sha256": "4d8e0c37ef04543f1c6f2c08f701900d0ea65a410adae9b87a954ebe53f1df42","tools": ["tool_result_read","list_room_targets",@@ -547,8 +547,8 @@]},"shared+non-chief": {- "bytes": 55896,- "sha256": "f8099b07091544e6b7cb5e649ed14d5ef2b71b603d9cd20dff57e8e17196dacb",+ "bytes": 56090,+ "sha256": "eccc815268433f280fb28d6cd222ca2330d29726a89da5f7c5d8134794bf6ed1","tools": ["tool_result_read","list_shared_computers",@@ -596,8 +596,8 @@]},"shared+voice+non-chief": {- "bytes": 56677,- "sha256": "c724440eee59abaf4f961b78e37fd0a2968750a39eee7f0d4281a9996757fb89",+ "bytes": 56871,+ "sha256": "d5df08f84fd1f985c5ecef15adec45cbd08ac6950d699b11b515ea2fcc49188f","tools": ["tool_result_read","list_shared_computers",@@ -646,8 +646,8 @@]},"skills+non-chief": {- "bytes": 56707,- "sha256": "50efb736ed6d93ad07eb576f55e63763e863cf136581dc4c0652bf6b5e33cf6f",+ "bytes": 56901,+ "sha256": "01e260da7c0dc7d2d6259366934e0f59117c908dba7da7fbb13b7fbc27c1b1b2","tools": ["tool_result_read","list_room_targets",@@ -695,8 +695,8 @@]},"skills+voice+non-chief": {- "bytes": 57488,- "sha256": "7f1e4a61a6df9fde20d74330932ae5ea23f0b46ab380f197018495d50f701fce",+ "bytes": 57682,+ "sha256": "dc451da2e9fdea2d8efab0257514f2a94f145bd99c42963c1c57fe07eba63535","tools": ["tool_result_read","list_room_targets",@@ -745,8 +745,8 @@]},"skills+shared+non-chief": {- "bytes": 58972,- "sha256": "f13792a13d7b511560ac06bc3989c5f9af2d09769195a97236097b52cba3d283",+ "bytes": 59166,+ "sha256": "bd08132095e552a6911e11b65af075526495cfcffa44f73e18ba83c48ab735d0","tools": ["tool_result_read","list_shared_computers",@@ -796,8 +796,8 @@]},"skills+shared+voice+non-chief": {- "bytes": 59753,- "sha256": "b083179a229a0f82f683df999d9c2ea891310f598cb11a4ff744512a2359700b",+ "bytes": 59947,+ "sha256": "70a08e90c1de577448187c50c59a78fe9bd90ead88abce946356b56bd27de768","tools": ["tool_result_read","list_shared_computers",@@ -848,8 +848,8 @@]},"skills+shared+voice+cloud-home": {- "bytes": 68868,- "sha256": "a47df948561206ccc2b3a086e8636e52a5f8b2b5dbae2b9b45cd9fe19469256e",+ "bytes": 69062,+ "sha256": "688425b59b929a709b360fe2d2005deb90d31c1d822c4fb80e31d9e15c9d89ce","tools": ["tool_result_read","list_shared_computers",@@ -907,8 +907,8 @@]},"skills+shared+voice+non-chief+cloud-home": {- "bytes": 59519,- "sha256": "9e3cb918b539d128e35cde14aa5d64aaaf8ded980b448334c8324f3dff7023c1",+ "bytes": 59713,+ "sha256": "3f4703cb4b6f823375f0c3c1975c1dcc39ea2d302b0a48c0d92d857517d73f42","tools": ["tool_result_read","list_shared_computers",@@ -959,8 +959,8 @@]},"skills+shared+voice+x": {- "bytes": 72941,- "sha256": "4ad6c77e071425a847c944a5153a6a0f8a7abd1341882e1f78eb72d6ef0aa707",+ "bytes": 73135,+ "sha256": "8340e0eb5fdc908fcd538fdc9a5c105765ecb73fa60c457aa353cad157fcda6e","tools": ["tool_result_read","list_shared_computers",@@ -1022,8 +1022,8 @@]},"skills+shared+voice+x+team": {- "bytes": 72941,- "sha256": "4ad6c77e071425a847c944a5153a6a0f8a7abd1341882e1f78eb72d6ef0aa707",+ "bytes": 73135,+ "sha256": "8340e0eb5fdc908fcd538fdc9a5c105765ecb73fa60c457aa353cad157fcda6e","tools": ["tool_result_read","list_shared_computers",@@ -1085,8 +1085,8 @@]},"skills+shared+voice+x+team+images": {- "bytes": 73714,- "sha256": "cb2eab11a4e88edfaca262facd422c39446a8d828691240dbcdbd257b1b63988",+ "bytes": 73908,+ "sha256": "c5995ac3dbdab8ed175fdc791ecd973c183e98523e5769d282706aa92cbf4eb9","tools": ["tool_result_read","list_shared_computers",@@ -1149,8 +1149,8 @@]},"default+legacy-switches": {- "bytes": 62980,- "sha256": "a1e5bb5f9e8fa1b9f6732f4fe692ab2be406d66586b888346a96edb9d22a6d4e",+ "bytes": 63174,+ "sha256": "187c5dd6ae45bcfb22ef0a8dc8e636c688cfc60b71a73e7278b011a78560ec58","tools": ["tool_result_read","list_room_targets",@@ -1203,8 +1203,8 @@]},"default+mausbot": {- "bytes": 63631,- "sha256": "580c7d5e93bcdc095300fa01ce46982aa794c6cf96d9d24bb21d07bb1df16401",+ "bytes": 63825,+ "sha256": "721bd26b264e5f4b4b8472061e451b003d046017c2a79c2adfffef2756a7a3f2","tools": ["tool_result_read","list_room_targets",@@ -1259,8 +1259,8 @@]},"skills+shared+voice+mausbot": {- "bytes": 69753,- "sha256": "c6f275dd5a7735cca36490ee665edb08e775c6249207edd05cf298556cb2a913",+ "bytes": 69947,+ "sha256": "3de31d9245d7fb33d3194abd056b8b0f49f7f832331bf4b57f93982dc9751562","tools": ["tool_result_read","list_shared_computers",@@ -1320,8 +1320,8 @@]},"default+no-computer-pick": {- "bytes": 61768,- "sha256": "ae01fde9181abcef5a13b43033c00f534796433e2d395f598b8ff383a7e21303",+ "bytes": 61962,+ "sha256": "fe8cacc7c1aa4dfca003e78c5524fff6b641fb7be07f2d3a1c5e9a595586183c","tools": ["tool_result_read","list_room_targets",@@ -1373,8 +1373,8 @@]},"default+room": {- "bytes": 59270,- "sha256": "22fcfe0c0c9c51f35200f2df652ca52875ae65ea53a8a6e63434e6ab26704a40",+ "bytes": 59464,+ "sha256": "67e9ebf985cbbf239c2ea06a83d8c448d73b1d65a138ebd2216a114f2d22e5a2","tools": ["tool_result_read","list_room_targets",@@ -1422,8 +1422,8 @@]},"non-chief+room": {- "bytes": 49921,- "sha256": "9f5092bdeb352f3699d2336f3989dcca322855ba6f64654afe5748ac36b1061e",+ "bytes": 50115,+ "sha256": "6283c8aa78b6aa65b6754741c81c12b0997ceb8fce8f351d4b26c5af6a2a0930","tools": ["tool_result_read","list_room_targets",@@ -1464,8 +1464,8 @@]},"default+images": {- "bytes": 63753,- "sha256": "580c754ef01b3ffeff0f3d0a341eb8e94012151beb2abeb40687c3de467d6bac",+ "bytes": 63947,+ "sha256": "7247e62f5a224dc992ca2001265d9b5e688d0934942763a7355d98351060eb5f","tools": ["tool_result_read","list_room_targets",@@ -1519,8 +1519,8 @@]},"skills+shared+voice+x+team+images+hosting": {- "bytes": 75577,- "sha256": "738ee8cec5b177b8c7e828f15ccd86c5d7cca77a90d24910ee91aa2c7e786586",+ "bytes": 75771,+ "sha256": "1bd2a18120ce0431a27dfcc6a26a86b2d5fbdf6289a3b6667fb4f06d4f2c2cfa","tools": ["tool_result_read","list_shared_computers",@@ -1585,8 +1585,8 @@]},"default+hosting": {- "bytes": 64843,- "sha256": "3ccc4dc55f2c8337943b995f75fcfabbe6c4aee4ffd4f412bd9062b4a07a5cff",+ "bytes": 65037,+ "sha256": "82121f98c9ff6f63451ed2f77bba85d3940133602058f41cf93009d3a7120bda","tools": ["tool_result_read","list_room_targets",diff --git a/server/drivers/agents-catalog-wire.test.ts b/server/drivers/agents-catalog-wire.test.tsindex b8d2315f08..ccc114cc97 100644--- a/server/drivers/agents-catalog-wire.test.ts+++ b/server/drivers/agents-catalog-wire.test.ts@@ -85,14 +85,14 @@ const FULL = "skills+shared+voice+x+team+images+hosting";/** Bytes when the budget was last set; a profile may move at most 2% either way (lower it to lock in a win). */const BUDGET_BASELINE: Record<string, number> = {- "default": 61763,- "voice": 62544,- "shared": 64028,- "shared+voice": 64809,- "skills": 64839,- "skills+voice": 65620,- "skills+shared": 67009,- "skills+shared+voice": 67790,+ "default": 61957,+ "voice": 62738,+ "shared": 64222,+ "shared+voice": 65003,+ "skills": 65033,+ "skills+voice": 65814,+ "skills+shared": 67203,+ "skills+shared+voice": 67984,"non-chief": 52785,"voice+non-chief": 53566,"shared+non-chief": 55050,@@ -101,19 +101,19 @@ const BUDGET_BASELINE: Record<string, number> = {"skills+voice+non-chief": 56642,"skills+shared+non-chief": 58126,"skills+shared+voice+non-chief": 58907,- "skills+shared+voice+cloud-home": 67556,+ "skills+shared+voice+cloud-home": 67750,"skills+shared+voice+non-chief+cloud-home": 58673,- "default+legacy-switches": 61763,- "default+mausbot": 62414,- "skills+shared+voice+mausbot": 68441,- "skills+shared+voice+x": 71614,- "skills+shared+voice+x+team": 71614,+ "default+legacy-switches": 61957,+ "default+mausbot": 62608,+ "skills+shared+voice+mausbot": 68635,+ "skills+shared+voice+x": 71808,+ "skills+shared+voice+x+team": 71808,"default+no-computer-pick": 60923,"default+room": 58440,"non-chief+room": 49224,- "skills+shared+voice+x+team+images": 72387,- "default+images": 62536,- "skills+shared+voice+x+team+images+hosting": 74226,+ "skills+shared+voice+x+team+images": 72581,+ "default+images": 62730,+ "skills+shared+voice+x+team+images+hosting": 74420,"default+hosting": 63965,};