Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
message_person: a bot's name is refused with the right tool, never posted to the person's Inbox (#7550)
Milind Sonif1b3664bb5e0
diff --git a/server/bot-link/link.ts b/server/bot-link/link.tsindex a8324bc455..af3c0af3fe 100644--- a/server/bot-link/link.ts+++ b/server/bot-link/link.ts@@ -807,7 +807,7 @@ export function createBotLink(deps: BotLinkDeps) {const cloudPeer = () => (state?.role === "dialer" ? Object.keys(state.peers)[0] ?? null : null);return {- host, coordinate, resolve,+ host, coordinate, resolve, candidates,on: () => state !== null,/** What this place is called, as the other places were told. */selfName: () => state?.self.name ?? "",diff --git a/server/drivers/agents-catalog-goldens/bridged.profiles.json b/server/drivers/agents-catalog-goldens/bridged.profiles.jsonindex 8293ed6215..994e2c879a 100644--- a/server/drivers/agents-catalog-goldens/bridged.profiles.json+++ b/server/drivers/agents-catalog-goldens/bridged.profiles.json@@ -1,7 +1,7 @@{"default": {- "bytes": 18101,- "sha256": "4fac091dcd0b272bd485e5aeb3fb8479d3c0acfc1e414d6427b902d1a06208fa",+ "bytes": 18126,+ "sha256": "b3437b83e63a11bb6139469bb54ed47c9b5e226a6bd1e0831a5766a5cccb5e66","tools": ["tool_result_read","list_room_targets",@@ -24,8 +24,8 @@]},"voice": {- "bytes": 18882,- "sha256": "f3e3e422c74829b516e21b5278db0443508a1e00e6df2901c030fc422805b98a",+ "bytes": 18907,+ "sha256": "730ca4ece527802a1b38f89ebfa1f36b95c5dcdd5fa29809fc075d9f8cec9705","tools": ["tool_result_read","list_room_targets",@@ -49,8 +49,8 @@]},"shared": {- "bytes": 18141,- "sha256": "4f84e9f587861c245b471bc9f72d8b9c019d32878bb1656a1071744a781f35c3",+ "bytes": 18166,+ "sha256": "aca18462b4c04bc181e831556db94e951c497d1210ce74eb5b4b903fa28e8f92","tools": ["tool_result_read","list_room_targets",@@ -73,8 +73,8 @@]},"shared+voice": {- "bytes": 18922,- "sha256": "13801b3ba4dadd63fdb084ca3d3abcb00a41526162c83c461afa616025ad4bbc",+ "bytes": 18947,+ "sha256": "dae4059f091c44600dc1f38b5b43909038686aa71dcb41d6a043c5a789d7d473","tools": ["tool_result_read","list_room_targets",@@ -98,8 +98,8 @@]},"skills": {- "bytes": 18128,- "sha256": "fcb45a34022a83dd82e59fcddc42ab5c02f3a3e7a3cc074249092cdc5f1b641e",+ "bytes": 18153,+ "sha256": "01eb6139cc5309977fe763c544a4970cd7983240fdeeddf8252fc82bbea29dbf","tools": ["tool_result_read","list_room_targets",@@ -122,8 +122,8 @@]},"skills+voice": {- "bytes": 18909,- "sha256": "4814d6ee5493cbd78cbd772ca1acb7bdd3156aae5412055cf0e0a64b66ace0d2",+ "bytes": 18934,+ "sha256": "ea7669e99dd35223e0b324c16d1632d4fb91712318cdca409eb295fbd1af2b32","tools": ["tool_result_read","list_room_targets",@@ -147,8 +147,8 @@]},"skills+shared": {- "bytes": 18168,- "sha256": "8667307bad98f3fd329764303f5a1d3999d2089237c9d1be32d0c27e50c21d36",+ "bytes": 18193,+ "sha256": "71d303af856cabd3002a155d33cccb8f09ada60e1ed735b5bf159d255dac2266","tools": ["tool_result_read","list_room_targets",@@ -171,8 +171,8 @@]},"skills+shared+voice": {- "bytes": 18949,- "sha256": "cb2fb79bf1a40b3477f5ee5a7a9fd71c4df8e5e86477c6f9980859a5b9f91367",+ "bytes": 18974,+ "sha256": "51fa1f1f325807ae210093a6e2ada88d0976884f520f21b9a9ad2b62ad2ce184","tools": ["tool_result_read","list_room_targets",@@ -196,8 +196,8 @@]},"non-chief": {- "bytes": 17984,- "sha256": "559d805114b408f95a4ad47d7b8f046d8dd3dd782934e4a62f8d7c4c3f6dcb5f",+ "bytes": 18009,+ "sha256": "f6653006d84be755000091494973216e634d700744efc1e9ec151a2d6e6c0c28","tools": ["tool_result_read","list_room_targets",@@ -220,8 +220,8 @@]},"voice+non-chief": {- "bytes": 18765,- "sha256": "70a5ad428af06aee25998b6945d9d51663e7f0a70bdb4a88da5e4b06194a71b7",+ "bytes": 18790,+ "sha256": "e83db054fd04ff9b2ea9717ae1717eed094b6c6e67797db8def8696130e5c821","tools": ["tool_result_read","list_room_targets",@@ -245,8 +245,8 @@]},"shared+non-chief": {- "bytes": 18024,- "sha256": "6ae606c50d6e23cacb066fe558ed1ce8d8e04e0970af8b06e036d50b47afb890",+ "bytes": 18049,+ "sha256": "5933f671d38d6dc2cab1d0fa2538dca5948393aaefe345b7eaf1699dd4d79ab1","tools": ["tool_result_read","list_room_targets",@@ -269,8 +269,8 @@]},"shared+voice+non-chief": {- "bytes": 18805,- "sha256": "72902dabb0c59ae79423cd28216e89adbf2d4403341babc7dcdc36f6791a4a43",+ "bytes": 18830,+ "sha256": "732fd1914cdfa7d780cbdf019283a2b4a6d1dae790e8f9e276e4109af693d0c2","tools": ["tool_result_read","list_room_targets",@@ -294,8 +294,8 @@]},"skills+non-chief": {- "bytes": 18011,- "sha256": "4c45896a68e4c856bf659be5227493bd82f4602bbb8aa4b49eba8a61b95c6aa1",+ "bytes": 18036,+ "sha256": "977043bb4ed3d5439ed37a8f43e0c0bf31b2ad5fdf4ca8b2a389616c4ca54eee","tools": ["tool_result_read","list_room_targets",@@ -318,8 +318,8 @@]},"skills+voice+non-chief": {- "bytes": 18792,- "sha256": "441bee9932f0c5b745c2edcb2466732dafc2f94af5881bd9582970ceb906fd6a",+ "bytes": 18817,+ "sha256": "4de1171bc182a3c8790a6da3499788b451b96f798749563a8e485a3661decc8e","tools": ["tool_result_read","list_room_targets",@@ -343,8 +343,8 @@]},"skills+shared+non-chief": {- "bytes": 18051,- "sha256": "eb739fe9e39cbcc57e575c8e77d94b4c47bd5000e0e5f458ef7c4902dbc6ac0b",+ "bytes": 18076,+ "sha256": "22000967d92c0185299b9cec42926f20c51c62de7814cb96437f6fb6af35f611","tools": ["tool_result_read","list_room_targets",@@ -367,8 +367,8 @@]},"skills+shared+voice+non-chief": {- "bytes": 18832,- "sha256": "c8901768fb36729c9ea53031e69587792ac9220f70f835fa8b8ab7967cb41e6f",+ "bytes": 18857,+ "sha256": "ecfe96872e20f6daa704200ffa775f08b37cb40affce553ff79cccde2bedddc9","tools": ["tool_result_read","list_room_targets",@@ -392,8 +392,8 @@]},"skills+shared+voice+cloud-home": {- "bytes": 18965,- "sha256": "3a1b365b5c5ae0bc32e53bc16d34bac2686d52f847398611d81cae6a6ecebcee",+ "bytes": 18990,+ "sha256": "b79b8133d51c64b7dbf1f361358080f8ed23ada7753963b55ff331800167ef38","tools": ["tool_result_read","list_room_targets",@@ -417,8 +417,8 @@]},"skills+shared+voice+non-chief+cloud-home": {- "bytes": 18848,- "sha256": "6e7d143f9f485f43bc237026d77af88239187cf84d6c18ba743fc82df5c5f0a6",+ "bytes": 18873,+ "sha256": "a4e1ebdd4dee57df13f6b2c733204d65825631e55c0d03949d273782b1af6d3c","tools": ["tool_result_read","list_room_targets",@@ -442,8 +442,8 @@]},"skills+shared+voice+x": {- "bytes": 19010,- "sha256": "bae9a1e91a8e6600aab35389fa4af76954537c82ce76d2d781eb60057897fe2e",+ "bytes": 19035,+ "sha256": "ebf87387dae6fff8b76f6626bab7d7fb71bcc9a5dd2ef9b1869b38c5c3995224","tools": ["tool_result_read","list_room_targets",@@ -467,8 +467,8 @@]},"skills+shared+voice+x+team": {- "bytes": 19010,- "sha256": "bae9a1e91a8e6600aab35389fa4af76954537c82ce76d2d781eb60057897fe2e",+ "bytes": 19035,+ "sha256": "ebf87387dae6fff8b76f6626bab7d7fb71bcc9a5dd2ef9b1869b38c5c3995224","tools": ["tool_result_read","list_room_targets",@@ -492,8 +492,8 @@]},"skills+shared+voice+x+team+images": {- "bytes": 19038,- "sha256": "fdd88d3a0912fad7bc3fa45e040ac1832288e9e985bb57fbf9f076674d4acbcb",+ "bytes": 19063,+ "sha256": "44fa4a50aeff87e10107dd78c950bdee143b4949fc9ab4443b69545f2f6b055f","tools": ["tool_result_read","list_room_targets",@@ -517,8 +517,8 @@]},"default+legacy-switches": {- "bytes": 18101,- "sha256": "4fac091dcd0b272bd485e5aeb3fb8479d3c0acfc1e414d6427b902d1a06208fa",+ "bytes": 18126,+ "sha256": "b3437b83e63a11bb6139469bb54ed47c9b5e226a6bd1e0831a5766a5cccb5e66","tools": ["tool_result_read","list_room_targets",@@ -541,8 +541,8 @@]},"default+mausbot": {- "bytes": 18153,- "sha256": "da14e71c913492d74a764f38db64554af74d7eab62cc814be86b71d01f80733c",+ "bytes": 18178,+ "sha256": "893a48643cc3b1adda5f75337241b89e3460f759cf1535c9c7803ecf163d4582","tools": ["tool_result_read","list_room_targets",@@ -565,8 +565,8 @@]},"skills+shared+voice+mausbot": {- "bytes": 19001,- "sha256": "627c6c4f0be1f86b61487b620ead43bed156f9a1b7e873ee803a0deb12197efd",+ "bytes": 19026,+ "sha256": "4d254f408532c95a8349654608b8c5a22cdb4cfcf09d39123f00c3134f6892d7","tools": ["tool_result_read","list_room_targets",@@ -590,8 +590,8 @@]},"default+no-computer-pick": {- "bytes": 16889,- "sha256": "d2f171db7e8a6cba79d588b4d03188aa3ea77658ff1d8d6dceae3965ce6654b6",+ "bytes": 16914,+ "sha256": "73d0c92b75947356d6eda049d2ec0db10f5268b758cabcf7042b61e2bf2877a5","tools": ["tool_result_read","list_room_targets",@@ -613,8 +613,8 @@]},"default+room": {- "bytes": 16818,- "sha256": "f88d0e3f6c78cc3bee64355b7c21a1ed3ba05ca22d57a1b7809464c2e7700293",+ "bytes": 16843,+ "sha256": "53528c74d0bd5836167050f04953a3c56c4bb764b233e271058688835e6d50e5","tools": ["tool_result_read","list_room_targets",@@ -636,8 +636,8 @@]},"non-chief+room": {- "bytes": 16701,- "sha256": "8a38959c0cd6c8156d3d90a0b54db85c4ee0d10031e5285582f99b7aa90ad838",+ "bytes": 16726,+ "sha256": "1e7febdfe9eb58670801fdcdd8fc3c871c982a812b73beda15c3b9d3a0c1d497","tools": ["tool_result_read","list_room_targets",@@ -659,8 +659,8 @@]},"default+images": {- "bytes": 18129,- "sha256": "15c6811f9a0d140fbf2548cd944a22967e0f3e2eb365f8969435d5a934104ebf",+ "bytes": 18154,+ "sha256": "8148a7015ab0b1783c91c3a650f277f91afe908ea31b5f385cc02874899de599","tools": ["tool_result_read","list_room_targets",@@ -683,8 +683,8 @@]},"skills+shared+voice+x+team+images+hosting": {- "bytes": 20240,- "sha256": "2745125a29a3d69a858646ec5ca4966b368a31ab5d1c688e83673751209593d6",+ "bytes": 20265,+ "sha256": "c98264a5374f8be4fc1c99f760c8bb19f308a69ad53ecb2ed58261ba1e2803e2","tools": ["tool_result_read","list_room_targets",@@ -709,8 +709,8 @@]},"default+hosting": {- "bytes": 19303,- "sha256": "ebd39065170c0d0e62fccd5ed5c5f9e71ae614ca9b58fd7f4df8328b66dc8f36",+ "bytes": 19328,+ "sha256": "6006b01b13236f08c46d10524a6d70a930d6025db0115944c5ea7530e9497239","tools": ["tool_result_read","list_room_targets",@@ -734,8 +734,8 @@]},"skills+shared+voice+x+team+board": {- "bytes": 19047,- "sha256": "b952fee38047b56ab210b8accb5197a3e3f47a67afd3b0bcc78f1eb8b5d46292",+ "bytes": 19072,+ "sha256": "d198bf375aa2ac35a2aa8694dcb39cf42695c67c3b8e72c2a17f98b656cb93da","tools": ["tool_result_read","list_room_targets",@@ -759,8 +759,8 @@]},"default+room+board": {- "bytes": 16855,- "sha256": "1da389a5178734674ca47b44d4c97f9c4e4660fea18840345b9831777865c103",+ "bytes": 16880,+ "sha256": "89b038002de0fefa95dec1bfab26bfde8b5ab17e1364a43d50a2c9c0eab67f7b","tools": ["tool_result_read","list_room_targets",@@ -782,8 +782,8 @@]},"default+tools-off": {- "bytes": 16444,- "sha256": "1b468d3464d21ab53160b2c7c06f3d9a2f9c2202c7715f3bec41a11ac8e2a15b",+ "bytes": 16469,+ "sha256": "035a2ca358f75282de44d7968d0d03c44ea325552b3a85d7cb9b6dd1ce22c3bf","tools": ["tool_result_read","list_room_targets",diff --git a/server/drivers/agents-catalog-goldens/bridged.tools-list.json b/server/drivers/agents-catalog-goldens/bridged.tools-list.jsonindex 5bf1265f1c..ebc0f9edea 100644--- a/server/drivers/agents-catalog-goldens/bridged.tools-list.json+++ b/server/drivers/agents-catalog-goldens/bridged.tools-list.json@@ -420,7 +420,7 @@},{"name": "message_person",- "description": "Reach a person in their Inbox, with news they may miss here or when asked to tell someone something. Their answer comes back here. Only what you write goes.",+ "description": "Reach a person in their Inbox, never a bot (bots: coordinate_bots): news they may miss, or when asked to tell them something. Their answer comes back here; only what you write goes.","inputSchema": {"type": "object","additionalProperties": false,diff --git a/server/drivers/agents-catalog-goldens/full.tools-list.json b/server/drivers/agents-catalog-goldens/full.tools-list.jsonindex 83d683b742..b057cae2cb 100644--- a/server/drivers/agents-catalog-goldens/full.tools-list.json+++ b/server/drivers/agents-catalog-goldens/full.tools-list.json@@ -1462,7 +1462,7 @@},{"name": "message_person",- "description": "Reach a person in their Inbox, with news they may miss here or when asked to tell someone something. Their answer comes back here. Only what you write goes.",+ "description": "Reach a person in their Inbox, never a bot (bots: coordinate_bots): news they may miss, or when asked to tell them something. Their answer comes back here; only what you write goes.","inputSchema": {"type": "object","additionalProperties": false,diff --git a/server/drivers/agents-catalog-goldens/profiles.json b/server/drivers/agents-catalog-goldens/profiles.jsonindex d5f17b9efb..e941a43a1e 100644--- a/server/drivers/agents-catalog-goldens/profiles.json+++ b/server/drivers/agents-catalog-goldens/profiles.json@@ -1,7 +1,7 @@{"default": {- "bytes": 61786,- "sha256": "8fef28ec7f165f998038c3a8527d918f90451428fddde67b0ae99e27b0e1da81",+ "bytes": 61811,+ "sha256": "93105c87edae0e1012388db03e9b786228e0c02b0124c8784cdeb1331660d029","tools": ["tool_result_read","list_room_targets",@@ -61,8 +61,8 @@]},"voice": {- "bytes": 62567,- "sha256": "1948ed35962d65c153fc7b70fc10edfecc1bbe9656cb4936290a24ff4d778e8e",+ "bytes": 62592,+ "sha256": "8eaead0fe41c326689b2d05c58c86eb93351cbdc2dd6493533c96dd25364f7f3","tools": ["tool_result_read","list_room_targets",@@ -123,8 +123,8 @@]},"shared": {- "bytes": 64051,- "sha256": "5fee3bb2f5bd2d4bd3bab89f271d6ace0974e079123e4f170a33e14601996658",+ "bytes": 64076,+ "sha256": "77608035e01590409cf18a4b4d0ef814fe2025bef3f4942ce0f5f36b15c5a250","tools": ["tool_result_read","list_shared_computers",@@ -186,8 +186,8 @@]},"shared+voice": {- "bytes": 64832,- "sha256": "039c3f04aadb4effcfd6b64d78ecd9a36af2e225510946ba209d63cbdd59b78c",+ "bytes": 64857,+ "sha256": "459b8374aed3bd048e0f1f77e61d6f42f71af7cab9bd081abe4cbb26bb3155b9","tools": ["tool_result_read","list_shared_computers",@@ -250,8 +250,8 @@]},"skills": {- "bytes": 64209,- "sha256": "f3d39535b7f7ffde9da5d35f415de566a12f7fb88e841e1708462abc119a771f",+ "bytes": 64234,+ "sha256": "40a0c335730b1fcbf6993f62886ace018b343e1485c1d66a825d5a653d86ba6f","tools": ["tool_result_read","list_room_targets",@@ -313,8 +313,8 @@]},"skills+voice": {- "bytes": 64990,- "sha256": "98d5ba7f7b8982221f573e5efa782a59a0e66a0f19a020bcc28d540e3a757772",+ "bytes": 65015,+ "sha256": "cd17687cc3d5ed6b990b70494d2a7c39a59565f607f443b2f27a522c5eacbe41","tools": ["tool_result_read","list_room_targets",@@ -377,8 +377,8 @@]},"skills+shared": {- "bytes": 66474,- "sha256": "f8602f0a8085afcc547b3e951037dc0d3de84958acc5bec7815dd39dd5323637",+ "bytes": 66499,+ "sha256": "5d37cc0b89703ea345e721e1b5c37b18cd9c192083aa80ce0b65e2eb4b65f20f","tools": ["tool_result_read","list_shared_computers",@@ -442,8 +442,8 @@]},"skills+shared+voice": {- "bytes": 67255,- "sha256": "effdbd1fec661cdf7f7094cb87c067ee0bc07f2b063b5e18afb226e72cb0d44a",+ "bytes": 67280,+ "sha256": "244ba51255a8ae679d2fa9c0a49055e9b327ec50eacfd61f537544a0fee72e94","tools": ["tool_result_read","list_shared_computers",@@ -508,8 +508,8 @@]},"non-chief": {- "bytes": 53238,- "sha256": "11dcbe1b650b5594fcb8dee761821311d641a4f764db68d2359a6a516b1d753b",+ "bytes": 53263,+ "sha256": "541f9236cdff8ecb9440fa4942a1aa8abcb5c650c416deb5b5aeba5a5e092d9c","tools": ["tool_result_read","list_room_targets",@@ -562,8 +562,8 @@]},"voice+non-chief": {- "bytes": 54019,- "sha256": "fd0da22b8fb6e5bbb75598c4f4a95c948ce62afd002141633d019cbc18d318ff",+ "bytes": 54044,+ "sha256": "4a8c6cf0368184df6295f68e2d37636b5790698728b0b879d521ece75356d45e","tools": ["tool_result_read","list_room_targets",@@ -617,8 +617,8 @@]},"shared+non-chief": {- "bytes": 55503,- "sha256": "00c4719ede4cffa7021c6c0b0c3b46bcc9608039273d09771ec889eb26e07509",+ "bytes": 55528,+ "sha256": "08c930970af939542f519a242abd475cb522a068b8acb9891f98213d67a0b12a","tools": ["tool_result_read","list_shared_computers",@@ -673,8 +673,8 @@]},"shared+voice+non-chief": {- "bytes": 56284,- "sha256": "7d92acda7ea804a5d65e19091a344fb4b344281e0effc820fbaf90e7362bc876",+ "bytes": 56309,+ "sha256": "2ce571c0e232e32c51b061063b3759aed1d9771829e9382b995fa2177fe0ac52","tools": ["tool_result_read","list_shared_computers",@@ -730,8 +730,8 @@]},"skills+non-chief": {- "bytes": 55661,- "sha256": "78be33ea64f57ed7b017ffe5298ac1368816b6294ec563c4438f190fd80bdbab",+ "bytes": 55686,+ "sha256": "67c3865f927e014e60352133fd3512d1542e3140dfe78d2bcb90f56c9811fd4b","tools": ["tool_result_read","list_room_targets",@@ -786,8 +786,8 @@]},"skills+voice+non-chief": {- "bytes": 56442,- "sha256": "09f781ed0db3e954a4472b2ab8ecae350134b6f082c76fc6cfb3a2e9039727e0",+ "bytes": 56467,+ "sha256": "27720eec57ea58134715b0a7f5238409ac8ea854906d4e8c63e492b7c460fcaa","tools": ["tool_result_read","list_room_targets",@@ -843,8 +843,8 @@]},"skills+shared+non-chief": {- "bytes": 57926,- "sha256": "19296ac3fa4895ad356f16ae0de2c969bb72b5205c922d8d5843de7a67beb7e1",+ "bytes": 57951,+ "sha256": "18d9e4b76532fb0b6f3b09ec14e2d02a9f08dd75c75bbbb3af76e7cb6bb0d084","tools": ["tool_result_read","list_shared_computers",@@ -901,8 +901,8 @@]},"skills+shared+voice+non-chief": {- "bytes": 58707,- "sha256": "bb7c656302ad2d5fefced6784fe93e2800abda433e26844f1743b05d19acb0f4",+ "bytes": 58732,+ "sha256": "a737f6b06e92c086ff379443ffb80bf938a1e04fa5156b61af480e941851f1dd","tools": ["tool_result_read","list_shared_computers",@@ -960,8 +960,8 @@]},"skills+shared+voice+cloud-home": {- "bytes": 67011,- "sha256": "936445c5ce88243290c27b0d8c6f8e8d0179b8b779d512ca3329d6caa4d54038",+ "bytes": 67036,+ "sha256": "acf15e8eeab0927b30724678acad40703c2bfd3839151c34dc73de0e2bfcd132","tools": ["tool_result_read","list_shared_computers",@@ -1026,8 +1026,8 @@]},"skills+shared+voice+non-chief+cloud-home": {- "bytes": 58463,- "sha256": "73a3fb8a1206f0d0fbcb79563b40a0375d7d7c5853f774debcd8d9dc237cf8ff",+ "bytes": 58488,+ "sha256": "43ce2b51004a28d6fbf65b4f6ec55f5ab6bc3ba67cc5a05585b657bb9c5118d7","tools": ["tool_result_read","list_shared_computers",@@ -1085,8 +1085,8 @@]},"skills+shared+voice+x": {- "bytes": 71094,- "sha256": "023b62f4f3be938a669cbb50bbb15efef82cac0fd4d6a5ad030b0fe4324f2ef2",+ "bytes": 71119,+ "sha256": "11e393ae7a47d26692cb73da3d73d58121e314b39a52cc6b4cc29a1fb00c4806","tools": ["tool_result_read","list_shared_computers",@@ -1155,8 +1155,8 @@]},"skills+shared+voice+x+team": {- "bytes": 71094,- "sha256": "023b62f4f3be938a669cbb50bbb15efef82cac0fd4d6a5ad030b0fe4324f2ef2",+ "bytes": 71119,+ "sha256": "11e393ae7a47d26692cb73da3d73d58121e314b39a52cc6b4cc29a1fb00c4806","tools": ["tool_result_read","list_shared_computers",@@ -1225,8 +1225,8 @@]},"skills+shared+voice+x+team+images": {- "bytes": 73041,- "sha256": "090b7eccda9ffe75a5d3cf1006eacc237f221edcf366e796dfe528f107072e24",+ "bytes": 73066,+ "sha256": "c84de8dd6e1eea6e4a856e64e2e3914ea1501dfe92ba7bd241b02fd9f4f6f354","tools": ["tool_result_read","list_shared_computers",@@ -1297,8 +1297,8 @@]},"default+legacy-switches": {- "bytes": 61786,- "sha256": "8fef28ec7f165f998038c3a8527d918f90451428fddde67b0ae99e27b0e1da81",+ "bytes": 61811,+ "sha256": "93105c87edae0e1012388db03e9b786228e0c02b0124c8784cdeb1331660d029","tools": ["tool_result_read","list_room_targets",@@ -1358,8 +1358,8 @@]},"default+mausbot": {- "bytes": 62437,- "sha256": "e71818d3b029d88915f275d033efd65824bf856f10a42d416d70cb72deca109a",+ "bytes": 62462,+ "sha256": "5883cfe256f6e49a17cbac3b19c48b09cf03f2c28d216acf855d00c844af1b80","tools": ["tool_result_read","list_room_targets",@@ -1421,8 +1421,8 @@]},"skills+shared+voice+mausbot": {- "bytes": 67906,- "sha256": "6f2f9a44dd450fe75c8ece144154b535ca9a8e3f65f33c897f9e2f708b7ee488",+ "bytes": 67931,+ "sha256": "7f651a2057dffa10cc0a589620cdc44c0bd781a1818ac55d3647d3f49bee37f7","tools": ["tool_result_read","list_shared_computers",@@ -1489,8 +1489,8 @@]},"default+no-computer-pick": {- "bytes": 60574,- "sha256": "caea065b9d1c1136843b9af9e3262b0d1cb2e7577a7a73ce1ab1868e8fdae7b9",+ "bytes": 60599,+ "sha256": "3a1e522b0c152fccb92a2eb764f7c35dc5c14a9ae7fa5a6778e9562d5bedb1e9","tools": ["tool_result_read","list_room_targets",@@ -1549,8 +1549,8 @@]},"default+room": {- "bytes": 57134,- "sha256": "6bcd18bc424e26a4992a36104fcc0a4287b8aea9cefe41bb789a9ce30ac2c3aa",+ "bytes": 57159,+ "sha256": "dbb06cd45508eabf7dd22288814f2ad8edb891215182f7c54cd3e9912c66425c","tools": ["tool_result_read","list_room_targets",@@ -1603,8 +1603,8 @@]},"non-chief+room": {- "bytes": 48586,- "sha256": "6860a81c1fa3c8531e621ee23ad0ee1e9a516a62f59327c9522b01c88ddb1f0d",+ "bytes": 48611,+ "sha256": "d982340d902fa490144e5987cd943572f8bc6eb4a429f55077e5e87f220bd006","tools": ["tool_result_read","list_room_targets",@@ -1650,8 +1650,8 @@]},"default+images": {- "bytes": 63733,- "sha256": "55363deedcadebbfe935019cd4ffddb73fd9fa21bcc84eb4387e4fa106f8cbcd",+ "bytes": 63758,+ "sha256": "581df1e99e609e8fb05f0ac1b9100454a5122033fd726585b79bbb2d3808042a","tools": ["tool_result_read","list_room_targets",@@ -1713,8 +1713,8 @@]},"skills+shared+voice+x+team+images+hosting": {- "bytes": 74904,- "sha256": "7512a828fd2a1c50c3e0b9e2ce0530b17d7030580d364c255d2485094dc92620",+ "bytes": 74929,+ "sha256": "cbff275fcf30b239d85f012ddf168e5daf19f161505ca1b591375a6cd89814a3","tools": ["tool_result_read","list_shared_computers",@@ -1787,8 +1787,8 @@]},"default+hosting": {- "bytes": 63649,- "sha256": "08f24e6b0483ffbe58c4b106a223d42df13a00e2765457e988eb5a2ea8c64e13",+ "bytes": 63674,+ "sha256": "fdeaf37ac31f3988c07f3fe2b12afe0572c737dafc1056aee57fe1ec7ae64570","tools": ["tool_result_read","list_room_targets",@@ -1850,8 +1850,8 @@]},"skills+shared+voice+x+team+board": {- "bytes": 73149,- "sha256": "c74a780ae454c2b44a9c8ae69d133492b142cc83eb6151e79b32b17796f87894",+ "bytes": 73174,+ "sha256": "d46665daa960c578591c55d8ac9cf30c20860f14bd92bb894dc9a0b7d557fb54","tools": ["tool_result_read","list_shared_computers",@@ -1923,8 +1923,8 @@]},"default+room+board": {- "bytes": 59189,- "sha256": "03a6429caec5fc69dfaa5eed72c02e6621bbb0bf960c097536dbd9347cbf907a",+ "bytes": 59214,+ "sha256": "c86f380f525bfe5c61e11327288a838339ee8ccd1ac237374da5b9514d060c20","tools": ["tool_result_read","list_room_targets",@@ -1980,8 +1980,8 @@]},"default+tools-off": {- "bytes": 57469,- "sha256": "1ff600e1d65c11cae40425671f6e35324a78c7eb7b8f74663ed8633c1ef03f6e",+ "bytes": 57494,+ "sha256": "dca6082c130c1893923a63799067083049ecc5b4a4807120ead1012f9185d440","tools": ["tool_result_read","list_room_targets",diff --git a/server/drivers/agents-person-tools.ts b/server/drivers/agents-person-tools.tsindex 7e132cd948..c92dad0069 100644--- a/server/drivers/agents-person-tools.ts+++ b/server/drivers/agents-person-tools.ts@@ -16,7 +16,7 @@ export async function callPersonTool(_name: string, args: Json, context: ToolCalexport const PERSON_TOOL_DEFINITIONS = [{name: "message_person",- description: "Reach a person in their Inbox, with news they may miss here or when asked to tell someone something. Their answer comes back here. Only what you write goes.",+ description: "Reach a person in their Inbox, never a bot (bots: coordinate_bots): news they may miss, or when asked to tell them something. Their answer comes back here; only what you write goes.",inputSchema: {type: "object",additionalProperties: false,diff --git a/server/host/message-person-bots.ts b/server/host/message-person-bots.tsnew file mode 100644index 0000000000..4159a40215--- /dev/null+++ b/server/host/message-person-bots.ts@@ -0,0 +1,67 @@+// message_person is for people. Off a team there is one person, so whatever it names that is no bot reaches them; a bot,+// here or on the person's other places, is refused in words that name the tool that reaches it, so no bot waits on an+// answer that cannot come. The person's own name wins over a bot that shares it: a message meant for them is never refused.+import { allowsTool } from "../../shared/tool-scope.ts";+import { linkedId } from "../bot-link/protocol.ts";+import { namesTeammate, peerName, sharedNameChoices, type RosterMember } from "../peer-roster.ts";+import type { Explained } from "../places-elsewhere.ts";++/** Words a bot uses for the one person here. */+const PERSON_WORDS: ReadonlySet<string> = new Set(["me", "you", "owner", "the owner", "my owner", "person", "the person", "my person", "user", "the user"]);++/** What `to` names off a team: the bots elsewhere it could be, by their address, or where it lives when the link is off. */+export type BotsElsewhere = { linked: Array<{ id: string; name: string }> } | { where: string };++export interface MessagePersonBotsDeps {+ bots(): ReadonlyArray<RosterMember & { toolScope?: unknown }>;+ /** The names the person of this conversation goes by: the profile's name, and a guest's where it is theirs. */+ personNames(threadId: string): ReadonlyArray<string | undefined>;+ /** The bots of the person's other places `to` names; null when it names none. */+ elsewhere?(to: string): BotsElsewhere | null;+}++const fold = (value: string) => value.replace(/^@+/, "").replace(/\s+/g, " ").trim().toLowerCase();+const NOT_SENT = "so nothing was sent and no answer will come.";+const FOR_PERSON = " For the person, leave out to.";++/** "person" when `to` is the person here (post it, saying nothing more), a refusal when it names a bot, or null when it+ * names nobody known (post it, saying it went to the person). */+export function messagePersonTarget(deps: MessagePersonBotsDeps, botId: string, threadId: string, to: string): "person" | { refusal: string } | null {+ const wanted = fold(to);+ if (!wanted || PERSON_WORDS.has(wanted)) return "person";+ const names = deps.personNames(threadId).map((name) => fold(name ?? "")).filter(Boolean);+ if (names.some((name) => name === wanted || name.split(" ")[0] === wanted)) return "person";+ const raw = to.replace(/^@+/, "").trim();+ const bots = deps.bots();+ const self = bots.find((bot) => bot.id === botId);+ const named = bots.filter((bot) => !bot.hidden && bot.id !== botId && namesTeammate(bot, raw));+ const elsewhere = named.length ? null : deps.elsewhere?.(raw) ?? null;+ if (!named.length && !elsewhere && self && namesTeammate(self, raw)) return { refusal: `${JSON.stringify(peerName(raw))} is you, ${NOT_SENT}${FOR_PERSON}` };+ if (!named.length && !elsewhere) return null;+ if (elsewhere && "where" in elsewhere) return { refusal: `${elsewhere.where} Nothing was sent.` };+ const targets = named.length ? named.map((bot) => ({ id: bot.id, name: bot.name })) : elsewhere!.linked;+ const first = targets[0]!;+ const who = targets.length > 1 ? `${JSON.stringify(peerName(raw))} names ${targets.length} bots, not a person,` : `${peerName(first.name)} is a bot, not a person,`;+ // A bot whose tool selection leaves out coordinate_bots is never sent to it.+ if (!allowsTool(self?.toolScope, { kind: "mcp", server: "agents", name: "coordinate_bots" })) {+ return { refusal: `${who} ${NOT_SENT} You cannot reach other bots: tell the person in your reply.${FOR_PERSON}` };+ }+ const retry = targets.length > 1+ ? `Use coordinate_bots with the id of the one you mean: ${sharedNameChoices(targets)}.`+ : `Use coordinate_bots with bot_ids ${JSON.stringify([first.id])} (${peerName(first.name)}).`;+ return { refusal: `${who} ${NOT_SENT} ${retry}${FOR_PERSON}` };+}++/** The bots of the person's other places `to` names: through the bot link when it is on, else where the person's app+ * said a bot of that name lives. */+export function botsElsewhere(+ link: { on(): boolean; candidates(raw: string): Array<{ peer: string; bot: { id: string; name: string; paused?: boolean } }> } | null | undefined,+ explain: (name: string) => Explained,+ to: string,+): BotsElsewhere | null {+ const found = link?.on() ? link.candidates(to) : [];+ const awake = found.length > 1 ? found.filter((remote) => !remote.bot.paused) : found;+ if (awake.length) return { linked: awake.map((remote) => ({ id: linkedId(remote.peer, remote.bot.id), name: remote.bot.name })) };+ const known = explain(to);+ return known && "where" in known ? { where: known.where } : null;+}diff --git a/server/host/team-messages.test.ts b/server/host/team-messages.test.tsindex b448a4c621..2f1ce847a0 100644--- a/server/host/team-messages.test.ts+++ b/server/host/team-messages.test.ts@@ -3,6 +3,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";import { memberAudience } from "../audience.ts";import { ADA, CARL, key, BEN, CLEO, session, teamInbox } from "../testing/team-inbox-fixture.ts";import { ASSISTANT_HOURLY } from "./person-inbox.ts";+import { botsElsewhere } from "./message-person-bots.ts";import { MESSAGE_PERSON_HOURLY } from "./team-messages.ts";const fixtures: Array<ReturnType<typeof teamInbox>> = [];@@ -131,6 +132,87 @@ describe("message_person", () => {});});+describe("message_person naming a bot", () => {+ /** message_person as the agents server sends it, from Scout's own chat. */+ const send = async (f: ReturnType<typeof fixture>, body: Record<string, unknown>) => {+ let answered: { status: number; body: { text?: string; error?: string } } | null = null;+ await f.team.internal({ method: "POST", path: "/api/internal/people/message", res: {} as never, botId: "scout", threadId: "scout-main",+ json: ((_res: unknown, status: number, sent: { text?: string; error?: string }) => { answered = { status, body: sent }; }) as never, readBody: async () => body });+ return answered! as { status: number; body: { text?: string; error?: string } };+ };+ const POSTED = "It is in their Inbox and they were notified. Their answer comes back here, and you carry on from it.";+ const REVIEWER = "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f";+ /** A place of one person with a bot whose id is a real one, so only its name or id can match it. */+ const solo = (named: NonNullable<Parameters<typeof fixture>[0]>["named"] = { personNames: () => ["Milind Soni"] }) => {+ const f = fixture({ team: false, place: true, named });+ f.bots.push({ id: REVIEWER, name: "Reviewer 2", color: "teal", threadId: "rev-main", tasks: [{ threadId: "rev-main", title: "Reviewer 2" }] });+ return f;+ };+ const refusal = (id: string, name: string) => `${name} is a bot, not a person, so nothing was sent and no answer will come. Use coordinate_bots with bot_ids ["${id}"] (${name}). For the person, leave out to.`;++ it("off a team, puts nothing in the person's Inbox for a bot, however it is written, and names coordinate_bots with its id", async () => {+ const f = solo();+ for (const to of ["Reviewer 2", "reviewer 2", "@Reviewer 2", " REVIEWER 2 ", "reviewer-2", "reviewer_2", REVIEWER, REVIEWER.slice(0, 8).toUpperCase()]) {+ expect(await send(f, { to, message: "Send me the Q4 numbers." }), to).toEqual({ status: 409, body: { error: refusal(REVIEWER, "Reviewer 2") } });+ }+ expect(await send(f, { to: "Scout", message: "Note to self" })).toEqual({ status: 409, body: { error: '"Scout" is you, so nothing was sent and no answer will come. For the person, leave out to.' } });+ expect(f.lines("scout-main"), "no line, so no Inbox row").toEqual([]);+ expect(f.notified).toEqual([]);+ expect(await send(f, { message: "The report is ready." }), "the hourly cap was not spent on the refusals").toEqual({ status: 200, body: { text: POSTED } });+ });++ it("names every bot that shares a name, each by its id", async () => {+ const f = solo();+ f.bots.push({ id: "0d9e8f7a-6b5c-4d3e-2f1a-0b9c8d7e6f5a", name: "Reviewer 2", color: "red", threadId: "rev2-main", tasks: [{ threadId: "rev2-main", title: "Reviewer 2" }] });+ expect((await send(f, { to: "reviewer 2", message: "Hi" })).body.error).toBe(`"reviewer 2" names 2 bots, not a person, so nothing was sent and no answer will come. Use coordinate_bots with the id of the one you mean: Reviewer 2 (id ${REVIEWER}); Reviewer 2 (id 0d9e8f7a-6b5c-4d3e-2f1a-0b9c8d7e6f5a). For the person, leave out to.`);+ });++ it("gives the person what is meant for them, even when a bot shares their name, and says nothing more", async () => {+ const f = solo({ personNames: () => ["Reviewer 2", undefined] });+ for (const to of ["Reviewer 2", "reviewer", "me", "You", "the person", "@owner", "the user"]) expect(await send(f, { to, message: `For you: ${to}` }), to).toEqual({ status: 200, body: { text: POSTED } });+ expect(f.lines("scout-main")).toHaveLength(7);+ });++ it("never sends a bot to coordinate_bots when its tool selection leaves it out", async () => {+ const f = solo();+ f.bots.find((bot) => bot.id === "scout")!.toolScope = { deny: ["mcp:agents:coordinate_bots"] };+ expect(await send(f, { to: "Reviewer 2", message: "Hi" })).toEqual({ status: 409, body: { error: "Reviewer 2 is a bot, not a person, so nothing was sent and no answer will come. You cannot reach other bots: tell the person in your reply. For the person, leave out to." } });+ expect(f.lines("scout-main")).toEqual([]);+ });++ it("refuses a bot of the person's other place: by its address through the link, or where it lives when the link is off", async () => {+ const linked = solo({ personNames: () => [], elsewhere: (to) => (to === "Atlas" ? { linked: [{ id: "link-laptop-1234", name: "Atlas" }] } : null) });+ expect(await send(linked, { to: "Atlas", message: "Hi" })).toEqual({ status: 409, body: { error: refusal("link-laptop-1234", "Atlas") } });+ const away = solo({ personNames: () => [], elsewhere: (to) => (to === "Atlas" ? { where: "Atlas lives on Laptop, the person's computer, not here. Tell the person plainly." } : null) });+ expect(await send(away, { to: "Atlas", message: "Hi" })).toEqual({ status: 409, body: { error: "Atlas lives on Laptop, the person's computer, not here. Tell the person plainly. Nothing was sent." } });+ expect([...linked.lines("scout-main"), ...away.lines("scout-main")]).toEqual([]);+ });++ it("off a team, says plainly that a name nobody here has went to the person's own Inbox", async () => {+ const f = solo();+ const answer = await send(f, { to: "Bob", message: "Can you send the slides?" });+ expect(answer).toEqual({ status: 200, body: { text: `No bot here is called "Bob", and only the person you work for can be messaged from here, so this went to their own Inbox. ${POSTED}` } });+ expect(f.lines("scout-main")).toEqual([expect.objectContaining({ kind: "text", text: "Can you send the slides?", inbox: expect.objectContaining({ kind: "message" }) })]);+ });++ it("on a team, leaves a name nobody has to the team's own refusal", async () => {+ const f = fixture();+ expect(await send(f, { to: "reporter", message: "Hi" })).toMatchObject({ status: 404, body: { error: expect.stringContaining("The people here: Ada, Ben, Cleo.") } });+ });+});++describe("the bots of the person's other place message_person can name", () => {+ const link = (on: boolean) => ({ on: () => on, candidates: (raw: string) => (raw === "Atlas" ? [{ peer: "laptop", bot: { id: "b1", name: "Atlas" } }, { peer: "desk", bot: { id: "b2", name: "Atlas", paused: true } }] : []) });+ const explain = (name: string) => (name === "Atlas" ? { where: "Atlas lives on Laptop." } : { hint: "Bots work together only within one place." });++ it("asks the link first, leaving out a paused bot when another has the name, then where the person's app said it lives", () => {+ expect(botsElsewhere(link(true), explain, "Atlas")).toEqual({ linked: [{ id: "link-laptop-b1", name: "Atlas" }] });+ expect(botsElsewhere(link(false), explain, "Atlas")).toEqual({ where: "Atlas lives on Laptop." });+ expect(botsElsewhere(null, explain, "Atlas")).toEqual({ where: "Atlas lives on Laptop." });+ expect(botsElsewhere(link(true), explain, "Bob"), "a hint is no bot").toBeNull();+ });+});+describe("a teammate who shares a bot's name", () => {it("is still the one their tag reaches: a tie is the person's, and their tags are known", () => {const f = fixture();diff --git a/server/host/team-messages.ts b/server/host/team-messages.tsindex e9c07a25aa..78f6dc9c4c 100644--- a/server/host/team-messages.ts+++ b/server/host/team-messages.ts@@ -26,6 +26,7 @@ import type { BotRecord, GroupRecord, Message, Store, StoreChange } from "../stoimport type { TeamPeople } from "../team-people.ts";import { currentTimeZone } from "../time-zone.ts";import { loadMemory } from "../workspace.ts";+import { messagePersonTarget, type MessagePersonBotsDeps } from "./message-person-bots.ts";import { OUTSIDE_REFUSAL } from "./outside-fence.ts";import type { PlaceInbox } from "./place-inbox.ts";import { createPersonInbox, type Delivery, type Item, type Passed, type PersonInbox, type PersonInboxDeps } from "./person-inbox.ts";@@ -66,6 +67,8 @@ export interface TeamMessagesDeps {notify(notification: Notification): void;/** The inbox of a place that is no team's. */place?: PlaceInbox | null;+ /** Off a team: who `to` may name besides the bots here (message-person-bots.ts). */+ named?: Omit<MessagePersonBotsDeps, "bots">;/** What the inbox needs from the server: whose asks are whose, hand-offs, a bot carrying on, the assistant's reads. */inbox: Pick<PersonInboxDeps, "askedPerson" | "handedFrom" | "continueTurn"> & Partial<Pick<PersonInboxDeps, "notes" | "ensureOwnBot" | "changed" | "delivered">> & {representative?: Omit<RepresentativeDeps, "timeZone"> & Partial<Pick<RepresentativeDeps, "timeZone">>;@@ -333,8 +336,14 @@ export function createTeamMessages(deps: TeamMessagesDeps) {if (!team && deps.place) {const body = placeBodySchema.safeParse(await ctx.readBody());if (!body.success) return ctx.json(ctx.res, 400, { error: `message_person needs message (up to ${MESSAGE_PERSON_MAX} characters).` });+ const to = body.data.to ?? "";+ const target = to ? messagePersonTarget({ bots: () => store.bots, personNames: deps.named?.personNames ?? (() => []), ...(deps.named?.elsewhere ? { elsewhere: deps.named.elsewhere } : {}) }, ctx.botId, ctx.threadId, to) : "person";+ if (target !== "person" && target) return ctx.json(ctx.res, 409, { error: target.refusal });const sent = deps.place.message(ctx.botId, ctx.threadId, body.data.message);- return ctx.json(ctx.res, sent.status, sent.status === 200 ? { text: sent.text } : { error: sent.text });+ // There is one person here: a name that is no bot's still reaches them, and the bot is told so, never left waiting on "Bob".+ const shown = JSON.stringify(oneLine(to, 80));+ const text = target === null && sent.status === 200 ? `No bot here is called ${shown}, and only the person you work for can be messaged from here, so this went to their own Inbox. ${sent.text}` : sent.text;+ return ctx.json(ctx.res, sent.status, sent.status === 200 ? { text } : { error: sent.text });}if (!team || !deps.people) return ctx.json(ctx.res, 404, { error: "Passing a message to a person works only on a team's Cloud." });if (deps.confined?.(ctx.threadId)) return ctx.json(ctx.res, 403, { error: OUTSIDE_REFUSAL });diff --git a/server/index.ts b/server/index.tsindex de467aa139..7755a8a981 100644--- a/server/index.ts+++ b/server/index.ts@@ -635,7 +635,7 @@ import { createReactions, withReactionNotes, type Reactor } from "./reactions.tsimport { createPersonReplies } from "./person-replies.ts";import { handedOwnServerLender, lendingPerson, lendingPersonKey, OWN_SERVER_LENDER, ownWindowLender, personKey, relayedPersonKey } from "./person-key.ts"; import { ownWindowLine } from "./own-window-sends.ts"; import { ownServerLendingRefusal } from "./own-server-lending-refusal.ts";import { createOutsideLineage, OUTSIDE_STAYS_HERE } from "./host/outside-lineage.ts"; import { OUTSIDE_REFUSAL, outsideRouteRefused } from "./host/outside-fence.ts"; import { createOutsideWrites } from "./host/outside-writes.ts";-import { teamAiOwner } from "./host/team-ai-owner.ts"; import { createTeamOwners, type AskViewer } from "./host/team-owners.ts"; import { createTeamMessages } from "./host/team-messages.ts"; import { createTeamAwayHost } from "./host/team-away-host.ts"; import { createPlaceInbox, guestNameIn, placeInboxViewer } from "./host/place-inbox.ts"; import { relayedTurn } from "./host/relayed-turn.ts"; import { createPersonCalendar } from "./host/person-calendar.ts";+import { teamAiOwner } from "./host/team-ai-owner.ts"; import { createTeamOwners, type AskViewer } from "./host/team-owners.ts"; import { createTeamMessages } from "./host/team-messages.ts"; import { botsElsewhere } from "./host/message-person-bots.ts"; import { createTeamAwayHost } from "./host/team-away-host.ts"; import { createPlaceInbox, guestNameIn, placeInboxViewer } from "./host/place-inbox.ts"; import { relayedTurn } from "./host/relayed-turn.ts"; import { createPersonCalendar } from "./host/person-calendar.ts";import { createDevsReports } from "./host/devs-reports.ts"; import { createSettingNudges } from "./host/setting-nudges.ts"; import { cloudStorage, createPerfHost } from "./perf/perf-host.ts"; import { afterLaunchSettles, launchListening, launchServerPart } from "./perf/launch-probe.ts"; import { footprintOwners } from "./host/bot-footprint-owners.ts"; import { engineOwners } from "./engine-owners.ts"; import { startBotMemoryCapHost } from "./host/bot-memory-cap-host.ts"; import { botMemoryCapReport } from "./bot-memory-cap.ts"; import { createPerfDiagnosticsRoutes } from "./routes/perf-diagnostics.ts"; import { createCachesRoutes } from "./routes/caches.ts"; import { botEnginesLive, createCacheSweepHost, withCacheCounters } from "./cache-sweep/host.ts"; import { bugReportEndpoint, devsReportSender, devsStatusAsker } from "./devs-report-send.ts"; import { captureRecentLog } from "./recent-log.ts"; import { createShareAnswer } from "./host/share-answer.ts";import { createCardRequester, linePersonKey } from "./host/thread-person.ts"; import { selfThreadRefusal } from "./host/self-threads.ts"; import { lookedAfterBy } from "./host/looked-after.ts"; import { createActingPeople, HANDED_PEOPLE_FILE, HandedPeople, type HandedRun, keptPrivate, privateHandBack, withPerson } from "./host/acting-person.ts"; import { createTurnCallSignals } from "./host/turn-call-signals.ts";import { createThreadRoutes } from "./routes/threads.ts";@@ -2758,7 +2758,7 @@ const computerAsks = CLOUD_PERSONAL ? createComputerAsksHost({ store, notify, leconst { stopThreadForPerson, stopOnTypedCommand, restartForPerson } = createPersonStop({store, routines: () => routines, handoffs: () => handoffs, interruptDirectThread, stopping: (botId, threadId) => idleThreads.stopping(botId, threadId), clearUnattended,stopGoal: (threadId) => { oneOnOneGoals.stop(threadId); checkWork.stop(threadId); }, markStopped: (threadId, by) => personStops.stop(threadId, liveTurns.running(threadId), directTurnDispatchClaims.has(threadId), by), working: (botId, threadId) => threadBusy(botId, threadId) || coordinator.activeDirect(threadId) || checkWork.holds(threadId), asking: (threadId) => coordinator.awaitingAnswer(threadId) || Boolean(openPersonCard(threadId)), language: threadLanguage, stopRefusal: (threadId, by) => runOwners.stopRefusal(threadId, by),-}); const teamMessages = createTeamMessages({ place: CLOUD_TEAM ? null : createPlaceInbox({ dataDir: DATA_DIR, store, openCards: openCardRows, live: (threadId, requestId) => askMessageByRequest.has(`${threadId}:${requestId}`), waiting: () => personWaits.waiting(), send: (notification) => { broadcast({ kind: "notify", notification: logNotification(notification) }); }, sees: (auth, threadId) => visibleTo(viewerFor(auth)).thread(threadId), mayAnswer: (auth, threadId, requestId) => cardAnswerRefusal(auth, threadId, requestId, "allow") === null, viewer: (auth) => placeInboxViewer(auth, { personal: CLOUD_PERSONAL, owner: cloudOwnerSession, personOf: personKey }), guestOf: (threadId) => { if (!CLOUD_PERSONAL || !cloudGuestDriven(threadId)) return null; const person = [...cloudThreadStarters(threadId), threadPersonKey(threadId)].find((one) => one && one !== CLOUD_OUTSIDE_KEY && !cloudOwnerPerson(one)); return person ?? null; }, guestName: (threadId) => guestNameIn(store.messagesFor(threadId)), handedBy: (threadId) => { const from = delegatorOf(threadId); return from && from.threadId !== threadId ? from.botId ?? store.botByThread(from.threadId)?.id ?? null : null; } }), team: CLOUD_TEAM, dataDir: DATA_DIR, store, confined: (threadId) => cloudGuestDriven(threadId), people: teamOwners.people, personName: teamHost.personName, audienceOf: teamHost.audienceOf, starters: threadStarters, notify, sees: (person) => visibleTo(person.role === "member" ? { kind: "member", email: person.email } : { kind: "all", email: person.email }), inbox: { askedPerson: teamOwners.routing.askedPerson, delivered: (item, delivery) => teamAway.delivered(item, delivery), changed: (threadId) => { const bot = store.botByThread(threadId); if (bot) broadcast({ kind: "bot", bot: wireBot(bot) }); }, ensureOwnBot: (email) => { ensureDefaultBot(store, { dataDir: DATA_DIR, person: email, team: CLOUD_TEAM?.name ?? null, opened: (made) => void mausbotOwnChat.claim(made) }); }, handedFrom: (threadId) => { const from = delegatorOf(threadId); return from && from.threadId !== threadId ? from.threadId : null; }, continueTurn: relayedTurn({ store, startTurn, state: (botId, threadId) => ({ atCapacity: botAtThreadCapacity(botId, threadId), threadBusy: threadBusy(botId, threadId), groupTurn: roomTurnHolds(activeGroupTurnForBot(botId), threadId, false), parksBehindCoordination: parksBehindCoordination(botId, threadId) }) }), representative: { generate: async (botId, prompt) => (await sideJobs.text("representative", botId)?.generateText(prompt, { timeoutMs: 60_000 })) ?? null, busy: createPersonCalendar({ access: (person) => teamConnections.personApps().includes("googlecalendar") ? teamConnections.people.appsAccess(person) : null, connected: async (access) => (await composio.connectedServices(...teamConnections.via(access))).googlecalendar?.connected === true, relay: (payload, session, signal, access) => composio.relayMcp(teamConnections.via(access)[0], payload as never, session, undefined, signal, teamConnections.via(access)[1]) }).busy } } });+}); const teamMessages = createTeamMessages({ place: CLOUD_TEAM ? null : createPlaceInbox({ dataDir: DATA_DIR, store, openCards: openCardRows, live: (threadId, requestId) => askMessageByRequest.has(`${threadId}:${requestId}`), waiting: () => personWaits.waiting(), send: (notification) => { broadcast({ kind: "notify", notification: logNotification(notification) }); }, sees: (auth, threadId) => visibleTo(viewerFor(auth)).thread(threadId), mayAnswer: (auth, threadId, requestId) => cardAnswerRefusal(auth, threadId, requestId, "allow") === null, viewer: (auth) => placeInboxViewer(auth, { personal: CLOUD_PERSONAL, owner: cloudOwnerSession, personOf: personKey }), guestOf: (threadId) => { if (!CLOUD_PERSONAL || !cloudGuestDriven(threadId)) return null; const person = [...cloudThreadStarters(threadId), threadPersonKey(threadId)].find((one) => one && one !== CLOUD_OUTSIDE_KEY && !cloudOwnerPerson(one)); return person ?? null; }, guestName: (threadId) => guestNameIn(store.messagesFor(threadId)), handedBy: (threadId) => { const from = delegatorOf(threadId); return from && from.threadId !== threadId ? from.botId ?? store.botByThread(from.threadId)?.id ?? null : null; } }), named: { personNames: (threadId) => [cfg.profile?.name, CLOUD_PERSONAL && cloudGuestDriven(threadId) ? guestNameIn(store.messagesFor(threadId)) : undefined], elsewhere: (to) => botsElsewhere(botLink.link, (name) => botLink.explain(name, placesElsewhere), to) }, team: CLOUD_TEAM, dataDir: DATA_DIR, store, confined: (threadId) => cloudGuestDriven(threadId), people: teamOwners.people, personName: teamHost.personName, audienceOf: teamHost.audienceOf, starters: threadStarters, notify, sees: (person) => visibleTo(person.role === "member" ? { kind: "member", email: person.email } : { kind: "all", email: person.email }), inbox: { askedPerson: teamOwners.routing.askedPerson, delivered: (item, delivery) => teamAway.delivered(item, delivery), changed: (threadId) => { const bot = store.botByThread(threadId); if (bot) broadcast({ kind: "bot", bot: wireBot(bot) }); }, ensureOwnBot: (email) => { ensureDefaultBot(store, { dataDir: DATA_DIR, person: email, team: CLOUD_TEAM?.name ?? null, opened: (made) => void mausbotOwnChat.claim(made) }); }, handedFrom: (threadId) => { const from = delegatorOf(threadId); return from && from.threadId !== threadId ? from.threadId : null; }, continueTurn: relayedTurn({ store, startTurn, state: (botId, threadId) => ({ atCapacity: botAtThreadCapacity(botId, threadId), threadBusy: threadBusy(botId, threadId), groupTurn: roomTurnHolds(activeGroupTurnForBot(botId), threadId, false), parksBehindCoordination: parksBehindCoordination(botId, threadId) }) }), representative: { generate: async (botId, prompt) => (await sideJobs.text("representative", botId)?.generateText(prompt, { timeoutMs: 60_000 })) ?? null, busy: createPersonCalendar({ access: (person) => teamConnections.personApps().includes("googlecalendar") ? teamConnections.people.appsAccess(person) : null, connected: async (access) => (await composio.connectedServices(...teamConnections.via(access))).googlecalendar?.connected === true, relay: (payload, session, signal, access) => composio.relayMcp(teamConnections.via(access)[0], payload as never, session, undefined, signal, teamConnections.via(access)[1]) }).busy } } });const imageTools = createImageToolRoutes({ config: () => cfg, dataDir: DATA_DIR, liveTurn: (threadId) => liveTurnByThread.get(threadId), key: turnAttachmentKey, images: (key) => (turnAttachmentsByTurn.get(key) ?? []).filter((item) => item.kind === "image").length, park: (key, image) => { const saved = saveImage(image.bytes, image.mime); turnAttachmentsByTurn.set(key, [...turnAttachmentsByTurn.get(key) ?? [], { kind: "image", path: saved.path, mime: saved.mime }]); } });const noAiNotice = createNoAiNotice({ team: CLOUD_TEAM, dataDir: DATA_DIR, people: () => teamOwners.people?.list() ?? [], personName: teamHost.personName, inbox: () => teamMessages.inbox, language: personLanguages.forLine, threadLanguage: conversationLanguage });const botNameClash = createBotNameClash({ store, people: () => teamMessages.people(), profileName: () => cfg.profile?.name });diff --git a/server/testing/team-inbox-fixture.ts b/server/testing/team-inbox-fixture.tsindex b3d69b5df9..15f6afab5a 100644--- a/server/testing/team-inbox-fixture.ts+++ b/server/testing/team-inbox-fixture.ts@@ -7,6 +7,7 @@ import { join } from "node:path";import { botOwner } from "../../shared/bot-owner.ts";import type { Notification } from "../../shared/notification.ts";import { audienceMember, memberAudience, roomAudience, type Audience } from "../audience.ts";+import { createPlaceInbox } from "../host/place-inbox.ts";import { createTeamMessages, type TeamMessagesDeps } from "../host/team-messages.ts";import { personKey } from "../person-key.ts";import type { RequestAuth } from "../request-auth.ts";@@ -23,7 +24,7 @@ export const session = (email: string) => ({ kind: "session", scopes: ["client"]type Task = { threadId: string; title: string; archivedAt?: number; activity?: string; routineRunId?: string };type Bot = Partial<Omit<BotRecord, "tasks">> & { id: string; name: string; threadId: string; tasks: Task[] };-export function teamInbox(options: { team?: boolean; representative?: TeamMessagesDeps["inbox"]["representative"]; noChiefFor?: string[]; handed?: Record<string, string>; confined?: string[] } = {}) {+export function teamInbox(options: { team?: boolean; place?: boolean; named?: TeamMessagesDeps["named"]; representative?: TeamMessagesDeps["inbox"]["representative"]; noChiefFor?: string[]; handed?: Record<string, string>; confined?: string[] } = {}) {const dataDir = mkdtempSync(join(tmpdir(), "omb-team-inbox-"));const listeners = new Set<(change: StoreChange) => void>();const emit = (change: StoreChange) => { for (const listener of listeners) listener(change); };@@ -90,6 +91,10 @@ export function teamInbox(options: { team?: boolean; representative?: TeamMessagconst changed: string[] = [];const make = () => createTeamMessages({team: options.team === false ? null : { id: "team-acme", name: "Acme" },+ // A place that is no team's (this computer, or a Cloud of one person): its one inbox.+ ...(options.place ? { place: createPlaceInbox({ dataDir, store: store as never, openCards: () => [], live: () => false, viewer: () => ({ kind: "owner" }), sees: () => true,+ mayAnswer: () => true, guestOf: () => null, guestName: () => undefined, handedBy: () => null, send: (notification) => { notified.push(notification); }, now: tick }) } : {}),+ ...(options.named ? { named: options.named } : {}),dataDir,now: tick,store: store as never,