Your team of AI agents, on your Mac, Windows or Linux. Agents that talk in channels, write code, review each other and use your tools, on the Claude Code, Codex, OpenCode or Pi you already have. Anything that touches the real world waits for your yes.
TypeScript agent-teamagentic-aiai-agentsai-assistantclaude-codecodexcursorelectrongrokgrok-bot-alternativelinuxlocal-firstmacosmcpmulti-agentopenclaw-alternativeopencodewindows
Connect more: Google, Slack, six services that ask first, and secrets from 1Password (#166)
Eduardo Machadoa1cda210a7bd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e7ce888..a6f2f90 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,13 @@ What changed in each version of Tucano. The format follows [Keep a Changelog](ht## [Unreleased]+### Added++- **Six more connectors in the store, for services that ask a few things first:** GitHub (a personal access token), Dynatrace and Snowflake (your instance and a token), Metabase (your address, then the browser sign-in), and Azure DevOps and AWS CloudWatch, which run the service's official server on this computer (with npx and uv). The store asks for what each needs in a window and adds the connector as the custom form would.+- **A connector's secrets can stay in 1Password.** In place of a token or a variable of a local connector's command, an `op://Vault/Item/field` reference: Tucano keeps only the reference and reads the value with the 1Password CLI on each connection, and says what to do when the CLI is missing, signed out or locked, or the item isn't there.+- **Gmail, Google Calendar, Google Drive, Google Docs and Google Sheets in the connector store**, through Google's own MCP servers. Google signs in only apps registered with it, so the first one walks you through making yours in Google Cloud, once, in five steps with a link for each; the other four then sign in with one click. Each asks only for what its tools need: Gmail searches, reads, drafts and labels but never sends nor deletes for good, and Drive writes only the files it made or opened. The Tuca's guide explains the steps and what to check when Google turns a sign-in away.+- **Slack in the connector store**, through Slack's own MCP server. Slack takes only directory apps or a workspace's internal apps, so the first Connect makes yours from a link that fills it all in (permissions, MCP on, the address to come back to): pick the workspace, create, paste its Client ID and Secret. Agents act as you, with a user token, through the same classes and approvals. The sign-in comes back through the workspace's fixed webhook port, since Slack takes only the address registered in the app. Google's or Slack's app can be changed from the connector's page.+## [0.2.13] - 2026-11-06> **Em português:**diff --git a/src/core/connectors.ts b/src/core/connectors.tsindex e372436..e61e623 100644--- a/src/core/connectors.ts+++ b/src/core/connectors.ts@@ -12,10 +12,12 @@ import type { OAuthClientInformationMixed, OAuthClientMetadata, OAuthTokens } frimport { L } from '../shared/lang'import { friendly } from '../shared/errors'import type { CoreEvent } from '../shared/rpc'+import { ownAppOf, type AppProvider, type CatalogEntry } from '../shared/connector-catalog'import type { Connector, ConnectorInput, ConnectorStatus, ConnectorTool } from '../shared/types'import type { Db } from './db'import { classify } from './policy'import type { Secrets } from './secrets'+import { OpError, resolveOp, resolveOpRefs } from './onepassword'const CALL_TIMEOUT_MS = 120_000// A server that doesn't answer the handshake shows an error instead of "conectando…" for a minute.@@ -80,7 +82,12 @@ export interface ConnectorDeps {emit: (e: CoreEvent) => voidopenUrl: (url: string) => voidoauthCallbackUrl: () => string+ readOp?: (ref: string) => Promise<string> // a 1Password reference's value (the op CLI; tests fake it)callTimeoutMs?: number // how long a tool call may take; tests shorten it+ // Where a sign-in with the person's own app comes back: Slack takes only the address registered in the+ // app, port and all, which the gateway's (new on each launch) can't be.+ fixedCallbackUrl?: () => string+ ownAppOf?: (url: string | undefined) => CatalogEntry['app'] // which servers sign in with the person's app; tests point it at their own}interface Live {@@ -102,6 +109,33 @@ export const staleSession = (e: unknown): boolean =>(e instanceof StreamableHTTPError && e.code === 404) || (e instanceof Error && /session not found|no valid session|invalid session id|^not connected$/i.test(e.message))const key = (id: string, what: string): string => `connector:${id}:${what}`+const appKey = (provider: AppProvider): string => `${provider}:app`+const PROVIDER = { google: 'Google', slack: 'Slack' } satisfies Record<AppProvider, string>++// The OAuth client the person made (in Google Cloud, in their Slack workspace): neither takes an app it hasn't met.+export interface OwnApp {+ clientId: string+ clientSecret: string+}++// The authorization page, asking only for the scopes the connector's tools need (Google's servers list+// the full ones too, which the SDK would ask for). Google's also asks for a refresh token: it gives one+// only offline, and only on consent, so a connector doesn't stop working an hour after signing in.+export function ownAuthorization(url: URL, app: NonNullable<CatalogEntry['app']>): URL {+ const u = new URL(url)+ u.searchParams.set('scope', app.scopes.join(' '))+ if (app.provider === 'google') {+ u.searchParams.set('access_type', 'offline')+ u.searchParams.set('prompt', 'consent')+ }+ return u+}++// What a client ID of each looks like: Google's end in .apps.googleusercontent.com, Slack's are two numbers.+const CLIENT_ID: Record<AppProvider, { re: RegExp; pt: string; en: string }> = {+ google: { re: /^[\w.-]+\.apps\.googleusercontent\.com$/, pt: 'ele termina em .apps.googleusercontent.com', en: 'it ends in .apps.googleusercontent.com' },+ slack: { re: /^\d+\.\d+$/, pt: 'são dois números com um ponto, como 1234567890.1234567890', en: 'it is two numbers with a dot, like 1234567890.1234567890' }+}// The gateway's callback port changes on every launch, and RFC 8252 §7.3 has an// authorization server treat a loopback redirect as port-agnostic. Comparing the@@ -179,6 +213,38 @@ export class ConnectorManager {return id}+ // The person's app for a provider, and the address its sign-in comes back to (Slack's app registers it).+ async ownApp(provider: AppProvider): Promise<{ clientId?: string; redirectUrl: string }> {+ const app = await this.deps.secrets.getJson<OwnApp>(appKey(provider))+ return { ...(app ? { clientId: app.clientId } : {}), redirectUrl: this.redirectFor(provider) }+ }++ // Saves the person's app. Another one leaves its connectors signed in to the old one without a way+ // to renew: they sign in again, with this one.+ async setOwnApp(provider: AppProvider, input: OwnApp): Promise<void> {+ const clientId = input.clientId.trim()+ const clientSecret = input.clientSecret.trim()+ const shape = CLIENT_ID[provider]+ if (!shape.re.test(clientId)) throw new Error(L(`Esse não parece um ID do cliente do ${PROVIDER[provider]}: ${shape.pt}.`, `That doesn't look like a ${PROVIDER[provider]} client ID: ${shape.en}.`))+ if (!clientSecret) throw new Error(L('Cole a chave secreta do cliente.', 'Paste the client secret.'))+ const before = await this.deps.secrets.getJson<OwnApp>(appKey(provider))+ await this.deps.secrets.setJson(appKey(provider), { clientId, clientSecret })+ if (before && before.clientId === clientId) return+ for (const c of this.deps.db.connectors()) {+ if (c.kind !== 'remote' || this.appOf(c.url)?.provider !== provider) continue+ await this.deps.secrets.set(key(c.id, 'oauth_tokens'), undefined)+ void this.connect(c.id)+ }+ }++ private appOf(url: string | undefined): CatalogEntry['app'] {+ return (this.deps.ownAppOf ?? ownAppOf)(url)+ }++ private redirectFor(provider: AppProvider): string {+ return provider === 'slack' && this.deps.fixedCallbackUrl ? this.deps.fixedCallbackUrl() : this.deps.oauthCallbackUrl()+ }+// Sets or replaces the token of a connector that signs in with one, and connects with it.async setToken(id: string, token: string): Promise<void> {const c = this.deps.db.connector(id)@@ -255,20 +321,32 @@ export class ConnectorManager {{ listChanged: { tools: { onChanged: () => void this.refreshTools(id).catch(() => {}) } } })let transport: Transport- if (c.kind === 'remote') {- const headers: Record<string, string> = {}- if (c.auth === 'token') {- const token = await this.deps.secrets.get(key(id, 'token'))- if (token) headers['Authorization'] = `Bearer ${token}`+ const own = c.kind === 'remote' && c.auth === 'oauth' ? this.appOf(c.url) : undefined+ if (own && !(await this.deps.secrets.getJson<OwnApp>(appKey(own.provider)))) {+ const name = PROVIDER[own.provider]+ this.setStatus(id, 'error', L(`Falta o seu app do ${name}: em Conectores, clique em Conectar no ${own.provider === 'google' ? 'conector do Google' : 'Slack'} e siga os passos.`, `Your ${name} app is missing: in Connectors, click Connect on ${own.provider === 'google' ? 'a Google connector' : 'Slack'} and follow the steps.`))+ return+ }+ try {+ if (c.kind === 'remote') {+ const headers: Record<string, string> = {}+ if (c.auth === 'token') {+ const token = await this.deps.secrets.get(key(id, 'token'))+ if (token) headers['Authorization'] = `Bearer ${await resolveOp(token, this.deps.readOp)}`+ }+ const http: StreamableHTTPClientTransport = new StreamableHTTPClientTransport(new URL(c.url!), {+ requestInit: { headers },+ authProvider: c.auth === 'oauth' ? this.oauthProvider(id, () => http, interactive, own) : undefined+ })+ transport = http+ } else {+ const env = await resolveOpRefs((await this.deps.secrets.getJson<Record<string, string>>(key(id, 'env'))) ?? {}, this.deps.readOp)+ transport = new StdioClientTransport({ command: c.command!, args: c.args, env: { ...getDefaultEnvironment(), ...env }, stderr: 'ignore' })}- const http: StreamableHTTPClientTransport = new StreamableHTTPClientTransport(new URL(c.url!), {- requestInit: { headers },- authProvider: c.auth === 'oauth' ? this.oauthProvider(id, () => http, interactive) : undefined- })- transport = http- } else {- const env = (await this.deps.secrets.getJson<Record<string, string>>(key(id, 'env'))) ?? {}- transport = new StdioClientTransport({ command: c.command!, args: c.args, env: { ...getDefaultEnvironment(), ...env }, stderr: 'ignore' })+ } catch (e) {+ // A 1Password secret that wasn't read: it needs you (unlock, install the CLI), so no retries.+ this.setStatus(id, 'error', e instanceof OpError ? e.message : connectError(e))+ return}try {@@ -440,9 +518,10 @@ export class ConnectorManager {return true}- private oauthProvider(id: string, transport: () => StreamableHTTPClientTransport, interactive: boolean): OAuthClientProvider {+ // `own`: a server that signs in with the person's own app (Google's, Slack's) instead of registering one.+ private oauthProvider(id: string, transport: () => StreamableHTTPClientTransport, interactive: boolean, own?: CatalogEntry['app']): OAuthClientProvider {const { secrets } = this.deps- const redirectUrl = this.deps.oauthCallbackUrl()+ const redirectUrl = own ? this.redirectFor(own.provider) : this.deps.oauthCallbackUrl()let state = ''return {get redirectUrl() {@@ -466,23 +545,28 @@ export class ConnectorManager {// redirect). Signing in again, it must be the exact address: a server that// doesn't take any port on loopback would turn the new one away, so it registers again.clientInformation: async () => {+ if (own) {+ const app = await secrets.getJson<OwnApp>(appKey(own.provider))+ return app && { client_id: app.clientId, client_secret: app.clientSecret }+ }const info = await secrets.getJson<OAuthClientInformationMixed & { redirect_uris?: string[] }>(key(id, 'oauth_client'))const fits = (u: string): boolean => (interactive ? u === redirectUrl : sameLoopbackRedirect(u, redirectUrl))return info && (!info.redirect_uris || info.redirect_uris.some(fits)) ? info : undefined},- saveClientInformation: (info) => secrets.setJson(key(id, 'oauth_client'), { ...info, redirect_uris: [redirectUrl] }),+ saveClientInformation: (info) => (own ? undefined : secrets.setJson(key(id, 'oauth_client'), { ...info, redirect_uris: [redirectUrl] })),tokens: () => secrets.getJson<OAuthTokens>(key(id, 'oauth_tokens')),saveTokens: (t) => secrets.setJson(key(id, 'oauth_tokens'), t),saveCodeVerifier: (v) => secrets.set(key(id, 'oauth_verifier'), v),codeVerifier: async () => (await secrets.get(key(id, 'oauth_verifier'))) ?? '',- redirectToAuthorization: (url) => {+ redirectToAuthorization: (page) => {if (!interactive) return // never pop a browser on a background reconnect+ const url = own ? ownAuthorization(page, own) : pagethis.oauthStates.set(state || url.searchParams.get('state') || '', { connectorId: id, transport: transport() })this.authUrls.set(id, url.toString())this.deps.openUrl(url.toString())},invalidateCredentials: async (scope) => {- if (scope === 'all' || scope === 'client') await secrets.set(key(id, 'oauth_client'), undefined)+ if ((scope === 'all' || scope === 'client') && !own) await secrets.set(key(id, 'oauth_client'), undefined) // the app is the person'sif (scope === 'all' || scope === 'tokens') await secrets.set(key(id, 'oauth_tokens'), undefined)if (scope === 'all' || scope === 'verifier') await secrets.set(key(id, 'oauth_verifier'), undefined)}diff --git a/src/core/guide/conectores.md b/src/core/guide/conectores.mdindex fa96451..e6cdd4e 100644--- a/src/core/guide/conectores.md+++ b/src/core/guide/conectores.md@@ -6,9 +6,12 @@ Um conector é um servidor MCP: ele dá aos agentes ferramentas de um serviço (## Adicionar pela loja1. Abra **Conectores** (Connectors) na barra lateral.2. Busque o serviço (**Buscar conectores**) ou escolha pela categoria.-3. **Conectar**: o login abre no navegador. O acesso fica neste computador.+3. **Conectar**: o login abre no navegador. O acesso fica neste computador. Alguns perguntam antes o endereço da sua instância ou um token (GitHub, Dynatrace, Snowflake, Metabase), e o Azure DevOps e o AWS CloudWatch rodam o servidor oficial no seu computador (precisam do Node.js ou do uv).4. Dê acesso aos agentes: na página de cada um, **Ferramentas** › **Ferramentas e acesso**.+## Google e Slack+Gmail, Calendar, Drive, Docs e Sheets pedem um app seu no Google Cloud, criado uma vez: veja **google**. O Slack também pede um app seu, interno do seu workspace: veja **slack**.+## Personalizado**Adicionar personalizado** (Add custom) pra qualquer servidor MCP, inclusive os internos da empresa:- **Remoto (URL)**: o **URL do servidor MCP** e a **Autenticação**: **OAuth** (abre o navegador pra autorizar), **Token** (vai no cabeçalho Authorization: Bearer) ou **Nenhuma**.@@ -16,7 +19,7 @@ Um conector é um servidor MCP: ele dá aos agentes ferramentas de um serviço (Os servidores MCP que você já configurou no Claude Code, no Codex e nos outros aparecem numa lista própria: **Adicionar** traz cada um pro Tucano, com as permissões e aprovações daqui.-Credenciais ficam cifradas no cofre do sistema e nunca aparecem de novo. Pra trocar um token, **Token (substitui o atual)**.+Credenciais ficam cifradas no cofre do sistema e nunca aparecem de novo. No lugar de um token ou de uma variável, dá pra pôr uma referência do 1Password (`op://Cofre/Item/campo`): o Tucano guarda só a referência e lê o valor com o 1Password CLI a cada conexão. Pra trocar um token, **Token (substitui o atual)**.## As ferramentas de um conectorNa página do conector, cada ferramenta tem uma **Classe**: **leitura**, **escrita** ou **sensível**, e pode ser marcada como **Alto risco** ou desligada. Ferramentas novas que o servidor publicar depois entram desligadas até você revisar. Sensíveis sempre pedem aprovação (veja **aprovacoes**). **Quem usa:** mostra os agentes com acesso.@@ -30,5 +33,6 @@ Nos agentes, o nível por conector é **Sem acesso**, **Ler** (só as de leitura- **precisa autorizar**: **Autorizar no navegador** e entre de novo. Um conector OAuth renova sozinho entre aberturas do app; se o servidor recusar a renovação, ele pede login de novo.- **não conectou**: **Conectar de novo**. Se continuar, confira o endereço e o login.- O pedido de autorização expirou: feche e clique em **Conectar** de novo.+- Um do Google ou o Slack que não conecta: veja **google** ou **slack**.- Ferramenta que o agente precisa não aparece: veja se está ligada na página do conector, se o agente tem o nível certo e use **Atualizar ferramentas**.- **Remover** tira o acesso de todos os agentes; pra voltar, adicione de novo.diff --git a/src/core/guide/google.md b/src/core/guide/google.mdnew file mode 100644index 0000000..fb4fff9--- /dev/null+++ b/src/core/guide/google.md@@ -0,0 +1,20 @@+# Google: Gmail, Calendar, Drive, Docs e Sheets+> Conectar os serviços do Google: o app que a pessoa cria no Google Cloud uma vez, os 5 passos, o aviso de app não verificado e o que conferir quando o Google recusa.++O Google só deixa entrar apps cadastrados nele, então a pessoa cria o seu uma vez, no Google Cloud, e os cinco entram com ele. O primeiro **Conectar** num deles abre **Seu app do Google** com os passos:+1. Criar um projeto no Google Cloud.+2. Ativar as APIs (um link ativa as dez: a de cada serviço e a MCP de cada um).+3. Configurar a tela de login (Google Auth Platform › Começar): nome do app, e-mail, Público-alvo **Externo** (ou **Interno** numa conta Google Workspace de empresa), e o próprio e-mail em **Usuários de teste**.+4. Criar o cliente: tipo **App para computador**, com **Usar este cliente para um agente com IA** marcado. Sem essa marca o Google recusa os conectores.+5. Colar o **ID do cliente** e a **chave secreta do cliente** e clicar em **Salvar e conectar**.++Depois os outros quatro são um clique. Pra trocar de app: **Seu app do Google**, ao lado do título Google na loja; trocar desconecta os do Google, que pedem login de novo.++Com o app **em teste**, o Google pede login de novo a cada 7 dias. Pra parar: em Público-alvo, **Publicar app**; o login passa a mostrar "O Google não verificou este app", e como o app é da própria pessoa, é só clicar em **Avançado** e continuar.++O Gmail busca, lê, rascunha e põe marcadores, mas não envia nem apaga de vez. O Drive lê tudo e só escreve nos arquivos que criou ou abriu.++## Quando dá errado+- **Falta o seu app do Google**: clique em **Conectar** num deles e siga os passos.+- O Google recusa no login ou o conector não conecta depois: confira se o cliente é **App para computador**, se tem **Usar este cliente para um agente com IA** marcado, se as APIs estão ativadas no mesmo projeto do cliente e se o e-mail está em **Usuários de teste**.+- Pede login de novo toda semana: o app está **em teste**; publique-o (acima).diff --git a/src/core/guide/slack.md b/src/core/guide/slack.mdnew file mode 100644index 0000000..78bbdad--- /dev/null+++ b/src/core/guide/slack.md@@ -0,0 +1,18 @@+# Slack+> Conectar o Slack: o app interno que a pessoa cria a partir de um link, os 2 passos, a aprovação do admin e o que conferir quando não conecta.++O servidor MCP do Slack só aceita apps do diretório do Slack ou apps internos de um workspace. Então a pessoa cria o seu, interno, uma vez. O primeiro **Conectar** no Slack abre **Seu app do Slack** com os passos:+1. **Crie o app no Slack**: o link abre o Slack com tudo preenchido (o nome Tucano, as permissões, o endereço de volta e o MCP ligado). Escolha o workspace, **Próximo** e **Criar**.+2. Em **Basic Information › App Credentials**, copie o **Client ID** e o **Client Secret** (**Show**), cole e clique em **Salvar e conectar**. O login abre no navegador: **Permitir**.++Os agentes agem como a própria pessoa (um token de usuário): veem os canais e conversas que ela vê, e o que mandam sai no nome dela. Cada ferramenta continua passando pelas classes e aprovações do Tucano: dê acesso de escrita só a quem precisa mandar mensagens.++O login volta pela porta fixa do workspace (a dos gatilhos, 47717 no workspace padrão), que fica cadastrada no app. Num workspace novo do Tucano a porta é outra: crie outro app pelo link de lá.++Pra trocar de app: na página do conector, **Seu app do Slack**.++## Quando dá errado+- **Falta o seu app do Slack**: clique em **Conectar** no Slack e siga os passos.+- O Slack diz que o app precisa de aprovação: num workspace de empresa, o admin aprova em **Gerenciar apps**; depois, **Autorizar no navegador**.+- "redirect_uri did not match": o app foi criado com o link de outro workspace do Tucano. Crie de novo pelo link deste.+- O login não volta pro Tucano: outro programa está na porta dos gatilhos (outro Tucano aberto, por exemplo). Feche-o e autorize de novo.diff --git a/src/core/index.ts b/src/core/index.tsindex bc95531..c72beb9 100644--- a/src/core/index.ts+++ b/src/core/index.ts@@ -534,16 +534,19 @@ const connectors = new ConnectorManager({openUrl: (url) => serverMode || toMain({ type: 'open', url }),// On a server behind https (TUCANO_URL), the provider sends the person back to the server's own// address, which src/server hands over here; on a desktop, to the gateway on this computer.- oauthCallbackUrl: () => (serverMode && publicUrl?.startsWith('https://') ? `${publicUrl}/oauth/callback` : gateway.url('/oauth/callback'))+ oauthCallbackUrl: () => (serverMode && publicUrl?.startsWith('https://') ? `${publicUrl}/oauth/callback` : gateway.url('/oauth/callback')),+ // Slack's app registers its address once: the workspace's webhook port, which doesn't change.+ fixedCallbackUrl: () => (serverMode && publicUrl?.startsWith('https://') ? `${publicUrl}/oauth/callback` : `http://localhost:${runtimePorts.webhook}/oauth/callback`)})-gateway.route('/oauth/callback', async (url) => {+const oauthCallback = async (url: URL): Promise<string> => {const code = url.searchParams.get('code')const state = url.searchParams.get('state') ?? ''if (!code) return notAuthorized(url)return (await connectors.finishOAuth(state, code))? L('Conector autorizado. Pode fechar esta aba e voltar pro Tucano.', 'Connector authorized. You can close this tab and go back to Tucano.'): L('Esse pedido de autorização expirou. Tente de novo pelo app.', 'This authorization request expired. Try again from the app.')-})+}+gateway.route('/oauth/callback', oauthCallback)const memory = new Memories({ db, engines: engineImpls, settings: () => ready.then(settings), emit, workDir: join(dataDir, 'agents') })@@ -656,6 +659,14 @@ if (defaultWorkspace) telegram = new Telegram({// Routines started by something on this Mac: POST http://127.0.0.1:WEBHOOK_PORT/gatilho/<token>.const hooks = createServer((req, res) => {+ // The sign-in of a connector whose app registers a fixed address (Slack's) comes back here.+ if (req.method === 'GET' && req.url?.startsWith('/oauth/callback')) {+ void oauthCallback(new URL(req.url, 'http://localhost')).then(+ (text) => res.writeHead(200, { 'content-type': 'text/plain; charset=utf-8' }).end(text),+ (e: unknown) => res.writeHead(500, { 'content-type': 'text/plain; charset=utf-8' }).end(e instanceof Error ? e.message : String(e))+ )+ return+ }const m = /^\/gatilho\/([\w-]{10,})$/.exec(req.url ?? '')if (req.method !== 'POST' || !m) return void res.writeHead(404).end(L('Use POST /gatilho/<código>\n', 'Use POST /gatilho/<code>\n'))let body = ''@@ -1164,6 +1175,8 @@ const api: Api = {removeConnector: ({ id }) => void connectors.remove(id),reconnectConnector: ({ id }) => void connectors.connect(id),setConnectorToken: ({ id, token }) => connectors.setToken(id, token),+ ownApp: ({ provider }) => connectors.ownApp(provider),+ setOwnApp: ({ provider, clientId, clientSecret }) => connectors.setOwnApp(provider, { clientId, clientSecret }),authorizeConnector: async ({ id }) => {const url = await connectors.authorize(id)return serverMode && url ? { url } : {}diff --git a/src/core/onepassword.ts b/src/core/onepassword.tsnew file mode 100644index 0000000..3b27fa3--- /dev/null+++ b/src/core/onepassword.ts@@ -0,0 +1,50 @@+// A connector's secret (its token, a variable of its command) can be a 1Password reference instead of+// the value: op://Vault/Item/field. The app keeps only the reference; the value is read with the+// 1Password CLI on each connection, so it's never saved here, and 1Password asks you to unlock it.+import { execFile } from 'node:child_process'+import { L } from '../shared/lang'++export const isOpRef = (v: string | undefined): v is string => !!v && /^op:\/\/[^/]+\/[^/]+\/.+$/.test(v.trim())++// Time to unlock 1Password (Touch ID, the password) when it asks.+const READ_TIMEOUT_MS = 90_000++type Read = (ref: string) => Promise<string>++export class OpError extends Error {}++const opRead: Read = (ref) =>+ new Promise((resolve, reject) => {+ execFile('op', ['read', '--no-newline', ref], { timeout: READ_TIMEOUT_MS, windowsHide: true }, (err, stdout, stderr) => {+ if (!err) return resolve(stdout)+ reject(new OpError(opMessage(err as NodeJS.ErrnoException & { killed?: boolean }, String(stderr), ref)))+ })+ })++// Why a reference wasn't read, and what to do.+export function opMessage(err: { code?: string | number; killed?: boolean; message?: string }, stderr: string, ref: string): string {+ if (err.code === 'ENOENT')+ return L(+ 'Esse conector usa um segredo do 1Password, e o 1Password CLI (op) não foi encontrado. Instale (developer.1password.com/docs/cli) e ligue “Integrar com o 1Password CLI” nas configurações do app do 1Password.',+ 'This connector uses a 1Password secret, and the 1Password CLI (op) wasn’t found. Install it (developer.1password.com/docs/cli) and turn on “Integrate with 1Password CLI” in the 1Password app’s settings.'+ )+ if (err.killed) return L('O 1Password não foi desbloqueado a tempo. Conecte de novo e desbloqueie quando ele pedir.', '1Password wasn’t unlocked in time. Connect again and unlock it when it asks.')+ const why = stderr.replace(/^\[ERROR\]\s*\S+\s+\S+\s*/m, '').trim()+ if (/not (currently )?signed in|no accounts configured|sign in|authoriz/i.test(why))+ return L(+ 'O 1Password CLI não está conectado à sua conta. Ligue “Integrar com o 1Password CLI” nas configurações do app do 1Password, ou rode op signin.',+ 'The 1Password CLI isn’t signed in to your account. Turn on “Integrate with 1Password CLI” in the 1Password app’s settings, or run op signin.'+ )+ if (/isn't an item|not found|no item|could not find|isn't a vault|doesn't have a field/i.test(why))+ return L(`O 1Password não achou ${ref}. Confira o cofre, o item e o campo da referência.`, `1Password didn’t find ${ref}. Check the reference’s vault, item and field.`)+ return L(`O 1Password não leu ${ref}: ${why || err.message}`, `1Password didn’t read ${ref}: ${why || err.message}`)+}++export const resolveOp = async (v: string, read: Read = opRead): Promise<string> => (isOpRef(v) ? read(v.trim()) : v)++// Each value that's a reference, read; the others as they are.+export async function resolveOpRefs(values: Record<string, string>, read: Read = opRead): Promise<Record<string, string>> {+ const out: Record<string, string> = {}+ for (const [k, v] of Object.entries(values)) out[k] = await resolveOp(v, read)+ return out+}diff --git a/src/renderer/src/components/ConnectorStore.tsx b/src/renderer/src/components/ConnectorStore.tsxindex 8853c42..aa0a5af 100644--- a/src/renderer/src/components/ConnectorStore.tsx+++ b/src/renderer/src/components/ConnectorStore.tsx@@ -1,10 +1,13 @@// The Connectors page's grid: what's added, then what's ready to add, by category. One click signs-// in through the browser (or needs no sign-in); anything else goes in by hand, with "Adicionar personalizado".-import { useState, type ReactNode } from 'react'+// in through the browser (or needs no sign-in); a service that asks a few things first (its address,+// a token) asks them in a window; anything else goes in by hand, with "Adicionar personalizado".+// Google's and Slack's sign in with an app the person makes once, which the first Connect walks them through.+import { useEffect, useState, type ReactNode } from 'react'import { L } from '../../../shared/lang'-import { CATALOG, CATEGORIES, sameServer, searchCatalog, type CatalogEntry } from '../../../shared/connector-catalog'+import { catalogInput, CATEGORIES, entryOf, GOOGLE_APIS, searchCatalog, slackAppLink, type AppProvider, type CatalogEntry } from '../../../shared/connector-catalog'import { LOGOS } from '../connector-logos'-import { addConnector, authorizeConnector, useStore, type Connector } from '../store'+import { addConnector, authorizeConnector, openExternal, ownApp, setOwnApp, useStore, type Connector } from '../store'+import { Modal } from './Modal'import { Icon } from './ui'// A light brand color takes a dark mark, so every tile reads in both themes.@@ -14,7 +17,7 @@ const light = (hex: string): boolean => {}// Brands without a mark in Simple Icons, or with only a wordmark: their initial, on their color.-const OWN_COLOR: Record<string, string> = { jam: 'FF2D55', monday: '6161FF', granola: '3F6212', canva: '00C4CC', context7: '0F172A', exa: '1F40ED', aave: 'B6509E', coinbase: '0052FF', zapier: 'FF4F00' }+const OWN_COLOR: Record<string, string> = { jam: 'FF2D55', monday: '6161FF', granola: '3F6212', canva: '00C4CC', context7: '0F172A', exa: '1F40ED', aave: 'B6509E', coinbase: '0052FF', zapier: 'FF4F00', 'azure-devops': '0078D4', cloudwatch: 'E7157B' }export function CatalogLogo({ entry, size = 36 }: { entry: CatalogEntry; size?: number }): ReactNode {const logo = LOGOS[entry.id]@@ -43,15 +46,23 @@ export function ConnectorGrid({ status, onManage }: { status: Status; onManage:const [query, setQuery] = useState('')const [busy, setBusy] = useState<string | null>(null)const [error, setError] = useState<{ id: string; text: string } | null>(null)- const entryOf = (c: Connector): CatalogEntry | undefined => (c.kind === 'remote' ? CATALOG.find((e) => sameServer(c.url, e.url)) : undefined)+ const [setup, setSetup] = useState<CatalogEntry | null>(null)+ const [apps, setApps] = useState<Partial<Record<AppProvider, boolean>>>({}) // which own apps are saved+ const [appSetup, setAppSetup] = useState<{ provider: AppProvider; then?: CatalogEntry } | null>(null)+ useEffect(() => {+ for (const p of ['google', 'slack'] as const) void ownApp(p).then((a) => setApps((now) => ({ ...now, [p]: !!a.clientId })), () => {})+ }, [])+ const google = apps.googleconst words = query.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase().trim()const mine = connectors.filter((c) => !words || `${c.name} ${entryOf(c)?.about() ?? ''}`.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase().includes(words))- const found = searchCatalog(query).filter((e) => !connectors.some((c) => c.kind === 'remote' && sameServer(c.url, e.url)))+ const found = searchCatalog(query).filter((e) => !connectors.some((c) => entryOf(c)?.id === e.id))const connect = (c: CatalogEntry): void => {+ if (c.app && !apps[c.app.provider]) return setAppSetup({ provider: c.app.provider, then: c })+ if (c.fields?.length) return setSetup(c)setBusy(c.id)setError(null)- addConnector({ name: c.name, kind: 'remote', url: c.url, auth: c.auth })+ addConnector(catalogInput(c)).catch((e: unknown) => setError({ id: c.id, text: e instanceof Error ? e.message.replace(/^Error invoking.*?: /, '') : String(e) })).finally(() => setBusy(null))}@@ -127,7 +138,13 @@ export function ConnectorGrid({ status, onManage }: { status: Status; onManage:<div key={cat.id} className="catalog__group"><h3>{cat.name} <span className="muted">{entries.length}</span>+ {cat.id === 'google' && google && (+ <button className="btn btn--ghost btn--sm catalog__google-app" onClick={() => setAppSetup({ provider: 'google' })}>+ {L('Seu app do Google', 'Your Google app')}+ </button>+ )}</h3>+ {cat.id === 'google' && !google && <p className="muted small catalog__note">{L('O Google pede um app seu, criado uma vez no Google Cloud: o primeiro Conectar mostra como, em 5 passos. Depois, os cinco entram com um clique.', 'Google asks for an app of your own, made once in Google Cloud: the first Connect shows how, in 5 steps. After that, all five sign in with one click.')}</p>}<div className="catalog__grid">{entries.map((c) => (<div key={c.id} className="catalog__card">@@ -151,6 +168,202 @@ export function ConnectorGrid({ status, onManage }: { status: Status; onManage:</div>)})}+ {setup && <ConnectorSetup entry={setup} onClose={() => setSetup(null)} onAdded={(id) => (setSetup(null), onManage(id))} />}+ {appSetup && (+ <OwnAppSetup+ provider={appSetup.provider}+ connecting={!!appSetup.then}+ onClose={() => setAppSetup(null)}+ onSaved={() => {+ setApps((now) => ({ ...now, [appSetup.provider]: true }))+ const then = appSetup.then+ setAppSetup(null)+ if (then) {+ setBusy(then.id)+ addConnector(catalogInput(then))+ .catch((e: unknown) => setError({ id: then.id, text: e instanceof Error ? e.message.replace(/^Error invoking.*?: /, '') : String(e) }))+ .finally(() => setBusy(null))+ }+ }}+ />+ )}</section>)}++// What a service asks before connecting: the address of your own instance, a token, an account. The+// values go into the connector as the custom form would put them; the secrets, into the system vault.+function ConnectorSetup({ entry, onClose, onAdded }: { entry: CatalogEntry; onClose: () => void; onAdded: (id: string) => void }): ReactNode {+ const [values, setValues] = useState<Record<string, string>>({})+ const [error, setError] = useState<string | null>(null)+ const [busy, setBusy] = useState(false)+ const runs = entry.local && [entry.local.command, ...entry.local.args.filter((a) => !a.includes('{'))].join(' ')+ const submit = (): void => {+ setError(null)+ let input+ try {+ input = catalogInput(entry, values)+ } catch (e) {+ return setError(e instanceof Error ? e.message : String(e))+ }+ setBusy(true)+ addConnector(input)+ .then(onAdded)+ .catch((e: unknown) => setError(e instanceof Error ? e.message.replace(/^Error invoking.*?: /, '').replace(/^Error: /, '') : String(e)))+ .finally(() => setBusy(false))+ }+ return (+ <Modal title={entry.name} onClose={onClose} className="connector-setup">+ <form+ className="connector-setup__body"+ onSubmit={(e) => {+ e.preventDefault()+ submit()+ }}+ >+ <div className="row connector-setup__head">+ <CatalogLogo entry={entry} size={40} />+ <span className="muted small">{entry.about()}</span>+ </div>+ {runs && (+ <p className="warn-box small">+ <Icon name="terminal" size={14} /> {L(`Roda o servidor oficial neste computador, com o seu usuário: ${runs}.`, `Runs the official server on this computer, as your user: ${runs}.`)}+ </p>+ )}+ {(entry.fields ?? []).map((f) => (+ <label key={f.id} className="field">+ <span className="field__label">{f.label()}</span>+ <input+ type={f.secret ? 'password' : 'text'}+ autoComplete="off"+ spellCheck={false}+ value={values[f.id] ?? ''}+ placeholder={f.placeholder}+ onChange={(e) => setValues((v) => ({ ...v, [f.id]: e.target.value }))}+ />+ {f.hint && <span className="hint">{f.hint()}</span>}+ </label>+ ))}+ {error && <p className="note note--error">{error}</p>}+ <div className="row connector__actions">+ <span className="small muted grow">+ <Icon name="shield" size={12} /> {L('Os segredos ficam cifrados no cofre do sistema.', 'Secrets are encrypted in the system vault.')}+ </span>+ <button type="button" className="btn btn--ghost" onClick={onClose}>+ {L('Cancelar', 'Cancel')}+ </button>+ <button type="submit" className="btn btn--primary" disabled={busy}>+ {busy ? L('Conectando…', 'Connecting…') : L('Conectar', 'Connect')}+ </button>+ </div>+ </form>+ </Modal>+ )+}++const cloud = (path: string): string => `https://console.cloud.google.com/${path}`++// The person's own app, step by step: Google and Slack sign in only apps registered with them, and+// Tucano's own isn't (Google's verification, Slack's directory). Made once, it serves all of that+// provider's connectors. Also opened from a connector's page, to change it.+export function OwnAppSetup({ provider, connecting = false, onClose, onSaved }: { provider: AppProvider; connecting?: boolean; onClose: () => void; onSaved?: () => void }): ReactNode {+ const [current, setCurrent] = useState<{ clientId?: string; redirectUrl: string } | null>(null)+ const [clientId, setClientId] = useState('')+ const [secret, setSecret] = useState('')+ const [busy, setBusy] = useState(false)+ const [error, setError] = useState('')+ useEffect(() => {+ void ownApp(provider).then((a) => (setCurrent(a), setClientId(a.clientId ?? '')), (e: unknown) => setError(String(e)))+ }, [provider])+ const link = (href: string, text: string): ReactNode => (+ <button type="button" className="link" onClick={() => openExternal(href)}>+ {text}+ </button>+ )+ const save = (): void => {+ setBusy(true)+ setError('')+ setOwnApp(provider, clientId, secret)+ .then(() => (onSaved ? onSaved() : onClose()))+ .catch((e: unknown) => setError(e instanceof Error ? e.message.replace(/^Error invoking.*?: /, '') : String(e)))+ .finally(() => setBusy(false))+ }+ const google = provider === 'google'+ return (+ <Modal title={google ? L('Seu app do Google', 'Your Google app') : L('Seu app do Slack', 'Your Slack app')} onClose={onClose} className="google-setup">+ <p className="muted small modal__lead">+ ? L(+ 'O Google só deixa entrar apps cadastrados nele. Você cria o seu uma vez, em uns 10 minutos, e o Gmail, o Drive, o Calendar, o Docs e o Sheets entram com ele. Fica tudo na sua conta: os dados vão do Google direto pro seu computador.',+ 'Google only lets in apps registered with it. You make yours once, in about 10 minutes, and Gmail, Drive, Calendar, Docs and Sheets sign in with it. It all stays in your account: the data goes from Google straight to your computer.'+ )+ : L(+ 'O Slack só deixa usar o servidor MCP dele apps do diretório ou apps internos de um workspace. Você cria o seu, interno, em uns 2 minutos: o link já traz tudo preenchido. Os dados vão do Slack direto pro seu computador.',+ "Slack lets only directory apps or a workspace's internal apps use its MCP server. You make yours, internal, in about 2 minutes: the link brings it all filled in. The data goes from Slack straight to your computer."+ )}+ </p>+ {google ? (+ <ol className="google-setup__steps">+ <li>+ {link(cloud('projectcreate'), L('Crie um projeto no Google Cloud', 'Create a project in Google Cloud'))}+ {L(', com o nome que quiser (Tucano, por exemplo).', ', named as you like (Tucano, say).')}+ </li>+ <li>+ {link(cloud(`flows/enableapi?apiid=${GOOGLE_APIS.join(',')}`), L('Ative as APIs', 'Turn on the APIs'))}+ {L(': com o projeto escolhido no topo, clique em Próxima e em Ativar. São as do Gmail, Drive, Calendar, Docs e Sheets e a MCP de cada um.', ': with the project chosen at the top, click Next and Enable. They are Gmail, Drive, Calendar, Docs and Sheets, and the MCP one of each.')}+ </li>+ <li>+ {link(cloud('auth/overview'), L('Configure a tela de login', 'Set up the sign-in screen'))}+ {L(+ ' (Google Auth Platform › Começar): o nome do app e o seu e-mail; em Público-alvo, Externo (ou Interno, numa conta Google Workspace de empresa). Depois, em Público-alvo › Usuários de teste, adicione o seu e-mail.',+ ' (Google Auth Platform › Get started): the app name and your email; under Audience, External (or Internal, in a company Google Workspace account). Then, under Audience › Test users, add your email.'+ )}+ </li>+ <li>+ {link(cloud('auth/clients/create'), L('Crie o cliente', 'Create the client'))}+ {L(': em Tipo de aplicativo, App para computador; marque ', ': under Application type, Desktop app; tick ')}+ <b>{L('Usar este cliente para um agente com IA', 'Use this client for an AI-powered agent')}</b>+ {L(' (sem isso o Google recusa os conectores) e clique em Criar.', ' (without it Google turns the connectors away) and click Create.')}+ </li>+ <li>{L('Copie o ID do cliente e a chave secreta do cliente que aparecem e cole aqui:', 'Copy the client ID and the client secret it shows and paste them here:')}</li>+ </ol>+ ) : (+ <ol className="google-setup__steps">+ <li>+ {current ? link(slackAppLink(current.redirectUrl), L('Crie o app no Slack', 'Create the app in Slack')) : L('Crie o app no Slack', 'Create the app in Slack')}+ {L(': escolha o seu workspace, clique em Próximo e em Criar. O nome, as permissões, o endereço de volta e o MCP já vêm preenchidos.', ': choose your workspace, click Next and Create. The name, the permissions, the return address and MCP come filled in.')}+ </li>+ <li>{L('Em Basic Information › App Credentials, copie o Client ID e o Client Secret (Show) e cole aqui:', 'Under Basic Information › App Credentials, copy the Client ID and the Client Secret (Show) and paste them here:')}</li>+ </ol>+ )}+ <label className="field">+ <span className="field__label">{google ? L('ID do cliente', 'Client ID') : 'Client ID'}</span>+ <input autoFocus spellCheck={false} disabled={busy} value={clientId} placeholder={google ? '1234567890-abc….apps.googleusercontent.com' : '1234567890.1234567890123'} onChange={(e) => setClientId(e.target.value)} />+ </label>+ <label className="field">+ <span className="field__label">{google ? L('Chave secreta do cliente', 'Client secret') : 'Client Secret'}</span>+ <input type="password" spellCheck={false} disabled={busy} value={secret} placeholder={current?.clientId ? L('A mesma, ou uma nova', 'The same, or a new one') : google ? 'GOCSPX-…' : ''} onChange={(e) => setSecret(e.target.value)} onKeyDown={(e) => e.key === 'Enter' && !busy && (e.preventDefault(), save())} />+ </label>+ <p className="muted small">+ ? L(+ 'Com o app em teste, o Google pede pra entrar de novo a cada 7 dias. Pra não pedir, em Público-alvo clique em Publicar app: no login vai aparecer “O Google não verificou este app”. É o seu próprio app: clique em Avançado e continue.',+ 'While the app is in testing, Google asks you to sign in again every 7 days. To stop that, click Publish app under Audience: the sign-in will say “Google hasn’t verified this app”. It’s your own app: click Advanced and go on.'+ )+ : L(+ 'Num workspace de empresa, o admin pode precisar aprovar o app antes: o Slack avisa no login, e o pedido vai pra ele.',+ 'In a company workspace, an admin may need to approve the app first: Slack says so at sign-in, and the request goes to them.'+ )}+ </p>+ {error && <p className="catalog__error small">{error}</p>}+ <div className="modal__foot">+ <button className="btn btn--ghost" onClick={onClose}>+ {L('Cancelar', 'Cancel')}+ </button>+ <button className="btn btn--primary" disabled={busy || !clientId.trim() || !secret.trim()} onClick={save}>+ {busy ? L('Salvando…', 'Saving…') : connecting ? L('Salvar e conectar', 'Save and connect') : L('Salvar', 'Save')}+ </button>+ </div>+ </Modal>+ )+}diff --git a/src/renderer/src/components/Pages.tsx b/src/renderer/src/components/Pages.tsxindex 7fc6ba2..97240bb 100644--- a/src/renderer/src/components/Pages.tsx+++ b/src/renderer/src/components/Pages.tsx@@ -68,7 +68,8 @@ import { voiceRefusal } from '../../../shared/voice'import { useVoice, VOICE_CHOICES, VoiceSetup } from './VoiceSetup'import { AccountPicker, AccountsCard, HarnessList, HarnessMcps, ModelPicker, onGateway, OutsideGateway, usableEngines } from './Harness'import { AppsCard } from './Apps'-import { ConnectorGrid } from './ConnectorStore'+import { ConnectorGrid, OwnAppSetup } from './ConnectorStore'+import { entryOf } from '../../../shared/connector-catalog'import { ApprovalCard, toolWords } from './Conversation'import { confirmDialog } from './Dialogs'import { Modal } from './Modal'@@ -1094,7 +1095,7 @@ function ConnectorToken({ id }: { id: string }): ReactNode {}return (<div className="row">- <input className="grow" type="password" value={token} placeholder={L('Token (substitui o atual)', 'Token (replaces the current one)')} onChange={(e) => setToken(e.target.value)} />+ <input className="grow" type="password" value={token} placeholder={L('Token ou op://… (substitui o atual)', 'Token or op://… (replaces the current one)')} onChange={(e) => setToken(e.target.value)} /><button className="btn btn--sm" disabled={busy || !token.trim()} onClick={save}>{L('Salvar token', 'Save token')}</button>@@ -1142,6 +1143,8 @@ export function ConnectorsPage(): ReactNode {// A connector's state, who uses it and its tools, in a window over the page.function ConnectorDetails({ c, onClose }: { c: Connector; onClose: () => void }): ReactNode {const users = useStore((s) => s.agents.filter((a) => (a.grants[c.id] ?? 'none') !== 'none'))+ const own = entryOf(c)?.app // signs in with the person's own app: it can be changed here+ const [changing, setChanging] = useState(false)return (<Modal title={c.name} onClose={onClose} className="connector-modal"><div className="connector-modal__body">@@ -1181,6 +1184,11 @@ function ConnectorDetails({ c, onClose }: { c: Connector; onClose: () => void }){c.status === 'connected' ? L('Atualizar ferramentas', 'Refresh tools') : L('Conectar de novo', 'Reconnect')}</button>)}+ {own && (+ <button className="btn btn--ghost btn--sm" onClick={() => setChanging(true)}>+ {own.provider === 'google' ? L('Seu app do Google', 'Your Google app') : L('Seu app do Slack', 'Your Slack app')}+ </button>+ )}<span className="grow" /><buttonclassName="btn btn--ghost btn--sm"@@ -1227,6 +1235,7 @@ function ConnectorDetails({ c, onClose }: { c: Connector; onClose: () => void })))}<p className="hint">{L('Ferramentas novas que o servidor publicar depois entram desligadas até você revisar. Sensíveis sempre pedem aprovação.', 'New tools the server publishes later come in off until you review them. Sensitive ones always ask for approval.')}</p></div>+ {changing && own && <OwnAppSetup provider={own.provider} onClose={() => setChanging(false)} />}</Modal>)}@@ -1295,7 +1304,7 @@ function AddConnector({ onDone }: { onDone: (id?: string) => void }): ReactNode</select></Field>{auth === 'token' && (- <Field label="Token">+ <Field label="Token" hint={L('Ou uma referência do 1Password (op://Cofre/Item/campo), lida a cada conexão.', 'Or a 1Password reference (op://Vault/Item/field), read on each connection.')}><input type="password" value={token} onChange={(e) => setToken(e.target.value)} /></Field>)}@@ -1313,7 +1322,7 @@ function AddConnector({ onDone }: { onDone: (id?: string) => void }): ReactNode<input value={args} placeholder="-y @modelcontextprotocol/server-postgres postgres://…" onChange={(e) => setArgs(e.target.value)} /></Field></div>- <Field label={L('Variáveis de ambiente', 'Environment variables')} hint={L('Uma por linha, NOME=valor. Os valores ficam cifrados.', 'One per line, NAME=value. Values are encrypted.')}>+ <Field label={L('Variáveis de ambiente', 'Environment variables')} hint={L('Uma por linha, NOME=valor. Os valores ficam cifrados; um valor op://Cofre/Item/campo vem do 1Password.', 'One per line, NAME=value. Values are encrypted; an op://Vault/Item/field value comes from 1Password.')}><textarea rows={2} value={env} onChange={(e) => setEnv(e.target.value)} /></Field>{demo && (diff --git a/src/renderer/src/connector-logos.ts b/src/renderer/src/connector-logos.tsindex 8132e1c..8c57ed1 100644--- a/src/renderer/src/connector-logos.ts+++ b/src/renderer/src/connector-logos.ts@@ -1,6 +1,12 @@// Brand marks for the connector catalog, from Simple Icons 16.36.0 (CC0 1.0, https://simpleicons.org).// Generated; the brands without one there, or with only a wordmark (Coinbase, Zapier), show their initial. Each mark is a 24×24 path in the brand color.export const LOGOS: Record<string, { hex: string; path: string }> = {+ slack: { hex: '4A154B', path: 'M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z' }, // Slack's one-color mark, as its brand guide allows to show an integration (Simple Icons 13.21.0, before it was taken out)+ gmail: { hex: 'EA4335', path: 'M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-2.023 2.309-3.178 3.927-1.964L5.455 4.64 12 9.548l6.545-4.91 1.528-1.145C21.69 2.28 24 3.434 24 5.457z' },+ 'google-calendar': { hex: '4285F4', path: 'M18.316 5.684H24v12.632h-5.684V5.684zM5.684 24h12.632v-5.684H5.684V24zM18.316 5.684V0H1.895A1.894 1.894 0 0 0 0 1.895v16.421h5.684V5.684h12.632zm-7.207 6.25v-.065c.272-.144.5-.349.687-.617s.279-.595.279-.982c0-.379-.099-.72-.3-1.025a2.05 2.05 0 0 0-.832-.714 2.703 2.703 0 0 0-1.197-.257c-.6 0-1.094.156-1.481.467-.386.311-.65.671-.793 1.078l1.085.452c.086-.249.224-.461.413-.633.189-.172.445-.257.767-.257.33 0 .602.088.816.264a.86.86 0 0 1 .322.703c0 .33-.12.589-.36.778-.24.19-.535.284-.886.284h-.567v1.085h.633c.407 0 .748.109 1.02.327.272.218.407.499.407.843 0 .336-.129.614-.387.832s-.565.327-.924.327c-.351 0-.651-.103-.897-.311-.248-.208-.422-.502-.521-.881l-1.096.452c.178.616.505 1.082.977 1.401.472.319.984.478 1.538.477a2.84 2.84 0 0 0 1.293-.291c.382-.193.684-.458.902-.794.218-.336.327-.72.327-1.149 0-.429-.115-.797-.344-1.105a2.067 2.067 0 0 0-.881-.689zm2.093-1.931l.602.913L15 10.045v5.744h1.187V8.446h-.827l-2.158 1.557zM22.105 0h-3.289v5.184H24V1.895A1.894 1.894 0 0 0 22.105 0zm-3.289 23.5l4.684-4.684h-4.684V23.5zM0 22.105C0 23.152.848 24 1.895 24h3.289v-5.184H0v3.289z' },+ 'google-drive': { hex: '4285F4', path: 'M12.01 1.485c-2.082 0-3.754.02-3.743.047.01.02 1.708 3.001 3.774 6.62l3.76 6.574h3.76c2.081 0 3.753-.02 3.742-.047-.005-.02-1.708-3.001-3.775-6.62l-3.76-6.574zm-4.76 1.73a789.828 789.861 0 0 0-3.63 6.319L0 15.868l1.89 3.298 1.885 3.297 3.62-6.335 3.618-6.33-1.88-3.287C8.1 4.704 7.255 3.22 7.25 3.214zm2.259 12.653-.203.348c-.114.198-.96 1.672-1.88 3.287a423.93 423.948 0 0 1-1.698 2.97c-.01.026 3.24.042 7.222.042h7.244l1.796-3.157c.992-1.734 1.85-3.23 1.906-3.323l.104-.167h-7.249z' },+ 'google-docs': { hex: '4285F4', path: 'M14.727 6.727H14V0H4.91c-.905 0-1.637.732-1.637 1.636v20.728c0 .904.732 1.636 1.636 1.636h14.182c.904 0 1.636-.732 1.636-1.636V6.727h-6zm-.545 10.455H7.09v-1.364h7.09v1.364zm2.727-3.273H7.091v-1.364h9.818v1.364zm0-3.273H7.091V9.273h9.818v1.363zM14.727 6h6l-6-6v6z' },+ 'google-sheets': { hex: '34A853', path: 'M11.318 12.545H7.91v-1.909h3.41v1.91zM14.728 0v6h6l-6-6zm1.363 10.636h-3.41v1.91h3.41v-1.91zm0 3.273h-3.41v1.91h3.41v-1.91zM20.727 6.5v15.864c0 .904-.732 1.636-1.636 1.636H4.909a1.636 1.636 0 0 1-1.636-1.636V1.636C3.273.732 4.005 0 4.909 0h9.318v6.5h6.5zm-3.273 2.773H6.545v7.909h10.91v-7.91zm-6.136 4.636H7.91v1.91h3.41v-1.91z' },linear: { hex: '5E6AD2', path: 'M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z' },sentry: { hex: '362D59', path: 'M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z' },vercel: { hex: '000000', path: 'm12 1.608 12 20.784H0Z' },@@ -26,4 +32,8 @@ export const LOGOS: Record<string, { hex: string; path: string }> = {wix: { hex: '0C6EFC', path: 'm0 7.354 2.113 9.292h.801a1.54 1.54 0 0 0 1.506-1.218l1.351-6.34a.171.171 0 0 1 .167-.137c.08 0 .15.058.167.137l1.352 6.34a1.54 1.54 0 0 0 1.506 1.218h.805l2.113-9.292h-.565c-.62 0-1.159.43-1.296 1.035l-1.26 5.545-1.106-5.176a1.76 1.76 0 0 0-2.19-1.324c-.639.176-1.113.716-1.251 1.365l-1.094 5.127-1.26-5.537A1.33 1.33 0 0 0 .563 7.354H0zm13.992 0a.951.951 0 0 0-.951.95v8.342h.635a.952.952 0 0 0 .951-.95V7.353h-.635zm1.778 0 3.158 4.66-3.14 4.632h1.325c.368 0 .712-.181.918-.486l1.756-2.59a.12.12 0 0 1 .197 0l1.754 2.59c.206.305.55.486.918.486h1.326l-3.14-4.632L24 7.354h-1.326c-.368 0-.712.181-.918.486l-1.772 2.617a.12.12 0 0 1-.197 0L18.014 7.84a1.108 1.108 0 0 0-.918-.486H15.77z' },huggingface: { hex: 'FFD21E', path: 'M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378 0 1.112.178 2.181.503 3.185.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284.278.173.48.408.71.694.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542.01.026.653 1.552 1.657 2.54.616.605 1.01 1.223 1.082 1.912.055.537-.096 1.059-.38 1.572.637.121 1.294.187 1.967.187.657 0 1.298-.063 1.921-.178-.287-.517-.44-1.041-.384-1.581.07-.69.465-1.307 1.081-1.913 1.004-.987 1.647-2.513 1.657-2.539.021-.074.083-.285.233-.542.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952.23-.286.432-.52.71-.694.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174 1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013 1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164 1.607-.007 2.984-1.155 3.572-1.164.196-.003.305.12.305.454 0 .886-.424 2.328-1.563 3.202-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026-.01.008-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116 1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243 1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444-.034-.016-.104-.008-.2.022q-.094.03-.216.087-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096 3 3 0 0 0-.26.219 2 2 0 0 0-.12.121 2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203 0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647 2.822 2.813 2.562 3.244-1.176-.506-1.176-.506-2.866-2.567-3.49-1.898.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405-.238.839-2.71-1.587-3.216-.642-.506.946 3.49 2.056 3.522 2.064 1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194 1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647-2.822 2.813-2.562 3.244 1.176-.506 1.176-.506 2.866-2.567 3.49-1.898-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405.238.839 2.71-1.587 3.216-.642.506.946-3.49 2.056-3.522 2.064-1.29.33-4.568 1.028-5.713-.624' },robinhood: { hex: 'CCFF00', path: 'M2.84 24h.53c.096 0 .192-.048.224-.128C7.591 13.696 11.94 8.656 14.67 5.638c.112-.128.064-.225-.096-.225h-4.88a.55.55 0 0 0-.45.225L5.746 9.972c-.514.642-.642 1.236-.642 2.086v4.43c-1.14 3.194-1.862 5.361-2.392 7.32-.032.125.016.192.129.192M20.447.646c-.754-.802-4.157-.834-5.73-.224a3 3 0 0 0-.786.465 41 41 0 0 0-3.323 3.178c-.112.113-.064.225.097.225h5.409c.497 0 .786.289.786.786v6.1c0 .16.128.208.225.064l3.258-4.254c.53-.69.69-.898.835-1.861.192-1.413.08-3.58-.77-4.479m-6.982 16.18 2.231-3.676a.7.7 0 0 0 .064-.29V6.73c0-.16-.112-.225-.224-.097-3.355 3.74-5.971 7.672-8.395 12.407-.06.12.016.225.16.177l5.009-1.54c.565-.174.882-.402 1.155-.852' },+ github: { hex: '181717', path: 'M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12' },+ snowflake: { hex: '29B5E8', path: 'M24 3.459c0 .646-.418 1.18-1.141 1.18-.723 0-1.142-.534-1.142-1.18 0-.647.419-1.18 1.142-1.18.723 0 1.141.533 1.141 1.18zm-.228 0c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0 .533.38.952.913.952.57 0 .913-.419.913-.951zm-1.37-.533h.495c.266 0 .456.152.456.38 0 .153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114 0 .152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602 12.4c.038-.151.076-.304.076-.456 0-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153 1.56.532 1.94l2.701 1.56-2.701 1.56c-.685.38-.913 1.256-.533 1.94.38.685 1.256.914 1.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332 2.626c-.266-.038-.57.038-.837.19l-4.832 2.777c-.685.38-.913 1.256-.532 1.94.38.686 1.255.914 1.94.533l2.701-1.56v3.12c0 .8.647 1.408 1.446 1.408.799 0 1.407-.647 1.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701 1.56V1.975c0-.799-.647-1.408-1.446-1.408-.799 0-1.446.609-1.446 1.408V7.53c0 .76.609 1.37 1.332 1.407zM3.265 5.97l4.832 2.777c.266.152.533.19.837.19.723-.038 1.331-.684 1.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799 0-1.446.647-1.446 1.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19 1.521.494 1.902zm9.093 6.011a.412.412 0 00-.114-.266l-.57-.571a.346.346 0 00-.267-.114.412.412 0 00-.266.114l-.571.57a.411.411 0 00-.114.267c0 .076.038.19.114.267l.57.57a.345.345 0 00.267.114c.076 0 .19-.038.266-.114l.571-.57a.412.412 0 00.114-.267zm1.598.533L11.94 14.53c-.039.038-.153.114-.229.114h-.608a.411.411 0 01-.267-.114L8.82 12.514a.408.408 0 01-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41 0 01.267-.114h.608a.41.41 0 01.267.114l2.016 2.016a.347.347 0 01.114.267v.608c-.076.077-.114.19-.19.229zm5.593 5.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332 1.408v5.554c0 .8.647 1.408 1.408 1.408.799 0 1.446-.647 1.446-1.408v-3.12l2.7 1.56c.686.38 1.561.152 1.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701 1.56 2.7 1.56c.686.38.914 1.256.533 1.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644 1.644 0 01-.647-.798c-.037-.153-.076-.305-.076-.457 0-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38 1.56-.152 1.94.533.457.609.19 1.484-.494 1.864' },+ metabase: { hex: '509EE3', path: 'M5.385 6.136c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.654 1.438 1.461zm-1.438 2.63c-.794 0-1.438.654-1.438 1.461s.644 1.461 1.438 1.461 1.438-.654 1.438-1.461-.644-1.461-1.438-1.461zm5.465-2.63c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.654 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.499-1.088 1.111.488 1.111 1.088 1.111 1.088-.498 1.088-1.111zm-1.088 5.592c.794 0 1.438-.654 1.438-1.461s-.644-1.461-1.438-1.461-1.438.654-1.438 1.461.643 1.461 1.438 1.461zm5.464-5.592c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.654 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.498-1.088 1.111S11.4 7.247 12 7.247s1.088-.498 1.088-1.111zm.35-4.675c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461S11.206 0 12 0s1.438.654 1.438 1.461zm-.35 0C13.088.848 12.6.35 12 .35s-1.088.498-1.088 1.111S11.4 2.572 12 2.572s1.088-.498 1.088-1.111zm.35 8.806c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.654 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.498-1.088 1.111.488 1.111 1.088 1.111 1.088-.499 1.088-1.111zm4.376-4.131c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.654 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.498-1.088 1.111.488 1.111 1.088 1.111 1.088-.498 1.088-1.111zm2.939 1.461c.794 0 1.438-.654 1.438-1.461s-.644-1.461-1.438-1.461-1.438.654-1.438 1.461.644 1.461 1.438 1.461zm-4.027 1.209c-.794 0-1.438.654-1.438 1.461s.644 1.461 1.438 1.461 1.438-.654 1.438-1.461-.643-1.461-1.438-1.461zm4.027 0c-.794 0-1.438.654-1.438 1.461s.644 1.461 1.438 1.461 1.438-.654 1.438-1.461-.644-1.461-1.438-1.461zM3.947 12.857a1.45 1.45 0 0 0-1.438 1.461c0 .807.644 1.461 1.438 1.461s1.438-.654 1.438-1.461a1.45 1.45 0 0 0-1.438-1.461zm5.465 1.5c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.655 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.498-1.088 1.111.488 1.111 1.088 1.111 1.088-.498 1.088-1.111zM12 12.896c-.794 0-1.438.654-1.438 1.461s.644 1.461 1.438 1.461 1.438-.654 1.438-1.461-.644-1.461-1.438-1.461zm5.464 1.461c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.655 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.498-1.088 1.111.488 1.111 1.088 1.111 1.088-.498 1.088-1.111zm2.939-1.461c-.794 0-1.438.654-1.438 1.461s.644 1.461 1.438 1.461 1.438-.654 1.438-1.461-.644-1.461-1.438-1.461zM3.947 16.948c-.794 0-1.438.654-1.438 1.461s.644 1.461 1.438 1.461 1.438-.654 1.438-1.461-.644-1.461-1.438-1.461zm5.465 1.5c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.654 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.498-1.088 1.111.488 1.111 1.088 1.111 1.088-.498 1.088-1.111zm4.376 0c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.654 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.498-1.088 1.111.488 1.111 1.088 1.111 1.088-.498 1.088-1.111zm.35 4.091c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.654 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.498-1.088 1.111S11.4 23.65 12 23.65s1.088-.498 1.088-1.111zm4.376-4.091c0 .807-.644 1.461-1.438 1.461s-1.438-.654-1.438-1.461.644-1.461 1.438-1.461 1.438.654 1.438 1.461zm-.35 0c0-.613-.488-1.111-1.088-1.111s-1.088.498-1.088 1.111.488 1.111 1.088 1.111 1.088-.498 1.088-1.111zm2.939-1.461c-.794 0-1.438.654-1.438 1.461s.644 1.461 1.438 1.461 1.438-.654 1.438-1.461-.644-1.461-1.438-1.461z' },+ dynatrace: { hex: '1496FF', path: 'M9.372 0c-.31.006-.93.09-1.521.654-.872.824-5.225 4.957-6.973 6.617-.79.754-.72 1.595-.72 1.664v.377c.067-.292.187-.5.427-.825.496-.616 1.3-.788 1.627-.822a64.238 64.238 0 01.002 0 64.238 64.238 0 016.528-.55c4.335-.136 7.197.226 7.197.226l6.085-5.794s-3.188-.6-6.82-1.027a93.4 93.4 0 00-5.64-.514c-.02 0-.09-.008-.192-.006zm13.56 2.508l-6.066 5.79s.222 2.881-.137 7.2c-.189 2.45-.584 4.866-.875 6.494-.052.326-.256 1.114-.925 1.594-.29.198-.49.295-.748.363 1.546-.51 1.091-7.047 1.091-7.047-4.335.137-7.214-.223-7.214-.223l-6.085 5.793s3.223.634 6.856 1.045c2.056.24 4.833.429 5.227.463.023 0 .045-.007.068-.012-.013.003-.022.009-.035.012.138 0 .26.015.38.015.084 0 .924.105 1.712-.648 1.748-1.663 6.084-5.81 6.94-6.634.789-.754.72-1.594.72-1.68a81.846 81.846 0 00-.206-5.654 101.75 101.75 0 00-.701-6.872zM3.855 8.306c-1.73.002-3.508.208-3.696 1.021.017 1.216.05 3.137.205 5.28.24 3.65.703 6.887.703 6.887l6.083-5.79c-.017.016-.24-2.88.12-7.2 0 0-1.684-.201-3.416-.2z' },}diff --git a/src/renderer/src/store.ts b/src/renderer/src/store.tsindex 9b9b2b8..28e232c 100644--- a/src/renderer/src/store.ts+++ b/src/renderer/src/store.ts@@ -3,6 +3,7 @@import { useRef, useSyncExternalStore } from 'react'import { L, setLang } from '../../shared/lang'import type { CoreEvent, Method, Params } from '../../shared/rpc'+import type { AppProvider } from '../../shared/connector-catalog'import {type Account,type AccountEngine,@@ -492,6 +493,8 @@ export const addConnector = (input: ConnectorInput): Promise<string> => call('adexport const removeConnector = (id: string): void => void fire(L('Não consegui remover o conector.', "I couldn't remove the connector."), 'removeConnector', { id })export const reconnectConnector = (id: string): void => void fire(L('Não consegui reconectar.', "I couldn't reconnect."), 'reconnectConnector', { id })export const setConnectorToken = (id: string, token: string): Promise<void> => call('setConnectorToken', { id, token })+export const ownApp = (provider: AppProvider): Promise<{ clientId?: string; redirectUrl: string }> => call('ownApp', { provider })+export const setOwnApp = (provider: AppProvider, clientId: string, clientSecret: string): Promise<void> => call('setOwnApp', { provider, clientId, clientSecret })// On a server the authorization page comes back to be opened here, then pasted back.export const authorizeConnector = (id: string): void =>void call('authorizeConnector', { id }).then(diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.cssindex 68aff23..d816adb 100644--- a/src/renderer/src/styles.css+++ b/src/renderer/src/styles.css@@ -8181,6 +8181,29 @@ button.wk-pill.is-on { box-shadow: 0 0 0 1.5px var(--k); background: color-mix(i.catalog__error {color: var(--danger);}+.catalog__group h3 .catalog__google-app {+ margin-left: 6px;+ font-weight: 400;+}+.catalog__note {+ margin: -2px 0 8px;+}+.modal__card.google-setup {+ width: min(560px, calc(100vw - 32px));+ max-height: calc(100vh - 48px);+ overflow-y: auto;+}+.google-setup__steps {+ margin: 0 0 14px;+ padding-left: 20px;+ display: grid;+ gap: 8px;+ font-size: 13px;+ line-height: 1.5;+}+.google-setup .field + .field {+ margin-top: 10px;+}.catalog__card.is-mine {cursor: pointer;}@@ -8226,6 +8249,24 @@ button.wk-pill.is-on { box-shadow: 0 0 0 1.5px var(--k); background: color-mix(i.catalog__dot.tag--danger {background: var(--danger);}+/* What a catalog service asks before connecting. */+.modal__card.connector-setup {+ width: min(520px, calc(100vw - 32px));+}+.connector-setup__body {+ display: flex;+ flex-direction: column;+ gap: 4px;+ min-height: 0;+ overflow-y: auto;+}+.connector-setup__head {+ gap: 12px;+ margin-bottom: 8px;+}+.connector-setup__body .warn-box {+ margin: 0 0 8px;+}/* A connector's details, over the page: the tools scroll, the head stays. */.modal__card.connector-modal {width: min(680px, calc(100vw - 32px));diff --git a/src/shared/connector-catalog.ts b/src/shared/connector-catalog.tsindex d34c179..8055fb1 100644--- a/src/shared/connector-catalog.ts+++ b/src/shared/connector-catalog.ts@@ -1,21 +1,44 @@// The connectors the app offers ready to add: official remote MCP servers that an app it has never// met (Tucano) can sign in to by itself, through the browser (OAuth with dynamic registration and// PKCE), or that need no sign-in at all. Each was probed on 2026-11-05; a server that only takes an-// app registered ahead of time (HubSpot, Box, Asana's current one) isn't here: it's added by hand.+// app registered ahead of time (HubSpot, Box, Asana's current one; Outlook and Teams) isn't here:+// it's added by hand. Some ask a few things first (the address of your own instance, a token) or run+// the service's official server on this computer. Google's and Slack's sign-in take no app they haven't+// met either, so the person makes one, once (in Google Cloud, in their Slack workspace), and signs in+// with it.import { L } from './lang'+import type { ConnectorInput } from './types'-export type CatalogCategory = 'dev' | 'work' | 'business' | 'design' | 'research' | 'finance'+export type CatalogCategory = 'google' | 'dev' | 'work' | 'business' | 'design' | 'research' | 'finance'++// Something asked before connecting. Its value fills {id} in the address, the arguments or the+// variables; the field "token" is the token itself.+export interface CatalogField {+ id: string+ label: () => string+ placeholder: string+ hint?: () => string+ secret?: boolean+ clean?: (v: string) => string // what was pasted, as it goes in (an account out of its full address)+}export interface CatalogEntry {id: string // also the logo's keyname: string- url: string- auth: 'oauth' | 'none'+ url: string // with {field}s, filled in before connecting; empty for a local one+ auth: 'oauth' | 'none' | 'token'category: CatalogCategoryabout: () => string // a few words: what the agents get+ local?: { command: string; args: string[]; env?: Record<string, string> } // runs on this computer+ fields?: CatalogField[]+ app?: { provider: AppProvider; scopes: string[] } // signs in with the person's own app, asking for these scopes}+// Whose sign-in needs an app the person makes: Google's (one for its five servers) and Slack's.+export type AppProvider = 'google' | 'slack'+export const CATEGORIES = (): { id: CatalogCategory; name: string }[] => [+ { id: 'google', name: 'Google' },{ id: 'dev', name: L('Programação', 'Development') },{ id: 'work', name: L('Projetos e tarefas', 'Projects and tasks') },{ id: 'business', name: L('Negócio e dados', 'Business and data') },@@ -24,16 +47,60 @@ export const CATEGORIES = (): { id: CatalogCategory; name: string }[] => [{ id: 'finance', name: L('Finanças', 'Finance') }]-const e = (id: string, name: string, url: string, category: CatalogCategory, pt: string, en: string, auth: CatalogEntry['auth'] = 'oauth'): CatalogEntry => ({+const e = (id: string, name: string, url: string, category: CatalogCategory, pt: string, en: string, auth: CatalogEntry['auth'] = 'oauth', more: Partial<CatalogEntry> = {}): CatalogEntry => ({id,name,url,auth,category,- about: () => L(pt, en)+ about: () => L(pt, en),+ ...more+})++// "https://abc.apps.dynatrace.com/…" -> "abc": the first part of a host, however much of the address was pasted.+const firstLabel = (v: string): string => v.trim().replace(/^https?:\/\//i, '').split(/[./]/)[0]!.toLowerCase()+const site = (v: string): string => {+ const t = v.trim().replace(/\/+$/, '')+ return /^https?:\/\//i.test(t) ? t : `https://${t}`+}+const plain = (v: string): string => v.trim()++const opHint = (): string => L('Ou uma referência do 1Password, como op://Cofre/Item/campo: o segredo fica lá e é lido a cada conexão.', 'Or a 1Password reference, like op://Vault/Item/field: the secret stays there and is read on each connection.')+const tokenField = (placeholder: string, hint: () => string, label = (): string => L('Token', 'Token')): CatalogField => ({+ id: 'token',+ label,+ placeholder,+ secret: true,+ clean: plain,+ hint: () => `${hint()} ${opHint()}`+})++// Google's own MCP servers. The scopes are what their tools need, short of the full ones: Gmail+// drafts but never sends nor deletes for good, Drive reads all and writes only what it made or opened.+const DRIVE = ['drive.readonly', 'drive.file']+const g = (id: string, name: string, host: string, pt: string, en: string, scopes: string[]): CatalogEntry =>+ e(id, name, `https://${host}.googleapis.com/mcp/v1`, 'google', pt, en, 'oauth', { app: { provider: 'google', scopes: scopes.map((s) => `https://www.googleapis.com/auth/${s}`) } })++// What Slack's server offers, all of it: the app is the person's, made for this, and each tool still+// goes through the classes and approvals here.+export const SLACK_SCOPES = 'canvases:read canvases:write channels:history channels:read channels:write chat:write emoji:read files:read files:write groups:history groups:read groups:write im:history im:read im:write lists:read lists:write mpim:history mpim:read mpim:write reactions:read reactions:write search:read.files search:read.im search:read.mpim search:read.private search:read.public search:read.users users:read users:read.email'.split(' ')++// The Slack app the person makes from a link, filled in: its user scopes, MCP turned on, and the+// address the sign-in comes back to, which Slack takes only as registered, port and all.+export const slackManifest = (redirectUrl: string): Record<string, unknown> => ({+ display_information: { name: 'Tucano', description: L('Os agentes do Tucano no seu Slack, pelo servidor MCP do Slack.', "Tucano's agents in your Slack, through Slack's MCP server.") },+ oauth_config: { redirect_urls: [redirectUrl], scopes: { user: SLACK_SCOPES } },+ settings: { is_mcp_enabled: true, org_deploy_enabled: false, socket_mode_enabled: false, token_rotation_enabled: false }})+export const slackAppLink = (redirectUrl: string): string => `https://api.slack.com/apps?new_app=1&manifest_json=${encodeURIComponent(JSON.stringify(slackManifest(redirectUrl)))}`export const CATALOG: CatalogEntry[] = [+ g('gmail', 'Gmail', 'gmailmcp', 'E-mails, rascunhos e marcadores', 'Email, drafts and labels', ['gmail.modify']),+ g('google-calendar', 'Google Calendar', 'calendarmcp', 'Eventos, convites e horários livres', 'Events, invites and free time', ['calendar.events', 'calendar.calendarlist.readonly', 'calendar.events.freebusy']),+ g('google-drive', 'Google Drive', 'drivemcp', 'Buscar, ler e criar arquivos', 'Find, read and create files', DRIVE),+ g('google-docs', 'Google Docs', 'docsmcp', 'Ler, criar e editar documentos', 'Read, create and edit documents', [...DRIVE, 'documents']),+ g('google-sheets', 'Google Sheets', 'sheetsmcp', 'Ler, criar e editar planilhas', 'Read, create and edit spreadsheets', [...DRIVE, 'spreadsheets']),+e('linear', 'Linear', 'https://mcp.linear.app/mcp', 'dev', 'Issues, projetos e ciclos', 'Issues, projects and cycles'),e('sentry', 'Sentry', 'https://mcp.sentry.dev/mcp', 'dev', 'Erros e falhas em produção', 'Errors and crashes in production'),e('vercel', 'Vercel', 'https://mcp.vercel.com', 'dev', 'Deploys, logs e projetos', 'Deploys, logs and projects'),@@ -43,7 +110,51 @@ export const CATALOG: CatalogEntry[] = [e('netlify', 'Netlify', 'https://netlify-mcp.netlify.app/mcp', 'dev', 'Sites, deploys e logs', 'Sites, deploys and logs'),e('railway', 'Railway', 'https://mcp.railway.com', 'dev', 'Serviços, deploys e logs', 'Services, deploys and logs'),e('jam', 'Jam', 'https://mcp.jam.dev/mcp', 'dev', 'Relatos de bug com vídeo e logs', 'Bug reports with video and logs'),+ e('github', 'GitHub', 'https://api.githubcopilot.com/mcp/', 'dev', 'Repositórios, issues e pull requests', 'Repositories, issues and pull requests', 'token', {+ fields: [+ tokenField(+ 'github_pat_…',+ () => L('Um token de acesso pessoal, de github.com/settings/personal-access-tokens, com os repositórios que os agentes podem ver.', 'A personal access token, from github.com/settings/personal-access-tokens, with the repositories the agents may see.'),+ () => L('Token de acesso pessoal', 'Personal access token')+ )+ ]+ }),+ e('azure-devops', 'Azure DevOps', '', 'dev', 'Work items, repositórios, PRs e pipelines', 'Work items, repositories, PRs and pipelines', 'none', {+ local: { command: 'npx', args: ['-y', '@azure-devops/mcp', '{organization}'] },+ fields: [+ {+ id: 'organization',+ label: () => L('Organização', 'Organization'),+ placeholder: 'contoso',+ hint: () => L('O nome em dev.azure.com/organização. Na primeira vez que um agente usar, abre o login da Microsoft no navegador.', 'The name in dev.azure.com/organization. The first time an agent uses it, the Microsoft sign-in opens in the browser.'),+ clean: (v) => {+ const t = v.trim().replace(/^https?:\/\//i, '')+ return (/^dev\.azure\.com\//i.test(t) ? t.split('/')[1]! : t.split(/[./]/)[0]!).trim()+ }+ }+ ]+ }),+ e('cloudwatch', 'AWS CloudWatch', '', 'dev', 'Métricas, alarmes e logs da AWS', 'AWS metrics, alarms and logs', 'none', {+ local: { command: 'uvx', args: ['awslabs.cloudwatch-mcp-server@latest'], env: { AWS_PROFILE: '{profile}', AWS_REGION: '{region}' } },+ fields: [+ {+ id: 'profile',+ label: () => L('Perfil da AWS', 'AWS profile'),+ placeholder: 'default',+ hint: () => L('Um perfil do ~/.aws/config, de aws configure ou aws sso login. Precisa do uv instalado (docs.astral.sh/uv).', 'A profile in ~/.aws/config, from aws configure or aws sso login. Needs uv installed (docs.astral.sh/uv).'),+ clean: plain+ },+ { id: 'region', label: () => L('Região', 'Region'), placeholder: 'us-east-1', clean: (v) => v.trim().toLowerCase() }+ ]+ }),+ e('dynatrace', 'Dynatrace', 'https://{environment}.apps.dynatrace.com/platform-reserved/mcp-gateway/v0.1/servers/dynatrace-mcp/mcp', 'dev', 'Problemas, logs e métricas em produção', 'Problems, logs and metrics in production', 'token', {+ fields: [+ { id: 'environment', label: () => L('Ambiente', 'Environment'), placeholder: 'abc12345', hint: () => L('O começo do endereço: abc12345.apps.dynatrace.com.', 'The start of its address: abc12345.apps.dynatrace.com.'), clean: firstLabel },+ tokenField('dt0s16.…', () => L('Um platform token, com os escopos mcp-gateway:servers:invoke e mcp-gateway:servers:read.', 'A platform token, with the scopes mcp-gateway:servers:invoke and mcp-gateway:servers:read.'), () => 'Platform token')+ ]+ }),+ e('slack', 'Slack', 'https://mcp.slack.com/mcp', 'work', 'Mensagens, canais, canvases e listas', 'Messages, channels, canvases and lists', 'oauth', { app: { provider: 'slack', scopes: SLACK_SCOPES } }),e('notion', 'Notion', 'https://mcp.notion.com/mcp', 'work', 'Páginas, bancos e documentos', 'Pages, databases and docs'),e('atlassian', 'Jira e Confluence', 'https://mcp.atlassian.com/v2/mcp', 'work', 'Issues do Jira e páginas do Confluence', 'Jira issues and Confluence pages'),e('trello', 'Trello', 'https://mcp.trello.com/v1', 'work', 'Quadros, listas e cartões', 'Boards, lists and cards'),@@ -60,6 +171,26 @@ export const CATALOG: CatalogEntry[] = [e('square', 'Square', 'https://mcp.squareup.com/mcp', 'business', 'Vendas, pagamentos e estoque', 'Sales, payments and inventory'),e('intercom', 'Intercom', 'https://mcp.intercom.com/mcp', 'business', 'Conversas de suporte e clientes', 'Support conversations and customers'),e('airtable', 'Airtable', 'https://mcp.airtable.com/mcp', 'business', 'Bases e tabelas', 'Bases and tables'),+ e('snowflake', 'Snowflake', 'https://{account}.snowflakecomputing.com/api/v2/databases/{database}/schemas/{schema}/mcp-servers/{server}', 'business', 'Consultas e agentes do Cortex', 'Queries and Cortex agents', 'token', {+ fields: [+ { id: 'account', label: () => L('Conta', 'Account'), placeholder: L('minhaorg-minhaconta', 'myorg-myaccount'), hint: () => L('O começo do endereço: minhaorg-minhaconta.snowflakecomputing.com.', 'The start of its address: myorg-myaccount.snowflakecomputing.com.'), clean: firstLabel },+ { id: 'database', label: () => L('Banco', 'Database'), placeholder: 'ANALYTICS', clean: plain },+ { id: 'schema', label: () => 'Schema', placeholder: 'PUBLIC', clean: plain },+ { id: 'server', label: () => L('Servidor MCP', 'MCP server'), placeholder: 'AGENTS', hint: () => L('O nome dado em CREATE MCP SERVER.', 'The name given in CREATE MCP SERVER.'), clean: plain },+ tokenField('…', () => L('Um programmatic access token do seu usuário (ALTER USER … ADD PROGRAMMATIC ACCESS TOKEN).', 'A programmatic access token of your user (ALTER USER … ADD PROGRAMMATIC ACCESS TOKEN).'), () => 'Programmatic access token')+ ]+ }),+ e('metabase', 'Metabase', '{site}/api/metabase-mcp', 'business', 'Perguntas, dashboards e consultas', 'Questions, dashboards and queries', 'oauth', {+ fields: [+ {+ id: 'site',+ label: () => L('Endereço do seu Metabase', 'Your Metabase address'),+ placeholder: L('https://metabase.suaempresa.com', 'https://metabase.yourcompany.com'),+ hint: () => L('Com os recursos de IA ligados, em Admin → IA. O login abre no navegador.', 'With the AI features on, in Admin → AI. The sign-in opens in the browser.'),+ clean: site+ }+ ]+ }),e('zapier', 'Zapier', 'https://mcp.zapier.com/api/mcp/mcp', 'business', 'Ações em milhares de apps', 'Actions across thousands of apps'),e('canva', 'Canva', 'https://mcp.canva.com/mcp', 'design', 'Designs, modelos e exportações', 'Designs, templates and exports'),@@ -75,6 +206,38 @@ export const CATALOG: CatalogEntry[] = [e('aave', 'Aave', 'https://mcp.aave.com/mcp', 'finance', 'Dados do protocolo Aave', 'Aave protocol data', 'none')]+// What a catalog entry adds once its fields are filled in. Throws on one left empty.+export function catalogInput(entry: CatalogEntry, values: Record<string, string> = {}): ConnectorInput {+ const filled: Record<string, string> = {}+ for (const f of entry.fields ?? []) {+ const v = (f.clean ?? plain)(values[f.id] ?? '')+ if (!v || v === 'https://') throw new Error(L(`Preencha: ${f.label()}.`, `Fill in: ${f.label()}.`))+ filled[f.id] = v+ }+ // In an address a value goes in as one piece: a "/" or "?" in it can't reach another path or server.+ const fill = (t: string, inUrl: boolean): string => t.replace(/\{(\w+)\}/g, (_, k: string) => (inUrl && k !== 'site' ? encodeURIComponent(filled[k] ?? '') : (filled[k] ?? '')))+ if (entry.local) {+ const env = Object.fromEntries(Object.entries(entry.local.env ?? {}).map(([k, v]) => [k, fill(v, false)]))+ return { name: entry.name, kind: 'stdio', command: entry.local.command, args: entry.local.args.map((a) => fill(a, false)), env }+ }+ return { name: entry.name, kind: 'remote', url: fill(entry.url, true), auth: entry.auth, ...(entry.auth === 'token' ? { token: filled['token'] } : {}) }+}++// The catalog entry a connector came from: by its address (with any {field} in it), or by the package+// its command runs.+export function entryOf(c: { kind: 'remote' | 'stdio'; url?: string; command?: string; args?: string[] }, entries: CatalogEntry[] = CATALOG): CatalogEntry | undefined {+ if (c.kind === 'stdio') return entries.find((e) => e.local && e.local.command === c.command && e.local.args.filter((a) => !a.includes('{')).every((a) => c.args?.includes(a)))+ return entries.find((e) => {+ if (e.local || !e.url) return false+ if (!e.url.includes('{')) return sameServer(c.url, e.url)+ const pattern = e.url+ .split(/\{\w+\}/)+ .map((part) => part.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))+ .join('[^?#]+?')+ return new RegExp(`^${pattern}/?$`, 'i').test((c.url ?? '').trim())+ })+}+// The same server, however its address was typed: case, a trailing slash.export const sameServer = (a: string | undefined, b: string): boolean => {if (!a) return false@@ -101,3 +264,9 @@ export function searchCatalog(query: string, entries: CatalogEntry[] = CATALOG):const text = (c: CatalogEntry): string => `${c.name} ${c.about()} ${CATEGORIES().find((k) => k.id === c.category)?.name ?? ''}`.normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase()return entries.filter((c) => words.every((w) => text(c).includes(w)))}++// Whose app a connector signs in with, and what it asks for, by its address; undefined for any other server.+export const ownAppOf = (url: string | undefined): CatalogEntry['app'] => CATALOG.find((c) => c.app && sameServer(url, c.url))?.app++// What the person turns on in their Google Cloud project, in one page: each service's API and its MCP API.+export const GOOGLE_APIS = ['gmail', 'calendar-json', 'drive', 'docs', 'sheets'].flatMap((a) => [`${a}.googleapis.com`, `${a === 'calendar-json' ? 'calendar' : a}mcp.googleapis.com`])diff --git a/src/shared/errors.ts b/src/shared/errors.tsindex 2c16df2..ec4d3c2 100644--- a/src/shared/errors.ts+++ b/src/shared/errors.ts@@ -93,8 +93,14 @@ export function friendly(e: unknown, ctx: FriendlyContext = {}): Friendly {const missing = MISSING.exec(raw)?.[1];if (missing) {const node = /^(npx|npm|node)(\.cmd|\.exe)?$/i.test(missing);+ const uv = /^uvx?(\.exe)?$/i.test(missing);return mapped(- node+ uv+ ? L(+ `O comando \`${missing}\` não foi encontrado. Instale o uv (docs.astral.sh/uv) e tente de novo.`,+ `The \`${missing}\` command wasn't found. Install uv (docs.astral.sh/uv) and try again.`+ )+ : node? L(`O comando \`${missing}\` não foi encontrado. Instale o Node.js (nodejs.org) e tente de novo.`,`The \`${missing}\` command wasn't found. Install Node.js (nodejs.org) and try again.`diff --git a/src/shared/rpc.ts b/src/shared/rpc.tsindex 422d120..bb8b97b 100644--- a/src/shared/rpc.ts+++ b/src/shared/rpc.ts@@ -1,5 +1,6 @@// The contract between the renderer and the core, carried over a MessagePort.import type { WikiChange, WikiHit, WikiPage, WikiImport, WikiPageInfo, WikiReview, WikiSource, WikiVersion } from './types'+import type { AppProvider } from './connector-catalog'import type { Os, Account, AccountEngine, Agent, BrowserInput, Approval, Artifact, ImageUpload, BrowserView, ComputerInfo, Connector, ConnectorInput, ConnectorTool, HarnessMcp, Conversation, EngineId, Memory, MemoryScope, Message, Routine, RoutineInput, Report, Settings, LocalSkill, Skill, SkillInput, SkillVersion, Trigger, UsageReport, LocalInfo, VoiceModelId, VoiceStatus } from './types'export interface Snapshot {@@ -69,6 +70,8 @@ export interface Api {removeConnector(p: { id: string }): voidreconnectConnector(p: { id: string }): voidsetConnectorToken(p: { id: string; token: string }): Promise<void>+ ownApp(p: { provider: AppProvider }): Promise<{ clientId?: string; redirectUrl: string }> // the person's app (Google's, Slack's) its connectors sign in with; its secret stays in the core+ setOwnApp(p: { provider: AppProvider; clientId: string; clientSecret: string }): Promise<void>authorizeConnector(p: { id: string }): Promise<{ url?: string }> // url: on a server, the page to open in the person's browserfinishConnectorAuth(p: { url: string }): Promise<boolean> // on a server: the address the authorization page ended onharnessMcps(): Promise<HarnessMcp[]> // the MCP servers set up in Claude Code, Codex and OpenCodediff --git a/test/connector-catalog.test.ts b/test/connector-catalog.test.tsindex 2b481a8..98512d7 100644--- a/test/connector-catalog.test.ts+++ b/test/connector-catalog.test.ts@@ -1,15 +1,20 @@import { describe, expect, it } from 'vitest'-import { CATALOG, CATEGORIES, sameServer, searchCatalog } from '../src/shared/connector-catalog'+import { CATALOG, catalogInput, CATEGORIES, entryOf, GOOGLE_APIS, ownAppOf, sameServer, searchCatalog, SLACK_SCOPES, slackAppLink } from '../src/shared/connector-catalog'import { LOGOS } from '../src/renderer/src/connector-logos'describe('the connector catalog', () => {it('lists each service once, at an https address, in a category that exists', () => {- expect(CATALOG.length).toBe(34)+ expect(CATALOG.length).toBe(46)expect(new Set(CATALOG.map((c) => c.id)).size).toBe(CATALOG.length)- expect(new Set(CATALOG.map((c) => c.url)).size).toBe(CATALOG.length)+ const remote = CATALOG.filter((c) => !c.local)+ expect(new Set(remote.map((c) => c.url)).size).toBe(remote.length)const categories = CATEGORIES().map((k) => k.id)for (const c of CATALOG) {- expect(new URL(c.url).protocol, c.name).toBe('https:')+ if (!c.local) expect(new URL(c.url.replace('{site}', 'https://x.example').replace(/\{\w+\}/g, 'x')).protocol, c.name).toBe('https:')+ // Every {field} in what it adds is one it asks for.+ const asked = new Set((c.fields ?? []).map((f) => f.id))+ for (const [, k] of JSON.stringify([c.url, c.local]).matchAll(/\{(\w+)\}/g)) expect(asked, `${c.name}: {${k}}`).toContain(k)+ if (c.auth === 'token') expect(asked, c.name).toContain('token')expect(categories, c.name).toContain(c.category)expect(c.about().length, c.name).toBeGreaterThan(3)}@@ -33,4 +38,71 @@ describe('the connector catalog', () => {expect(searchCatalog('zzz')).toEqual([])expect(searchCatalog(' ')).toHaveLength(CATALOG.length)})++ it('fills in what a service asks, however much of its address was pasted', () => {+ const get = (id: string) => CATALOG.find((c) => c.id === id)!+ expect(catalogInput(get('linear'))).toEqual({ name: 'Linear', kind: 'remote', url: 'https://mcp.linear.app/mcp', auth: 'oauth' })+ expect(catalogInput(get('github'), { token: ' github_pat_1 ' })).toMatchObject({ url: 'https://api.githubcopilot.com/mcp/', auth: 'token', token: 'github_pat_1' })+ expect(catalogInput(get('dynatrace'), { environment: 'https://ABC12345.apps.dynatrace.com/ui', token: 't' }).url).toBe(+ 'https://abc12345.apps.dynatrace.com/platform-reserved/mcp-gateway/v0.1/servers/dynatrace-mcp/mcp'+ )+ expect(catalogInput(get('snowflake'), { account: 'org-acct.snowflakecomputing.com', database: 'DB', schema: 'S/../x', server: 'AG', token: 't' }).url).toBe(+ 'https://org-acct.snowflakecomputing.com/api/v2/databases/DB/schemas/S%2F..%2Fx/mcp-servers/AG' // a value can't reach another path+ )+ expect(catalogInput(get('metabase'), { site: 'metabase.acme.com/' }).url).toBe('https://metabase.acme.com/api/metabase-mcp')+ expect(catalogInput(get('azure-devops'), { organization: 'https://dev.azure.com/contoso/Project' })).toEqual({ name: 'Azure DevOps', kind: 'stdio', command: 'npx', args: ['-y', '@azure-devops/mcp', 'contoso'], env: {} })+ expect(catalogInput(get('azure-devops'), { organization: 'contoso.visualstudio.com' }).args).toEqual(['-y', '@azure-devops/mcp', 'contoso'])+ expect(catalogInput(get('cloudwatch'), { profile: 'prod', region: 'US-EAST-1' })).toMatchObject({ command: 'uvx', env: { AWS_PROFILE: 'prod', AWS_REGION: 'us-east-1' } })+ expect(() => catalogInput(get('cloudwatch'), { profile: 'prod', region: ' ' })).toThrow(/Região|Region/)+ expect(() => catalogInput(get('metabase'), {})).toThrow()+ })++ it('knows which service a connector came from, from what was filled in', () => {+ const get = (id: string) => CATALOG.find((c) => c.id === id)!+ for (const [id, values] of [+ ['linear', {}],+ ['github', { token: 't' }],+ ['dynatrace', { environment: 'abc', token: 't' }],+ ['snowflake', { account: 'a', database: 'b', schema: 'c', server: 'd', token: 't' }],+ ['metabase', { site: 'https://bi.acme.com' }],+ ['azure-devops', { organization: 'contoso' }],+ ['cloudwatch', { profile: 'p', region: 'r' }]+ ] as const)+ expect(entryOf(catalogInput(get(id), values))?.id, id).toBe(id)+ expect(entryOf({ kind: 'remote', url: 'https://bi.acme.com/api/other' })).toBeUndefined()+ expect(entryOf({ kind: 'stdio', command: 'npx', args: ['-y', '@modelcontextprotocol/server-postgres'] })).toBeUndefined()+ })++ it("signs in to Google's five with the person's app, asking only what their tools need", () => {+ const google = CATALOG.filter((c) => c.app?.provider === 'google')+ expect(google.map((c) => c.id)).toEqual(['gmail', 'google-calendar', 'google-drive', 'google-docs', 'google-sheets'])+ for (const c of google) {+ expect(c.category, c.name).toBe('google')+ expect(c.url, c.name).toMatch(/^https:\/\/\w+mcp\.googleapis\.com\/mcp\/v1$/)+ expect(LOGOS[c.id], c.name).toBeDefined()+ for (const s of c.app!.scopes) expect(s, c.name).toMatch(/^https:\/\/www\.googleapis\.com\/auth\/[\w.]+$/)+ }+ // Nothing that sends email or deletes it for good, nor Drive's full access.+ const all = google.flatMap((c) => c.app!.scopes)+ expect(all).not.toContain('https://mail.google.com/')+ expect(all).not.toContain('https://www.googleapis.com/auth/gmail.send')+ expect(all).not.toContain('https://www.googleapis.com/auth/drive')+ expect(ownAppOf('https://gmailmcp.googleapis.com/mcp/v1/')).toEqual({ provider: 'google', scopes: ['https://www.googleapis.com/auth/gmail.modify'] })+ expect(ownAppOf('https://mcp.linear.app/mcp')).toBeUndefined()+ // Each service's API and its MCP one, turned on in one page.+ expect(GOOGLE_APIS).toEqual(expect.arrayContaining(['calendar-json.googleapis.com', 'calendarmcp.googleapis.com', 'gmail.googleapis.com', 'gmailmcp.googleapis.com']))+ expect(GOOGLE_APIS).toHaveLength(10)+ })++ it("makes Slack's app from a link, with MCP on and the address the sign-in comes back to", () => {+ expect(ownAppOf('https://mcp.slack.com/mcp')).toEqual({ provider: 'slack', scopes: SLACK_SCOPES })+ const link = new URL(slackAppLink('http://localhost:47717/oauth/callback'))+ expect(`${link.origin}${link.pathname}`).toBe('https://api.slack.com/apps')+ expect(link.searchParams.get('new_app')).toBe('1')+ const manifest = JSON.parse(link.searchParams.get('manifest_json')!)+ expect(manifest.settings.is_mcp_enabled).toBe(true)+ expect(manifest.oauth_config.redirect_urls).toEqual(['http://localhost:47717/oauth/callback'])+ expect(manifest.oauth_config.scopes.user).toEqual(SLACK_SCOPES)+ expect(manifest.oauth_config.scopes.bot).toBeUndefined() // the agents act as the person, with a user token+ })})diff --git a/test/connectors.test.ts b/test/connectors.test.tsindex e627f25..1d0cd17 100644--- a/test/connectors.test.ts+++ b/test/connectors.test.ts@@ -6,6 +6,7 @@ import { join } from 'node:path'import { afterEach, beforeEach, describe, expect, it } from 'vitest'import { ConnectorManager } from '../src/core/connectors'import { Db } from '../src/core/db'+import { OpError } from '../src/core/onepassword'import { plainCipher, Secrets } from '../src/core/secrets'let server: Server@@ -107,6 +108,132 @@ describe('OAuth signed in from a page on another machine (Tucano as a server)',})})+// Google's sign-in takes no app it hasn't met: its connectors sign in with the person's own.+describe("Google's connectors", () => {+ let google: Server+ let gBase: string+ const calls: string[] = []+ const tokenBodies: string[] = []+ let gConnectors: ConnectorManager+ let secrets: Secrets++ beforeEach(async () => {+ calls.length = 0+ tokenBodies.length = 0+ google = createServer((req, res) => {+ calls.push(req.url ?? '')+ const json = (body: unknown, status = 200): void => void res.writeHead(status, { 'content-type': 'application/json' }).end(JSON.stringify(body))+ if (req.url?.startsWith('/.well-known/oauth-protected-resource'))+ return json({ resource: `${gBase}/mcp/v1`, authorization_servers: [gBase], scopes_supported: ['https://mail.google.com/', 'https://www.googleapis.com/auth/gmail.modify'] })+ if (req.url?.startsWith('/.well-known/oauth-authorization-server'))+ return json({ issuer: gBase, authorization_endpoint: `${gBase}/o/oauth2/v2/auth`, token_endpoint: `${gBase}/token`, response_types_supported: ['code'], code_challenge_methods_supported: ['S256'], token_endpoint_auth_methods_supported: ['client_secret_post', 'client_secret_basic'] })+ if (req.url === '/token') {+ let body = ''+ req.on('data', (c: Buffer) => (body += c))+ req.on('end', () => {+ tokenBodies.push(`${body}&auth=${req.headers.authorization ?? ''}`)+ json({ access_token: 'ya29.x', refresh_token: '1//r', token_type: 'Bearer', expires_in: 3600 })+ })+ return+ }+ res.writeHead(401, { 'www-authenticate': `Bearer resource_metadata="${gBase}/.well-known/oauth-protected-resource"` }).end()+ })+ await new Promise<void>((resolve) => google.listen(0, '127.0.0.1', resolve))+ gBase = `http://127.0.0.1:${(google.address() as AddressInfo).port}`+ secrets = new Secrets(db, plainCipher)+ gConnectors = new ConnectorManager({+ db,+ secrets,+ emit: () => {},+ openUrl: () => {},+ oauthCallbackUrl: () => 'http://127.0.0.1:1/oauth/callback',+ fixedCallbackUrl: () => 'http://localhost:47717/oauth/callback',+ ownAppOf: (url) =>+ url === `${gBase}/mcp/v1/slack`+ ? { provider: 'slack', scopes: ['chat:write', 'search:read.public'] }+ : url?.startsWith(gBase)+ ? { provider: 'google', scopes: ['https://www.googleapis.com/auth/gmail.modify'] }+ : undefined+ })+ })++ afterEach(async () => {+ await gConnectors.settled() // a connect under way would outlive the database+ await gConnectors.closeAll()+ await new Promise((resolve) => google.close(resolve))+ })++ it('says to make the Google app first when there is none', async () => {+ const id = await gConnectors.add({ name: 'Gmail', kind: 'remote', url: `${gBase}/mcp/v1`, auth: 'oauth' })+ await gConnectors.authorize(id)+ expect(gConnectors.get(id)!.error).toMatch(/app do Google/)+ expect(calls).toEqual([]) // it didn't even try+ })++ it("takes only a Google client ID, and never shows the secret back", async () => {+ await expect(gConnectors.setOwnApp('google', { clientId: 'abc', clientSecret: 's' })).rejects.toThrow(/googleusercontent/)+ await expect(gConnectors.setOwnApp('google', { clientId: '1-a.apps.googleusercontent.com', clientSecret: ' ' })).rejects.toThrow(/chave secreta/)+ await gConnectors.setOwnApp('google', { clientId: ' 1-a.apps.googleusercontent.com ', clientSecret: 'GOCSPX-s' })+ expect(await gConnectors.ownApp('google')).toEqual({ clientId: '1-a.apps.googleusercontent.com', redirectUrl: 'http://127.0.0.1:1/oauth/callback' })+ })++ it('signs in with that app, asking for its scopes and a refresh token, and renews with its secret', async () => {+ await gConnectors.setOwnApp('google', { clientId: '1-a.apps.googleusercontent.com', clientSecret: 'GOCSPX-s' })+ const id = await gConnectors.add({ name: 'Gmail', kind: 'remote', url: `${gBase}/mcp/v1`, auth: 'oauth' })+ await gConnectors.connect(id)+ const page = new URL((await gConnectors.authorize(id))!)+ expect(page.pathname).toBe('/o/oauth2/v2/auth')+ expect(page.searchParams.get('client_id')).toBe('1-a.apps.googleusercontent.com')+ expect(page.searchParams.get('scope')).toBe('https://www.googleapis.com/auth/gmail.modify') // not the full mail.google.com the server lists+ expect(page.searchParams.get('access_type')).toBe('offline')+ expect(page.searchParams.get('prompt')).toBe('consent')+ expect(calls.some((u) => u.startsWith('/register'))).toBe(false)++ await gConnectors.finishOAuthFromUrl(`http://127.0.0.1:1/oauth/callback?code=c1&state=${page.searchParams.get('state')}`).catch(() => {})+ // The code, then a renewal: this fake server turns every token away, so the connector renews at once.+ const bodies = tokenBodies.map((b) => new URLSearchParams(b))+ expect(bodies[0]!.get('code')).toBe('c1')+ expect(bodies.some((b) => b.get('grant_type') === 'refresh_token' && b.get('refresh_token') === '1//r')).toBe(true)+ // Basic, as Google lists first: the ID and the secret in the header.+ for (const b of bodies) expect(b.get('auth')).toBe(`Basic ${Buffer.from('1-a.apps.googleusercontent.com:GOCSPX-s').toString('base64')}`)+ expect(await secrets.getJson(`connector:${id}:oauth_tokens`)).toMatchObject({ refresh_token: '1//r' })+ expect(await secrets.getJson(`connector:${id}:oauth_client`)).toBeUndefined() // the app is kept once, for all of them+ })++ it('signs the Google connectors out when the app changes, and keeps them with the same one', async () => {+ await gConnectors.setOwnApp('google', { clientId: '1-a.apps.googleusercontent.com', clientSecret: 'GOCSPX-s' })+ const gmail = await gConnectors.add({ name: 'Gmail', kind: 'remote', url: `${gBase}/mcp/v1`, auth: 'oauth' })+ const other = await gConnectors.add({ name: 'Linear', kind: 'remote', url: `${base}/mcp`, auth: 'oauth' })+ await secrets.setJson(`connector:${gmail}:oauth_tokens`, { access_token: 'a', token_type: 'Bearer' })+ await secrets.setJson(`connector:${other}:oauth_tokens`, { access_token: 'b', token_type: 'Bearer' })+ await gConnectors.setOwnApp('google', { clientId: '1-a.apps.googleusercontent.com', clientSecret: 'GOCSPX-new' })+ expect(await secrets.getJson(`connector:${gmail}:oauth_tokens`)).toBeDefined()+ await gConnectors.setOwnApp('google', { clientId: '2-b.apps.googleusercontent.com', clientSecret: 'GOCSPX-b' })+ expect(await secrets.getJson(`connector:${gmail}:oauth_tokens`)).toBeUndefined()+ expect(await secrets.getJson(`connector:${other}:oauth_tokens`)).toBeDefined()+ })++ it("signs Slack in with the person's app, back to the fixed address its app registered", async () => {+ await expect(gConnectors.setOwnApp('slack', { clientId: '1-a.apps.googleusercontent.com', clientSecret: 's' })).rejects.toThrow(/Slack/)+ const id = await gConnectors.add({ name: 'Slack', kind: 'remote', url: `${gBase}/mcp/v1/slack`, auth: 'oauth' })+ await gConnectors.authorize(id)+ expect(gConnectors.get(id)!.error).toMatch(/app do Slack/)++ await gConnectors.setOwnApp('slack', { clientId: '123.456', clientSecret: 'shh' })+ expect(await gConnectors.ownApp('slack')).toEqual({ clientId: '123.456', redirectUrl: 'http://localhost:47717/oauth/callback' })+ expect(await gConnectors.ownApp('google')).toEqual({ redirectUrl: 'http://127.0.0.1:1/oauth/callback' }) // apart from Google's+ await gConnectors.settled() // saving the app tried the connector again, on its own+ expect(gConnectors.get(id)!.status).toBe('needs_auth')+ const page = new URL((await gConnectors.authorize(id))!)+ expect(page.searchParams.get('client_id')).toBe('123.456')+ expect(page.searchParams.get('redirect_uri')).toBe('http://localhost:47717/oauth/callback')+ expect(page.searchParams.get('scope')).toBe('chat:write search:read.public')+ expect(page.searchParams.has('access_type')).toBe(false) // Google's alone+ await gConnectors.finishOAuthFromUrl(`http://localhost:47717/oauth/callback?code=s1&state=${page.searchParams.get('state')}`).catch(() => {})+ expect(new URLSearchParams(tokenBodies[0]).get('redirect_uri')).toBe('http://localhost:47717/oauth/callback')+ })+})+describe('a connector with a token', () => {it('asks for the token, not for a browser, and takes it without being removed', async () => {let seen: string | undefined@@ -153,3 +280,48 @@ describe('a connector with a token', () => {srv.close()})})++describe('a secret kept in 1Password', () => {+ it('keeps only the reference, and reads the value on each connection', async () => {+ const seen: (string | undefined)[] = []+ const srv = createServer((req, res) => {+ seen.push(req.headers.authorization)+ res.writeHead(401).end()+ })+ await new Promise<void>((resolve) => srv.listen(0, '127.0.0.1', resolve))+ const reads: string[] = []+ const secrets = new Secrets(db, plainCipher)+ const mine = new ConnectorManager({+ db,+ secrets,+ emit: () => {},+ openUrl: () => {},+ oauthCallbackUrl: () => '',+ readOp: async (ref) => (reads.push(ref), 'from-1password')+ })+ const id = await mine.add({ kind: 'remote', name: 'GitHub', url: `http://127.0.0.1:${(srv.address() as AddressInfo).port}/mcp`, auth: 'token', token: ' op://Dev/GitHub/token ' })+ await mine.connect(id)+ expect(seen.at(-1)).toBe('Bearer from-1password')+ expect(reads).toEqual(['op://Dev/GitHub/token'])+ expect(await secrets.get(`connector:${id}:token`)).toBe('op://Dev/GitHub/token') // never the value+ await mine.closeAll()+ srv.close()+ })++ it("says what to do when 1Password doesn't give it, and doesn't try again by itself", async () => {+ const mine = new ConnectorManager({+ db,+ secrets: new Secrets(db, plainCipher),+ emit: () => {},+ openUrl: () => {},+ oauthCallbackUrl: () => '',+ readOp: async () => {+ throw new OpError('O 1Password não foi desbloqueado a tempo.')+ }+ })+ const id = await mine.add({ kind: 'stdio', name: 'AWS', command: 'node', args: ['-e', ''], env: { AWS_SECRET_ACCESS_KEY: 'op://Dev/AWS/secret', AWS_REGION: 'us-east-1' } })+ await mine.connect(id)+ expect(mine.get(id)).toMatchObject({ status: 'error', error: 'O 1Password não foi desbloqueado a tempo.' })+ await mine.closeAll()+ })+})diff --git a/test/errors.test.ts b/test/errors.test.tsindex ce22fa2..e2d5221 100644--- a/test/errors.test.ts+++ b/test/errors.test.ts@@ -87,7 +87,7 @@ describe("errors in people’s words", () => {detail: "spawn npx ENOENT",});expect(friendly(sys("spawn uvx ENOENT", "ENOENT")).text).toBe(- "O comando `uvx` não foi encontrado. Confira se ele está instalado."+ "O comando `uvx` não foi encontrado. Instale o uv (docs.astral.sh/uv) e tente de novo.");expect(friendly(sys("database is locked", "SQLITE_BUSY")).text).toBe("O Tucano está ocupado salvando. Tente de novo em instantes."diff --git a/test/onepassword.test.ts b/test/onepassword.test.tsnew file mode 100644index 0000000..da2d4fd--- /dev/null+++ b/test/onepassword.test.ts@@ -0,0 +1,25 @@+import { describe, expect, it } from 'vitest'+import { isOpRef, opMessage, resolveOpRefs } from '../src/core/onepassword'++describe('1Password references', () => {+ it('tells a reference from a value', () => {+ expect(isOpRef('op://Dev/GitHub/token')).toBe(true)+ expect(isOpRef(' op://Dev/AWS Keys/secret ')).toBe(true)+ expect(isOpRef('op://Dev/GitHub/section/token')).toBe(true)+ expect(isOpRef('op://Dev')).toBe(false)+ expect(isOpRef('github_pat_op://x/y/z')).toBe(false)+ expect(isOpRef(undefined)).toBe(false)+ })++ it('reads the references and leaves the other values as they are', async () => {+ const env = await resolveOpRefs({ AWS_REGION: 'us-east-1', AWS_SECRET_ACCESS_KEY: 'op://Dev/AWS/secret' }, async (ref) => `<${ref}>`)+ expect(env).toEqual({ AWS_REGION: 'us-east-1', AWS_SECRET_ACCESS_KEY: '<op://Dev/AWS/secret>' })+ })++ it('says what to do when op fails', () => {+ expect(opMessage({ code: 'ENOENT' }, '', 'op://a/b/c')).toMatch(/1Password CLI|op\)/)+ expect(opMessage({ killed: true }, '', 'op://a/b/c')).toMatch(/desbloqueado|unlocked/)+ expect(opMessage({ code: 1 }, '[ERROR] 2026/11/05 10:00:00 "GitHub" isn\'t an item in the "Dev" vault.', 'op://Dev/GitHub/token')).toMatch(/op:\/\/Dev\/GitHub\/token/)+ expect(opMessage({ code: 1 }, '[ERROR] 2026/11/05 10:00:00 You are not currently signed in.', 'op://a/b/c')).toMatch(/op signin/)+ })+})