Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat(desktop): add an SSH computer to a network with one click
leepokaib6f85d9b9728
diff --git a/apps/desktop/src/renderer/store/network.ts b/apps/desktop/src/renderer/store/network.tsindex 39a2c52a..19beb6db 100644--- a/apps/desktop/src/renderer/store/network.ts+++ b/apps/desktop/src/renderer/store/network.ts@@ -1,4 +1,4 @@-import type { NetworkRule, NetworkView } from '@shared/network'+import type { Network, NetworkRule, NetworkView } from '@shared/network'import type { BotStore } from './bot-store'/**@@ -30,6 +30,9 @@ async function changing<T>(store: BotStore, work: () => Promise<T>): Promise<T>return result}+/** `other`'s own copy of `net`: none when it isn't in it, or its host is too old to say. */+export const copyOf = (net: Network, other: BotStore) => other.network?.networks.find((n) => n.key !== undefined && n.key === net.key)+/** An empty field is the host's default. */const orNull = (text: string) => text.trim() || null@@ -49,6 +52,12 @@ export const network = {changing(store, () => call(store, 'networkJoin', { invite: invite.trim(), network: orNull(networkName), name: orNull(name), connector }, SLOW)),leave: (store: BotStore, network: string) => changing(store, () => call(store, 'networkLeave', { network })),invite: (store: BotStore, network: string) => call<{ invite: string; expiresAt: number }>(store, 'networkInvite', { network }),+ /** Puts `other`, a computer this app manages over SSH, in `net`: an invite made here, used there with the same connector. */+ add: async (store: BotStore, net: Network, other: BotStore) => {+ const { invite } = await network.invite(store, net.id)+ await network.join(other, invite, '', '', net.connector)+ await refreshNetwork(store)+ },promote: (store: BotStore, network: string, computer: string) => changing(store, () => call(store, 'networkPromote', { network, computer })),remove: (store: BotStore, network: string, computer: string, cascade: boolean) =>changing(store, () => call(store, 'networkRemove', { network, computer, cascade })),diff --git a/apps/desktop/src/renderer/views/settings/NetworkCard.tsx b/apps/desktop/src/renderer/views/settings/NetworkCard.tsxindex 9ef52977..181ce6e5 100644--- a/apps/desktop/src/renderer/views/settings/NetworkCard.tsx+++ b/apps/desktop/src/renderer/views/settings/NetworkCard.tsx@@ -4,6 +4,7 @@ import { HStack, VStack } from '../../components/Stack'import { Text } from '../../components/Text'import { botsTemplate, moved, presenceTitle, roleTitle, ruleLine } from '../../lib/network-copy'import { useTr } from '../../lib/use-language'+import type { BotStore } from '../../store/bot-store'/** What a network card asks its section to do. */export interface NetworkActions {@@ -13,12 +14,23 @@ export interface NetworkActions {leave: () => voidpromote: (computer: NetworkComputer) => voidremove: (computer: NetworkComputer) => void- addRule: () => void- setRules: (rules: NetworkRule[]) => void+ /** Puts a computer this one manages over SSH in the network. */+ add: (computer: BotStore) => void+ addRule: (of: RulesOf) => void+ setRules: (of: RulesOf, rules: NetworkRule[]) => void}-/** One of this computer's networks: who is in it, and who may message the bots here. */-export function NetworkCard({ net, several, disabled, act }: { net: Network; several: boolean; disabled: boolean; act: NetworkActions }) {+/** A computer's own copy of a network, whose rules say who may message its bots. */+export interface RulesOf {+ store: BotStore+ net: Network+}++/**+ * One of this computer's networks: who is in it, the computers it manages over SSH that aren't+ * (`outside`), and who may message the bots on each computer here that is (`rulesOf`, this one first).+ */+export function NetworkCard({ net, outside, rulesOf, several, disabled, act }: { net: Network; outside: BotStore[]; rulesOf: RulesOf[]; several: boolean; disabled: boolean; act: NetworkActions }) {const tr = useTr()const title = (<HStack as="span" gap={8}>@@ -43,21 +55,38 @@ export function NetworkCard({ net, several, disabled, act }: { net: Network; sev{net.computers.map((c) => (<ComputerRow key={c.name} computer={c} disabled={disabled} promote={() => act.promote(c)} remove={() => act.remove(c)} />))}- </CardSection>- <CardSection- title="Who may message bots here"- accessory={<IconButton title="Add rule" icon="plus" disabled={disabled} onClick={act.addRule} />}- footer="The first rule that matches decides. Without rules, every computer in the network may message every bot here. Answers to this computer's own messages always get in."- >- {net.rules.map((rule, i) => (- <HStack key={i} gap={4} className="settings-row settings-appear">- <Text grow>{ruleLine(rule, net, tr)}</Text>- <IconButton title="Move up" icon="chevron.up" disabled={disabled || i === 0} onClick={() => act.setRules(moved(net.rules, i, -1))} />- <IconButton title="Move down" icon="chevron.down" disabled={disabled || i === net.rules.length - 1} onClick={() => act.setRules(moved(net.rules, i, 1))} />- <IconButton title="Delete rule" icon="trash" disabled={disabled} onClick={() => act.setRules(net.rules.filter((_, j) => j !== i))} />+ {outside.map((o) => (+ <HStack key={o.computer.id} gap={8} className="settings-row settings-appear">+ <span className="network-dot" aria-hidden />+ <VStack grow className="settings-stack">+ <Text>{o.hostName}</Text>+ <Text size="caption" tone="secondary">{`${tr('Over SSH')} · ${tr('Not in the network')}`}</Text>+ </VStack>+ <IconButton title="Add to the network" icon="plus" disabled={disabled || o.connection.kind !== 'online' || o.mismatch !== null} onClick={() => act.add(o)} /></HStack>))}</CardSection>+ {rulesOf.map((of, n) => (+ <CardSection+ key={of.store.computer.id}+ title={rulesOf.length > 1 ? tr('Who may message bots on {name}').replaceAll('{name}', of.net.computer) : 'Who may message bots here'}+ accessory={<IconButton title="Add rule" icon="plus" disabled={disabled} onClick={() => act.addRule(of)} />}+ footer={+ n === rulesOf.length - 1+ ? "The first rule that matches decides. Without rules, every computer in the network may message every bot here. Answers to this computer's own messages always get in."+ : null+ }+ >+ {of.net.rules.map((rule, i) => (+ <HStack key={i} gap={4} className="settings-row settings-appear">+ <Text grow>{ruleLine(rule, of.net, tr)}</Text>+ <IconButton title="Move up" icon="chevron.up" disabled={disabled || i === 0} onClick={() => act.setRules(of, moved(of.net.rules, i, -1))} />+ <IconButton title="Move down" icon="chevron.down" disabled={disabled || i === of.net.rules.length - 1} onClick={() => act.setRules(of, moved(of.net.rules, i, 1))} />+ <IconButton title="Delete rule" icon="trash" disabled={disabled} onClick={() => act.setRules(of, of.net.rules.filter((_, j) => j !== i))} />+ </HStack>+ ))}+ </CardSection>+ ))}</VStack>)}diff --git a/apps/desktop/src/renderer/views/settings/NetworkSection.tsx b/apps/desktop/src/renderer/views/settings/NetworkSection.tsxindex cab02ab9..1aff4f05 100644--- a/apps/desktop/src/renderer/views/settings/NetworkSection.tsx+++ b/apps/desktop/src/renderer/views/settings/NetworkSection.tsx@@ -4,11 +4,12 @@ import { Button } from '../../components/Controls'import { Dialog, Sheet } from '../../components/Overlay'import { HStack, VStack } from '../../components/Stack'import { Text } from '../../components/Text'-import { useModel } from '../../lib/observable'+import { useModel, useModels } from '../../lib/observable'import { useTr } from '../../lib/use-language'import type { BotStore } from '../../store/bot-store'-import { network, refreshNetwork } from '../../store/network'-import { NetworkCard } from './NetworkCard'+import { useApp } from '../../store/context'+import { copyOf, network, refreshNetwork } from '../../store/network'+import { NetworkCard, type RulesOf } from './NetworkCard'import { InviteSheet, NetworkSetupSheet, RecoverSheet, RecoveryCodeSheet } from './NetworkSheets'import { errorText } from './parts'import { RuleSheet } from './RuleSheet'@@ -17,7 +18,8 @@ import './network.css'/** A sheet or dialog open for one network. */type Open =| { kind: 'create' | 'join' }- | { kind: 'invite' | 'recover' | 'rule' | 'leave'; net: Network }+ | { kind: 'invite' | 'recover' | 'leave'; net: Network }+ | { kind: 'rule'; of: RulesOf }| { kind: 'remove'; net: Network; computer: NetworkComputer }/**@@ -25,10 +27,20 @@ type Open =* network, with who is in it and who may message the bots here, and making or joining another.* Empty on hosts without `networkView`. Membership is decided here, at the computer; phones* only see it.+ *+ * The computer the app runs on is the master of the ones it manages over SSH: its cards add them+ * and hold their rules, so a network it shares with one shows once, in its card. Their own+ * sections show only the networks it isn't in, and make or join none.*/export function NetworkSection({ store, heading }: { store: BotStore; /** The computer's name when the page lists several; else the section's own title. */ heading?: string }) {const tr = useTr()+ const app = useApp()useModel(store)+ const isLocal = store === app.local+ const master = isLocal ? null : app.local+ const others = isLocal ? app.managedStores.filter((s) => s !== store) : []+ useModel(master)+ useModels(others)const [open, setOpen] = useState<Open | null>(null)const [busy, setBusy] = useState(false)const view = store.network@@ -41,6 +53,8 @@ export function NetworkSection({ store, heading }: { store: BotStore; /** The co// A host without networks shows its page empty, with what they are for when it is the only computer.if (!view) return heading ? null : <Text size="callout" tone="secondary">{tr('Connect your computers so bots on one can message bots on another.')}</Text>+ const nets = master ? view.networks.filter((net) => !copyOf(net, master)) : view.networks+ if (master && nets.length === 0) return nullconst run = (work: () => Promise<unknown>) => {setBusy(true)@@ -50,10 +64,15 @@ export function NetworkSection({ store, heading }: { store: BotStore; /** The co}const close = () => setOpen(null)const several = view.networks.length > 1- const sheetFor = (kind: 'invite' | 'recover' | 'rule') => (open && open.kind === kind ? open.net : null)+ // The computers this one manages over SSH that are in `net` too, each with its own copy.+ const inside = (net: Network): RulesOf[] => others.flatMap((o) => {+ const theirs = copyOf(net, o)+ return theirs ? [{ store: o, net: theirs }] : []+ })+ const sheetFor = (kind: 'invite' | 'recover') => (open && open.kind === kind ? open.net : null)const invite = sheetFor('invite')const recover = sheetFor('recover')- const rule = sheetFor('rule')+ const rule = open?.kind === 'rule' ? open.of : nullconst removing = open?.kind === 'remove' ? open : nullconst leaving = open?.kind === 'leave' ? open.net : null@@ -63,10 +82,12 @@ export function NetworkSection({ store, heading }: { store: BotStore; /** The co<Text as="h3" size="body" weight="semibold" tone="text">{heading ?? tr('Network')}</Text><Text as="span" size="caption" weight="semibold" className="beta-tag">{tr('Beta')}</Text></HStack>- {view.networks.map((net) => (+ {nets.map((net) => (<NetworkCardkey={net.id}net={net}+ outside={net.canInvite ? others.filter((o) => !copyOf(net, o)) : []}+ rulesOf={[{ store, net }, ...inside(net)]}several={several}disabled={busy || !manageable}act={{@@ -76,18 +97,21 @@ export function NetworkSection({ store, heading }: { store: BotStore; /** The coleave: () => setOpen({ kind: 'leave', net }),promote: (c) => run(() => network.promote(store, net.id, c.name)),remove: (computer) => setOpen({ kind: 'remove', net, computer }),- addRule: () => setOpen({ kind: 'rule', net }),- setRules: (rules) => run(() => network.setRules(store, net.id, rules)),+ add: (other) => run(() => network.add(store, net, other)),+ addRule: (of) => setOpen({ kind: 'rule', of }),+ setRules: (of, rules) => run(() => network.setRules(of.store, of.net.id, rules)),}}/>))}- <VStack gap={10} className="settings-appear">- {view.joined ? null : <Text size="callout" tone="secondary">{tr('Connect your computers so bots on one can message bots on another.')}</Text>}- <HStack gap={8}>- <Button kind="secondary" disabled={!manageable} onClick={() => setOpen({ kind: 'create' })}>Create network</Button>- <Button kind="secondary" disabled={!manageable} onClick={() => setOpen({ kind: 'join' })}>Join with invite</Button>- </HStack>- </VStack>+ {master ? null : (+ <VStack gap={10} className="settings-appear">+ {view.joined ? null : <Text size="callout" tone="secondary">{tr('Connect your computers so bots on one can message bots on another.')}</Text>}+ <HStack gap={8}>+ <Button kind="secondary" disabled={!manageable} onClick={() => setOpen({ kind: 'create' })}>Create network</Button>+ <Button kind="secondary" disabled={!manageable} onClick={() => setOpen({ kind: 'join' })}>Join with invite</Button>+ </HStack>+ </VStack>+ )}<Sheet open={open?.kind === 'create' || open?.kind === 'join'} onClose={close}><NetworkSetupSheet key={open?.kind} store={store} joining={open?.kind === 'join'} />@@ -99,7 +123,7 @@ export function NetworkSection({ store, heading }: { store: BotStore; /** The co{recover ? <RecoverSheet key={recover.id} store={store} net={recover} /> : null}</Sheet><Sheet open={rule !== null} onClose={close}>- {rule ? <RuleSheet key={rule.id} store={store} net={rule} /> : null}+ {rule ? <RuleSheet key={`${rule.store.computer.id}/${rule.net.id}`} store={rule.store} net={rule.net} /> : null}</Sheet>{/* Escape and the dim don't close it: only "I saved it" does. */}<Sheet open={store.recoveryCode !== null} onClose={() => {}}>diff --git a/apps/desktop/src/shared/network.ts b/apps/desktop/src/shared/network.tsindex 2dbdbb59..27fe1965 100644--- a/apps/desktop/src/shared/network.ts+++ b/apps/desktop/src/shared/network.ts@@ -28,6 +28,8 @@ export interface NetworkRule {export interface Network {/** What the host calls it in `network` arguments. */id: string+ /** The network's own id, the same on every computer in it; absent on hosts before 2.29.0. */+ key?: string/** What the user calls it (`home`). */name: string/** This computer's name and role there. */diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.jsonindex f0e176c4..bb3a8fac 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json@@ -1306,6 +1306,8 @@"Remove with its invites": "Mit seinen Einladungen entfernen","Make admin": "Zum Admin machen","Remove from the network": "Aus dem Netzwerk entfernen",+ "Add to the network": "Zum Netzwerk hinzufügen",+ "Not in the network": "Nicht im Netzwerk","y copy · s I saved it": "y kopieren · s gespeichert","Getting an invite…": "Einladung wird geholt…","y copy · n new invite · esc back": "y kopieren · n neue Einladung · esc zurück",@@ -1341,6 +1343,7 @@"It makes another computer the owner of {network} if {name} is lost. It's shown only once and kept on no computer.": "Damit wird ein anderer Computer Eigentümer von {network}, falls {name} verloren geht. Er wird nur einmal angezeigt und auf keinem Computer gespeichert.","Bots message the bots on these computers as bot@computer.{network}.": "Bots schreiben den Bots auf diesen Computern als bot@computer.{network}.","Who may message bots here": "Wer den Bots hier schreiben darf",+ "Who may message bots on {name}": "Wer den Bots auf {name} schreiben darf","The first rule that matches decides. Without rules, every computer in the network may message every bot here. Answers to this computer's own messages always get in.": "Die erste passende Regel entscheidet. Ohne Regeln darf jeder Computer im Netzwerk jedem Bot hier schreiben. Antworten auf eigene Nachrichten dieses Computers kommen immer an.","Add rule": "Regel hinzufügen","Delete rule": "Regel löschen",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.jsonindex 11930cbc..deea8cba 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json@@ -1306,6 +1306,8 @@"Remove with its invites": "Quitar con sus invitadas","Make admin": "Hacer administrador","Remove from the network": "Quitar de la red",+ "Add to the network": "Añadir a la red",+ "Not in the network": "No está en la red","y copy · s I saved it": "y copiar · s ya lo guardé","Getting an invite…": "Obteniendo una invitación…","y copy · n new invite · esc back": "y copiar · n nueva invitación · esc volver",@@ -1341,6 +1343,7 @@"It makes another computer the owner of {network} if {name} is lost. It's shown only once and kept on no computer.": "Hace propietaria de {network} a otra computadora si pierdes {name}. Solo se muestra una vez y no se guarda en ninguna computadora.","Bots message the bots on these computers as bot@computer.{network}.": "Los bots escriben a los bots de estas computadoras como bot@computadora.{network}.","Who may message bots here": "Quién puede escribir a los bots de aquí",+ "Who may message bots on {name}": "Quién puede escribir a los bots de {name}","The first rule that matches decides. Without rules, every computer in the network may message every bot here. Answers to this computer's own messages always get in.": "Decide la primera regla que coincida. Sin reglas, cada computadora de la red puede escribir a cada bot de aquí. Las respuestas a los mensajes de esta computadora siempre llegan.","Add rule": "Añadir regla","Delete rule": "Eliminar regla",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.jsonindex 304efd0d..a7095843 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json@@ -1306,6 +1306,8 @@"Remove with its invites": "Retirer avec ses invités","Make admin": "Nommer admin","Remove from the network": "Retirer du réseau",+ "Add to the network": "Ajouter au réseau",+ "Not in the network": "Pas dans le réseau","y copy · s I saved it": "y copier · s je l'ai enregistré","Getting an invite…": "Obtention d'une invitation…","y copy · n new invite · esc back": "y copier · n nouvelle invitation · esc retour",@@ -1341,6 +1343,7 @@"It makes another computer the owner of {network} if {name} is lost. It's shown only once and kept on no computer.": "Il fait d'un autre ordinateur le propriétaire de {network} si {name} est perdu. Il n'est affiché qu'une fois et n'est gardé sur aucun ordinateur.","Bots message the bots on these computers as bot@computer.{network}.": "Les bots écrivent aux bots de ces ordinateurs avec bot@ordinateur.{network}.","Who may message bots here": "Qui peut écrire aux bots d'ici",+ "Who may message bots on {name}": "Qui peut écrire aux bots de {name}","The first rule that matches decides. Without rules, every computer in the network may message every bot here. Answers to this computer's own messages always get in.": "La première règle qui correspond décide. Sans règles, chaque ordinateur du réseau peut écrire à chaque bot d'ici. Les réponses aux messages de cet ordinateur arrivent toujours.","Add rule": "Ajouter une règle","Delete rule": "Supprimer la règle",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.jsonindex e58a49f6..149f0e46 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json@@ -1306,6 +1306,8 @@"Remove with its invites": "招待したものごと削除","Make admin": "管理者にする","Remove from the network": "ネットワークから削除",+ "Add to the network": "ネットワークに追加",+ "Not in the network": "ネットワーク外","y copy · s I saved it": "y コピー · s 保存しました","Getting an invite…": "招待を取得しています…","y copy · n new invite · esc back": "y コピー · n 新しい招待 · esc 戻る",@@ -1341,6 +1343,7 @@"It makes another computer the owner of {network} if {name} is lost. It's shown only once and kept on no computer.": "{name} をなくしたとき、ほかのコンピューターを {network} のオーナーにできます。表示されるのは今回だけで、どのコンピューターにも保存されません。","Bots message the bots on these computers as bot@computer.{network}.": "ボットは bot@コンピューター.{network} でこれらのコンピューターのボットにメッセージを送ります。","Who may message bots here": "ここのボットにメッセージを送れる相手",+ "Who may message bots on {name}": "{name} のボットにメッセージを送れる相手","The first rule that matches decides. Without rules, every computer in the network may message every bot here. Answers to this computer's own messages always get in.": "最初に一致したルールで決まります。ルールがなければ、ネットワーク内のすべてのコンピューターがここのすべてのボットにメッセージを送れます。このコンピューターが送ったメッセージへの返信は常に届きます。","Add rule": "ルールを追加","Delete rule": "ルールを削除",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.jsonindex 3e80d9e9..59c8388a 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json@@ -1306,6 +1306,8 @@"Remove with its invites": "초대한 컴퓨터와 함께 제거","Make admin": "관리자로 지정","Remove from the network": "네트워크에서 제거",+ "Add to the network": "네트워크에 추가",+ "Not in the network": "네트워크에 없음","y copy · s I saved it": "y 복사 · s 저장했습니다","Getting an invite…": "초대를 받는 중…","y copy · n new invite · esc back": "y 복사 · n 새 초대 · esc 뒤로",@@ -1341,6 +1343,7 @@"It makes another computer the owner of {network} if {name} is lost. It's shown only once and kept on no computer.": "{name}을(를) 잃어버리면 다른 컴퓨터를 {network}의 소유자로 만들 수 있습니다. 이번 한 번만 표시되며 어떤 컴퓨터에도 저장되지 않습니다.","Bots message the bots on these computers as bot@computer.{network}.": "봇은 bot@컴퓨터.{network} 형식으로 이 컴퓨터들의 봇에게 메시지를 보냅니다.","Who may message bots here": "여기 봇에게 메시지를 보낼 수 있는 대상",+ "Who may message bots on {name}": "{name} 봇에게 메시지를 보낼 수 있는 대상","The first rule that matches decides. Without rules, every computer in the network may message every bot here. Answers to this computer's own messages always get in.": "처음 일치하는 규칙이 결정합니다. 규칙이 없으면 네트워크의 모든 컴퓨터가 여기 모든 봇에게 메시지를 보낼 수 있습니다. 이 컴퓨터가 보낸 메시지에 대한 답장은 항상 들어옵니다.","Add rule": "규칙 추가","Delete rule": "규칙 삭제",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.jsonindex e8c95c60..f48e2b8b 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json@@ -1306,6 +1306,8 @@"Remove with its invites": "连同它邀请的一起移除","Make admin": "设为管理员","Remove from the network": "从网络移除",+ "Add to the network": "加入网络",+ "Not in the network": "不在网络里","y copy · s I saved it": "y 复制 · s 我已保存","Getting an invite…": "正在获取邀请…","y copy · n new invite · esc back": "y 复制 · n 新的邀请 · esc 返回",@@ -1341,6 +1343,7 @@"It makes another computer the owner of {network} if {name} is lost. It's shown only once and kept on no computer.": "{name} 丢失时,它能让另一台电脑成为 {network} 的所有者。只会显示这一次,也不会存在任何电脑上。","Bots message the bots on these computers as bot@computer.{network}.": "Bot 用 bot@电脑.{network} 给这些电脑上的 Bot 发消息。","Who may message bots here": "谁可以给这里的 Bot 发消息",+ "Who may message bots on {name}": "谁可以给 {name} 上的 Bot 发消息","The first rule that matches decides. Without rules, every computer in the network may message every bot here. Answers to this computer's own messages always get in.": "由第一条匹配的规则决定。没有规则时,网络里的每台电脑都能给这里的每个 Bot 发消息。回复这台电脑自己发出的消息一律可以进来。","Add rule": "添加规则","Delete rule": "删除规则",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.jsonindex f6b15a1c..433f473c 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json@@ -1306,6 +1306,8 @@"Remove with its invites": "連同它邀請的一起移除","Make admin": "設為管理員","Remove from the network": "從網路移除",+ "Add to the network": "加入網路",+ "Not in the network": "不在網路裡","y copy · s I saved it": "y 複製 · s 我已儲存","Getting an invite…": "正在取得邀請…","y copy · n new invite · esc back": "y 複製 · n 新的邀請 · esc 返回",@@ -1341,6 +1343,7 @@"It makes another computer the owner of {network} if {name} is lost. It's shown only once and kept on no computer.": "{name} 遺失時,它能讓另一臺電腦成為 {network} 的擁有者。只會顯示這一次,也不會存在任何電腦上。","Bots message the bots on these computers as bot@computer.{network}.": "Bot 用 bot@電腦.{network} 傳訊息給這些電腦上的 Bot。","Who may message bots here": "誰可以傳訊息給這裡的 Bot",+ "Who may message bots on {name}": "誰可以傳訊息給 {name} 上的 Bot","The first rule that matches decides. Without rules, every computer in the network may message every bot here. Answers to this computer's own messages always get in.": "由第一條符合的規則決定。沒有規則時,網路裡的每臺電腦都能傳訊息給這裡的每個 Bot。回覆這臺電腦自己送出的訊息一律可以進來。","Add rule": "新增規則","Delete rule": "刪除規則",diff --git a/docs/features/codync-network.md b/docs/features/codync-network.mdindex 6a2275b9..0dcebc9f 100644--- a/docs/features/codync-network.md+++ b/docs/features/codync-network.md@@ -30,6 +30,16 @@ offers only what this computer may do to it: the host says so per row (`canRemov`Role::removes` and `Role::promotes` in the crate) and for this computer (`canInvite` from `Role::invites`,`canRecover`), so the apps never work out the role rules themselves.+The desktop app adds the computers it manages over SSH without a pasted invite: under each network where this+computer has `canInvite`, it lists every SSH computer whose own view has no network with the same `key`, and+**Add to the network** makes an invite here (`networkInvite`) and joins with it there (`networkJoin` through the+tunnel, the network's connector, the default name). Only the computer the app runs on adds; an SSH computer's+section never offers to add this one (the master → slave direction of Computers). A network both are in shows+once, in this computer's card, with one rules list per computer in it ("Who may message bots on …", each saved+on its own host); an SSH computer's own section lists only the networks this one isn't in, without Create or Join.+Once added, the bots on both computers may message each other (no rules = everyone in the network): adding a+computer is the permission.+The iPhone and Android apps read the network from the event stream's hello and through `networkView` (allowed forpaired devices over the encrypted channel): the computers with their roles, presence and offered bots, and whethercloud assistants are on (`assistants`) and can reach the computer at all (`assistantsAvailable`: it's in a Codync@@ -62,7 +72,8 @@ reaches no other, connectors differ per network (a private home network, a workwire changed. The cost is one endpoint per network.- The view (`networkView`, the `network` event, the hello) lists `networks`, the first being the default, each with- its `id`, `name`, this computer's name and role there, `canInvite`/`canRecover`, `connector`, `computers` and+ its `id` (local to this computer), `key` (the network's own id, its root key: the same on every computer in it),+ `name`, this computer's name and role there, `canInvite`/`canRecover`, `connector`, `computers` and`rules`. Methods take `network` (`networkInvite`, `networkRemove`, `setNetworkRules`, …); `networkLeave` stopsthis computer's node for one and deletes its folder (the others list the computer until they remove it).- An invite carries the network's name (`Node::set_network_name`, read with `codync_network::read_invite`), so adiff --git a/host/src/network/api.rs b/host/src/network/api.rsindex 9ce59953..d9d5f614 100644--- a/host/src/network/api.rs+++ b/host/src/network/api.rs@@ -17,8 +17,9 @@ pub fn emit(hub: &Hub) {}/// `networkStatus`, the `network` event and the stream's hello: every network this computer is in-/// (`networks`, the default first), each with its computers as last heard, what this computer may-/// do there (`canInvite`, `canRecover`) and to each (`canRemove`, `canPromote`), and its rules;+/// (`networks`, the default first), each with its `key` (the network's own id, the same on every+/// computer in it), its computers as last heard, what this computer may do there (`canInvite`,+/// `canRecover`) and to each (`canRemove`, `canPromote`), and its rules;/// plus the cloud assistants switch, and whether they can reach this computer at all/// (`assistantsAvailable`). Never an invite: phones read it too.pub fn status(hub: &Hub) -> Value {@@ -47,7 +48,7 @@ fn network(slot: &Slot) -> Value {}).collect();json!({- "id": slot.id, "name": slot.name, "computer": node.name(), "role": mine,+ "id": slot.id, "key": node.network_id(), "name": slot.name, "computer": node.name(), "role": mine,"canInvite": mine.is_some_and(Role::invites), "canRecover": mine.is_some_and(|r| r != Role::Owner),"connector": slot.connector,"computers": computers, "rules": node.rules(),diff --git a/host/tests/network_e2e.rs b/host/tests/network_e2e.rsindex b5f1431d..fa47f000 100644--- a/host/tests/network_e2e.rs+++ b/host/tests/network_e2e.rs@@ -226,6 +226,8 @@ async fn the_network_view_says_who_may_do_what_and_changes_reach_the_apps() {);let home = &theirs["networks"][0];assert_eq!((&home["canInvite"], &home["canRecover"]), (&json!(false), &json!(true)));+ let key = &view["networks"][0]["key"];+ assert!(key.is_string() && *key == home["key"], "one key on every computer: {key} {}", home["key"]);// The owner promotes the laptop: both computers' apps hear of it without asking.let there =diff --git a/web/content/docs/teamwork.mdx b/web/content/docs/teamwork.mdxindex cc1d0ea3..74c3e591 100644--- a/web/content/docs/teamwork.mdx+++ b/web/content/docs/teamwork.mdx@@ -64,6 +64,8 @@ On the first computer, choose **Create network** and give the network a name (foThen add each other computer with a one-time invite, good for an hour while the inviting computer stays on: **Invite a computer** on the owner, then **Join with invite** on the new computer and paste it.+On the desktop, the computers this one uses over SSH skip the invite: each network this computer can invite to lists the ones not in it yet, and **Add to the network** (+) puts one in. From then on the bots on both computers can message each other, and the network's card shows who may message the bots on each of them.+The network lists every computer with its role, whether it answers and how many bots it offers. The owner can make a computer an admin (**Make admin**), which can then invite computers and remove plain members too. **Remove** takes a computer out for good; **Remove with its invites** is for a stolen one, to also remove every computer it added. A computer that was off hears about a removal when it's back.### Several networks