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: show each agent's skills and connectors
forwardxu369466baf89a
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/BotDetailsView.kt b/apps/android/app/src/main/kotlin/com/codync/android/BotDetailsView.ktindex 976c9784..1871d763 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/BotDetailsView.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/BotDetailsView.kt@@ -39,7 +39,9 @@ import kotlinx.coroutines.delay* The details sheet's pages, as on the desktop inspector; no Memory until the read-only memory screen is ported* (docs/plans/android-app.md).*/-internal enum class DetailsTab(val title: String) { Details("Details"), Library("Library"), Settings("Settings") }+internal enum class DetailsTab(val title: String) {+ Details("Details"), Library("Library"), Settings("Settings"), Skills("Skills"), Connectors("Connectors"),+}/*** What to open the details sheet on (iOS `DetailsRequest`): a page, a routine's editor on the Details page, or another bot's@@ -48,7 +50,8 @@ internal enum class DetailsTab(val title: String) { Details("Details"), Library(internal data class DetailsRequest(val tab: DetailsTab = DetailsTab.Details, val routineId: String? = null, val botId: String? = null)/**- * A bot's details (iOS `BotDetailsView`): who it is, then its details, library and settings. Settings save as you edit.+ * A bot's details (iOS `BotDetailsView`): who it is, then its details, library, settings, skills and connectors.+ * Settings save as you edit.* `openArtifact`: an artifact picked in the Library, for the chat's viewer.*/@Composable internal fun BotDetailsView(bot: Bot, request: DetailsRequest, state: AppState, store: AppStore, openArtifact: (OpenArtifact) -> Unit) {@@ -68,7 +71,8 @@ internal data class DetailsRequest(val tab: DetailsTab = DetailsTab.Details, valdelay(600)store.saveSettings(draft)}- val tabs = listOfNotNull(DetailsTab.Details, DetailsTab.Library.takeIf { hasLibrary(state.hello?.text("version")) }, DetailsTab.Settings)+ val tabs = listOfNotNull(DetailsTab.Details, DetailsTab.Library.takeIf { hasLibrary(state.hello?.text("version")) },+ DetailsTab.Settings, DetailsTab.Skills, DetailsTab.Connectors)Box(Modifier.fillMaxSize().background(Palette.background)) {Column(Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(start = 20.dp, end = 20.dp, bottom = 24.dp),horizontalAlignment = Alignment.CenterHorizontally) {@@ -85,6 +89,8 @@ internal data class DetailsRequest(val tab: DetailsTab = DetailsTab.Details, val}DetailsTab.Library -> LibraryView(bot, state, store, openArtifact)DetailsTab.Settings -> BotSettingsForm(state, store, draft, { draft = it }, FormPart.Rarely)+ DetailsTab.Skills -> BotGearPage(bot, state, store, draft, { draft = it }, skills = true)+ DetailsTab.Connectors -> BotGearPage(bot, state, store, draft, { draft = it }, skills = false)}}}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/BotGearPage.kt b/apps/android/app/src/main/kotlin/com/codync/android/BotGearPage.ktnew file mode 100644index 00000000..319defc7--- /dev/null+++ b/apps/android/app/src/main/kotlin/com/codync/android/BotGearPage.kt@@ -0,0 +1,107 @@+package com.codync.android++import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Column+import androidx.compose.runtime.Composable+import androidx.compose.runtime.LaunchedEffect+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableStateOf+import androidx.compose.runtime.remember+import androidx.compose.material3.Text+import androidx.compose.runtime.setValue+import androidx.compose.ui.unit.dp+import com.codync.android.core.Bot+import com.codync.android.core.BotDraft+import com.codync.android.core.LinkState+import com.codync.android.design.*+import kotlinx.serialization.json.JsonArray+import kotlinx.serialization.json.JsonObject+import kotlinx.serialization.json.buildJsonObject+import kotlinx.serialization.json.contentOrNull+import kotlinx.serialization.json.jsonPrimitive+import kotlinx.serialization.json.put++/** One skill or connector the agent keeps for itself (`agentGear`). */+internal data class GearItem(val name: String, val description: String, val detail: String)++internal data class AgentGear(val skills: List<GearItem>, val connectors: List<GearItem>)++/** What `backend` already has in `cwd`. Codync's own skills and connectors are not in this list. */+internal suspend fun AppStore.agentGear(backend: String, cwd: String): AgentGear {+ val body = hostCall("agentGear", buildJsonObject {+ put("backend", backend)+ put("cwd", cwd)+ })+ val obj = body as? JsonObject ?: return AgentGear(emptyList(), emptyList())+ return AgentGear(obj.gearItems("skills"), obj.gearItems("connectors"))+}++private fun JsonObject.gearItems(key: String): List<GearItem> {+ val rows = this[key] as? JsonArray ?: return emptyList()+ return rows.mapNotNull { row ->+ val item = row as? JsonObject ?: return@mapNotNull null+ val name = item["name"]?.jsonPrimitive?.contentOrNull?.trim().orEmpty()+ if (name.isEmpty()) return@mapNotNull null+ GearItem(name, item["description"]?.jsonPrimitive?.contentOrNull.orEmpty(), item["detail"]?.jsonPrimitive?.contentOrNull.orEmpty())+ }+}++/**+ * The Skills or Connectors page: what the bot's agent already brings, then the Codync ones passed on top.+ * `skills` picks the skills page; otherwise the page is connectors.+ */+@Composable internal fun BotGearPage(bot: Bot, state: AppState, store: AppStore, draft: BotDraft, change: (BotDraft) -> Unit, skills: Boolean) {+ val online = state.actualConnection is LinkState.Ready+ val cwd = draft.cwd.ifEmpty { bot.cwd }+ val agent = backendName(state, draft.backend)+ var gear by remember(bot.id) { mutableStateOf<AgentGear?>(null) }+ var failed by remember(bot.id) { mutableStateOf(false) }+ var viewingSkill by remember { mutableStateOf<SkillRef?>(null) }+ LaunchedEffect(draft.backend, cwd, online) {+ gear = null+ failed = false+ if (!online) {+ failed = true+ return@LaunchedEffect+ }+ try {+ gear = store.agentGear(draft.backend, cwd)+ } catch (e: Exception) {+ if (e is kotlinx.coroutines.CancellationException) throw e+ failed = true+ }+ }+ LaunchedEffect(online) { if (online) store.refreshPlugins() }+ val items = if (skills) gear?.skills.orEmpty() else gear?.connectors.orEmpty()+ Column(verticalArrangement = Arrangement.spacedBy(28.dp)) {+ Text(tr("{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.").replace("{agent}", agent),+ style = Type.footnote, color = Palette.secondary)+ CardSection(tr("From {agent}").replace("{agent}", agent)) {+ when {+ gear == null && !failed -> row { Text(tr("Loading…"), style = Type.body, color = Palette.secondary) }+ failed -> row { Text(tr("Couldn't load what this agent brings."), style = Type.body, color = Palette.danger) }+ items.isEmpty() -> row { Text(tr("None from this agent."), style = Type.body, color = Palette.secondary) }+ else -> for (item in items) row {+ val note = if (skills) item.description else item.detail+ Column(verticalArrangement = Arrangement.spacedBy(2.dp)) {+ Text(item.name, style = Type.body, color = Palette.text)+ if (note.isNotEmpty()) Text(note, style = Type.caption, color = Palette.secondary)+ }+ }+ }+ }+ val plugins = state.plugins+ if (skills) {+ PluginToggles("From Codync", "No skills yet. Get some from Extensions, or write your own.",+ plugins?.skills.orEmpty().map { Triple(it.id, it.name, it.description) }, draft.skills.orEmpty(),+ { change(draft.copy(skills = it)) }) { id ->+ plugins?.skills?.firstOrNull { it.id == id }?.let { viewingSkill = SkillRef(it.id, it.name, it.description) }+ }+ } else {+ PluginToggles("From Codync", "No connectors yet. Add GitHub, Linear, Notion and more from Extensions.",+ plugins?.connectors.orEmpty().map { Triple(it.id, it.name, it.command ?: it.url.orEmpty()) },+ draft.connectors ?: plugins?.connectors.orEmpty().map { it.id }, { change(draft.copy(connectors = it)) })+ }+ }+ CodyncSheet(viewingSkill, { viewingSkill = null }) { SkillSheet(it, state, store) }+}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/BotSettingsForm.kt b/apps/android/app/src/main/kotlin/com/codync/android/BotSettingsForm.ktindex f8d04422..4e6527b5 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/BotSettingsForm.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/BotSettingsForm.kt@@ -80,7 +80,6 @@ internal enum class FormPart { All, Often, Rarely }// The agent and its model are on the Details page; what's left is where it works.CardSection("Workspace") { computerRow(state, online); placeRows(draft, change) { folders = true } }CardSection("Activity") { notifyRow(draft, change); manageTeamRow(state, draft, change); reachRows(state, draft, change) }- Plugins(state, draft, change) { viewingSkill = it }}}}diff --git a/apps/desktop/src/renderer/demo/fake-host.ts b/apps/desktop/src/renderer/demo/fake-host.tsindex 8e1ab3d9..a0198242 100644--- a/apps/desktop/src/renderer/demo/fake-host.ts+++ b/apps/desktop/src/renderer/demo/fake-host.ts@@ -244,6 +244,8 @@ export class FakeHost {}case 'routines':return { routines: [], runs: [] }+ case 'agentGear':+ return { skills: [], connectors: [] }case 'skills':case 'connectors':case 'marketSkills':diff --git a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx b/apps/desktop/src/renderer/views/bots/BotEditorView.tsxindex e71532b3..3669c666 100644--- a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx+++ b/apps/desktop/src/renderer/views/bots/BotEditorView.tsx@@ -281,21 +281,25 @@ function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {<NetworkSwitches draft={draft} set={set} /></CardSection>- <PluginToggles- title="Connectors"- empty="No connectors yet. Add GitHub, Linear, Notion and more from Extensions."- items={connectors.map((c) => ({ id: c.id, name: c.name, detail: c.command ?? c.url ?? '' }))}- selection={draft.connectors ?? []}- onChange={(ids) => set('connectors', ids)}- />- <PluginToggles- title="Skills"- empty="No skills yet. Get some from Extensions, or write your own."- items={skills.map((s) => ({ id: s.id, name: s.name, detail: s.description }))}- selection={draft.skills ?? []}- onChange={(ids) => set('skills', ids)}- onInfo={(s) => setViewingSkill({ id: s.id, name: s.name, description: s.detail })}- />+ {part === 'all' ? (+ <>+ <PluginToggles+ title="Connectors"+ empty="No connectors yet. Add GitHub, Linear, Notion and more from Extensions."+ items={connectors.map((c) => ({ id: c.id, name: c.name, detail: c.command ?? c.url ?? '' }))}+ selection={draft.connectors ?? []}+ onChange={(ids) => set('connectors', ids)}+ />+ <PluginToggles+ title="Skills"+ empty="No skills yet. Get some from Extensions, or write your own."+ items={skills.map((s) => ({ id: s.id, name: s.name, detail: s.description }))}+ selection={draft.skills ?? []}+ onChange={(ids) => set('skills', ids)}+ onInfo={(s) => setViewingSkill({ id: s.id, name: s.name, description: s.detail })}+ />+ </>+ ) : null}{error ? <Text size="footnote" tone="danger" className="fade-in">{error}</Text> : null}</div><FormSheet open={viewingSkill !== null} onClose={() => setViewingSkill(null)}>@@ -315,7 +319,7 @@ function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {}/** A card of on/off switches for the connectors or skills installed on the computer. */-function PluginToggles({ title, empty, items, selection, onChange, onInfo }: {+export function PluginToggles({ title, empty, items, selection, onChange, onInfo }: {title: stringempty: stringitems: { id: string; name: string; detail: string }[]diff --git a/apps/desktop/src/renderer/views/bots/GearPage.tsx b/apps/desktop/src/renderer/views/bots/GearPage.tsxnew file mode 100644index 00000000..61f4462e--- /dev/null+++ b/apps/desktop/src/renderer/views/bots/GearPage.tsx@@ -0,0 +1,128 @@+import { useCallback, useEffect, useState } from 'react'+import { draftOf, type BotDraft } from '@shared/models'+import { CardSection } from '../../components/Controls'+import { VStack } from '../../components/Stack'+import { Text } from '../../components/Text'+import { useTr } from '../../lib/use-language'+import { useStore } from '../../store/context'+import { FormSheet } from '../marketplace/pieces'+import { SkillSheet, type SkillRef } from '../marketplace/SkillSheet'+import { PluginToggles } from './BotEditorView'+import { errorText, isValid, normalized, useFollowSaved, usePlugins } from './drafts'+import './bots.css'++interface GearItem {+ name: string+ description?: string+ detail?: string+}++/** The agent's own skills or connectors, then the Codync ones this bot passes on. */+export function GearPage({ botId, kind }: { botId: string; kind: 'skills' | 'connectors' }) {+ const tr = useTr()+ const store = useStore()+ const plugins = usePlugins(store)+ const [draft, setDraft] = useState<BotDraft | null>(null)+ const [gear, setGear] = useState<{ skills: GearItem[]; connectors: GearItem[] } | null>(null)+ const [failed, setFailed] = useState(false)+ const [error, setError] = useState<string | null>(null)+ const [viewingSkill, setViewingSkill] = useState<SkillRef | null>(null)+ const change = useCallback((update: (d: BotDraft) => BotDraft) => setDraft((d) => (d ? update(d) : d)), [])++ useEffect(() => {+ const bot = store.bots.get(botId)+ setDraft(bot ? draftOf(bot) : null)+ }, [botId])+ useFollowSaved(store.bots.get(botId), change)++ const saved = store.bots.get(botId)+ const cwd = draft?.cwd || saved?.cwd || ''+ const backend = draft?.backend ?? ''+ const agent = store.hello?.backends.find((b) => b.id === backend)?.name ?? backend+ const online = store.connection.kind === 'online'++ useEffect(() => {+ const client = store.client+ if (!client || !backend || !online) {+ setFailed(!online)+ return+ }+ let live = true+ setFailed(false)+ setGear(null)+ void client+ .call<{ skills?: GearItem[]; connectors?: GearItem[] }>('agentGear', { backend, cwd })+ .then((value) => {+ if (live) setGear({ skills: value.skills ?? [], connectors: value.connectors ?? [] })+ })+ .catch(() => {+ if (live) setFailed(true)+ })+ return () => {+ live = false+ }+ }, [store, store.client, backend, cwd, online])++ const apply = (next: BotDraft) => {+ setDraft(next)+ if (!isValid(next) || !online) return+ void store+ .save(normalized(next))+ .then(() => setError(null))+ .catch((e: unknown) => setError(errorText(e)))+ }++ if (!draft) return null+ const items = (kind === 'skills' ? gear?.skills : gear?.connectors) ?? []+ const fromAgent = tr('From {agent}').replace('{agent}', agent)+ return (+ <div className="bot-form">+ <div className="bot-form-content">+ <Text size="footnote" tone="secondary">+ {tr('{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.').replace('{agent}', agent)}+ </Text>+ <CardSection title={fromAgent}>+ {failed ? (+ <Text tone="danger">{tr("Couldn't load what this agent brings.")}</Text>+ ) : !gear ? (+ <Text tone="secondary">{tr('Loading…')}</Text>+ ) : items.length === 0 ? (+ <Text tone="secondary">{tr('None from this agent.')}</Text>+ ) : (+ items.map((item) => {+ const note = kind === 'skills' ? item.description : item.detail+ return (+ <VStack key={item.name} gap={2}>+ <Text>{item.name}</Text>+ {note ? <Text size="caption" tone="secondary">{note}</Text> : null}+ </VStack>+ )+ })+ )}+ </CardSection>+ {kind === 'skills' ? (+ <PluginToggles+ title="From Codync"+ empty="No skills yet. Get some from Extensions, or write your own."+ items={(plugins?.skills ?? []).map((s) => ({ id: s.id, name: s.name, detail: s.description }))}+ selection={draft.skills ?? []}+ onChange={(ids) => apply({ ...draft, skills: ids })}+ onInfo={(s) => setViewingSkill({ id: s.id, name: s.name, description: s.detail })}+ />+ ) : (+ <PluginToggles+ title="From Codync"+ empty="No connectors yet. Add GitHub, Linear, Notion and more from Extensions."+ items={(plugins?.connectors ?? []).map((c) => ({ id: c.id, name: c.name, detail: c.command ?? c.url ?? '' }))}+ selection={draft.connectors ?? []}+ onChange={(ids) => apply({ ...draft, connectors: ids })}+ />+ )}+ {error ? <Text size="footnote" tone="danger">{error}</Text> : null}+ </div>+ <FormSheet open={viewingSkill !== null} onClose={() => setViewingSkill(null)}>+ {viewingSkill ? <SkillSheet key={viewingSkill.name} skill={viewingSkill} /> : null}+ </FormSheet>+ </div>+ )+}diff --git a/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx b/apps/desktop/src/renderer/views/thread/DetailsPanel.tsxindex 6c1ec0a2..eb19c72d 100644--- a/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx+++ b/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx@@ -10,6 +10,7 @@ import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { useScreenViewed } from '../../store/analytics'import { BotSettingsPanel } from '../bots/BotEditorView'+import { GearPage } from '../bots/GearPage'import { MemoryCard } from '../bots/MemoryView'import { RoutinesView } from '../routines/RoutinesView'import { LibraryView } from '../library/LibraryView'@@ -19,16 +20,18 @@ import './details-panel.css'import { useTr } from '../../lib/use-language'-export type DetailsTab = 'details' | 'library' | 'memory' | 'settings'+export type DetailsTab = 'details' | 'library' | 'memory' | 'settings' | 'skills' | 'connectors'const TABS: { id: DetailsTab; label: string }[] = [{ id: 'details', label: 'Details' },{ id: 'library', label: 'Library' },{ id: 'memory', label: 'Memory' },{ id: 'settings', label: 'Settings' },+ { id: 'skills', label: 'Skills' },+ { id: 'connectors', label: 'Connectors' },]-/** The inspector beside a conversation (Grok Bot's): who the bot is, then its details, library, memory and settings. */+/** The inspector beside a conversation (Grok Bot's): who the bot is, then its details, library, memory, settings, skills and connectors. */export function DetailsPanel({ botId, routineId, tab, setTab, editGroup, openArtifact, share, close }: {botId: stringroutineId: string | null@@ -68,6 +71,8 @@ export function DetailsPanel({ botId, routineId, tab, setTab, editGroup, openArt<LibraryView botId={botId} openArtifact={openArtifact} />) : tab === 'memory' ? (<MemoryCard botId={botId} />+ ) : tab === 'skills' || tab === 'connectors' ? (+ <GearPage botId={botId} kind={tab} />) : (<BotSettingsPanel botId={botId} part="rarely" />)}diff --git a/apps/ios/Kit/Sources/CodyncKit/Models/Market.swift b/apps/ios/Kit/Sources/CodyncKit/Models/Market.swiftindex 934d45da..2e821cf2 100644--- a/apps/ios/Kit/Sources/CodyncKit/Models/Market.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Models/Market.swift@@ -108,6 +108,41 @@ public struct MarketConnector: Codable, Hashable, Sendable, Identifiable {}}+/// Skills and MCP connectors an agent keeps for itself (`agentGear`). Codync's own are separate.+public struct AgentGear: Decodable, Sendable, Equatable {+ public var skills: [AgentGearItem]+ public var connectors: [AgentGearItem]++ public init(skills: [AgentGearItem] = [], connectors: [AgentGearItem] = []) {+ self.skills = skills+ self.connectors = connectors+ }++ public init(from decoder: Decoder) throws {+ let c = try decoder.container(keyedBy: CodingKeys.self)+ skills = try c.decodeIfPresent([AgentGearItem].self, forKey: .skills) ?? []+ connectors = try c.decodeIfPresent([AgentGearItem].self, forKey: .connectors) ?? []+ }++ private enum CodingKeys: String, CodingKey { case skills, connectors }+}++public struct AgentGearItem: Decodable, Sendable, Equatable, Identifiable {+ public var name: String+ public var description: String+ public var detail: String+ public var id: String { name }++ public init(from decoder: Decoder) throws {+ let c = try decoder.container(keyedBy: CodingKeys.self)+ name = try c.decodeIfPresent(String.self, forKey: .name) ?? ""+ description = try c.decodeIfPresent(String.self, forKey: .description) ?? ""+ detail = try c.decodeIfPresent(String.self, forKey: .detail) ?? ""+ }++ private enum CodingKeys: String, CodingKey { case name, description, detail }+}+public struct InstalledSkill: Codable, Hashable, Sendable, Identifiable {public var id: Stringpublic var name: String@@ -203,6 +238,11 @@ public extension HostClient {try await call("composioConnection", ["id": id], timeout: 30)}+ /// What `backend` already has in `cwd`: its own skills and MCP connectors, not Codync's.+ func agentGear(backend: String, cwd: String) async throws -> AgentGear {+ try await call("agentGear", ["backend": backend, "cwd": cwd])+ }+func skills() async throws -> [InstalledSkill] {let res: Items<InstalledSkill> = try await call("skills")return res.itemsdiff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.jsonindex 3c8effe8..0db811ca 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json@@ -434,6 +434,13 @@"Connectors": "Konnektoren","No connectors yet. Add GitHub, Linear, Notion and more from Extensions.": "Noch keine Konnektoren. Füge GitHub, Linear, Notion und weitere unter Erweiterungen hinzu.","Skills": "Skills",+ "From {agent}": "Von {agent}",+ "From Codync": "Von Codync",+ "None from this agent.": "Keine von diesem Agenten.",+ "{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.": "{agent} bringt diese mit. Codync legt eigene darüber; eingeschaltete werden an den Agenten übergeben.",+ "Couldn't load what this agent brings.": "Was dieser Agent mitbringt, konnte nicht geladen werden.",+ "between details, library, memory, settings, skills and connectors": "zwischen Details, Bibliothek, Gedächtnis, Einstellungen, Skills und Connectors",+ "space on / off · ⇧←→ page · esc": "Leertaste an / aus · ⇧←→ Seite · esc","No skills yet. Get some from Extensions, or write your own.": "Noch keine Skills. Hole welche aus den Erweiterungen oder schreibe eigene.","Your coding agents, as teammates.": "Deine Coding-Agenten als Teamkollegen.","Pick a bot, or create one for each kind of work and point it at a project.": "Wähle einen Bot oder erstelle für jede Art von Arbeit einen und weise ihm ein Projekt zu.",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.jsonindex 845dac9a..b09f48e4 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json@@ -434,6 +434,13 @@"Connectors": "Conectores","No connectors yet. Add GitHub, Linear, Notion and more from Extensions.": "Aún no hay conectores. Añade GitHub, Linear, Notion y más desde Extensiones.","Skills": "Habilidades",+ "From {agent}": "De {agent}",+ "From Codync": "De Codync",+ "None from this agent.": "Ninguno de este agente.",+ "{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.": "{agent} trae estos. Codync añade los suyos encima; los activados se pasan al agente.",+ "Couldn't load what this agent brings.": "No se pudo leer lo que trae este agente.",+ "between details, library, memory, settings, skills and connectors": "entre detalles, biblioteca, memoria, ajustes, habilidades y conectores",+ "space on / off · ⇧←→ page · esc": "espacio on / off · ⇧←→ página · esc","No skills yet. Get some from Extensions, or write your own.": "Aún no hay habilidades. Consíguelas en Extensiones o escribe las tuyas.","Your coding agents, as teammates.": "Tus agentes de programación, como compañeros de equipo.","Pick a bot, or create one for each kind of work and point it at a project.": "Elige un bot o crea uno para cada tipo de trabajo y asígnale un proyecto.",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.jsonindex ef6c4c99..ba3b4d9e 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json@@ -434,6 +434,13 @@"Connectors": "Connecteurs","No connectors yet. Add GitHub, Linear, Notion and more from Extensions.": "Aucun connecteur pour le moment. Ajoutez GitHub, Linear, Notion et d’autres depuis Extensions.","Skills": "Compétences",+ "From {agent}": "Depuis {agent}",+ "From Codync": "Depuis Codync",+ "None from this agent.": "Aucun de la part de cet agent.",+ "{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.": "{agent} apporte ceux-ci. Codync ajoute les siens par-dessus ; ceux qui sont activés sont transmis à l'agent.",+ "Couldn't load what this agent brings.": "Impossible de lire ce que cet agent apporte.",+ "between details, library, memory, settings, skills and connectors": "entre détails, bibliothèque, mémoire, réglages, compétences et connecteurs",+ "space on / off · ⇧←→ page · esc": "espace on / off · ⇧←→ page · esc","No skills yet. Get some from Extensions, or write your own.": "Aucune compétence pour le moment. Ajoutez-en depuis Extensions ou écrivez les vôtres.","Your coding agents, as teammates.": "Vos agents de programmation, comme coéquipiers.","Pick a bot, or create one for each kind of work and point it at a project.": "Choisissez un bot ou créez-en un par type de travail et attribuez-lui un projet.",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.jsonindex 0084862e..3a382687 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json@@ -434,6 +434,13 @@"Connectors": "コネクタ","No connectors yet. Add GitHub, Linear, Notion and more from Extensions.": "まだコネクタがありません。拡張機能から GitHub、Linear、Notion などを追加します。","Skills": "スキル",+ "From {agent}": "{agent} から",+ "From Codync": "Codync から",+ "None from this agent.": "このエージェントからはありません。",+ "{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.": "{agent} が持っているものです。Codync のものは上に加わり、オンにしたものがエージェントに渡されます。",+ "Couldn't load what this agent brings.": "このエージェントが持っているものを読み込めませんでした。",+ "between details, library, memory, settings, skills and connectors": "詳細、ライブラリ、メモリ、設定、スキル、コネクタの間",+ "space on / off · ⇧←→ page · esc": "space オン/オフ · ⇧←→ ページ · esc","No skills yet. Get some from Extensions, or write your own.": "まだスキルはありません。拡張機能からいくつかを取得するか、独自に作成します。","Your coding agents, as teammates.": "チームメイトとしてのコーディングエージェント。","Pick a bot, or create one for each kind of work and point it at a project.": "ボットを選択するか、作業の種類ごとにボットを作成してプロジェクトに向けます。",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.jsonindex ae52ae25..2f11d1f0 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json@@ -434,6 +434,13 @@"Connectors": "커넥터","No connectors yet. Add GitHub, Linear, Notion and more from Extensions.": "아직 커넥터가 없습니다. Extensions에서 GitHub, Linear, Notion 등을 추가하세요.","Skills": "기술",+ "From {agent}": "{agent}에서",+ "From Codync": "Codync에서",+ "None from this agent.": "이 에이전트에는 없습니다.",+ "{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.": "{agent}가 직접 가져오는 것입니다. Codync의 것은 위에 더해지며, 켜 둔 것이 에이전트에 전달됩니다.",+ "Couldn't load what this agent brings.": "이 에이전트가 가져오는 것을 불러오지 못했습니다.",+ "between details, library, memory, settings, skills and connectors": "상세, 라이브러리, 메모리, 설정, 기술, 커넥터 사이",+ "space on / off · ⇧←→ page · esc": "space 켜기/끄기 · ⇧←→ 페이지 · esc","No skills yet. Get some from Extensions, or write your own.": "아직 스킬이 없습니다. Extensions에서 일부를 가져오거나 직접 작성해 보세요.","Your coding agents, as teammates.": "코딩 에이전트를 팀원으로 활용하세요.","Pick a bot, or create one for each kind of work and point it at a project.": "봇을 선택하거나 작업 종류별로 하나를 만들고 프로젝트를 가리킵니다.",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.jsonindex 7c874c5f..d40693e2 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json@@ -434,6 +434,13 @@"Connectors": "连接器","No connectors yet. Add GitHub, Linear, Notion and more from Extensions.": "还没有连接器。到「扩展」里添加 GitHub、Linear、Notion 等。","Skills": "技能",+ "From {agent}": "来自 {agent}",+ "From Codync": "来自 Codync",+ "None from this agent.": "这个智能体没有自带的。",+ "{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.": "{agent} 自带这些。Codync 再叠加上去,打开的会传给智能体。",+ "Couldn't load what this agent brings.": "没能读到这个智能体自带的。",+ "between details, library, memory, settings, skills and connectors": "在详情、资料库、记忆、设置、技能和连接器之间切换",+ "space on / off · ⇧←→ page · esc": "空格 开/关 · ⇧←→ 翻页 · esc","No skills yet. Get some from Extensions, or write your own.": "还没有技能。到「扩展」里找,或自己写。","Your coding agents, as teammates.": "你的编程智能体,像队友一样。","Pick a bot, or create one for each kind of work and point it at a project.": "选一个 Bot,或为每种工作新建一个,并指向一个项目。",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.jsonindex a6b829b3..efac94ac 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json@@ -434,6 +434,13 @@"Connectors": "聯結器","No connectors yet. Add GitHub, Linear, Notion and more from Extensions.": "還沒有聯結器。到「擴充套件」裡新增 GitHub、Linear、Notion 等。","Skills": "技能",+ "From {agent}": "來自 {agent}",+ "From Codync": "來自 Codync",+ "None from this agent.": "這個智能體沒有自帶的。",+ "{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.": "{agent} 自帶這些。Codync 再疊加上去,打開的會傳給智能體。",+ "Couldn't load what this agent brings.": "沒能讀到這個智能體自帶的。",+ "between details, library, memory, settings, skills and connectors": "在詳情、資料庫、記憶、設定、技能和連接器之間切換",+ "space on / off · ⇧←→ page · esc": "空白鍵 開/關 · ⇧←→ 翻頁 · esc","No skills yet. Get some from Extensions, or write your own.": "還沒有技能。到「擴充套件」裡找,或自己寫。","Your coding agents, as teammates.": "你的程式設計智慧體,像隊友一樣。","Pick a bot, or create one for each kind of work and point it at a project.": "選一個 Bot,或為每種工作新建一個,並指向一個專案。",diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swiftindex 484bba2b..e0a21d78 100644--- a/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift@@ -3,7 +3,7 @@ import SwiftUI/// The details sheet's pages, as on the desktop inspector.enum DetailsTab: Hashable {- case details, library, memory, settings+ case details, library, memory, settings, skills, connectors}/// What to open the details sheet on.@@ -16,8 +16,8 @@ struct DetailsRequest: Identifiable {var botId: String?}-/// A bot's details (Grok Bot's): who it is, then its details, library, memory and settings. Settings save-/// as you edit.+/// A bot's details (Grok Bot's): who it is, then its details, library, memory, settings, skills and+/// connectors. Settings save as you edit.struct BotDetailsView: View {let botId: Stringlet routineId: String?@@ -45,7 +45,7 @@ struct BotDetailsView: View {VStack(spacing: 0) {if let bot { identity(bot) }TabChoice(selection: $tab, options: [(.details, "Details")] + (model.hasLibrary ? [(.library, "Library")] : [])- + [(.memory, "Memory"), (.settings, "Settings")])+ + [(.memory, "Memory"), (.settings, "Settings"), (.skills, "Skills"), (.connectors, "Connectors")]).padding(.top, 18)page.padding(.top, 20).environment(\.cardStyle, .outlined)@@ -144,6 +144,10 @@ struct BotDetailsView: View {if let draft = Binding($draft) {BotSettingsForm(draft: draft, error: saveError, scrolls: false, part: .rarely)}+ case .skills:+ if let draft = Binding($draft) { BotGearPage(draft: draft, kind: .skills) }+ case .connectors:+ if let draft = Binding($draft) { BotGearPage(draft: draft, kind: .connectors) }}}diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swiftindex df2f9ca2..ceb5b835 100644--- a/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift@@ -246,19 +246,22 @@ struct BotSettingsForm: View {}}- PluginToggles(- title: "Connectors",- empty: "No connectors yet. Add GitHub, Linear, Notion and more from Extensions.",- items: model.installedConnectors.map { ($0.id, $0.name, $0.command ?? $0.url ?? "") },- selection: Binding(get: { draft.connectors ?? [] }, set: { draft.connectors = $0 })- )- PluginToggles(- title: "Skills",- empty: "No skills yet. Get some from Extensions, or write your own.",- items: model.installedSkills.map { ($0.id, $0.name, $0.description) },- selection: Binding(get: { draft.skills ?? [] }, set: { draft.skills = $0 }),- info: { id in viewingSkill = model.installedSkills.first { $0.id == id }.map(SkillRef.init) }- )+ // The details sheet shows these on their own tabs. The full editor keeps the switches here.+ if part == .all {+ PluginToggles(+ title: "Connectors",+ empty: "No connectors yet. Add GitHub, Linear, Notion and more from Extensions.",+ items: model.installedConnectors.map { ($0.id, $0.name, $0.command ?? $0.url ?? "") },+ selection: Binding(get: { draft.connectors ?? [] }, set: { draft.connectors = $0 })+ )+ PluginToggles(+ title: "Skills",+ empty: "No skills yet. Get some from Extensions, or write your own.",+ items: model.installedSkills.map { ($0.id, $0.name, $0.description) },+ selection: Binding(get: { draft.skills ?? [] }, set: { draft.skills = $0 }),+ info: { id in viewingSkill = model.installedSkills.first { $0.id == id }.map(SkillRef.init) }+ )+ }if let error {Text(L10n.tr(error)).font(.footnote).foregroundStyle(Palette.danger)}diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotGearView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotGearView.swiftnew file mode 100644index 00000000..a08eb46b--- /dev/null+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotGearView.swift@@ -0,0 +1,98 @@+import CodyncKit+import SwiftUI++/// What the bot's agent already brings, and the Codync skills or connectors passed on top of that.+struct BotGearPage: View {+ @Binding var draft: BotDraft+ var kind: Kind+ @Environment(BotStore.self) private var model+ @State private var gear: AgentGear?+ @State private var failed = false+ @State private var viewingSkill: SkillRef?++ enum Kind { case skills, connectors }++ private var bot: Bot? { draft.id.flatMap { model.bots[$0] } }++ /// A personal workspace keeps its folder on the saved bot; a draft only has a folder once one is chosen.+ private var cwd: String { draft.cwd.isEmpty ? (bot?.cwd ?? "") : draft.cwd }++ private var agent: String { model.backendName(draft.backend) }++ private var agentItems: [AgentGearItem] {+ switch kind {+ case .skills: gear?.skills ?? []+ case .connectors: gear?.connectors ?? []+ }+ }++ var body: some View {+ VStack(alignment: .leading, spacing: 28) {+ Text(L10n.tr("{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.")+ .replacingOccurrences(of: "{agent}", with: agent))+ .font(.footnote)+ .foregroundStyle(Palette.secondary)+ agentSection+ codyncSection+ }+ .task(id: "\(draft.backend)|\(cwd)") { await load() }+ .codyncSheet(item: $viewingSkill) { SkillSheet(skill: $0) }+ }++ private var agentSection: some View {+ CardSection(L10n.tr("From {agent}").replacingOccurrences(of: "{agent}", with: agent)) {+ if gear == nil, !failed {+ Text(L10n.tr("Loading…")).foregroundStyle(Palette.secondary)+ } else if failed {+ Text(L10n.tr("Couldn't load what this agent brings.")).foregroundStyle(Palette.danger)+ } else if agentItems.isEmpty {+ Text(L10n.tr("None from this agent.")).foregroundStyle(Palette.secondary)+ } else {+ ForEach(agentItems) { item in+ VStack(alignment: .leading, spacing: 2) {+ Text(item.name).foregroundStyle(Palette.text)+ let note = kind == .skills ? item.description : item.detail+ if !note.isEmpty {+ Text(note).font(.caption).foregroundStyle(Palette.secondary)+ }+ }+ }+ }+ }+ }++ @ViewBuilder private var codyncSection: some View {+ switch kind {+ case .skills:+ PluginToggles(+ title: "From Codync",+ empty: "No skills yet. Get some from Extensions, or write your own.",+ items: model.installedSkills.map { ($0.id, $0.name, $0.description) },+ selection: Binding(get: { draft.skills ?? [] }, set: { draft.skills = $0 }),+ info: { id in viewingSkill = model.installedSkills.first { $0.id == id }.map(SkillRef.init) }+ )+ case .connectors:+ PluginToggles(+ title: "From Codync",+ empty: "No connectors yet. Add GitHub, Linear, Notion and more from Extensions.",+ items: model.installedConnectors.map { ($0.id, $0.name, $0.command ?? $0.url ?? "") },+ selection: Binding(get: { draft.connectors ?? [] }, set: { draft.connectors = $0 })+ )+ }+ }++ private func load() async {+ await model.refreshPlugins()+ failed = false+ guard let client = model.client else {+ failed = true+ return+ }+ do {+ let loaded = try await client.agentGear(backend: draft.backend, cwd: cwd)+ if !Task.isCancelled { gear = loaded }+ } catch {+ if !Task.isCancelled { failed = true }+ }+ }+}diff --git a/docs/plans/android-app.md b/docs/plans/android-app.mdindex bc4699a4..46090190 100644--- a/docs/plans/android-app.md+++ b/docs/plans/android-app.md@@ -19,7 +19,7 @@ emulator against a real host; device acceptance is listed separately.| Roster | Ported: rows, menus, pin/hide/delete, New session (bots only), groups, drag to reorder (host-synced order) and TalkBack Move up/down, computer header, pull to refresh (also in Computer management) | Multiple computers || Conversation | Ported: bubbles, Markdown/code, permissions, reactions, quote replies, Full conversation, bot-to-bot exchange lines and their conversation, routine notices that open their routine, files a bot shares (verified download, then the share sheet), sent images full size, pull down to reconnect, jump to latest, read receipts for every conversation on screen | Physical keyboard and TalkBack || Composer | Ported: files/photos/paste (groups too, image thumbnails, Paste only when the clipboard holds files), `/` commands (Fast mode, skills listed fresh on `/`), @mentions in groups, call/send/stop/interrupt button | Dictation ([voice call](../features/voice-call.md)): the mic, its recording pill, the engine menu beside it (On device, or OpenAI / Gemini transcribed on the user's key with *Transcribing…*) and the *Couldn't dictate* dialog |-| Bot and group editors | Ported: avatar, profile, agent and model options, Fast mode, workspace folder picker, permissions, activity, connectors, skills (with their details); the bot details sheet (`BotDetailsView`, from the chat's title, a routine notice or Add a fallback): Details (instructions, agent, Use the computer, Routines), Library and Settings tabs saved as you edit, Create template; a group's title opens its editor | The details' Memory tab (see Memory) |+| Bot and group editors | Ported: avatar, profile, agent and model options, Fast mode, workspace folder picker, permissions, activity, connectors, skills (with their details); the bot details sheet (`BotDetailsView`, from the chat's title, a routine notice or Add a fallback): Details (instructions, agent, Use the computer, Routines), Library, Settings, Skills and Connectors tabs saved as you edit, Create template; a group's title opens its editor | The details' Memory tab (see Memory) || Memory | Broken since 2.18.0: the screen calls removed host methods (see [Not ported yet](#not-ported-yet)); it shows only in the roster's Edit profile, and the bot details have no Memory tab until the port | Port the read-only memory screen from `MemoryView.swift`, `MemoryFilesView.swift` and `MemoryInfoSheet.swift`, without add, edit, pin or forget || Routines | Ported: list with switches, editor (schedule, webhook panel, run settings), test run, delete | Live provider/routine acceptance || Extensions | Ported: agents (install, sign-in, setup terminal), registry connectors, Composio apps, skills, installed list, custom connector, own skill, credentials, chat connection request card | Real provider OAuth, 1Password |diff --git a/host/src/agent/gear.rs b/host/src/agent/gear.rsnew file mode 100644index 00000000..50424ad3--- /dev/null+++ b/host/src/agent/gear.rs@@ -0,0 +1,473 @@+//! An agent's own skills and MCP connectors, read from the config it keeps on disk.+//!+//! Codync's skills and connectors are a separate list: clients show them beside these+//! and pass along the ones the bot has switched on. This never starts the agent.+//! MCP environment variables, headers and tokens stay in the files.++use serde_json::{Map, Value, json};+use std::io::Read;+use std::path::{Path, PathBuf};++const MAX_SKILLS: usize = 200;+const MAX_DEPTH: usize = 3;+const SKILL_BYTES: u64 = 8 * 1024;+const MCP_BYTES: u64 = 256 * 1024;+const NAME_CHARS: usize = 80;+const DETAIL_CHARS: usize = 180;++struct Item {+ name: String,+ description: String,+ detail: String,+}++/// `{ skills: [{name, description}], connectors: [{name, detail}] }` for `backend` working in `cwd`.+/// An empty `cwd` lists only what the agent keeps for the user, not a project.+pub async fn list(backend: &str, cwd: &str) -> Value {+ let backend = backend.to_owned();+ let cwd = cwd.to_owned();+ match tokio::task::spawn_blocking(move || scan(&backend, &cwd)).await {+ Ok(value) => value,+ Err(e) => {+ tracing::warn!(error = format!("{e:#}"), "listing an agent's skills and connectors");+ json!({"skills": [], "connectors": []})+ }+ }+}++fn scan(backend: &str, cwd: &str) -> Value {+ let home = dirs::home_dir().unwrap_or_default();+ let project = (!cwd.is_empty()).then(|| Path::new(cwd));+ let (skills, connectors) = collect(backend, &home, project);+ json!({+ "skills": skills.iter().map(|s| json!({"name": s.name, "description": s.description})).collect::<Vec<_>>(),+ "connectors": connectors.iter().map(|c| json!({"name": c.name, "detail": c.detail})).collect::<Vec<_>>(),+ })+}++fn collect(backend: &str, home: &Path, cwd: Option<&Path>) -> (Vec<Item>, Vec<Item>) {+ let mut skills = Vec::new();+ for root in skill_roots(backend, home, cwd) {+ walk_skills(&root, 0, &mut skills);+ }+ let mut connectors = Vec::new();+ for file in mcp_files(backend, home, cwd) {+ read_mcp(&file, &mut connectors);+ }+ dedupe(&mut skills);+ dedupe(&mut connectors);+ (skills, connectors)+}++/// Home directories first, then the project, so a project entry of the same name replaces it.+fn skill_roots(backend: &str, home: &Path, cwd: Option<&Path>) -> Vec<PathBuf> {+ let mut roots = Vec::new();+ push_rel(&mut roots, home, home_skills(backend));+ if let Some(cwd) = cwd {+ push_rel(&mut roots, cwd, project_skills(backend));+ }+ roots+}++fn home_skills(backend: &str) -> &'static [&'static str] {+ match backend {+ "cursor" => &[+ ".cursor/skills-cursor",+ ".cursor/skills",+ ".cursor/cloud-skills",+ ".agents/skills",+ ".claude/skills",+ ".codex/skills",+ ".grok/skills",+ ],+ "claude" | "copilot" => &[".claude/skills", ".agents/skills"],+ "codex" => &[".codex/skills", ".agents/skills"],+ "grok" => &[".grok/skills", ".agents/skills"],+ "codebuddy" | "workbuddy" => &[".codebuddy/skills", ".claude/skills", ".agents/skills"],+ "gemini" | "antigravity" => &[".gemini/skills", ".agents/skills"],+ _ => &[".agents/skills"],+ }+}++fn project_skills(backend: &str) -> &'static [&'static str] {+ match backend {+ "cursor" => &[+ ".cursor/skills",+ ".cursor/skills-cursor",+ ".cursor/plugins",+ ".agents/skills",+ ".claude/skills",+ ".codex/skills",+ ".grok/skills",+ ],+ "claude" | "copilot" => &[".claude/skills", ".claude/plugins", ".agents/skills"],+ "codex" => &[".codex/skills", ".agents/skills"],+ "grok" => &[".grok/skills", ".agents/skills"],+ "codebuddy" | "workbuddy" => &[".codebuddy/skills", ".claude/skills", ".agents/skills"],+ "gemini" | "antigravity" => &[".gemini/skills", ".agents/skills"],+ _ => &[".agents/skills", ".claude/skills"],+ }+}++fn mcp_files(backend: &str, home: &Path, cwd: Option<&Path>) -> Vec<PathBuf> {+ let mut files = Vec::new();+ push_rel(&mut files, home, home_mcp(backend));+ if let Some(cwd) = cwd {+ push_rel(&mut files, cwd, project_mcp(backend));+ }+ files+}++fn home_mcp(backend: &str) -> &'static [&'static str] {+ match backend {+ "cursor" => &[".cursor/mcp.json"],+ "claude" => &[".claude.json", ".claude/settings.json"],+ "codex" => &[".codex/config.toml"],+ "copilot" => &[".copilot/mcp-config.json"],+ "codebuddy" | "workbuddy" => &[".codebuddy/mcp.json", ".codebuddy/settings.json"],+ "gemini" | "antigravity" => &[".gemini/settings.json"],+ "grok" => &[".grok/mcp.json"],+ _ => &[],+ }+}++fn project_mcp(backend: &str) -> &'static [&'static str] {+ match backend {+ "cursor" => &[".cursor/mcp.json"],+ "claude" => &[".mcp.json", ".claude/settings.json", ".claude/settings.local.json"],+ "codex" => &[".codex/config.toml"],+ "copilot" => &[".mcp.json", ".vscode/mcp.json"],+ "codebuddy" | "workbuddy" => &[".codebuddy/mcp.json", ".mcp.json"],+ "gemini" | "antigravity" => &[".gemini/settings.json", ".mcp.json"],+ _ => &[".mcp.json"],+ }+}++fn push_rel(out: &mut Vec<PathBuf>, base: &Path, rels: &[&str]) {+ if base.as_os_str().is_empty() {+ return;+ }+ for rel in rels {+ out.push(base.join(rel));+ }+}++fn walk_skills(dir: &Path, depth: usize, out: &mut Vec<Item>) {+ if depth > MAX_DEPTH || out.len() >= MAX_SKILLS {+ return;+ }+ let Ok(entries) = std::fs::read_dir(dir) else { return };+ for entry in entries.flatten() {+ if out.len() >= MAX_SKILLS {+ return;+ }+ let path = entry.path();+ if skipped_dir(&path, &entry.file_name().to_string_lossy()) {+ continue;+ }+ let skill = path.join("SKILL.md");+ if skill.is_file() {+ if let Some(item) = skill_item(&skill, &entry.file_name().to_string_lossy()) {+ out.push(item);+ }+ } else {+ walk_skills(&path, depth + 1, out);+ }+ }+}++fn skipped_dir(path: &Path, name: &str) -> bool {+ if name.starts_with('.') || matches!(name, "node_modules" | "dist" | "target" | "__pycache__") {+ return true;+ }+ std::fs::symlink_metadata(path).is_ok_and(|meta| meta.file_type().is_symlink() || !meta.is_dir())+}++fn skill_item(path: &Path, folder: &str) -> Option<Item> {+ let text = read_limited(path, SKILL_BYTES)?;+ let (name, description) = front_matter(&text);+ let name = clip(&name.unwrap_or_else(|| folder.to_owned()), NAME_CHARS);+ if name.is_empty() {+ return None;+ }+ Some(Item { name, description: clip(&description.unwrap_or_default(), DETAIL_CHARS), detail: String::new() })+}++fn front_matter(md: &str) -> (Option<String>, Option<String>) {+ let Some(rest) = md.strip_prefix("---\n").or_else(|| md.strip_prefix("---\r\n")) else {+ return (None, None);+ };+ let Some((head, _)) = rest.split_once("\n---").or_else(|| rest.split_once("\r\n---")) else {+ return (None, None);+ };+ let mut name = None;+ let mut description = None;+ for line in head.lines() {+ let Some((key, value)) = line.split_once(':') else { continue };+ if key.chars().any(char::is_whitespace) {+ continue;+ }+ let value = bare(value);+ if value.is_empty() || value.starts_with('|') || value.starts_with('>') {+ continue;+ }+ match key.trim() {+ "name" if name.is_none() => name = Some(value.to_owned()),+ "description" if description.is_none() => description = Some(value.to_owned()),+ _ => {}+ }+ }+ (name, description)+}++fn bare(value: &str) -> &str {+ value.trim().trim_matches(['"', '\'']).trim()+}++fn read_mcp(path: &Path, out: &mut Vec<Item>) {+ if std::fs::symlink_metadata(path).is_ok_and(|meta| meta.is_dir()) {+ return;+ }+ let Some(text) = read_limited(path, MCP_BYTES) else { return };+ if path.extension().is_some_and(|ext| ext == "toml") {+ out.extend(mcp_toml(&text));+ return;+ }+ let Ok(value) = serde_json::from_str::<Value>(&text) else { return };+ let Some(servers) = servers_object(path, &value) else { return };+ for (name, server) in servers {+ let Some(server) = server.as_object() else { continue };+ let name = clip(name, NAME_CHARS);+ if name.is_empty() {+ continue;+ }+ out.push(Item { name, description: String::new(), detail: server_detail(server) });+ }+}++fn servers_object<'a>(path: &Path, value: &'a Value) -> Option<&'a Map<String, Value>> {+ if let Some(servers) = value.get("mcpServers").and_then(Value::as_object) {+ return Some(servers);+ }+ let name = path.file_name()?.to_str()?;+ if !matches!(name, "mcp.json" | "mcp-config.json") {+ return None;+ }+ value.get("servers").and_then(Value::as_object).or_else(|| value.as_object())+}++/// The command or URL a person can recognize. Arguments that look like a token are left out,+/// and a URL loses its user, query and fragment. A URL whose path still looks like a token is omitted.+fn server_detail(server: &Map<String, Value>) -> String {+ if let Some(url) = server.get("url").and_then(Value::as_str).filter(|url| !url.is_empty()) {+ let url = public_url(url);+ if looks_secret(&url) {+ return String::new();+ }+ return clip(&url, DETAIL_CHARS);+ }+ clip(&command_text(server), DETAIL_CHARS)+}++fn command_text(server: &Map<String, Value>) -> String {+ let mut parts = Vec::new();+ match server.get("command") {+ Some(Value::String(command)) if !command.is_empty() => parts.push(command.clone()),+ Some(Value::Array(command)) => parts.extend(command.iter().filter_map(|v| v.as_str().map(str::to_owned))),+ _ => {}+ }+ if let Some(args) = server.get("args").and_then(Value::as_array) {+ parts.extend(args.iter().filter_map(|v| v.as_str().map(str::to_owned)));+ }+ parts.retain(|part| !looks_secret(part));+ parts.join(" ")+}++fn public_url(url: &str) -> String {+ let Some((scheme, rest)) = url.split_once("://") else {+ return url.split(['?', '#']).next().unwrap_or(url).to_owned();+ };+ let rest = rest.split('@').next_back().unwrap_or(rest);+ let rest = rest.split(['?', '#']).next().unwrap_or(rest);+ format!("{scheme}://{rest}")+}++fn looks_secret(part: &str) -> bool {+ let lower = part.to_ascii_lowercase();+ ["token", "secret", "password", "api_key", "apikey", "authorization"].iter().any(|needle| lower.contains(needle))+}++/// `[mcp_servers.name]` tables. A later `url` replaces `command`. Nested tables are skipped.+fn mcp_toml(text: &str) -> Vec<Item> {+ let mut out = Vec::new();+ let mut name: Option<String> = None;+ let mut detail = String::new();+ let flush = |name: &mut Option<String>, detail: &mut String, out: &mut Vec<Item>| {+ if let Some(name) = name.take() {+ let name = clip(&name, NAME_CHARS);+ if !name.is_empty() {+ out.push(Item { name, description: String::new(), detail: clip(detail, DETAIL_CHARS) });+ }+ }+ detail.clear();+ };+ for line in text.lines() {+ let trimmed = line.trim();+ if trimmed.is_empty() || trimmed.starts_with('#') {+ continue;+ }+ if let Some(next) = toml_header(trimmed) {+ flush(&mut name, &mut detail, &mut out);+ name = match next {+ TomlTable::Server(server) => Some(server),+ TomlTable::Other => None,+ };+ continue;+ }+ if name.is_none() {+ continue;+ }+ if let Some(url) = toml_value(trimmed, "url") {+ detail = url;+ } else if detail.is_empty()+ && let Some(command) = toml_value(trimmed, "command")+ {+ detail = command;+ }+ }+ flush(&mut name, &mut detail, &mut out);+ out+}++/// A `[table]` line: one MCP server, or any other table. `None` is not a header.+enum TomlTable {+ Server(String),+ Other,+}++fn toml_header(line: &str) -> Option<TomlTable> {+ let inner = line.strip_prefix('[')?.strip_suffix(']')?.trim().trim_matches('"');+ let Some(rest) = inner.strip_prefix("mcp_servers.") else {+ return Some(TomlTable::Other);+ };+ if rest.is_empty() || rest.contains('.') {+ return Some(TomlTable::Other);+ }+ Some(TomlTable::Server(rest.to_owned()))+}++fn toml_value(line: &str, key: &str) -> Option<String> {+ let rest = line.strip_prefix(key)?.trim_start();+ let rest = rest.strip_prefix('=')?.trim();+ let value = bare(rest);+ (!value.is_empty() && !looks_secret(value)).then(|| value.to_owned())+}++fn dedupe(items: &mut Vec<Item>) {+ let mut index = std::collections::HashMap::<String, usize>::new();+ let mut kept = Vec::new();+ for item in items.drain(..) {+ if let Some(at) = index.get(&item.name).copied() {+ kept[at] = item;+ } else {+ index.insert(item.name.clone(), kept.len());+ kept.push(item);+ }+ }+ *items = kept;+}++fn clip(text: &str, max: usize) -> String {+ let collapsed = text.split_whitespace().collect::<Vec<_>>().join(" ");+ if collapsed.chars().count() <= max { collapsed } else { collapsed.chars().take(max).collect() }+}++fn read_limited(path: &Path, cap: u64) -> Option<String> {+ let file = std::fs::File::open(path).ok()?;+ let mut file = file.take(cap);+ let mut text = String::new();+ file.read_to_string(&mut text).ok()?;+ Some(text)+}++#[cfg(test)]+mod tests {+ use super::*;++ fn scratch() -> PathBuf {+ let dir = std::env::temp_dir().join(format!("codync-gear-{}", uuid::Uuid::new_v4()));+ std::fs::create_dir_all(&dir).expect("temp dir");+ dir+ }++ #[test]+ fn a_project_server_replaces_the_home_one_and_tokens_stay_out() {+ let root = scratch();+ let home = root.join("home");+ let cwd = root.join("proj");+ std::fs::create_dir_all(home.join(".cursor")).expect("home");+ std::fs::create_dir_all(cwd.join(".cursor/skills/review")).expect("skill");+ std::fs::write(+ home.join(".cursor/mcp.json"),+ r#"{"mcpServers":{"github":{"command":"npx","args":["-y","server"],"env":{"GITHUB_TOKEN":"secret-token"}}}}"#,+ )+ .expect("home mcp");+ std::fs::write(+ cwd.join(".cursor/mcp.json"),+ r#"{"mcpServers":{"github":{"url":"https://user:[email protected]/mcp?token=secret-token"},"linear":{"command":"linear-mcp"},"hidden":{"url":"https://example.test/secret-token"}}}"#,+ )+ .expect("project mcp");+ std::fs::write(+ cwd.join(".cursor/skills/review/SKILL.md"),+ "---\nname: review\ndescription: Review a diff\n---\n# Review\n",+ )+ .expect("skill");+ let (skills, connectors) = collect("cursor", &home, Some(&cwd));+ assert_eq!(skills.len(), 1);+ assert_eq!(skills[0].name, "review");+ assert_eq!(skills[0].description, "Review a diff");+ assert_eq!(connectors.iter().map(|c| c.name.as_str()).collect::<Vec<_>>(), ["github", "linear", "hidden"]);+ assert_eq!(connectors[0].detail, "https://example.test/mcp");+ assert_eq!(connectors[2].detail, "");+ let dumped =+ serde_json::to_string(&json!(connectors.iter().map(|c| &c.detail).collect::<Vec<_>>())).expect("json");+ assert!(!dumped.contains("secret-token"), "{dumped}");+ let _ = std::fs::remove_dir_all(root);+ }++ #[test]+ fn codex_toml_and_a_generic_project_are_listed() {+ let root = scratch();+ let home = root.join("home");+ let cwd = root.join("proj");+ std::fs::create_dir_all(home.join(".codex")).expect("codex");+ std::fs::create_dir_all(cwd.join(".agents/skills/ship")).expect("skill");+ std::fs::write(+ home.join(".codex/config.toml"),+ "[mcp_servers.github]\ncommand = \"github-mcp\"\n\n[mcp_servers.github.env]\nTOKEN = \"secret-token\"\n",+ )+ .expect("toml");+ std::fs::write(cwd.join(".mcp.json"), r#"{"mcpServers":{"docs":{"command":"docs-mcp"}}}"#).expect("mcp");+ std::fs::write(cwd.join(".agents/skills/ship/SKILL.md"), "---\nname: ship\ndescription: Ship it\n---\n")+ .expect("skill");+ let (codex_skills, codex_connectors) = collect("codex", &home, Some(&cwd));+ assert!(codex_skills.iter().any(|s| s.name == "ship"));+ assert_eq!(codex_connectors.len(), 1);+ assert_eq!(codex_connectors[0].name, "github");+ assert_eq!(codex_connectors[0].detail, "github-mcp");+ assert!(!codex_connectors.iter().any(|c| c.detail.contains("secret-token") || c.name.contains("secret-token")));+ let (generic_skills, generic_connectors) = collect("codebuddy", &home, Some(&cwd));+ assert!(generic_skills.iter().any(|s| s.name == "ship"));+ assert!(generic_connectors.iter().any(|c| c.name == "docs" && c.detail == "docs-mcp"));+ let _ = std::fs::remove_dir_all(root);+ }++ #[test]+ fn a_missing_config_is_an_empty_list() {+ let root = scratch();+ let (skills, connectors) = collect("cursor", &root.join("no-home"), Some(&root.join("no-proj")));+ assert!(skills.is_empty());+ assert!(connectors.is_empty());+ let _ = std::fs::remove_dir_all(root);+ }+}diff --git a/host/src/agent/mod.rs b/host/src/agent/mod.rsindex 1a03001e..b229a0a3 100644--- a/host/src/agent/mod.rs+++ b/host/src/agent/mod.rs@@ -7,6 +7,7 @@ pub mod backends;pub mod bot;pub mod config;pub mod fallback;+pub mod gear;pub mod new_bot;pub mod node;pub mod own_memory;diff --git a/host/src/api/marketplace.rs b/host/src/api/marketplace.rsindex 46fbd925..cc7a7b99 100644--- a/host/src/api/marketplace.rs+++ b/host/src/api/marketplace.rs@@ -1,4 +1,4 @@-//! Marketplace methods: connectors, credentials, Composio and skills.+//! Marketplace methods: connectors, credentials, Composio, skills, and an agent's own gear.use super::devices::Caller;use super::str_arg;@@ -169,6 +169,10 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Valuejson!({})}"skills" => market::list_skills(&hub.store),+ // What this agent already has on disk. Codync's own skills and connectors stay on the bot.+ "agentGear" => {+ crate::agent::gear::list(b["backend"].as_str().unwrap_or(""), b["cwd"].as_str().unwrap_or("")).await+ }"skillDetails" => market::skill_details(&hub.store, &b).await?,"installSkill" => {let before = Installed::Skills.ids(&hub.store)?;diff --git a/host/src/tui/app/overlay_keys.rs b/host/src/tui/app/overlay_keys.rsindex 996f9614..aa53809f 100644--- a/host/src/tui/app/overlay_keys.rs+++ b/host/src/tui/app/overlay_keys.rs@@ -124,6 +124,7 @@ impl App {Overlay::Routines(l) => self.routines_key(l, k),Overlay::Routine(f) => self.routine_key(f, k),Overlay::Library(l) => self.library_key(l, k),+ Overlay::Gear(g) => self.gear_key(g, k),Overlay::Market(m) => self.market_key(m, k),Overlay::Agent(a) => self.agent_key(a, k),Overlay::Fields(f) => self.fields_key(f, k),diff --git a/host/src/tui/app/ui.rs b/host/src/tui/app/ui.rsindex f087fa0b..e632b13c 100644--- a/host/src/tui/app/ui.rs+++ b/host/src/tui/app/ui.rs@@ -5,7 +5,7 @@ use std::collections::BTreeMap;use std::time::Instant;use super::super::manage::{- AgentSetup, AnalyticsSheet, BotChatSheet, Fields, Library, Market, MemorySheet, NetworkSheet, RoutineForm,+ AgentSetup, AnalyticsSheet, BotChatSheet, Fields, Gear, Library, Market, MemorySheet, NetworkSheet, RoutineForm,RoutineList, SkillSheet,};use super::{Editor, Mark};@@ -320,6 +320,7 @@ pub enum Overlay {Routines(RoutineList),Routine(Box<RoutineForm>),Library(Library),+ Gear(Gear),Market(Box<Market>),Agent(AgentSetup),Fields(Box<Fields>),diff --git a/host/src/tui/manage/gear.rs b/host/src/tui/manage/gear.rsnew file mode 100644index 00000000..07cef6ce--- /dev/null+++ b/host/src/tui/manage/gear.rs@@ -0,0 +1,158 @@+//! A bot's Skills and Connectors pages: what its agent already has, then the Codync ones it passes on.++use crossterm::event::{KeyCode, KeyEvent};+use serde_json::{Value, json};++use super::super::app::{After, App, Overlay};+use super::{Page, Reply};++/// Which of the two pages is open.+#[derive(Clone, Copy, PartialEq, Eq, Debug)]+pub enum GearKind {+ Skills,+ Connectors,+}++impl GearKind {+ pub fn page(self) -> Page {+ match self {+ Self::Skills => Page::Skills,+ Self::Connectors => Page::Connectors,+ }+ }++ fn field(self) -> &'static str {+ match self {+ Self::Skills => "skills",+ Self::Connectors => "connectors",+ }+ }+}++/// One skill or connector the agent keeps for itself.+#[derive(Clone, Debug)]+pub struct GearItem {+ pub name: String,+ pub detail: String,+}++/// The Skills or Connectors page of one bot.+pub struct Gear {+ pub bot: String,+ pub kind: GearKind,+ /// `None` until `agentGear` answers.+ pub agent_skills: Option<Vec<GearItem>>,+ pub agent_connectors: Option<Vec<GearItem>>,+ pub failed: bool,+ pub cursor: usize,+}++impl Gear {+ pub fn agent(&self) -> Option<&[GearItem]> {+ match self.kind {+ GearKind::Skills => self.agent_skills.as_deref(),+ GearKind::Connectors => self.agent_connectors.as_deref(),+ }+ }+}++pub(super) fn items(value: &Value) -> Vec<GearItem> {+ value+ .as_array()+ .map(|rows| {+ rows.iter()+ .filter_map(|row| {+ let name = row["name"].as_str()?.trim();+ if name.is_empty() {+ return None;+ }+ let detail = row["description"]+ .as_str()+ .filter(|s| !s.is_empty())+ .or_else(|| row["detail"].as_str())+ .unwrap_or("")+ .to_owned();+ Some(GearItem { name: name.to_owned(), detail })+ })+ .collect()+ })+ .unwrap_or_default()+}++impl App {+ pub(in crate::tui) fn open_gear(&mut self, kind: GearKind) {+ let Some(bot) = self.bot().filter(|bot| !bot.group) else {+ self.flash("Skills and connectors belong to a bot, not a group");+ return;+ };+ let id = bot.id.clone();+ let backend = bot.backend.clone();+ let cwd = bot.cwd.clone();+ self.sheet("agentGear", json!({"backend": backend, "cwd": cwd}), Reply::Gear(id.clone()));+ self.call("connectors", json!({}), After::Connectors);+ self.call("skills", json!({}), After::Skills);+ self.overlays.push(Overlay::Gear(Gear {+ bot: id,+ kind,+ agent_skills: None,+ agent_connectors: None,+ failed: false,+ cursor: 0,+ }));+ }++ pub(in crate::tui) fn gear_key(&mut self, mut gear: Gear, key: KeyEvent) -> Option<Overlay> {+ if let Some(page) = gear.kind.page().step(key) {+ self.open_page(page);+ return None;+ }+ let count = self.gear_toggles(&gear).len();+ gear.cursor = gear.cursor.min(count.saturating_sub(1));+ match key.code {+ KeyCode::Esc | KeyCode::Char('q') => return None,+ KeyCode::Down | KeyCode::Char('j') => gear.cursor = (gear.cursor + 1).min(count.saturating_sub(1)),+ KeyCode::Up | KeyCode::Char('k') => gear.cursor = gear.cursor.saturating_sub(1),+ KeyCode::Char(' ') | KeyCode::Enter => self.toggle_gear(&gear),+ _ => {}+ }+ Some(Overlay::Gear(gear))+ }++ /// Installed Codync connectors or skills, and whether this bot passes each one on.+ pub(in crate::tui) fn gear_toggles(&self, gear: &Gear) -> Vec<(String, String, bool)> {+ let Some(bot) = self.bots.get(&gear.bot) else { return Vec::new() };+ let (installed, enabled) = match gear.kind {+ GearKind::Skills => (&self.market.1, &bot.skills),+ GearKind::Connectors => (&self.market.0, &bot.connectors),+ };+ installed+ .iter()+ .map(|item| (item.id.clone(), item.name.clone(), enabled.iter().any(|id| id == &item.id)))+ .collect()+ }++ fn toggle_gear(&mut self, gear: &Gear) {+ let (bot_id, field, ids) = {+ let Some(bot) = self.bots.get(&gear.bot) else { return };+ let installed = match gear.kind {+ GearKind::Skills => &self.market.1,+ GearKind::Connectors => &self.market.0,+ };+ let Some(item) = installed.get(gear.cursor) else { return };+ let id = item.id.clone();+ let mut ids = match gear.kind {+ GearKind::Skills => bot.skills.clone(),+ GearKind::Connectors => bot.connectors.clone(),+ };+ if ids.iter().any(|have| have == &id) {+ ids.retain(|have| have != &id);+ } else {+ ids.push(id);+ }+ (gear.bot.clone(), gear.kind.field(), ids)+ };+ let mut body = json!({"id": bot_id});+ body[field] = json!(ids);+ self.call("updateBot", body, After::Nothing);+ }+}diff --git a/host/src/tui/manage/mod.rs b/host/src/tui/manage/mod.rsindex e5cc7b00..f3bf905d 100644--- a/host/src/tui/manage/mod.rs+++ b/host/src/tui/manage/mod.rs@@ -9,6 +9,7 @@ mod agent;mod analytics;mod bot_chat;mod fields;+mod gear;mod library;mod market;mod memory;@@ -23,6 +24,7 @@ mod when;pub use analytics::AnalyticsSheet;pub use fields::handoff_fields;+pub use gear::{Gear, GearKind};pub use library::{ArtifactTitles, LibraryItem};pub use memory::{MemoryMode, MemorySheet, Scroll, Section};pub use network::{NetReply, NetworkSheet, Recovery, Step};@@ -53,6 +55,8 @@ pub enum Reply {RoutineSaved,/// A bot's Library (`library {botId}`).Library(String),+ /// What an agent brings on its own (`agentGear`), for the bot's Skills or Connectors page.+ Gear(String),/// A routine's webhook URL and key: copied as a ready-to-run curl.Webhook,/// A bot conversation's fetched history.diff --git a/host/src/tui/manage/pages.rs b/host/src/tui/manage/pages.rsindex 65963124..40ca92ef 100644--- a/host/src/tui/manage/pages.rs+++ b/host/src/tui/manage/pages.rs@@ -1,6 +1,6 @@//! A bot's pages of details, as in the desktop inspector and the iPhone's details: Details (whether it//! may use the computer, and its routines), Library (the artifacts it made and the files shared in its-//! chat), Memory and Settings. Shift+←→ moves between them.+//! chat), Memory, Settings, Skills and Connectors. Shift+←→ moves between them.use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};@@ -12,10 +12,13 @@ pub enum Page {Library,Memory,Settings,+ Skills,+ Connectors,}impl Page {- pub const ALL: [Self; 4] = [Self::Details, Self::Library, Self::Memory, Self::Settings];+ pub const ALL: [Self; 6] =+ [Self::Details, Self::Library, Self::Memory, Self::Settings, Self::Skills, Self::Connectors];pub fn label(self) -> &'static str {match self {@@ -23,6 +26,8 @@ impl Page {Self::Library => "Library",Self::Memory => "Memory",Self::Settings => "Settings",+ Self::Skills => "Skills",+ Self::Connectors => "Connectors",}}@@ -49,6 +54,8 @@ impl App {Page::Library => self.open_library(),Page::Memory => self.open_memory(),Page::Settings => self.edit_bot(),+ Page::Skills => self.open_gear(super::GearKind::Skills),+ Page::Connectors => self.open_gear(super::GearKind::Connectors),}}}@@ -63,7 +70,10 @@ mod tests {assert_eq!(Page::Details.step(key(KeyCode::Right)), Some(Page::Library));assert_eq!(Page::Memory.step(key(KeyCode::Left)), Some(Page::Library));assert_eq!(Page::Library.step(key(KeyCode::Left)), Some(Page::Details));- assert_eq!(Page::Settings.step(key(KeyCode::Right)), None);+ assert_eq!(Page::Settings.step(key(KeyCode::Right)), Some(Page::Skills));+ assert_eq!(Page::Skills.step(key(KeyCode::Right)), Some(Page::Connectors));+ assert_eq!(Page::Connectors.step(key(KeyCode::Left)), Some(Page::Skills));+ assert_eq!(Page::Connectors.step(key(KeyCode::Right)), None);assert_eq!(Page::Details.step(key(KeyCode::Left)), None);assert_eq!(Page::Memory.step(KeyEvent::new(KeyCode::Right, KeyModifiers::NONE)),diff --git a/host/src/tui/manage/replies.rs b/host/src/tui/manage/replies.rsindex 4fb5fcf0..577a1680 100644--- a/host/src/tui/manage/replies.rs+++ b/host/src/tui/manage/replies.rs@@ -88,6 +88,19 @@ impl App {}}Reply::Library(bot) => self.library_loaded(&bot, v["items"].as_array().map_or(&[], Vec::as_slice)),+ Reply::Gear(bot) => {+ let skills = super::gear::items(&v["skills"]);+ let connectors = super::gear::items(&v["connectors"]);+ for overlay in &mut self.overlays {+ if let Overlay::Gear(gear) = overlay+ && gear.bot == bot+ {+ gear.agent_skills = Some(skills.clone());+ gear.agent_connectors = Some(connectors.clone());+ gear.failed = false;+ }+ }+ }Reply::RoutineSaved => {if let Some(i) = self.overlays.iter().rposition(|o| matches!(o, Overlay::Routine(_))) {self.overlays.truncate(i);@@ -294,6 +307,18 @@ impl App {}self.flash(&e);}+ Reply::Gear(bot) => {+ for o in &mut self.overlays {+ if let Overlay::Gear(gear) = o+ && gear.bot == *bot+ {+ gear.agent_skills.get_or_insert_with(Vec::new);+ gear.agent_connectors.get_or_insert_with(Vec::new);+ gear.failed = true;+ }+ }+ self.flash(&e);+ }Reply::Memory(_) | Reply::MemorySaved(_) | Reply::MemoryFile(_) | Reply::Routines(_) => {for o in &mut self.overlays {match o {@@ -329,6 +354,7 @@ impl App {/// Loads what every open sheet shows again, after a change.pub(in crate::tui) fn refresh_sheets(&mut self) {let mut calls: Vec<(&'static str, Value, After)> = vec![];+ let mut gear_ids = Vec::new();for o in &self.overlays {match o {Overlay::Memory(m) => {@@ -343,6 +369,11 @@ impl App {Overlay::Library(l) => {calls.push(("library", json!({"botId": l.bot}), After::Sheet(Reply::Library(l.bot.clone()))));}+ Overlay::Gear(gear) => {+ gear_ids.push(gear.bot.clone());+ calls.push(("connectors", json!({}), After::Connectors));+ calls.push(("skills", json!({}), After::Skills));+ }Overlay::Market(_) | Overlay::Form(_) => {calls.push(("connectors", json!({}), After::Connectors));calls.push(("skills", json!({}), After::Skills));@@ -350,6 +381,15 @@ impl App {_ => {}}}+ for id in gear_ids {+ if let Some(bot) = self.bots.get(&id) {+ calls.push((+ "agentGear",+ json!({"backend": bot.backend, "cwd": bot.cwd}),+ After::Sheet(Reply::Gear(id)),+ ));+ }+ }calls.dedup_by(|a, b| a.0 == b.0 && a.1 == b.1);for (m, body, after) in calls {self.call(m, body, after);diff --git a/host/src/tui/sheets.rs b/host/src/tui/sheets.rsindex 4f71dab5..c7d12a50 100644--- a/host/src/tui/sheets.rs+++ b/host/src/tui/sheets.rs@@ -10,9 +10,11 @@ use ratatui::style::{Modifier, Style};use crate::tui::l10n::tr;use serde_json::Value;+mod gear_view;mod library_view;mod market_view;mod memory_view;+pub use gear_view::draw as gear;pub use library_view::draw as library;pub use market_view::draw as market;pub use memory_view::draw as memory;diff --git a/host/src/tui/sheets/gear_view.rs b/host/src/tui/sheets/gear_view.rsnew file mode 100644index 00000000..b5dd69d9--- /dev/null+++ b/host/src/tui/sheets/gear_view.rs@@ -0,0 +1,90 @@+//! The Skills and Connectors pages: the agent's own rows, then Codync's switches.++use super::{App, Buffer, Rect, centered, footer, frame_box, name_of, page_tabs, put, row, theme, truncate, window};+use crate::tui::l10n::tr;+use crate::tui::manage::{Gear, GearKind};++pub fn draw(buf: &mut Buffer, area: Rect, app: &App, gear: &Gear) {+ let t = theme();+ let frame = centered(area, 90, 28);+ let title = name_of(app, &gear.bot);+ let inner = frame_box(buf, frame, t.text, t.panel, Some((&title, t.text)));+ let inner = page_tabs(buf, inner, gear.kind.page());+ let agent = app.bots.get(&gear.bot).map(|bot| app.agent_name(&bot.backend)).unwrap_or_default();+ let intro = tr("{agent} brings these. Codync adds its own on top, and those are what get passed to the agent.")+ .replace("{agent}", &agent);+ let mut y = inner.y;+ let bottom = inner.bottom().saturating_sub(2);+ if y < bottom {+ put(buf, inner.x, y, inner.width, &intro, t.secondary.patch(t.panel));+ y += 2;+ }+ let from_agent = tr("From {agent}").replace("{agent}", &agent);+ if y < bottom {+ put(buf, inner.x, y, inner.width, &from_agent, t.bold.patch(t.panel));+ y += 1;+ }+ y = agent_rows(buf, inner, y, bottom, gear);+ if y < bottom {+ y += 1;+ put(buf, inner.x, y, inner.width, &tr("From Codync"), t.bold.patch(t.panel));+ y += 1;+ }+ let toggles = app.gear_toggles(gear);+ let room = usize::from(bottom.saturating_sub(y));+ if toggles.is_empty() {+ if y < bottom {+ let empty = match gear.kind {+ GearKind::Skills => "No skills yet. Get some from Extensions, or write your own.",+ GearKind::Connectors => "No connectors yet. Add GitHub, Linear, Notion and more from Extensions.",+ };+ put(buf, inner.x, y, inner.width, &tr(empty), t.dim.patch(t.panel));+ }+ } else {+ let cursor = gear.cursor.min(toggles.len().saturating_sub(1));+ for (offset, (_id, name, on)) in toggles.iter().enumerate().skip(window(cursor, room)).take(room) {+ let base = row(buf, inner, y, offset == cursor);+ let mark = if *on { "☑" } else { "☐" };+ put(buf, inner.x, y, inner.width, &format!("{mark} {name}"), t.text.patch(base));+ y += 1;+ }+ }+ footer(buf, inner, None, "space on / off · ⇧←→ page · esc");+}++fn agent_rows(buf: &mut Buffer, inner: Rect, mut y: u16, bottom: u16, gear: &Gear) -> u16 {+ let t = theme();+ match gear.agent() {+ None => {+ if y < bottom {+ put(buf, inner.x, y, inner.width, &tr("Loading…"), t.dim.patch(t.panel));+ y += 1;+ }+ }+ Some(_) if gear.failed => {+ if y < bottom {+ put(buf, inner.x, y, inner.width, &tr("Couldn't load what this agent brings."), t.red.patch(t.panel));+ y += 1;+ }+ }+ Some([]) => {+ if y < bottom {+ put(buf, inner.x, y, inner.width, &tr("None from this agent."), t.dim.patch(t.panel));+ y += 1;+ }+ }+ Some(items) => {+ let room = usize::from(bottom.saturating_sub(y).saturating_sub(3));+ for item in items.iter().take(room.max(1)) {+ if y >= bottom {+ break;+ }+ let line =+ if item.detail.is_empty() { item.name.clone() } else { format!("{} {}", item.name, item.detail) };+ put(buf, inner.x, y, inner.width, &truncate(&line, usize::from(inner.width)), t.text.patch(t.panel));+ y += 1;+ }+ }+ }+ y+}diff --git a/host/src/tui/view/help.rs b/host/src/tui/view/help.rsindex 2ffc0ff3..663ff944 100644--- a/host/src/tui/view/help.rs+++ b/host/src/tui/view/help.rs@@ -63,7 +63,7 @@ const HELP: [(&str, &str, &str); 69] = [("BOTS", "R", "details: routines, computer"),("BOTS", "B", "details: switch back to the bot's own agent"),("BOTS", "L", "library: artifacts and files; open, save, rename"),- ("BOTS", "⇧← ⇧→", "between details, library, memory, settings"),+ ("BOTS", "⇧← ⇧→", "between details, library, memory, settings, skills and connectors"),("BOTS", "A", "extensions, sign-in"),("BOTS", "x", "delete bot or group"),("VIEW", "t", "trace pane"),diff --git a/host/src/tui/view/overlay.rs b/host/src/tui/view/overlay.rsindex e6da35a0..4514f119 100644--- a/host/src/tui/view/overlay.rs+++ b/host/src/tui/view/overlay.rs@@ -133,6 +133,7 @@ pub(super) fn overlay(buf: &mut Buffer, area: Rect, app: &mut App, top: &OverlayOverlay::Routines(l) => super::super::sheets::routines(buf, area, app, l),Overlay::Routine(f) => super::super::sheets::routine(buf, area, f),Overlay::Library(l) => super::super::sheets::library(buf, area, app, l),+ Overlay::Gear(g) => super::super::sheets::gear(buf, area, app, g),Overlay::Market(m) => super::super::sheets::market(buf, area, app, m),Overlay::Agent(a) => super::super::sheets::agent(buf, area, app, a),Overlay::Fields(f) => super::super::sheets::fields(buf, area, f),diff --git a/web/content/docs/bots.mdx b/web/content/docs/bots.mdxindex aecec2f4..be2c3347 100644--- a/web/content/docs/bots.mdx+++ b/web/content/docs/bots.mdx@@ -18,9 +18,10 @@ The host on your computer runs every bot. A bot's agent starts when you send it## Where to change a bot's settings-- **iPhone:** open the bot's chat and tap its name at the top, for the tabs **Details**, **Library**, **Memory** and **Settings**. **Details** shows its instructions, agent, model and routines; **Settings** shows the rest. Changes save as you edit. You can also touch and hold the bot in the list and choose **Edit profile**.-- **Desktop:** click the bot's name at the top of the chat to open the details panel, with the tabs **Details**, **Library**, **Memory** and **Settings**. Changes save as you edit. You can also right-click the bot in the sidebar and choose **Edit Profile…**-- **Terminal UI:** select the bot and press `e`. Press Ctrl+S to save, or Esc to drop your changes.+- **iPhone:** open the bot's chat and tap its name at the top, for the tabs **Details**, **Library**, **Memory**, **Settings**, **Skills** and **Connectors**. **Details** shows its instructions, agent, model and routines; **Settings** shows the rest. **Skills** and **Connectors** show what that agent already brings, and the Codync ones passed on top. Changes save as you edit. You can also touch and hold the bot in the list and choose **Edit profile**.+- **Desktop:** click the bot's name at the top of the chat to open the details panel, with the same tabs. Changes save as you edit. You can also right-click the bot in the sidebar and choose **Edit Profile…**+- **Android:** the same sheet, without **Memory** until that screen is ported.+- **Terminal UI:** select the bot and press `e` for settings. Shift+Left and Shift+Right move between the same pages, including **Skills** and **Connectors**. Press Ctrl+S to save, or Esc to drop your changes.## Profile@@ -75,7 +76,7 @@ How approval cards work: [Conversations](/docs/conversations#approval-cards).## Connectors and skills-The **Connectors** and **Skills** sections list everything installed on the computer, each with a switch. A new bot starts with all of them on; turn off what a bot shouldn't use. A skill a bot writes for itself is on only for that bot until you turn it on for others. See [Connectors and skills](/docs/connectors-and-skills).+The **Skills** and **Connectors** tabs list two groups. The first is named for the agent (From Claude Code, for example): the skills it already has, and the MCP servers in its config for this bot's folder. Those rows are there to read; Codync does not turn them on or off. **From Codync** is what Codync adds on top and passes to the agent. Each of those has a switch. A new bot starts with all of them on; turn off what a bot shouldn't use. A skill a bot writes for itself is on only for that bot until you turn it on for others. The full editor (Edit profile) still has the same switches. See [Connectors and skills](/docs/connectors-and-skills).## Memory and routinesdiff --git a/web/content/docs/connectors-and-skills.mdx b/web/content/docs/connectors-and-skills.mdxindex 7b4a5803..7d25e5fb 100644--- a/web/content/docs/connectors-and-skills.mdx+++ b/web/content/docs/connectors-and-skills.mdx@@ -76,11 +76,11 @@ The cards themselves hold no credentials. You can answer them in the iPhone app,## Turn connectors and skills on or off per bot-A connector or skill you add is turned on for every bot, and new bots start with all of them on (without a credential store, as on a [headless Linux server](/docs/linux-servers#limits-on-a-headless-server), new bots start with no connectors). To turn one off for a bot, open the bot's **Settings** tab:+A connector or skill you add is turned on for every bot, and new bots start with all of them on (without a credential store, as on a [headless Linux server](/docs/linux-servers#limits-on-a-headless-server), new bots start with no connectors). To turn one off for a bot, open the bot and choose **Skills** or **Connectors**. The top group is what that agent already brings. The **From Codync** group is what Codync passes on; each switch there is one you added.-- **Desktop app:** click the bot's name at the top of the chat, then **Settings**.-- **iPhone:** tap the bot's name at the top of the chat, then the **Settings** tab.-- **Terminal UI:** press `e` on the bot, then use the **Connectors** and **Skills** fields (space toggles).+- **Desktop app:** click the bot's name at the top of the chat, then **Skills** or **Connectors**.+- **iPhone and Android:** tap the bot's name at the top of the chat, then the **Skills** or **Connectors** tab.+- **Terminal UI:** Shift+Right from settings opens **Skills**, then **Connectors**. Space toggles a Codync row. The settings form (`e`) still has the same fields.The bot picks up the change on its next turn, in the same conversation.