+ {manifestUrl ? (
+
+
+
+ ) : null}
+
(
+
+
+
+ {tx("custom.waiting", "Waiting for Linear authorization...")}
+
+ {connect.qr_url ? (
+
+ ) : null}
+
+ )}
+ />
+
+ );
+}
+
+export function linearManifestUrl(
+ publicBaseUrl: string,
+ webhookPath: string,
+ callbackPath: string,
+): string {
+ const manifest = {
+ $schema: "https://linear.app/.well-known/oauth-app-manifest.schema.json",
+ schemaVersion: "1.0.0",
+ distribution: "private",
+ display: {
+ description: "Use nanobot as a native issue agent.",
+ },
+ developer: { name: "nanobot" },
+ oauth: {
+ client_name: "nanobot Agent",
+ client_uri: publicBaseUrl,
+ redirect_uris: [`${publicBaseUrl}${callbackPath}`],
+ grant_types: ["authorization_code"],
+ },
+ webhook: {
+ enabled: true,
+ url: `${publicBaseUrl}${webhookPath}`,
+ resourceTypes: [
+ "AgentSessionEvent",
+ "PermissionChange",
+ "OAuthAuthorization",
+ ],
+ },
+ };
+ return `https://linear.app/settings/api/applications/new?${new URLSearchParams({
+ manifest: JSON.stringify(manifest),
+ })}`;
+}
diff --git a/nanobot/channels/linear/webui/index.tsx b/nanobot/channels/linear/webui/index.tsx
new file mode 100644
index 000000000..a1d298151
--- /dev/null
+++ b/nanobot/channels/linear/webui/index.tsx
@@ -0,0 +1,37 @@
+import { lazy } from "react";
+
+import type { ChannelUiContribution } from "@/channel-plugins/types";
+import { chatAppGuideUrl } from "@/components/settings/channels/catalog";
+
+const LinearConnectFlow = lazy(() =>
+ import("./LinearConnectFlow").then(({ LinearConnectFlow: component }) => ({
+ default: component,
+ })),
+);
+
+export default {
+ ConnectFlow: LinearConnectFlow,
+ presentation: {
+ displayName: "Linear",
+ initials: "LI",
+ color: "#5E6AD2",
+ logoUrl: "https://linear.app/favicon.ico",
+ setup: {
+ mode: "connect",
+ docsUrl: chatAppGuideUrl("linear"),
+ fields: [
+ { key: "channels.linear.clientId" },
+ { key: "channels.linear.clientSecret" },
+ { key: "channels.linear.webhookSigningSecret" },
+ { key: "channels.linear.publicBaseUrl" },
+ ],
+ manualFields: [
+ { key: "channels.linear.host" },
+ { key: "channels.linear.port" },
+ { key: "channels.linear.webhookPath" },
+ { key: "channels.linear.oauthCallbackPath" },
+ { key: "channels.linear.allowFrom" },
+ ],
+ },
+ },
+} satisfies ChannelUiContribution;
diff --git a/nanobot/channels/linear/webui/locales/en.json b/nanobot/channels/linear/webui/locales/en.json
new file mode 100644
index 000000000..846bbabc0
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/en.json
@@ -0,0 +1,71 @@
+{
+ "description": "Work with nanobot from Linear issues through native Agent Sessions.",
+ "requirements": "A private Linear OAuth app and a stable public HTTPS callback URL",
+ "setup": {
+ "docsLabel": "Open Linear setup guide",
+ "officialLabel": "Create Linear OAuth app",
+ "tryIt": "Mention the app in an issue comment. Follow-ups inside its Agent Session do not need another mention.",
+ "summary": "Create a private Linear OAuth app, save its credentials and public URL, then authorize each workspace. New sessions require an explicit @mention; ordinary comments are ignored.",
+ "steps": [
+ "Expose this nanobot instance through a stable HTTPS URL (a tunnel is fine).",
+ "Create a private OAuth app in Linear with read, write, and app:mentionable scopes. Do not add app:assignable.",
+ "Subscribe the app webhook to AgentSessionEvent, PermissionChange, and OAuthAuthorization using the generated webhook URL.",
+ "Save settings, connect the workspace with OAuth, then @mention the app on an issue."
+ ],
+ "fields": {
+ "clientId": {
+ "label": "OAuth client ID",
+ "placeholder": "Linear OAuth client ID",
+ "help": "Copy it from the private OAuth app in Linear."
+ },
+ "clientSecret": {
+ "label": "OAuth client secret",
+ "placeholder": "••••••",
+ "help": "Stored only by this nanobot instance."
+ },
+ "webhookSigningSecret": {
+ "label": "Webhook signing secret",
+ "placeholder": "••••••",
+ "help": "Used to verify Linear-Signature before any webhook body is parsed."
+ },
+ "publicBaseUrl": {
+ "label": "Public HTTPS URL",
+ "placeholder": "https://nanobot.example.com",
+ "help": "A stable HTTPS origin routed to the listener below; do not include a path."
+ },
+ "host": {
+ "label": "Listen host",
+ "placeholder": "0.0.0.0"
+ },
+ "port": {
+ "label": "Listen port",
+ "placeholder": "3979"
+ },
+ "webhookPath": {
+ "label": "Webhook path",
+ "placeholder": "/linear/webhook"
+ },
+ "oauthCallbackPath": {
+ "label": "OAuth callback path",
+ "placeholder": "/linear/oauth/callback"
+ },
+ "allowFrom": {
+ "label": "Allowed Linear users",
+ "placeholder": "Linear user IDs, comma separated",
+ "help": "Leave empty to use nanobot pairing, or use * to allow every user in connected workspaces."
+ }
+ }
+ },
+ "custom": {
+ "qrAlt": "Linear authorization QR code",
+ "authorizeTitle": "Authorize in Linear",
+ "authorizeDescription": "Open Linear in this browser or scan the QR code. nanobot enables the channel after authorization.",
+ "waiting": "Waiting for Linear authorization...",
+ "connected": "Linear is connected.",
+ "stopped": "Authorization stopped.",
+ "connecting": "Connecting...",
+ "reconnect": "Connect another workspace",
+ "connect": "Connect Linear",
+ "openLinear": "Continue in Linear"
+ }
+}
diff --git a/nanobot/channels/linear/webui/locales/es.json b/nanobot/channels/linear/webui/locales/es.json
new file mode 100644
index 000000000..eb5deb090
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/es.json
@@ -0,0 +1,71 @@
+{
+ "description": "Trabaja con nanobot desde incidencias de Linear mediante sesiones de agente nativas.",
+ "requirements": "Una aplicación OAuth privada de Linear y una URL HTTPS pública y estable para las devoluciones de llamada",
+ "setup": {
+ "docsLabel": "Abrir la guía de configuración de Linear",
+ "officialLabel": "Crear una aplicación OAuth de Linear",
+ "tryIt": "Menciona la aplicación en un comentario de una incidencia. Las respuestas dentro de su sesión de agente no necesitan otra mención.",
+ "summary": "Crea una aplicación OAuth privada de Linear, guarda sus credenciales y la URL pública y, después, autoriza el espacio de trabajo. Cada sesión nueva requiere una @mención explícita; los comentarios normales se ignoran.",
+ "steps": [
+ "Expón esta instancia de nanobot mediante una URL HTTPS estable (puedes usar un túnel).",
+ "Crea una aplicación OAuth privada en Linear con los permisos read, write y app:mentionable. No añadas app:assignable.",
+ "Suscribe el webhook de la aplicación a AgentSessionEvent, PermissionChange y OAuthAuthorization con la URL generada.",
+ "Guarda la configuración, conecta el espacio de trabajo mediante OAuth y @menciona la aplicación en una incidencia."
+ ],
+ "fields": {
+ "clientId": {
+ "label": "ID de cliente OAuth",
+ "placeholder": "ID de cliente OAuth de Linear",
+ "help": "Cópialo de la aplicación OAuth privada en Linear."
+ },
+ "clientSecret": {
+ "label": "Secreto de cliente OAuth",
+ "placeholder": "••••••",
+ "help": "Solo se guarda en esta instancia de nanobot."
+ },
+ "webhookSigningSecret": {
+ "label": "Secreto de firma del webhook",
+ "placeholder": "••••••",
+ "help": "Se usa para verificar Linear-Signature antes de analizar el cuerpo del webhook."
+ },
+ "publicBaseUrl": {
+ "label": "URL HTTPS pública",
+ "placeholder": "https://nanobot.example.com",
+ "help": "Un origen HTTPS estable dirigido al listener indicado abajo; no incluyas una ruta."
+ },
+ "host": {
+ "label": "Host de escucha",
+ "placeholder": "0.0.0.0"
+ },
+ "port": {
+ "label": "Puerto de escucha",
+ "placeholder": "3979"
+ },
+ "webhookPath": {
+ "label": "Ruta del webhook",
+ "placeholder": "/linear/webhook"
+ },
+ "oauthCallbackPath": {
+ "label": "Ruta de devolución OAuth",
+ "placeholder": "/linear/oauth/callback"
+ },
+ "allowFrom": {
+ "label": "Usuarios de Linear permitidos",
+ "placeholder": "ID de usuarios de Linear separados por comas",
+ "help": "Déjalo vacío para usar el emparejamiento de nanobot, o usa * para permitir a todos los usuarios de los espacios conectados."
+ }
+ }
+ },
+ "custom": {
+ "qrAlt": "Código QR de autorización de Linear",
+ "authorizeTitle": "Autorizar en Linear",
+ "authorizeDescription": "Abre Linear en este navegador o escanea el código QR. nanobot habilitará el canal después de la autorización.",
+ "waiting": "Esperando la autorización de Linear...",
+ "connected": "Linear está conectado.",
+ "stopped": "La autorización se detuvo.",
+ "connecting": "Conectando...",
+ "reconnect": "Conectar otro espacio de trabajo",
+ "connect": "Conectar Linear",
+ "openLinear": "Continuar en Linear"
+ }
+}
diff --git a/nanobot/channels/linear/webui/locales/fr.json b/nanobot/channels/linear/webui/locales/fr.json
new file mode 100644
index 000000000..53742c966
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/fr.json
@@ -0,0 +1,71 @@
+{
+ "description": "Utilisez nanobot depuis les tickets Linear grâce aux sessions d’agent natives.",
+ "requirements": "Une application OAuth Linear privée et une URL de rappel HTTPS publique et stable",
+ "setup": {
+ "docsLabel": "Ouvrir le guide de configuration Linear",
+ "officialLabel": "Créer une application OAuth Linear",
+ "tryIt": "Mentionnez l’application dans un commentaire de ticket. Les messages suivants dans sa session d’agent ne nécessitent pas de nouvelle mention.",
+ "summary": "Créez une application OAuth Linear privée, enregistrez ses identifiants et son URL publique, puis autorisez l’espace de travail. Chaque nouvelle session exige une @mention explicite ; les commentaires ordinaires sont ignorés.",
+ "steps": [
+ "Exposez cette instance nanobot avec une URL HTTPS stable (un tunnel convient).",
+ "Créez une application OAuth privée dans Linear avec les autorisations read, write et app:mentionable. N’ajoutez pas app:assignable.",
+ "Abonnez le webhook de l’application à AgentSessionEvent, PermissionChange et OAuthAuthorization avec l’URL générée.",
+ "Enregistrez les paramètres, connectez l’espace de travail avec OAuth, puis @mentionnez l’application dans un ticket."
+ ],
+ "fields": {
+ "clientId": {
+ "label": "ID client OAuth",
+ "placeholder": "ID client OAuth Linear",
+ "help": "Copiez-le depuis l’application OAuth privée dans Linear."
+ },
+ "clientSecret": {
+ "label": "Secret client OAuth",
+ "placeholder": "••••••",
+ "help": "Enregistré uniquement sur cette instance nanobot."
+ },
+ "webhookSigningSecret": {
+ "label": "Secret de signature du webhook",
+ "placeholder": "••••••",
+ "help": "Utilisé pour vérifier Linear-Signature avant toute analyse du contenu du webhook."
+ },
+ "publicBaseUrl": {
+ "label": "URL HTTPS publique",
+ "placeholder": "https://nanobot.example.com",
+ "help": "Une origine HTTPS stable acheminée vers l’écouteur ci-dessous ; n’incluez pas de chemin."
+ },
+ "host": {
+ "label": "Hôte d’écoute",
+ "placeholder": "0.0.0.0"
+ },
+ "port": {
+ "label": "Port d’écoute",
+ "placeholder": "3979"
+ },
+ "webhookPath": {
+ "label": "Chemin du webhook",
+ "placeholder": "/linear/webhook"
+ },
+ "oauthCallbackPath": {
+ "label": "Chemin de rappel OAuth",
+ "placeholder": "/linear/oauth/callback"
+ },
+ "allowFrom": {
+ "label": "Utilisateurs Linear autorisés",
+ "placeholder": "ID utilisateur Linear séparés par des virgules",
+ "help": "Laissez vide pour utiliser l’association nanobot, ou saisissez * pour autoriser tous les utilisateurs des espaces connectés."
+ }
+ }
+ },
+ "custom": {
+ "qrAlt": "Code QR d’autorisation Linear",
+ "authorizeTitle": "Autoriser dans Linear",
+ "authorizeDescription": "Ouvrez Linear dans ce navigateur ou scannez le code QR. nanobot activera le canal après l’autorisation.",
+ "waiting": "En attente de l’autorisation Linear...",
+ "connected": "Linear est connecté.",
+ "stopped": "L’autorisation a été interrompue.",
+ "connecting": "Connexion...",
+ "reconnect": "Connecter un autre espace de travail",
+ "connect": "Connecter Linear",
+ "openLinear": "Continuer dans Linear"
+ }
+}
diff --git a/nanobot/channels/linear/webui/locales/id.json b/nanobot/channels/linear/webui/locales/id.json
new file mode 100644
index 000000000..d00e5907c
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/id.json
@@ -0,0 +1,71 @@
+{
+ "description": "Gunakan nanobot dari issue Linear melalui Agent Session native.",
+ "requirements": "Aplikasi OAuth Linear privat dan URL callback HTTPS publik yang stabil",
+ "setup": {
+ "docsLabel": "Buka panduan penyiapan Linear",
+ "officialLabel": "Buat aplikasi OAuth Linear",
+ "tryIt": "Mention aplikasi dalam komentar issue. Pesan lanjutan di Agent Session tidak memerlukan mention lagi.",
+ "summary": "Buat aplikasi OAuth Linear privat, simpan kredensial dan URL publiknya, lalu otorisasi workspace. Setiap sesi baru memerlukan @mention eksplisit; komentar biasa akan diabaikan.",
+ "steps": [
+ "Ekspos instans nanobot ini melalui URL HTTPS yang stabil (tunnel dapat digunakan).",
+ "Buat aplikasi OAuth privat di Linear dengan scope read, write, dan app:mentionable. Jangan tambahkan app:assignable.",
+ "Daftarkan webhook aplikasi untuk AgentSessionEvent, PermissionChange, dan OAuthAuthorization menggunakan URL yang dibuat.",
+ "Simpan pengaturan, hubungkan workspace melalui OAuth, lalu @mention aplikasi pada issue."
+ ],
+ "fields": {
+ "clientId": {
+ "label": "ID klien OAuth",
+ "placeholder": "ID klien OAuth Linear",
+ "help": "Salin dari aplikasi OAuth privat di Linear."
+ },
+ "clientSecret": {
+ "label": "Secret klien OAuth",
+ "placeholder": "••••••",
+ "help": "Hanya disimpan oleh instans nanobot ini."
+ },
+ "webhookSigningSecret": {
+ "label": "Secret penandatanganan webhook",
+ "placeholder": "••••••",
+ "help": "Digunakan untuk memverifikasi Linear-Signature sebelum isi webhook diurai."
+ },
+ "publicBaseUrl": {
+ "label": "URL HTTPS publik",
+ "placeholder": "https://nanobot.example.com",
+ "help": "Origin HTTPS stabil yang diarahkan ke listener di bawah; jangan sertakan path."
+ },
+ "host": {
+ "label": "Host listener",
+ "placeholder": "0.0.0.0"
+ },
+ "port": {
+ "label": "Port listener",
+ "placeholder": "3979"
+ },
+ "webhookPath": {
+ "label": "Path webhook",
+ "placeholder": "/linear/webhook"
+ },
+ "oauthCallbackPath": {
+ "label": "Path callback OAuth",
+ "placeholder": "/linear/oauth/callback"
+ },
+ "allowFrom": {
+ "label": "Pengguna Linear yang diizinkan",
+ "placeholder": "ID pengguna Linear, dipisahkan koma",
+ "help": "Biarkan kosong untuk memakai pairing nanobot, atau gunakan * untuk mengizinkan semua pengguna di workspace yang terhubung."
+ }
+ }
+ },
+ "custom": {
+ "qrAlt": "Kode QR otorisasi Linear",
+ "authorizeTitle": "Otorisasi di Linear",
+ "authorizeDescription": "Buka Linear di browser ini atau pindai kode QR. nanobot akan mengaktifkan channel setelah otorisasi.",
+ "waiting": "Menunggu otorisasi Linear...",
+ "connected": "Linear telah terhubung.",
+ "stopped": "Otorisasi dihentikan.",
+ "connecting": "Menghubungkan...",
+ "reconnect": "Hubungkan workspace lain",
+ "connect": "Hubungkan Linear",
+ "openLinear": "Lanjutkan di Linear"
+ }
+}
diff --git a/nanobot/channels/linear/webui/locales/ja.json b/nanobot/channels/linear/webui/locales/ja.json
new file mode 100644
index 000000000..847799155
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/ja.json
@@ -0,0 +1,71 @@
+{
+ "description": "Linear の issue からネイティブ Agent Session を通じて nanobot を利用します。",
+ "requirements": "非公開の Linear OAuth アプリと、安定した公開 HTTPS コールバック URL",
+ "setup": {
+ "docsLabel": "Linear セットアップガイドを開く",
+ "officialLabel": "Linear OAuth アプリを作成",
+ "tryIt": "issue のコメントでアプリをメンションしてください。Agent Session 内の続きのメッセージでは、再度メンションする必要はありません。",
+ "summary": "非公開の Linear OAuth アプリを作成し、認証情報と公開 URL を保存してからワークスペースを認証します。新しいセッションの開始には明示的な @メンションが必要で、通常のコメントは無視されます。",
+ "steps": [
+ "この nanobot インスタンスを安定した HTTPS URL で公開します(トンネルも利用できます)。",
+ "Linear で read、write、app:mentionable スコープを持つ非公開 OAuth アプリを作成します。app:assignable は追加しないでください。",
+ "生成された URL を使い、アプリの webhook を AgentSessionEvent、PermissionChange、OAuthAuthorization に登録します。",
+ "設定を保存し、OAuth でワークスペースを接続してから、issue でアプリを @メンションします。"
+ ],
+ "fields": {
+ "clientId": {
+ "label": "OAuth クライアント ID",
+ "placeholder": "Linear OAuth クライアント ID",
+ "help": "Linear の非公開 OAuth アプリからコピーします。"
+ },
+ "clientSecret": {
+ "label": "OAuth クライアントシークレット",
+ "placeholder": "••••••",
+ "help": "この nanobot インスタンス内にのみ保存されます。"
+ },
+ "webhookSigningSecret": {
+ "label": "Webhook 署名シークレット",
+ "placeholder": "••••••",
+ "help": "Webhook の本文を解析する前に Linear-Signature を検証するために使います。"
+ },
+ "publicBaseUrl": {
+ "label": "公開 HTTPS URL",
+ "placeholder": "https://nanobot.example.com",
+ "help": "下のリスナーへ転送される安定した HTTPS オリジンを指定します。パスは含めないでください。"
+ },
+ "host": {
+ "label": "リッスンホスト",
+ "placeholder": "0.0.0.0"
+ },
+ "port": {
+ "label": "リッスンポート",
+ "placeholder": "3979"
+ },
+ "webhookPath": {
+ "label": "Webhook パス",
+ "placeholder": "/linear/webhook"
+ },
+ "oauthCallbackPath": {
+ "label": "OAuth コールバックパス",
+ "placeholder": "/linear/oauth/callback"
+ },
+ "allowFrom": {
+ "label": "許可する Linear ユーザー",
+ "placeholder": "Linear ユーザー ID(カンマ区切り)",
+ "help": "nanobot のペアリングを使う場合は空欄にします。接続済みワークスペースの全ユーザーを許可する場合のみ * を指定してください。"
+ }
+ }
+ },
+ "custom": {
+ "qrAlt": "Linear 認証 QR コード",
+ "authorizeTitle": "Linear で認証",
+ "authorizeDescription": "このブラウザで Linear を開くか、QR コードを読み取ってください。認証後、nanobot がチャンネルを有効にします。",
+ "waiting": "Linear の認証を待っています...",
+ "connected": "Linear に接続しました。",
+ "stopped": "認証を中止しました。",
+ "connecting": "接続しています...",
+ "reconnect": "別のワークスペースを接続",
+ "connect": "Linear に接続",
+ "openLinear": "Linear で続行"
+ }
+}
diff --git a/nanobot/channels/linear/webui/locales/ko.json b/nanobot/channels/linear/webui/locales/ko.json
new file mode 100644
index 000000000..34bf8cbdb
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/ko.json
@@ -0,0 +1,71 @@
+{
+ "description": "Linear 이슈에서 네이티브 Agent Session을 통해 nanobot을 사용합니다.",
+ "requirements": "비공개 Linear OAuth 앱과 안정적인 공개 HTTPS 콜백 URL",
+ "setup": {
+ "docsLabel": "Linear 설정 가이드 열기",
+ "officialLabel": "Linear OAuth 앱 만들기",
+ "tryIt": "이슈 댓글에서 앱을 멘션하세요. Agent Session 안의 후속 메시지에는 다시 멘션할 필요가 없습니다.",
+ "summary": "비공개 Linear OAuth 앱을 만들고 인증 정보와 공개 URL을 저장한 다음 워크스페이스를 승인하세요. 새 세션은 명시적인 @멘션으로만 시작되며 일반 댓글은 무시됩니다.",
+ "steps": [
+ "이 nanobot 인스턴스를 안정적인 HTTPS URL로 공개하세요(터널을 사용할 수 있습니다).",
+ "Linear에서 read, write, app:mentionable 범위가 있는 비공개 OAuth 앱을 만드세요. app:assignable은 추가하지 마세요.",
+ "생성된 URL로 앱 webhook을 AgentSessionEvent, PermissionChange, OAuthAuthorization에 구독하세요.",
+ "설정을 저장하고 OAuth로 워크스페이스를 연결한 다음 이슈에서 앱을 @멘션하세요."
+ ],
+ "fields": {
+ "clientId": {
+ "label": "OAuth 클라이언트 ID",
+ "placeholder": "Linear OAuth 클라이언트 ID",
+ "help": "Linear의 비공개 OAuth 앱에서 복사하세요."
+ },
+ "clientSecret": {
+ "label": "OAuth 클라이언트 시크릿",
+ "placeholder": "••••••",
+ "help": "이 nanobot 인스턴스에만 저장됩니다."
+ },
+ "webhookSigningSecret": {
+ "label": "Webhook 서명 시크릿",
+ "placeholder": "••••••",
+ "help": "Webhook 본문을 파싱하기 전에 Linear-Signature를 검증하는 데 사용됩니다."
+ },
+ "publicBaseUrl": {
+ "label": "공개 HTTPS URL",
+ "placeholder": "https://nanobot.example.com",
+ "help": "아래 리스너로 연결되는 안정적인 HTTPS 오리진입니다. 경로는 포함하지 마세요."
+ },
+ "host": {
+ "label": "수신 호스트",
+ "placeholder": "0.0.0.0"
+ },
+ "port": {
+ "label": "수신 포트",
+ "placeholder": "3979"
+ },
+ "webhookPath": {
+ "label": "Webhook 경로",
+ "placeholder": "/linear/webhook"
+ },
+ "oauthCallbackPath": {
+ "label": "OAuth 콜백 경로",
+ "placeholder": "/linear/oauth/callback"
+ },
+ "allowFrom": {
+ "label": "허용된 Linear 사용자",
+ "placeholder": "쉼표로 구분한 Linear 사용자 ID",
+ "help": "nanobot 페어링을 사용하려면 비워 두세요. 연결된 워크스페이스의 모든 사용자를 허용하려면 *를 사용하세요."
+ }
+ }
+ },
+ "custom": {
+ "qrAlt": "Linear 승인 QR 코드",
+ "authorizeTitle": "Linear에서 승인",
+ "authorizeDescription": "이 브라우저에서 Linear를 열거나 QR 코드를 스캔하세요. 승인 후 nanobot이 채널을 활성화합니다.",
+ "waiting": "Linear 승인을 기다리는 중...",
+ "connected": "Linear가 연결되었습니다.",
+ "stopped": "승인이 중지되었습니다.",
+ "connecting": "연결 중...",
+ "reconnect": "다른 워크스페이스 연결",
+ "connect": "Linear 연결",
+ "openLinear": "Linear에서 계속"
+ }
+}
diff --git a/nanobot/channels/linear/webui/locales/pt-BR.json b/nanobot/channels/linear/webui/locales/pt-BR.json
new file mode 100644
index 000000000..caa01e3d7
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/pt-BR.json
@@ -0,0 +1,71 @@
+{
+ "description": "Use o nanobot em issues do Linear por meio de Agent Sessions nativas.",
+ "requirements": "Um aplicativo OAuth privado do Linear e uma URL pública HTTPS estável para callbacks",
+ "setup": {
+ "docsLabel": "Abrir o guia de configuração do Linear",
+ "officialLabel": "Criar aplicativo OAuth do Linear",
+ "tryIt": "Mencione o aplicativo em um comentário da issue. As mensagens seguintes dentro da Agent Session não precisam de outra menção.",
+ "summary": "Crie um aplicativo OAuth privado do Linear, salve as credenciais e a URL pública e autorize o workspace. Cada nova sessão exige uma @menção explícita; comentários comuns são ignorados.",
+ "steps": [
+ "Exponha esta instância do nanobot por uma URL HTTPS estável (um túnel pode ser usado).",
+ "Crie um aplicativo OAuth privado no Linear com os escopos read, write e app:mentionable. Não adicione app:assignable.",
+ "Inscreva o webhook do aplicativo em AgentSessionEvent, PermissionChange e OAuthAuthorization usando a URL gerada.",
+ "Salve as configurações, conecte o workspace com OAuth e @mencione o aplicativo em uma issue."
+ ],
+ "fields": {
+ "clientId": {
+ "label": "ID do cliente OAuth",
+ "placeholder": "ID do cliente OAuth do Linear",
+ "help": "Copie do aplicativo OAuth privado no Linear."
+ },
+ "clientSecret": {
+ "label": "Segredo do cliente OAuth",
+ "placeholder": "••••••",
+ "help": "Armazenado somente nesta instância do nanobot."
+ },
+ "webhookSigningSecret": {
+ "label": "Segredo de assinatura do webhook",
+ "placeholder": "••••••",
+ "help": "Usado para verificar Linear-Signature antes de interpretar o conteúdo do webhook."
+ },
+ "publicBaseUrl": {
+ "label": "URL HTTPS pública",
+ "placeholder": "https://nanobot.example.com",
+ "help": "Uma origem HTTPS estável encaminhada ao listener abaixo; não inclua um caminho."
+ },
+ "host": {
+ "label": "Host de escuta",
+ "placeholder": "0.0.0.0"
+ },
+ "port": {
+ "label": "Porta de escuta",
+ "placeholder": "3979"
+ },
+ "webhookPath": {
+ "label": "Caminho do webhook",
+ "placeholder": "/linear/webhook"
+ },
+ "oauthCallbackPath": {
+ "label": "Caminho do callback OAuth",
+ "placeholder": "/linear/oauth/callback"
+ },
+ "allowFrom": {
+ "label": "Usuários do Linear permitidos",
+ "placeholder": "IDs de usuário do Linear separados por vírgulas",
+ "help": "Deixe vazio para usar o pareamento do nanobot ou use * para permitir todos os usuários dos workspaces conectados."
+ }
+ }
+ },
+ "custom": {
+ "qrAlt": "Código QR de autorização do Linear",
+ "authorizeTitle": "Autorizar no Linear",
+ "authorizeDescription": "Abra o Linear neste navegador ou escaneie o código QR. O nanobot habilitará o canal após a autorização.",
+ "waiting": "Aguardando autorização do Linear...",
+ "connected": "O Linear está conectado.",
+ "stopped": "A autorização foi interrompida.",
+ "connecting": "Conectando...",
+ "reconnect": "Conectar outro workspace",
+ "connect": "Conectar Linear",
+ "openLinear": "Continuar no Linear"
+ }
+}
diff --git a/nanobot/channels/linear/webui/locales/vi.json b/nanobot/channels/linear/webui/locales/vi.json
new file mode 100644
index 000000000..9f68506d0
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/vi.json
@@ -0,0 +1,71 @@
+{
+ "description": "Sử dụng nanobot từ issue Linear thông qua Agent Session gốc.",
+ "requirements": "Ứng dụng OAuth Linear riêng tư và URL callback HTTPS công khai, ổn định",
+ "setup": {
+ "docsLabel": "Mở hướng dẫn thiết lập Linear",
+ "officialLabel": "Tạo ứng dụng OAuth Linear",
+ "tryIt": "Nhắc đến ứng dụng trong bình luận của issue. Tin nhắn tiếp theo trong Agent Session không cần nhắc lại.",
+ "summary": "Tạo ứng dụng OAuth Linear riêng tư, lưu thông tin xác thực và URL công khai, rồi cấp quyền cho workspace. Mỗi phiên mới cần @mention rõ ràng; bình luận thông thường sẽ bị bỏ qua.",
+ "steps": [
+ "Công khai phiên bản nanobot này qua URL HTTPS ổn định (có thể dùng tunnel).",
+ "Tạo ứng dụng OAuth riêng tư trong Linear với các scope read, write và app:mentionable. Không thêm app:assignable.",
+ "Đăng ký webhook của ứng dụng cho AgentSessionEvent, PermissionChange và OAuthAuthorization bằng URL được tạo.",
+ "Lưu cài đặt, kết nối workspace qua OAuth, rồi @mention ứng dụng trong một issue."
+ ],
+ "fields": {
+ "clientId": {
+ "label": "ID máy khách OAuth",
+ "placeholder": "ID máy khách OAuth Linear",
+ "help": "Sao chép từ ứng dụng OAuth riêng tư trong Linear."
+ },
+ "clientSecret": {
+ "label": "Mã bí mật máy khách OAuth",
+ "placeholder": "••••••",
+ "help": "Chỉ được lưu trên phiên bản nanobot này."
+ },
+ "webhookSigningSecret": {
+ "label": "Mã bí mật ký webhook",
+ "placeholder": "••••••",
+ "help": "Dùng để xác minh Linear-Signature trước khi phân tích nội dung webhook."
+ },
+ "publicBaseUrl": {
+ "label": "URL HTTPS công khai",
+ "placeholder": "https://nanobot.example.com",
+ "help": "Origin HTTPS ổn định được chuyển tiếp tới listener bên dưới; không bao gồm path."
+ },
+ "host": {
+ "label": "Host lắng nghe",
+ "placeholder": "0.0.0.0"
+ },
+ "port": {
+ "label": "Cổng lắng nghe",
+ "placeholder": "3979"
+ },
+ "webhookPath": {
+ "label": "Đường dẫn webhook",
+ "placeholder": "/linear/webhook"
+ },
+ "oauthCallbackPath": {
+ "label": "Đường dẫn callback OAuth",
+ "placeholder": "/linear/oauth/callback"
+ },
+ "allowFrom": {
+ "label": "Người dùng Linear được phép",
+ "placeholder": "ID người dùng Linear, phân tách bằng dấu phẩy",
+ "help": "Để trống để dùng ghép đôi nanobot, hoặc dùng * để cho phép mọi người dùng trong các workspace đã kết nối."
+ }
+ }
+ },
+ "custom": {
+ "qrAlt": "Mã QR cấp quyền Linear",
+ "authorizeTitle": "Cấp quyền trong Linear",
+ "authorizeDescription": "Mở Linear trong trình duyệt này hoặc quét mã QR. nanobot sẽ bật channel sau khi được cấp quyền.",
+ "waiting": "Đang chờ cấp quyền Linear...",
+ "connected": "Linear đã được kết nối.",
+ "stopped": "Đã dừng cấp quyền.",
+ "connecting": "Đang kết nối...",
+ "reconnect": "Kết nối workspace khác",
+ "connect": "Kết nối Linear",
+ "openLinear": "Tiếp tục trong Linear"
+ }
+}
diff --git a/nanobot/channels/linear/webui/locales/zh-CN.json b/nanobot/channels/linear/webui/locales/zh-CN.json
new file mode 100644
index 000000000..4326166d5
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/zh-CN.json
@@ -0,0 +1 @@
+{"description":"通过 Linear 原生 Agent Session 在 issue 中使用 nanobot。","requirements":"一个私有 Linear OAuth 应用和稳定的公网 HTTPS 回调地址","setup":{"docsLabel":"打开 Linear 配置指南","officialLabel":"创建 Linear OAuth 应用","tryIt":"在 issue 评论中 @ 应用;进入 Agent Session 后,后续对话无需重复 @。","summary":"创建私有 Linear OAuth 应用,保存凭据和公网地址,再授权工作区。新会话必须显式 @ 应用,普通评论会被忽略。","steps":["用稳定的 HTTPS 地址暴露此 nanobot 实例(可以使用隧道)。","在 Linear 创建私有 OAuth 应用,启用 read、write 和 app:mentionable;不要启用 app:assignable。","将应用 webhook 订阅 AgentSessionEvent、PermissionChange 和 OAuthAuthorization,并填写生成的 webhook 地址。","保存设置、通过 OAuth 连接工作区,然后在 issue 中 @ 应用。"],"fields":{"clientId":{"label":"OAuth Client ID","placeholder":"Linear OAuth Client ID","help":"从 Linear 私有 OAuth 应用中复制。"},"clientSecret":{"label":"OAuth Client Secret","placeholder":"••••••","help":"只保存在此 nanobot 实例中。"},"webhookSigningSecret":{"label":"Webhook 签名密钥","placeholder":"••••••","help":"在解析 webhook 内容前验证 Linear-Signature。"},"publicBaseUrl":{"label":"公网 HTTPS 地址","placeholder":"https://nanobot.example.com","help":"稳定且能转发到下方监听端口的 HTTPS 源地址,不要包含路径。"},"host":{"label":"监听地址","placeholder":"0.0.0.0"},"port":{"label":"监听端口","placeholder":"3979"},"webhookPath":{"label":"Webhook 路径","placeholder":"/linear/webhook"},"oauthCallbackPath":{"label":"OAuth 回调路径","placeholder":"/linear/oauth/callback"},"allowFrom":{"label":"允许的 Linear 用户","placeholder":"用逗号分隔 Linear 用户 ID","help":"留空使用 nanobot 配对;填写 * 允许已连接工作区内的所有用户。"}}},"custom":{"qrAlt":"Linear 授权二维码","authorizeTitle":"在 Linear 中授权","authorizeDescription":"在当前浏览器打开 Linear 或扫描二维码;授权后 nanobot 会自动启用 channel。","waiting":"正在等待 Linear 授权……","connected":"Linear 已连接。","stopped":"授权已停止。","connecting":"正在连接……","reconnect":"连接另一个工作区","connect":"连接 Linear","openLinear":"前往 Linear"}}
diff --git a/nanobot/channels/linear/webui/locales/zh-TW.json b/nanobot/channels/linear/webui/locales/zh-TW.json
new file mode 100644
index 000000000..fefe5e27a
--- /dev/null
+++ b/nanobot/channels/linear/webui/locales/zh-TW.json
@@ -0,0 +1 @@
+{"description":"透過 Linear 原生 Agent Session 在 issue 中使用 nanobot。","requirements":"一個私有 Linear OAuth 應用程式和穩定的公網 HTTPS 回呼網址","setup":{"docsLabel":"開啟 Linear 設定指南","officialLabel":"建立 Linear OAuth 應用程式","tryIt":"在 issue 評論中 @ 應用程式;進入 Agent Session 後,後續對話無需重複 @。","summary":"建立私有 Linear OAuth 應用程式,儲存憑證和公網網址,再授權工作區。新會話必須明確 @ 應用程式,普通評論會被忽略。","steps":["用穩定的 HTTPS 網址公開此 nanobot 實例(可以使用隧道)。","在 Linear 建立私有 OAuth 應用程式,啟用 read、write 和 app:mentionable;不要啟用 app:assignable。","將應用程式 webhook 訂閱 AgentSessionEvent、PermissionChange 和 OAuthAuthorization,並填入產生的 webhook 網址。","儲存設定、透過 OAuth 連接工作區,然後在 issue 中 @ 應用程式。"],"fields":{"clientId":{"label":"OAuth Client ID","placeholder":"Linear OAuth Client ID","help":"從 Linear 私有 OAuth 應用程式中複製。"},"clientSecret":{"label":"OAuth Client Secret","placeholder":"••••••","help":"只儲存在此 nanobot 實例中。"},"webhookSigningSecret":{"label":"Webhook 簽署密鑰","placeholder":"••••••","help":"在解析 webhook 內容前驗證 Linear-Signature。"},"publicBaseUrl":{"label":"公網 HTTPS 網址","placeholder":"https://nanobot.example.com","help":"穩定且能轉送到下方監聽連接埠的 HTTPS 來源網址,不要包含路徑。"},"host":{"label":"監聽位址","placeholder":"0.0.0.0"},"port":{"label":"監聽連接埠","placeholder":"3979"},"webhookPath":{"label":"Webhook 路徑","placeholder":"/linear/webhook"},"oauthCallbackPath":{"label":"OAuth 回呼路徑","placeholder":"/linear/oauth/callback"},"allowFrom":{"label":"允許的 Linear 使用者","placeholder":"以逗號分隔 Linear 使用者 ID","help":"留空使用 nanobot 配對;填寫 * 允許已連接工作區內的所有使用者。"}}},"custom":{"qrAlt":"Linear 授權 QR code","authorizeTitle":"在 Linear 中授權","authorizeDescription":"在目前瀏覽器開啟 Linear 或掃描 QR code;授權後 nanobot 會自動啟用 channel。","waiting":"正在等待 Linear 授權……","connected":"Linear 已連接。","stopped":"授權已停止。","connecting":"正在連接……","reconnect":"連接另一個工作區","connect":"連接 Linear","openLinear":"前往 Linear"}}
diff --git a/tests/channels/test_channel_plugins.py b/tests/channels/test_channel_plugins.py
index aadce9c44..c99045e58 100644
--- a/tests/channels/test_channel_plugins.py
+++ b/tests/channels/test_channel_plugins.py
@@ -281,7 +281,18 @@ def test_channels_config_keeps_shared_delivery_defaults():
@pytest.mark.parametrize(
"name",
- ["websocket", "telegram", "discord", "slack", "email", "feishu", "matrix", "weixin", "whatsapp"],
+ [
+ "websocket",
+ "telegram",
+ "discord",
+ "slack",
+ "email",
+ "feishu",
+ "linear",
+ "matrix",
+ "weixin",
+ "whatsapp",
+ ],
)
def test_special_setup_validation_is_owned_by_channel_package(name: str):
plugin = load_channel_package(name)
@@ -292,7 +303,7 @@ def test_special_setup_validation_is_owned_by_channel_package(name: str):
assert plugin.setup.validator.__module__ == f"nanobot.channels.{name}.validation"
-@pytest.mark.parametrize("name", ["feishu", "weixin", "whatsapp"])
+@pytest.mark.parametrize("name", ["feishu", "linear", "weixin", "whatsapp"])
def test_interactive_connector_is_owned_by_channel_package(name: str):
plugin = load_channel_package(name)
@@ -2667,6 +2678,7 @@ def test_optional_dependency_metadata_for_enable():
"dingtalk",
"discord",
"feishu",
+ "linear",
"matrix",
"mochat",
"msteams",
diff --git a/tests/channels/test_channel_setup.py b/tests/channels/test_channel_setup.py
index 2cbb2277c..fb2a9c49e 100644
--- a/tests/channels/test_channel_setup.py
+++ b/tests/channels/test_channel_setup.py
@@ -18,6 +18,7 @@ EXPECTED_CHANNELS = {
"discord",
"email",
"feishu",
+ "linear",
"matrix",
"mattermost",
"mochat",
diff --git a/webui/src/tests/channel-locale-registry.test.ts b/webui/src/tests/channel-locale-registry.test.ts
index c1a47e4c7..5af0a9c11 100644
--- a/webui/src/tests/channel-locale-registry.test.ts
+++ b/webui/src/tests/channel-locale-registry.test.ts
@@ -10,6 +10,7 @@ const expectedChannels = [
"discord",
"email",
"feishu",
+ "linear",
"matrix",
"mattermost",
"mochat",
diff --git a/webui/src/tests/linear-channel-ui.test.ts b/webui/src/tests/linear-channel-ui.test.ts
new file mode 100644
index 000000000..895f4c629
--- /dev/null
+++ b/webui/src/tests/linear-channel-ui.test.ts
@@ -0,0 +1,37 @@
+import { describe, expect, it } from "vitest";
+
+import { linearManifestUrl } from "../../../nanobot/channels/linear/webui/LinearConnectFlow";
+
+describe("Linear channel UI", () => {
+ it("creates a private mention-only Agent app manifest with exact callback routes", () => {
+ const url = new URL(
+ linearManifestUrl(
+ "https://nanobot.example.com",
+ "/linear/webhook",
+ "/linear/oauth/callback",
+ ),
+ );
+ const manifest = JSON.parse(url.searchParams.get("manifest") ?? "{}") as {
+ distribution?: string;
+ oauth?: { redirect_uris?: string[] };
+ webhook?: { url?: string; resourceTypes?: string[] };
+ };
+
+ expect(url.origin + url.pathname).toBe(
+ "https://linear.app/settings/api/applications/new",
+ );
+ expect(manifest.distribution).toBe("private");
+ expect(manifest.oauth?.redirect_uris).toEqual([
+ "https://nanobot.example.com/linear/oauth/callback",
+ ]);
+ expect(manifest.webhook?.url).toBe(
+ "https://nanobot.example.com/linear/webhook",
+ );
+ expect(manifest.webhook?.resourceTypes).toEqual([
+ "AgentSessionEvent",
+ "PermissionChange",
+ "OAuthAuthorization",
+ ]);
+ expect(manifest.webhook?.resourceTypes).not.toContain("Comment");
+ });
+});
diff --git a/webui/src/tests/settings-channels.test.tsx b/webui/src/tests/settings-channels.test.tsx
index a241bd551..a53d2239f 100644
--- a/webui/src/tests/settings-channels.test.tsx
+++ b/webui/src/tests/settings-channels.test.tsx
@@ -31,7 +31,7 @@ function channelSetupField(
}
function channelSetupContract(
- channel: "discord" | "email" | "feishu" | "matrix" | "qq",
+ channel: "discord" | "email" | "feishu" | "linear" | "matrix" | "qq",
): ChannelSetupContract {
const field = (
name: string,
@@ -108,6 +108,22 @@ function channelSetupContract(
{ alternatives: [["channels.feishu.appSecret"]] },
],
};
+ case "linear":
+ return {
+ fields: [
+ field("clientId", "string", { required: true }),
+ field("clientSecret", "secret", { required: true }),
+ field("webhookSigningSecret", "secret", { required: true }),
+ field("publicBaseUrl", "string", { required: true }),
+ field("host", "string", { defaultValue: "0.0.0.0" }),
+ field("port", "int", { defaultValue: "3979" }),
+ field("webhookPath", "string", { defaultValue: "/linear/webhook" }),
+ field("oauthCallbackPath", "string", {
+ defaultValue: "/linear/oauth/callback",
+ }),
+ field("allowFrom", "list"),
+ ],
+ };
case "matrix":
return {
official_url: "https://matrix.org/ecosystem/clients/",
@@ -859,6 +875,103 @@ describe("Settings channels", () => {
expect(await screen.findByText("Scan with Feishu")).toBeInTheDocument();
});
+ it("saves a Linear public URL before OAuth credentials and reveals the app manifest", async () => {
+ const linearFeature = {
+ name: "linear",
+ display_name: "Linear",
+ webui: "webui/index.tsx",
+ type: "channel",
+ enabled: false,
+ configured: false,
+ installed: true,
+ ready: false,
+ status: "not_enabled",
+ install_supported: true,
+ requires_restart: false,
+ setup: channelSetupContract("linear"),
+ };
+ vi.stubGlobal(
+ "fetch",
+ vi.fn(async (input: RequestInfo | URL) => {
+ const url = String(input);
+ if (url === "/api/settings") return jsonResponse(settingsPayload());
+ if (url === "/api/settings/cli-apps") {
+ return jsonResponse({ apps: [], installed_count: 0 });
+ }
+ if (url === "/api/settings/mcp-presets") {
+ return jsonResponse({ presets: [], installed_count: 0 });
+ }
+ if (url === "/api/settings/nanobot-features") {
+ return jsonResponse({ features: [linearFeature], enabled_count: 0 });
+ }
+ return { ok: false, status: 404, json: async () => ({}) } as Response;
+ }),
+ );
+ requestMutationMock
+ .mockResolvedValueOnce({
+ name: "linear",
+ status: "needs_setup",
+ checks: [],
+ missing_fields: [
+ "channels.linear.clientId",
+ "channels.linear.clientSecret",
+ "channels.linear.webhookSigningSecret",
+ ],
+ can_enable: false,
+ requires_restart: false,
+ message: "Missing Linear credentials.",
+ })
+ .mockResolvedValueOnce({
+ name: "linear",
+ saved: true,
+ saved_keys: ["channels.linear.publicBaseUrl"],
+ nanobot_features: {
+ features: [{
+ ...linearFeature,
+ config_values: {
+ "channels.linear.publicBaseUrl": "https://nanobot.example.com",
+ "channels.linear.host": "0.0.0.0",
+ "channels.linear.port": "3979",
+ "channels.linear.webhookPath": "/linear/webhook",
+ "channels.linear.oauthCallbackPath": "/linear/oauth/callback",
+ },
+ configured_fields: ["channels.linear.publicBaseUrl"],
+ }],
+ enabled_count: 0,
+ requires_restart: false,
+ },
+ });
+
+ renderSettingsView({ initialSection: "channels" });
+
+ expect(await screen.findByRole("button", { name: "View Linear settings" })).toBeInTheDocument();
+ fireEvent.change(screen.getByPlaceholderText("https://nanobot.example.com"), {
+ target: { value: "https://nanobot.example.com" },
+ });
+ fireEvent.click(screen.getByRole("button", { name: "Save" }));
+
+ await waitFor(() =>
+ expect(requestMutationMock).toHaveBeenCalledWith(
+ "settings.channel.configure",
+ expect.objectContaining({
+ name: "linear",
+ values: expect.objectContaining({
+ "channels.linear.publicBaseUrl": "https://nanobot.example.com",
+ }),
+ }),
+ 150_000,
+ ),
+ );
+ expect(
+ await screen.findByText(
+ "Partial settings saved. Complete the required fields before connecting.",
+ ),
+ ).toBeInTheDocument();
+ expect(
+ await screen.findByRole("button", { name: "Create prefilled Linear app" }),
+ ).toBeInTheDocument();
+ });
+
it("enables configured Feishu assistant without starting a new connect flow", async () => {
const fetchMock = vi.fn(async (input: RequestInfo | URL) => {
const url = String(input);