Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
feat(projects): one Resources list with a single Add menu (MUL-10084) (#11446)
Jiayuan Zhanga2a7d8c7a66c
diff --git a/apps/docs/content/docs/project-resources.fr.mdx b/apps/docs/content/docs/project-resources.fr.mdxindex c4b6a66098..1201bcd163 100644--- a/apps/docs/content/docs/project-resources.fr.mdx+++ b/apps/docs/content/docs/project-resources.fr.mdx@@ -28,7 +28,7 @@ Un répertoire local ne s'applique qu'au daemon auquel il est lié. Lorsque le d## Ajouter un dépôt GitHub-Ouvrez le projet et cliquez sur **Ajouter un dépôt** dans **Ressources → Dépôts**. Recherchez un dépôt rattaché à l'espace de travail ou collez une URL Git. Les dépôts de l'espace de travail se gèrent dans **Paramètres → Code** ; une fois GitHub connecté, la même page propose **Choisir depuis GitHub** pour importer les dépôts auxquels la GitHub App a accès.+Ouvrez le projet, cliquez sur **Ajouter** dans **Ressources**, puis choisissez **Dépôt GitHub**. Recherchez un dépôt rattaché à l'espace de travail ou collez une URL Git. Les dépôts de l'espace de travail se gèrent dans **Paramètres → Code** ; une fois GitHub connecté, la même page propose **Choisir depuis GitHub** pour importer les dépôts auxquels la GitHub App a accès.Coller une URL de branche GitHub (`https://github.com/owner/repo/tree/branch`) renseigne séparément l’URL du dépôt et la branche de départ. Les noms de branche encodés dans l’URL sont décodés ; les paramètres de requête et les ancres de page sont exclus. Vérifiez la branche de départ avant d’ajouter le dépôt. Modifier l’URL du dépôt efface la branche de départ précédente, sauf si la nouvelle URL en précise une.@@ -60,12 +60,12 @@ Assurez-vous que le daemon local de l'application de bureau est en ligne.</Step><Step>-Pour un projet existant, ouvrez **Ressources → Dossiers locaux** et suivez les étapes ci-dessous. Lors de la création d'un projet, utilisez plutôt l'onglet **Dossier local** ; le dossier et son mode sont enregistrés avec le projet.+Pour un projet existant, suivez les étapes ci-dessous depuis **Ressources** sur la page du projet. Lors de la création d'un projet, utilisez plutôt l'onglet **Dossier local** ; le dossier et son mode sont enregistrés avec le projet.</Step><Step>-Sous votre ordinateur, cliquez sur **Choisir un dossier...**, puis sélectionnez le dossier à utiliser.+Cliquez sur **Ajouter**, choisissez **Dossier local...**, puis sélectionnez le dossier à utiliser. La boîte de dialogue qui s'ouvre affiche le chemin ; cliquez sur **Changer...** pour en choisir un autre. Cette option est indisponible dans un navigateur, quand le daemon local est hors ligne ou quand cet ordinateur a déjà un dossier pour le projet.</Step><Step>diff --git a/apps/docs/content/docs/project-resources.ja.mdx b/apps/docs/content/docs/project-resources.ja.mdxindex a276266143..cf145a65ce 100644--- a/apps/docs/content/docs/project-resources.ja.mdx+++ b/apps/docs/content/docs/project-resources.ja.mdx@@ -28,7 +28,7 @@ import { LocalDirModeDemo } from "@/components/demos/local-dir-mode-demo";## GitHub リポジトリの追加-プロジェクトの **リソース → リポジトリ** で **リポジトリを追加** をクリックします。ワークスペースに紐づけ済みのリポジトリを検索するか、Git URL を貼り付けます。ワークスペースのリポジトリは **設定 → コード** で管理します。GitHub を接続すると、同じページの **GitHub から選択** で、App が認可済みのリポジトリをインポートできます。+プロジェクトの **リソース** で **追加** をクリックし、**GitHub リポジトリ** を選びます。ワークスペースに紐づけ済みのリポジトリを検索するか、Git URL を貼り付けます。ワークスペースのリポジトリは **設定 → コード** で管理します。GitHub を接続すると、同じページの **GitHub から選択** で、App が認可済みのリポジトリをインポートできます。GitHub のブランチ URL(`https://github.com/owner/repo/tree/branch`)を貼り付けると、リポジトリ URL と開始ブランチが別々に入力されます。URL エンコードされたブランチ名はデコードされ、クエリパラメータやページ内アンカーは除外されます。リポジトリを追加する前に開始ブランチを確認してください。リポジトリ URL を変更すると、以前の開始ブランチはクリアされます。新しい URL にブランチが含まれる場合は、そのブランチが入力されます。@@ -61,12 +61,12 @@ Desktop のローカルデーモンがオンラインであることを確認し</Step><Step>-既存のプロジェクトでは **リソース → ローカルフォルダ** を開き、以下の手順で追加します。プロジェクト作成時は **ローカルフォルダ** タブを使い、フォルダとモードをプロジェクトと一緒に保存します。+既存のプロジェクトでは、プロジェクトページの **リソース** から以下の手順で追加します。プロジェクト作成時は **ローカルフォルダ** タブを使い、フォルダとモードをプロジェクトと一緒に保存します。</Step><Step>-自分のコンピュータの欄で **フォルダを選択...** をクリックし、使用するフォルダを選びます。+**追加** をクリックして **ローカルフォルダ...** を選び、使用するフォルダを選びます。開いたダイアログにパスが表示され、**変更...** で選び直せます。ブラウザ上、ローカルデーモンがオフラインのとき、またはこのコンピュータにすでにこのプロジェクトのフォルダがある場合、この項目は選択できません。</Step><Step>diff --git a/apps/docs/content/docs/project-resources.ko.mdx b/apps/docs/content/docs/project-resources.ko.mdxindex 25ddfc6c44..2784988385 100644--- a/apps/docs/content/docs/project-resources.ko.mdx+++ b/apps/docs/content/docs/project-resources.ko.mdx@@ -28,7 +28,7 @@ import { LocalDirModeDemo } from "@/components/demos/local-dir-mode-demo";## GitHub 저장소 추가-프로젝트의 **리소스 → 저장소**에서 **저장소 추가**를 클릭합니다. 워크스페이스에 연결된 저장소를 검색하거나 Git URL을 붙여 넣습니다. 워크스페이스 저장소는 **설정 → 코드**에서 관리합니다. GitHub를 연결한 뒤 같은 페이지에서 **GitHub에서 선택**을 통해 App에 승인된 저장소를 가져올 수 있습니다.+프로젝트의 **리소스**에서 **추가**를 클릭하고 **GitHub 저장소**를 선택합니다. 워크스페이스에 연결된 저장소를 검색하거나 Git URL을 붙여 넣습니다. 워크스페이스 저장소는 **설정 → 코드**에서 관리합니다. GitHub를 연결한 뒤 같은 페이지에서 **GitHub에서 선택**을 통해 App에 승인된 저장소를 가져올 수 있습니다.GitHub 브랜치 URL(`https://github.com/owner/repo/tree/branch`)을 붙여 넣으면 저장소 URL과 시작 브랜치가 각각 입력됩니다. URL로 인코딩된 브랜치 이름은 디코딩되며, 쿼리 매개변수와 페이지 앵커는 제외됩니다. 저장소를 추가하기 전에 시작 브랜치를 확인하세요. 저장소 URL을 변경하면 이전 시작 브랜치가 지워집니다. 새 URL에 브랜치가 포함되어 있으면 해당 브랜치가 입력됩니다.@@ -60,12 +60,12 @@ Desktop의 로컬 데몬이 온라인인지 확인합니다.</Step><Step>-기존 프로젝트에서는 **리소스 → 로컬 폴더**를 열고 아래 단계에 따라 추가합니다. 프로젝트 생성 시에는 **로컬 폴더** 탭을 사용하며, 폴더와 모드는 프로젝트를 만들 때 함께 저장됩니다.+기존 프로젝트에서는 프로젝트 페이지의 **리소스**에서 아래 단계에 따라 추가합니다. 프로젝트 생성 시에는 **로컬 폴더** 탭을 사용하며, 폴더와 모드는 프로젝트를 만들 때 함께 저장됩니다.</Step><Step>-내 컴퓨터 아래에서 **폴더 선택...** 버튼을 클릭하고 사용할 폴더를 고릅니다.+**추가**를 클릭하고 **로컬 폴더...** 항목을 선택한 뒤 사용할 폴더를 고릅니다. 열리는 대화 상자에 경로가 표시되며 **변경...** 버튼을 눌러 다시 고를 수 있습니다. 브라우저에서, 로컬 데몬이 오프라인일 때, 또는 이 컴퓨터에 이미 이 프로젝트의 폴더가 있으면 이 항목을 사용할 수 없습니다.</Step><Step>diff --git a/apps/docs/content/docs/project-resources.mdx b/apps/docs/content/docs/project-resources.mdxindex e7aa6d10b9..caf12a87c3 100644--- a/apps/docs/content/docs/project-resources.mdx+++ b/apps/docs/content/docs/project-resources.mdx@@ -28,7 +28,7 @@ A local directory only applies to the daemon it is bound to. When the daemon exe## Add a GitHub repository-Open the project and click **Add repository** in **Resources → Repositories**. Search for a repository already linked to the workspace, or paste a Git URL. Workspace repositories are managed in **Settings → Code**; once GitHub is connected, the same page offers **Pick from GitHub** to import repositories the App is authorized for.+Open the project, click **Add** in **Resources**, and choose **GitHub repository**. Search for a repository already linked to the workspace, or paste a Git URL. Workspace repositories are managed in **Settings → Code**; once GitHub is connected, the same page offers **Pick from GitHub** to import repositories the App is authorized for.Pasting a GitHub branch URL (`https://github.com/owner/repo/tree/branch`) fills in the repository URL and starting branch separately. URL-encoded branch names are decoded; query parameters and page anchors are excluded. Check the starting branch before adding the repository. Changing the repository URL clears the previous starting branch unless the new URL specifies one.@@ -60,12 +60,12 @@ Make sure Desktop's local daemon is online.</Step><Step>-For an existing project, open **Resources → Local folders** and follow the steps below. When creating a project, use the **Local folder** tab instead; the folder and mode are saved when you create the project.+For an existing project, follow the steps below from **Resources** on the project page. When creating a project, use the **Local folder** tab instead; the folder and mode are saved when you create the project.</Step><Step>-Under your computer, click **Choose folder...**, then pick the folder to use.+Click **Add**, choose **Local folder...**, then pick the folder to use. The dialog that opens shows the path; click **Change...** to pick another. The option is unavailable in a browser, while the local daemon is offline, or when this computer already has a folder for the project.</Step><Step>diff --git a/apps/docs/content/docs/project-resources.zh-Hant.mdx b/apps/docs/content/docs/project-resources.zh-Hant.mdxindex 6f1da6b1f2..c58cf98a41 100644--- a/apps/docs/content/docs/project-resources.zh-Hant.mdx+++ b/apps/docs/content/docs/project-resources.zh-Hant.mdx@@ -28,7 +28,7 @@ import { LocalDirModeDemo } from "@/components/demos/local-dir-mode-demo";## 新增 GitHub 倉庫-開啟專案,在 **資源 → 倉庫** 中點選 **新增倉庫**。搜尋已關聯到工作區的倉庫,或貼上 Git URL。工作區倉庫在 **設定 → 程式碼** 中維護;連線 GitHub 後,可在同一頁面透過 **從 GitHub 選擇** 匯入 App 已授權的倉庫。+開啟專案,在 **資源** 中點選 **新增**,選擇 **GitHub 倉庫**。搜尋已關聯到工作區的倉庫,或貼上 Git URL。工作區倉庫在 **設定 → 程式碼** 中維護;連線 GitHub 後,可在同一頁面透過 **從 GitHub 選擇** 匯入 App 已授權的倉庫。貼上 GitHub 分支頁面的 URL(`https://github.com/owner/repo/tree/branch`)時,倉庫位址和起始分支會分別填入。經過 URL 編碼的分支名稱會還原,查詢參數和頁面錨點不會算入分支名稱。新增倉庫前請檢查起始分支。修改倉庫位址時,原來的起始分支會清空;如果新位址包含分支,則改用該分支。@@ -60,12 +60,12 @@ import { LocalDirModeDemo } from "@/components/demos/local-dir-mode-demo";</Step><Step>-已有專案開啟 **資源 → 本地資料夾**,按下方步驟新增。建立專案時則使用 **本地資料夾** 標籤頁;所選資料夾和模式會隨專案一起儲存。+已有專案在專案頁的 **資源** 中按下方步驟新增。建立專案時則使用 **本地資料夾** 標籤頁;所選資料夾和模式會隨專案一起儲存。</Step><Step>-在你的電腦下點選 **選擇資料夾...**,再選擇要使用的資料夾。+點選 **新增**,選擇 **本地資料夾...**,再選擇要使用的資料夾。彈出的對話框會顯示路徑,可點選 **更換...** 重新選擇。在瀏覽器中、本機守護程序離線時,或這臺電腦已為該專案新增過資料夾時,該選項無法使用。</Step><Step>diff --git a/apps/docs/content/docs/project-resources.zh.mdx b/apps/docs/content/docs/project-resources.zh.mdxindex 7957f25bc7..f24ff28c8a 100644--- a/apps/docs/content/docs/project-resources.zh.mdx+++ b/apps/docs/content/docs/project-resources.zh.mdx@@ -28,7 +28,7 @@ import { LocalDirModeDemo } from "@/components/demos/local-dir-mode-demo";## 添加 GitHub 仓库-打开项目,在 **资源 → 仓库** 中点击 **添加仓库**。搜索已关联到工作区的仓库,或粘贴 Git URL。工作区仓库在 **设置 → 代码** 中维护;连接 GitHub 后,可在同一页面通过 **从 GitHub 选择** 导入 App 已授权的仓库。+打开项目,在 **资源** 中点击 **添加**,选择 **GitHub 仓库**。搜索已关联到工作区的仓库,或粘贴 Git URL。工作区仓库在 **设置 → 代码** 中维护;连接 GitHub 后,可在同一页面通过 **从 GitHub 选择** 导入 App 已授权的仓库。粘贴 GitHub 分支页面的 URL(`https://github.com/owner/repo/tree/branch`)时,仓库地址和起始分支会分别填入。经过 URL 编码的分支名会还原,查询参数和页面锚点不会算入分支名。添加仓库前请检查起始分支。修改仓库地址时,原来的起始分支会清空;如果新地址包含分支,则改用该分支。@@ -60,12 +60,12 @@ import { LocalDirModeDemo } from "@/components/demos/local-dir-mode-demo";</Step><Step>-已有项目打开 **资源 → 本地文件夹**,按下方步骤添加。创建项目时则使用 **本地文件夹** 标签页;所选文件夹和模式会随项目一起保存。+已有项目在项目页的 **资源** 中按下方步骤添加。创建项目时则使用 **本地文件夹** 标签页;所选文件夹和模式会随项目一起保存。</Step><Step>-在你的电脑下点击 **选择文件夹...**,再选择要使用的文件夹。+点击 **添加**,选择 **本地文件夹...**,再选择要使用的文件夹。弹出的对话框会显示路径,可点击 **更换...** 重新选择。在浏览器中、本地守护进程离线时,或这台电脑已为该项目添加过文件夹时,该选项不可用。</Step><Step>diff --git a/apps/docs/content/docs/tasks.fr.mdx b/apps/docs/content/docs/tasks.fr.mdxindex 4637cdfad9..d8acfff718 100644--- a/apps/docs/content/docs/tasks.fr.mdx+++ b/apps/docs/content/docs/tasks.fr.mdx@@ -105,7 +105,7 @@ Les motifs d'échec affichés dans le journal d'exécution et dans les [Statisti| `queued_expired` | Le runtime a cessé d'envoyer des signaux de vie pendant plus longtemps que le délai de grâce de reconnexion, et l'exécution était aussi en file d'attente depuis aussi longtemps | Vérifiez que le runtime est en ligne, puis relancez || `runtime_recovery` | Le daemon a récupéré une exécution interrompue après son redémarrage | Relancez directement || `environment_prepare_failed` | Le daemon n'a pas pu préparer l'environnement d'exécution — son répertoire de travail, ou la configuration locale du runtime qui y est écrite | Lisez l'erreur brute pour savoir quelle étape a échoué, puis vérifiez cette machine : espace disque, permissions, répertoire encore utilisé, ou configuration locale de l'outil de codage IA |-| `local_directory_missing` | Le dossier local lié au projet n'existe plus sur l'ordinateur qui exécute l'agent — il a été supprimé ou déplacé après avoir été lié | Restaurez le dossier au même chemin, puis réessayez. Pour utiliser un nouvel emplacement, retirez l'ancien dossier dans **Ressources → Dossiers locaux** et liez le nouveau depuis l'application de bureau sur cet ordinateur — les navigateurs ne peuvent pas sélectionner de dossiers ; voir [Ressources du projet](/project-resources) |+| `local_directory_missing` | Le dossier local lié au projet n'existe plus sur l'ordinateur qui exécute l'agent — il a été supprimé ou déplacé après avoir été lié | Restaurez le dossier au même chemin, puis réessayez. Pour utiliser un nouvel emplacement, retirez l'ancien dossier dans **Ressources** (menu **⋯** de sa ligne → **Retirer**) et liez le nouveau depuis l'application de bureau sur cet ordinateur — les navigateurs ne peuvent pas sélectionner de dossiers ; voir [Ressources du projet](/project-resources) || `cancelled` | Arrêtée manuellement, ou annulée avec un archivage ou une suppression | Rien à faire || `timeout` | Dépassement de la limite de durée d'exécution configurée pour le daemon | Réduisez le périmètre de la tâche, ou ajustez `agent_timeout` du daemon || `iteration_limit` | Plafond d'itérations d'une exécution atteint | Réduisez le périmètre de la tâche |diff --git a/apps/docs/content/docs/tasks.ja.mdx b/apps/docs/content/docs/tasks.ja.mdxindex 1606a923f6..d0e5035c34 100644--- a/apps/docs/content/docs/tasks.ja.mdx+++ b/apps/docs/content/docs/tasks.ja.mdx@@ -105,7 +105,7 @@ import { RunLifecycleDemo } from "@/components/demos/run-lifecycle-demo";| `queued_expired` | ランタイムが再接続猶予を超えてハートビートを停止し、かつその作業も同じ時間キューで待っていた | ランタイムがオンラインであることを確認してからリトライ || `runtime_recovery` | デーモンが再起動後、中断された実行を回収した | そのままリトライ || `environment_prepare_failed` | デーモンがこの実行に必要な環境(作業ディレクトリ、およびそこに書き込むローカルランタイム設定)を準備できなかった | 生のエラーでどの段階が失敗したかを確認し、そのマシンのディスク空き容量・権限・ディレクトリの使用状況、AI コーディングツールのローカル設定を点検 |-| `local_directory_missing` | プロジェクトに関連付けたローカルフォルダが、エージェントを実行するコンピュータ上にもう存在しない(関連付けた後に削除または移動された) | フォルダを元のパスに戻してから再試行。新しい場所を使う場合は、**リソース → ローカルフォルダ** で古いフォルダを削除し、そのコンピュータの Desktop から新しい場所を関連付ける(ブラウザではフォルダを選択できない)。[プロジェクトリソース](/project-resources) を参照 |+| `local_directory_missing` | プロジェクトに関連付けたローカルフォルダが、エージェントを実行するコンピュータ上にもう存在しない(関連付けた後に削除または移動された) | フォルダを元のパスに戻してから再試行。新しい場所を使う場合は、**リソース** で古いフォルダの **⋯** メニューから **削除** し、そのコンピュータの Desktop から新しい場所を関連付ける(ブラウザではフォルダを選択できない)。[プロジェクトリソース](/project-resources) を参照 || `cancelled` | 手動で停止されたか、アーカイブ・削除に伴ってキャンセルされた | 対処不要 || `timeout` | デーモンに設定された実行時間の上限を超えた | タスクの範囲を狭めるか、デーモンの `agent_timeout` を調整する || `iteration_limit` | 実行の反復回数の上限に達した | タスクの範囲を狭める |diff --git a/apps/docs/content/docs/tasks.ko.mdx b/apps/docs/content/docs/tasks.ko.mdxindex b68ac7f6a7..2cfbaccc1d 100644--- a/apps/docs/content/docs/tasks.ko.mdx+++ b/apps/docs/content/docs/tasks.ko.mdx@@ -105,7 +105,7 @@ import { RunLifecycleDemo } from "@/components/demos/run-lifecycle-demo";| `queued_expired` | 런타임이 재연결 유예를 넘겨 하트비트를 멈췄고, 실행 자체도 그만큼 큐에서 기다림 | 런타임이 온라인인지 확인한 뒤 재시도 || `runtime_recovery` | 데몬 재시작 후 중단된 실행을 회수함 | 바로 재시도 || `environment_prepare_failed` | 데몬이 이번 실행에 필요한 환경(작업 디렉터리, 그리고 거기에 기록되는 로컬 런타임 설정)을 준비하지 못함 | 원본 오류로 어느 단계가 실패했는지 확인한 뒤 해당 머신의 디스크 여유 공간, 권한, 디렉터리 사용 여부, AI 코딩 도구의 로컬 설정을 점검 |-| `local_directory_missing` | 프로젝트에 연결된 로컬 폴더가 에이전트를 실행하는 컴퓨터에 더 이상 없음 — 연결한 뒤 삭제되거나 이동됨 | 폴더를 원래 경로로 복원한 뒤 재시도. 새 위치를 쓰려면 **리소스 → 로컬 폴더**에서 기존 폴더를 제거하고 해당 컴퓨터의 Desktop에서 새 위치를 연결(브라우저에서는 폴더를 선택할 수 없음). [프로젝트 리소스](/project-resources) 참고 |+| `local_directory_missing` | 프로젝트에 연결된 로컬 폴더가 에이전트를 실행하는 컴퓨터에 더 이상 없음 — 연결한 뒤 삭제되거나 이동됨 | 폴더를 원래 경로로 복원한 뒤 재시도. 새 위치를 쓰려면 **리소스**에서 기존 폴더의 **⋯** 메뉴로 **제거**하고 해당 컴퓨터의 Desktop에서 새 위치를 연결(브라우저에서는 폴더를 선택할 수 없음). [프로젝트 리소스](/project-resources) 참고 || `cancelled` | 수동으로 중지되었거나 보관 또는 삭제와 함께 취소됨 | 별도 처리 불필요 || `timeout` | 데몬에 설정된 실행 시간 상한을 초과함 | 태스크 범위를 줄이거나 데몬의 `agent_timeout` 조정 || `iteration_limit` | 실행 반복 횟수 상한에 도달함 | 태스크 범위 축소 |diff --git a/apps/docs/content/docs/tasks.mdx b/apps/docs/content/docs/tasks.mdxindex 465dc1a3d0..62bb298236 100644--- a/apps/docs/content/docs/tasks.mdx+++ b/apps/docs/content/docs/tasks.mdx@@ -105,7 +105,7 @@ The failure reasons shown in the execution log and [Analytics](/analytics#errors| `queued_expired` | The runtime stopped heartbeating for longer than the reconnect grace, and the run had also been queued that long | Confirm the runtime is online, then retry || `runtime_recovery` | The daemon reclaimed an interrupted run after restarting | Retry directly || `environment_prepare_failed` | The daemon could not set up the execution environment for this run — its working directory, or the local runtime config written into it | Read the raw error to see which step failed, then check that machine: disk space, permissions, a directory still in use, or the AI coding tool's local config |-| `local_directory_missing` | The local folder linked to the project no longer exists on the computer running the agent — it was deleted or moved after it was linked | Restore the folder at the same path, then retry. To use a new location, remove the old folder under **Resources → Local folders** and link the new one from Desktop on that computer — browsers cannot pick folders; see [Project resources](/project-resources) |+| `local_directory_missing` | The local folder linked to the project no longer exists on the computer running the agent — it was deleted or moved after it was linked | Restore the folder at the same path, then retry. To use a new location, remove the old folder from **Resources** (its **⋯** menu → **Remove**) and link the new one from Desktop on that computer — browsers cannot pick folders; see [Project resources](/project-resources) || `cancelled` | Stopped manually, or cancelled along with an archive or delete | Nothing to do || `timeout` | Exceeded the daemon's configured execution time limit | Narrow the issue scope, or adjust the daemon's `agent_timeout` || `iteration_limit` | Hit the iteration cap for a run | Narrow the issue scope |diff --git a/apps/docs/content/docs/tasks.zh-Hant.mdx b/apps/docs/content/docs/tasks.zh-Hant.mdxindex c0ad0ccdd8..cad93aee85 100644--- a/apps/docs/content/docs/tasks.zh-Hant.mdx+++ b/apps/docs/content/docs/tasks.zh-Hant.mdx@@ -105,7 +105,7 @@ AI 代理自身返回的錯誤通常不會自動重試。鑑權失效、額度| `queued_expired` | 執行時心跳缺席超過重連寬限期,且該執行也已排隊滿這麼久 | 確認執行時線上後重試 || `runtime_recovery` | 守護程序重啟後回收了中斷的執行 | 直接重試 || `environment_prepare_failed` | 守護程序沒能準備好本次執行的執行環境——工作目錄,或寫入其中的本地執行時配置 | 先看原始錯誤定位是哪一步失敗,再檢查那臺機器:磁碟空間、權限、目錄是否仍被佔用,或 AI 程式設計工具的本地配置 |-| `local_directory_missing` | 專案關聯的本地資料夾在執行 AI 代理的那臺電腦上已不存在——關聯之後被刪除或移走了 | 把資料夾恢復到原路徑後重試。要換到新位置,在 **資源 → 本地資料夾** 裡移除舊資料夾,再在那臺電腦的 Desktop 中關聯新位置(瀏覽器無法選擇資料夾);參見 [專案資源](/project-resources) |+| `local_directory_missing` | 專案關聯的本地資料夾在執行 AI 代理的那臺電腦上已不存在——關聯之後被刪除或移走了 | 把資料夾恢復到原路徑後重試。要換到新位置,在 **資源** 中透過舊資料夾的 **⋯** 選單 **移除** 它,再在那臺電腦的 Desktop 中關聯新位置(瀏覽器無法選擇資料夾);參見 [專案資源](/project-resources) || `cancelled` | 被手動停止,或隨歸檔、刪除一併取消 | 無需處理 || `timeout` | 超過守護程序配置的執行時長上限 | 縮小任務範圍,或調整守護程序的 `agent_timeout` || `iteration_limit` | 達到執行輪次上限 | 縮小任務範圍 |diff --git a/apps/docs/content/docs/tasks.zh.mdx b/apps/docs/content/docs/tasks.zh.mdxindex ad273d1f00..f115ca3231 100644--- a/apps/docs/content/docs/tasks.zh.mdx+++ b/apps/docs/content/docs/tasks.zh.mdx@@ -105,7 +105,7 @@ import { RunLifecycleDemo } from "@/components/demos/run-lifecycle-demo";| `queued_expired` | 运行时心跳缺席超过重连宽限期,且该运行也已排队满这么久 | 确认运行时在线后重试 || `runtime_recovery` | 守护进程重启后回收了中断的执行 | 直接重试 || `environment_prepare_failed` | 守护进程没能准备好本次执行的运行环境——工作目录,或写入其中的本地运行时配置 | 先看原始错误定位是哪一步失败,再检查那台机器:磁盘空间、权限、目录是否仍被占用,或 AI 编程工具的本地配置 |-| `local_directory_missing` | 项目关联的本地文件夹在运行智能体的那台电脑上已不存在——关联之后被删除或移走了 | 把文件夹恢复到原路径后重试。要换到新位置,在 **资源 → 本地文件夹** 里移除旧文件夹,再在那台电脑的 Desktop 中关联新位置(浏览器无法选择文件夹);参见 [项目资源](/project-resources) |+| `local_directory_missing` | 项目关联的本地文件夹在运行智能体的那台电脑上已不存在——关联之后被删除或移走了 | 把文件夹恢复到原路径后重试。要换到新位置,在 **资源** 中通过旧文件夹的 **⋯** 菜单 **移除** 它,再在那台电脑的 Desktop 中关联新位置(浏览器无法选择文件夹);参见 [项目资源](/project-resources) || `cancelled` | 被手动停止,或随归档、删除一并取消 | 无需处理 || `timeout` | 超过守护进程配置的执行时长上限 | 缩小任务范围,或调整守护进程的 `agent_timeout` || `iteration_limit` | 达到执行轮次上限 | 缩小任务范围 |diff --git a/packages/views/locales/en/chat.json b/packages/views/locales/en/chat.jsonindex 8148ae33d6..faca43b0ec 100644--- a/packages/views/locales/en/chat.json+++ b/packages/views/locales/en/chat.json@@ -85,7 +85,7 @@"skill_bundle_unavailable": "The agent's skills couldn't be downloaded, so it never got started. This is usually a connection problem — please try again.","runtime_cli_timeout": "The local OpenClaw CLI timed out before answering. Check your local OpenClaw CLI setup or raise MULTICA_OPENCLAW_CLI_TIMEOUT before retrying.","environment_prepare_failed": "The machine running the agent couldn't set this run up, so it never started. The error below says what failed there — often disk space, a permission, a folder still in use, or a local config that couldn't be read. It isn't the agent or the model provider.",- "local_directory_missing": "The local folder linked to this project no longer exists on the machine running the agent, so the run never started. Restore the folder, then try again. To use a different folder, open Resources → Local folders in the project with the desktop app on that machine and link it there — a browser can't choose folders.",+ "local_directory_missing": "The local folder linked to this project no longer exists on the machine running the agent, so the run never started. Restore the folder, then try again. To use a different folder, open the project in the desktop app on that machine, remove the old folder from Resources, and add the new one with Add → Local folder... — a browser can't choose folders.","provider_network": "The connection to the model provider dropped before the reply finished. Check your network and try again.","provider_auth_or_access": "The provider rejected this agent's credentials or access. Check the API key or account — it may have expired or no longer have access.","provider_quota_limit": "The agent's model account has run out of credit. Top it up or switch accounts, then retry.",diff --git a/packages/views/locales/en/projects.json b/packages/views/locales/en/projects.jsonindex 5219c85ab7..c0e4d757ff 100644--- a/packages/views/locales/en/projects.json+++ b/packages/views/locales/en/projects.json@@ -146,9 +146,23 @@},"resources": {"section_header": "Resources",- "repos_group": "Repositories",- "repos_add": "Add repository",- "repos_empty": "No repositories yet.",+ "add": "Add",+ "add_repo": "GitHub repository",+ "add_repo_hint": "Checked out by runs on any computer",+ "add_local": "Local folder...",+ "add_local_hint": "Used only by runs on this computer",+ "add_local_desktop_only": "Only in the desktop app",+ "add_local_exists": "Already set for this computer",+ "empty": "Add a repository or a local folder for agents to work in.",+ "empty_read_only": "No repositories or local folders yet.",+ "row_menu": "Actions for {{name}}",+ "copy_url": "Copy URL",+ "copy_path": "Copy path",+ "toast_copied": "Copied",+ "local_dialog_title": "Add local folder",+ "local_dialog_description": "Runs on this computer will use this folder instead of a fresh checkout.",+ "local_dialog_change": "Change...",+ "local_dialog_mode_label": "How runs use it","repos_input_placeholder": "Search or paste a GitHub URL...","repos_add_url": "Add {{repo}}","repos_search_empty": "No matching repositories.",@@ -158,13 +172,9 @@"toast_attach_failed": "Couldn't add","toast_removed": "Removed","toast_remove_failed": "Couldn't remove",- "local_group": "Local folders",- "local_group_hint": "One per computer, used only on that computer.","local_this_computer": "This computer","local_unknown_computer": "Another computer","local_offline": "Offline",- "local_slot_description": "Runs on this computer use your folder instead of a fresh checkout.",- "local_pick": "Choose folder...","local_daemon_offline_hint": "Start the local daemon to choose a folder.","chat_hint_prefix": "Agent will work in-place at","chat_hint_worktree_prefix": "Agent will work in an isolated worktree of",diff --git a/packages/views/locales/es/chat.json b/packages/views/locales/es/chat.jsonindex b8c2fb4ed7..7706be85f5 100644--- a/packages/views/locales/es/chat.json+++ b/packages/views/locales/es/chat.json@@ -84,7 +84,7 @@"skill_bundle_unavailable": "No se han podido descargar las skills del agente, así que nunca se puso en marcha. Suele ser un problema de conexión: inténtalo de nuevo.","runtime_cli_timeout": "La CLI local de OpenClaw agotó el tiempo de espera antes de responder. Comprueba la configuración de tu CLI local de OpenClaw o aumenta MULTICA_OPENCLAW_CLI_TIMEOUT antes de volver a intentarlo.","environment_prepare_failed": "La máquina que ejecuta el agente no pudo preparar esta ejecución, así que nunca arrancó. El error de abajo indica qué falló allí: a menudo espacio en disco, un permiso, una carpeta aún en uso, o una configuración local ilegible. No es el agente ni el proveedor del modelo.",- "local_directory_missing": "La carpeta local vinculada a este proyecto ya no existe en la máquina que ejecuta el agente, así que la ejecución nunca arrancó. Restaura la carpeta y vuelve a intentarlo. Para usar otra carpeta, abre Recursos → Carpetas locales del proyecto en la app de escritorio de esa máquina y vincúlala de nuevo: el navegador no puede elegir carpetas.",+ "local_directory_missing": "La carpeta local vinculada a este proyecto ya no existe en la máquina que ejecuta el agente, así que la ejecución nunca arrancó. Restaura la carpeta y vuelve a intentarlo. Para usar otra carpeta, abre el proyecto en la app de escritorio de esa máquina, quita la carpeta anterior en Recursos y vincula la nueva con Añadir → Carpeta local...: el navegador no puede elegir carpetas.","provider_network": "La conexión con el proveedor del modelo se perdió antes de que terminara la respuesta. Comprueba tu red e inténtalo de nuevo.","provider_auth_or_access": "El proveedor rechazó las credenciales o el acceso de este agente. Comprueba la clave de API o la cuenta: puede haber caducado o perdido el acceso.","provider_quota_limit": "La cuenta de modelo del agente se ha quedado sin crédito. Recárgala o cambia de cuenta, y reintenta.",diff --git a/packages/views/locales/es/projects.json b/packages/views/locales/es/projects.jsonindex 398114eac4..188f85c045 100644--- a/packages/views/locales/es/projects.json+++ b/packages/views/locales/es/projects.json@@ -146,9 +146,23 @@},"resources": {"section_header": "Recursos",- "repos_group": "Repositorios",- "repos_add": "Añadir repositorio",- "repos_empty": "Aún no hay repositorios.",+ "add": "Añadir",+ "add_repo": "Repositorio de GitHub",+ "add_repo_hint": "Lo usan las ejecuciones en cualquier ordenador",+ "add_local": "Carpeta local...",+ "add_local_hint": "Solo la usan las ejecuciones en este ordenador",+ "add_local_desktop_only": "Solo en la app de escritorio",+ "add_local_exists": "Ya hay una en este ordenador",+ "empty": "Añade un repositorio o una carpeta local para que trabajen los agentes.",+ "empty_read_only": "Aún no hay repositorios ni carpetas locales.",+ "row_menu": "Acciones de {{name}}",+ "copy_url": "Copiar URL",+ "copy_path": "Copiar ruta",+ "toast_copied": "Copiado",+ "local_dialog_title": "Añadir carpeta local",+ "local_dialog_description": "Las ejecuciones en este ordenador usarán esta carpeta en lugar de una copia nueva.",+ "local_dialog_change": "Cambiar...",+ "local_dialog_mode_label": "Cómo la usan las ejecuciones","repos_input_placeholder": "Busca o pega una URL de GitHub...","repos_add_url": "Añadir {{repo}}","repos_search_empty": "Ningún repositorio coincide.",@@ -158,13 +172,9 @@"toast_attach_failed": "No se ha podido añadir","toast_removed": "Eliminado","toast_remove_failed": "No se ha podido eliminar",- "local_group": "Carpetas locales",- "local_group_hint": "Una por ordenador; solo se usa en ese ordenador.","local_this_computer": "Este ordenador","local_unknown_computer": "Otro ordenador","local_offline": "Sin conexión",- "local_slot_description": "Las ejecuciones en este ordenador usan tu carpeta en lugar de una copia nueva.",- "local_pick": "Elegir carpeta...","local_daemon_offline_hint": "Inicia el daemon local para elegir una carpeta.","chat_hint_prefix": "El agente trabajará directamente en","chat_hint_worktree_prefix": "El agente trabajará en un worktree aislado de",diff --git a/packages/views/locales/fr/chat.json b/packages/views/locales/fr/chat.jsonindex 488fcbbb25..73c3466db3 100644--- a/packages/views/locales/fr/chat.json+++ b/packages/views/locales/fr/chat.json@@ -85,7 +85,7 @@"skill_bundle_unavailable": "Les skills de l'agent n'ont pas pu être téléchargés : il n'a donc jamais démarré. C'est généralement un problème de connexion — veuillez réessayer.","runtime_cli_timeout": "Le CLI OpenClaw local a expiré avant de répondre. Vérifiez votre configuration locale du CLI OpenClaw ou augmentez MULTICA_OPENCLAW_CLI_TIMEOUT avant de réessayer.","environment_prepare_failed": "La machine de l'agent n'a pas pu préparer cette exécution, qui n'a donc jamais démarré. L'erreur ci-dessous indique la cause locale : souvent un manque d'espace disque, une permission, un dossier encore utilisé ou une configuration illisible. Le problème ne vient ni de l'agent ni du fournisseur du modèle.",- "local_directory_missing": "Le dossier local lié à ce projet n'existe plus sur la machine de l'agent, donc l'exécution n'a jamais démarré. Restaurez le dossier, puis réessayez. Pour utiliser un autre dossier, ouvrez Ressources → Dossiers locaux du projet dans l'application de bureau de cette machine et liez-le à nouveau : un navigateur ne peut pas choisir de dossier.",+ "local_directory_missing": "Le dossier local lié à ce projet n'existe plus sur la machine de l'agent, donc l'exécution n'a jamais démarré. Restaurez le dossier, puis réessayez. Pour utiliser un autre dossier, ouvrez le projet dans l'application de bureau de cette machine, retirez l'ancien dossier dans Ressources, puis liez le nouveau via Ajouter → Dossier local... : un navigateur ne peut pas choisir de dossier.","provider_network": "La connexion au fournisseur du modèle a été perdue avant la fin de la réponse. Vérifiez votre réseau et réessayez.","provider_auth_or_access": "Le fournisseur a refusé les identifiants ou l'accès de cet agent. Vérifiez la clé API ou le compte — ils ont peut-être expiré ou perdu l'accès.","provider_quota_limit": "Le compte de modèle de l'agent n'a plus de crédit. Rechargez-le ou changez de compte, puis réessayez.",diff --git a/packages/views/locales/fr/projects.json b/packages/views/locales/fr/projects.jsonindex 0792373135..5a9dfa8a4c 100644--- a/packages/views/locales/fr/projects.json+++ b/packages/views/locales/fr/projects.json@@ -146,9 +146,23 @@},"resources": {"section_header": "Ressources",- "repos_group": "Dépôts",- "repos_add": "Ajouter un dépôt",- "repos_empty": "Aucun dépôt pour l'instant.",+ "add": "Ajouter",+ "add_repo": "Dépôt GitHub",+ "add_repo_hint": "Utilisé par les exécutions sur n'importe quel ordinateur",+ "add_local": "Dossier local...",+ "add_local_hint": "Utilisé uniquement par les exécutions sur cet ordinateur",+ "add_local_desktop_only": "Uniquement dans l'app de bureau",+ "add_local_exists": "Déjà défini pour cet ordinateur",+ "empty": "Ajoutez un dépôt ou un dossier local dans lequel les agents travailleront.",+ "empty_read_only": "Aucun dépôt ni dossier local pour l'instant.",+ "row_menu": "Actions pour {{name}}",+ "copy_url": "Copier l'URL",+ "copy_path": "Copier le chemin",+ "toast_copied": "Copié",+ "local_dialog_title": "Ajouter un dossier local",+ "local_dialog_description": "Les exécutions sur cet ordinateur utiliseront ce dossier au lieu d'une nouvelle copie.",+ "local_dialog_change": "Changer...",+ "local_dialog_mode_label": "Utilisation par les exécutions","repos_input_placeholder": "Rechercher ou coller une URL GitHub...","repos_add_url": "Ajouter {{repo}}","repos_search_empty": "Aucun dépôt correspondant.",@@ -158,13 +172,9 @@"toast_attach_failed": "Échec de l'ajout","toast_removed": "Retiré","toast_remove_failed": "Échec du retrait",- "local_group": "Dossiers locaux",- "local_group_hint": "Un par ordinateur, utilisé uniquement sur cet ordinateur.","local_this_computer": "Cet ordinateur","local_unknown_computer": "Un autre ordinateur","local_offline": "Hors ligne",- "local_slot_description": "Les exécutions sur cet ordinateur utilisent votre dossier au lieu d'une nouvelle copie.",- "local_pick": "Choisir un dossier...","local_daemon_offline_hint": "Démarrez le daemon local pour choisir un dossier.","chat_hint_prefix": "L'agent travaillera en place dans","chat_hint_worktree_prefix": "L'agent travaillera dans un worktree isolé de",diff --git a/packages/views/locales/ja/chat.json b/packages/views/locales/ja/chat.jsonindex 7a2c6dfff4..202ffe52da 100644--- a/packages/views/locales/ja/chat.json+++ b/packages/views/locales/ja/chat.json@@ -82,7 +82,7 @@"skill_bundle_unavailable": "エージェントの skill をダウンロードできず、返信を開始できませんでした。多くの場合はネットワークの問題です。もう一度お試しください。","runtime_cli_timeout": "ローカルの OpenClaw CLI が応答する前にタイムアウトしました。ローカルの OpenClaw CLI 設定を確認するか、MULTICA_OPENCLAW_CLI_TIMEOUT を引き上げてから再試行してください。","environment_prepare_failed": "エージェントを実行しているマシンでこの実行を準備できず、開始されませんでした。何が失敗したかは下のエラーに出ています——ディスクの空き容量、権限、使用中のフォルダー、読み取れないローカル設定などが多いです。エージェントやモデルプロバイダーの問題ではありません。",- "local_directory_missing": "このプロジェクトに関連付けたローカルフォルダが、エージェントを実行しているマシン上にもう存在しないため、実行は開始されませんでした。フォルダを元に戻してから、もう一度お試しください。別のフォルダを使う場合は、そのマシンのデスクトップアプリでプロジェクトの「リソース → ローカルフォルダ」を開いて関連付け直してください。ブラウザではフォルダを選択できません。",+ "local_directory_missing": "このプロジェクトに関連付けたローカルフォルダが、エージェントを実行しているマシン上にもう存在しないため、実行は開始されませんでした。フォルダを元に戻してから、もう一度お試しください。別のフォルダを使う場合は、そのマシンのデスクトップアプリでプロジェクトを開き、「リソース」で古いフォルダを削除してから「追加 → ローカルフォルダ...」で関連付け直してください。ブラウザではフォルダを選択できません。","provider_network": "モデルサービスとの接続が切断され、返信を完了できませんでした。ネットワークを確認してから再度お試しください。","provider_auth_or_access": "プロバイダーがこのエージェントの認証情報またはアクセスを拒否しました。API キーやアカウントの有効期限・権限を確認してください。","provider_quota_limit": "エージェントのモデルアカウントの残高が不足しています。チャージするかアカウントを切り替えてからお試しください。",diff --git a/packages/views/locales/ja/projects.json b/packages/views/locales/ja/projects.jsonindex ecd4b4143f..6a1fe9c33c 100644--- a/packages/views/locales/ja/projects.json+++ b/packages/views/locales/ja/projects.json@@ -142,9 +142,23 @@},"resources": {"section_header": "リソース",- "repos_group": "リポジトリ",- "repos_add": "リポジトリを追加",- "repos_empty": "まだリポジトリがありません。",+ "add": "追加",+ "add_repo": "GitHub リポジトリ",+ "add_repo_hint": "どのコンピュータでの実行でもチェックアウトされます",+ "add_local": "ローカルフォルダ...",+ "add_local_hint": "このコンピュータでの実行だけが使います",+ "add_local_desktop_only": "デスクトップアプリでのみ利用できます",+ "add_local_exists": "このコンピュータには設定済みです",+ "empty": "エージェントが作業するリポジトリまたはローカルフォルダを追加してください。",+ "empty_read_only": "まだリポジトリもローカルフォルダもありません。",+ "row_menu": "{{name}} の操作",+ "copy_url": "URL をコピー",+ "copy_path": "パスをコピー",+ "toast_copied": "コピーしました",+ "local_dialog_title": "ローカルフォルダを追加",+ "local_dialog_description": "このコンピュータでの実行は、チェックアウトせずにこのフォルダを使います。",+ "local_dialog_change": "変更...",+ "local_dialog_mode_label": "実行方法","repos_input_placeholder": "検索、または GitHub の URL を貼り付け...","repos_add_url": "{{repo}} を追加","repos_search_empty": "一致するリポジトリはありません。",@@ -154,13 +168,9 @@"toast_attach_failed": "追加できませんでした","toast_removed": "削除しました","toast_remove_failed": "削除できませんでした",- "local_group": "ローカルフォルダ",- "local_group_hint": "コンピュータごとに 1 つ。そのコンピュータでのみ使われます。","local_this_computer": "このコンピュータ","local_unknown_computer": "別のコンピュータ","local_offline": "オフライン",- "local_slot_description": "このコンピュータでの実行は、チェックアウトせずにあなたのフォルダを使います。",- "local_pick": "フォルダを選択...","local_daemon_offline_hint": "フォルダを選ぶには、ローカルデーモンを起動してください。","chat_hint_prefix": "エージェントは次の場所で直接作業します:","chat_hint_worktree_prefix": "エージェントは次のリポジトリの独立した worktree で作業します:",diff --git a/packages/views/locales/ko/chat.json b/packages/views/locales/ko/chat.jsonindex 54953ca0b0..ccb0fb0c9a 100644--- a/packages/views/locales/ko/chat.json+++ b/packages/views/locales/ko/chat.json@@ -82,7 +82,7 @@"skill_bundle_unavailable": "에이전트의 skill을 내려받지 못해 답변을 시작하지 못했습니다. 대개 네트워크 연결 문제입니다. 다시 시도해 주세요.","runtime_cli_timeout": "로컬 OpenClaw CLI가 응답하기 전에 시간 초과되었습니다. 로컬 OpenClaw CLI 설정을 확인하거나 MULTICA_OPENCLAW_CLI_TIMEOUT 값을 높인 뒤 다시 시도하세요.","environment_prepare_failed": "에이전트를 실행하는 머신에서 이번 실행을 준비하지 못해 시작되지 못했습니다. 무엇이 실패했는지는 아래 오류에 나옵니다 — 디스크 공간, 권한, 사용 중인 폴더, 읽을 수 없는 로컬 설정 등이 흔합니다. 에이전트나 모델 제공자의 문제가 아닙니다.",- "local_directory_missing": "이 프로젝트에 연결된 로컬 폴더가 에이전트를 실행하는 머신에 더 이상 없어 실행이 시작되지 않았습니다. 폴더를 복원한 뒤 다시 시도하세요. 다른 폴더를 쓰려면 그 머신의 데스크톱 앱에서 프로젝트의 \"리소스 → 로컬 폴더\"를 열어 다시 연결하세요. 브라우저에서는 폴더를 선택할 수 없습니다.",+ "local_directory_missing": "이 프로젝트에 연결된 로컬 폴더가 에이전트를 실행하는 머신에 더 이상 없어 실행이 시작되지 않았습니다. 폴더를 복원한 뒤 다시 시도하세요. 다른 폴더를 쓰려면 그 머신의 데스크톱 앱에서 프로젝트를 열고 \"리소스\"에서 기존 폴더를 제거한 뒤 \"추가 → 로컬 폴더...\"로 다시 연결하세요. 브라우저에서는 폴더를 선택할 수 없습니다.","provider_network": "모델 서비스와의 연결이 끊겨 답변을 완료하지 못했습니다. 네트워크를 확인한 뒤 다시 시도해 주세요.","provider_auth_or_access": "제공자가 이 에이전트의 자격 증명 또는 접근을 거부했습니다. API 키나 계정이 만료되었거나 권한이 없는지 확인하세요.","provider_quota_limit": "에이전트의 모델 계정 잔액이 부족합니다. 충전하거나 계정을 변경한 뒤 시도해 주세요.",diff --git a/packages/views/locales/ko/projects.json b/packages/views/locales/ko/projects.jsonindex 5483e747b3..c7f52c284e 100644--- a/packages/views/locales/ko/projects.json+++ b/packages/views/locales/ko/projects.json@@ -142,9 +142,23 @@},"resources": {"section_header": "리소스",- "repos_group": "저장소",- "repos_add": "저장소 추가",- "repos_empty": "아직 저장소가 없습니다.",+ "add": "추가",+ "add_repo": "GitHub 저장소",+ "add_repo_hint": "어느 컴퓨터에서 실행해도 체크아웃됩니다",+ "add_local": "로컬 폴더...",+ "add_local_hint": "이 컴퓨터에서 실행할 때만 사용됩니다",+ "add_local_desktop_only": "데스크톱 앱에서만 사용할 수 있습니다",+ "add_local_exists": "이 컴퓨터에는 이미 설정되어 있습니다",+ "empty": "에이전트가 작업할 저장소나 로컬 폴더를 추가하세요.",+ "empty_read_only": "아직 저장소나 로컬 폴더가 없습니다.",+ "row_menu": "{{name}} 작업",+ "copy_url": "URL 복사",+ "copy_path": "경로 복사",+ "toast_copied": "복사했습니다",+ "local_dialog_title": "로컬 폴더 추가",+ "local_dialog_description": "이 컴퓨터에서 실행하면 새로 체크아웃하지 않고 이 폴더를 사용합니다.",+ "local_dialog_change": "변경...",+ "local_dialog_mode_label": "실행 방식","repos_input_placeholder": "검색하거나 GitHub URL 붙여넣기...","repos_add_url": "{{repo}} 추가","repos_search_empty": "일치하는 저장소가 없습니다.",@@ -154,13 +168,9 @@"toast_attach_failed": "추가하지 못했습니다","toast_removed": "제거했습니다","toast_remove_failed": "제거하지 못했습니다",- "local_group": "로컬 폴더",- "local_group_hint": "컴퓨터당 하나이며, 그 컴퓨터에서만 사용됩니다.","local_this_computer": "이 컴퓨터","local_unknown_computer": "다른 컴퓨터","local_offline": "오프라인",- "local_slot_description": "이 컴퓨터에서 실행하면 새로 체크아웃하지 않고 내 폴더를 사용합니다.",- "local_pick": "폴더 선택...","local_daemon_offline_hint": "폴더를 선택하려면 로컬 데몬을 시작하세요.","chat_hint_prefix": "에이전트가 다음 위치에서 직접 작업합니다:","chat_hint_worktree_prefix": "에이전트가 다음 저장소의 격리된 worktree에서 작업합니다:",diff --git a/packages/views/locales/ru/chat.json b/packages/views/locales/ru/chat.jsonindex 5d02cb26cc..5b347ff21f 100644--- a/packages/views/locales/ru/chat.json+++ b/packages/views/locales/ru/chat.json@@ -91,7 +91,7 @@"skill_bundle_unavailable": "Не удалось загрузить навыки агента, поэтому запуск не состоялся. Обычно это проблема с подключением — попробуйте ещё раз.","runtime_cli_timeout": "Превышено время ожидания ответа от локального OpenClaw CLI. Проверьте настройку локального OpenClaw CLI или увеличьте MULTICA_OPENCLAW_CLI_TIMEOUT перед повторной попыткой.","environment_prepare_failed": "Машина, на которой работает агент, не смогла подготовить этот запуск, поэтому он так и не начался. Ошибка ниже описывает, что там пошло не так — часто это нехватка места на диске, права доступа, занятая папка или локальная конфигурация, которую не удалось прочитать. Проблема не в агенте и не в провайдере модели.",- "local_directory_missing": "Локальной папки, привязанной к этому проекту, больше нет на машине, где работает агент, поэтому запуск так и не начался. Восстановите папку и повторите попытку. Чтобы использовать другую папку, откройте «Ресурсы → Локальные папки» проекта в десктоп-приложении на этой машине и привяжите её заново: в браузере выбрать папку нельзя.",+ "local_directory_missing": "Локальной папки, привязанной к этому проекту, больше нет на машине, где работает агент, поэтому запуск так и не начался. Восстановите папку и повторите попытку. Чтобы использовать другую папку, откройте проект в десктоп-приложении на этой машине, удалите старую папку в «Ресурсах» и привяжите новую через «Добавить → Локальная папка...»: в браузере выбрать папку нельзя.","provider_network": "Соединение с провайдером модели прервалось до завершения ответа. Проверьте сеть и попробуйте ещё раз.","provider_auth_or_access": "Провайдер отклонил учётные данные или доступ этого агента. Проверьте API-ключ или аккаунт — возможно, срок действия истёк или доступ был отозван.","provider_quota_limit": "На учётной записи модели агента закончились средства. Пополните баланс или переключите учётную запись, затем повторите попытку.",diff --git a/packages/views/locales/ru/projects.json b/packages/views/locales/ru/projects.jsonindex b2462ef9dc..d4a7f4d5c1 100644--- a/packages/views/locales/ru/projects.json+++ b/packages/views/locales/ru/projects.json@@ -154,9 +154,23 @@},"resources": {"section_header": "Ресурсы",- "repos_group": "Репозитории",- "repos_add": "Добавить репозиторий",- "repos_empty": "Репозиториев пока нет.",+ "add": "Добавить",+ "add_repo": "Репозиторий GitHub",+ "add_repo_hint": "Используется запусками на любом компьютере",+ "add_local": "Локальная папка...",+ "add_local_hint": "Используется только запусками на этом компьютере",+ "add_local_desktop_only": "Только в настольном приложении",+ "add_local_exists": "Для этого компьютера уже задана",+ "empty": "Добавьте репозиторий или локальную папку, в которых будут работать агенты.",+ "empty_read_only": "Репозиториев и локальных папок пока нет.",+ "row_menu": "Действия для {{name}}",+ "copy_url": "Копировать URL",+ "copy_path": "Копировать путь",+ "toast_copied": "Скопировано",+ "local_dialog_title": "Добавить локальную папку",+ "local_dialog_description": "Запуски на этом компьютере будут использовать эту папку вместо новой копии репозитория.",+ "local_dialog_change": "Изменить...",+ "local_dialog_mode_label": "Как её используют запуски","repos_input_placeholder": "Поиск или ссылка на GitHub...","repos_add_url": "Добавить {{repo}}","repos_search_empty": "Подходящих репозиториев нет.",@@ -166,13 +180,9 @@"toast_attach_failed": "Не удалось добавить","toast_removed": "Удалено","toast_remove_failed": "Не удалось удалить",- "local_group": "Локальные папки",- "local_group_hint": "По одной на компьютер; используется только на нём.","local_this_computer": "Этот компьютер","local_unknown_computer": "Другой компьютер","local_offline": "Не в сети",- "local_slot_description": "Запуски на этом компьютере используют вашу папку вместо новой копии репозитория.",- "local_pick": "Выбрать папку...","local_daemon_offline_hint": "Запустите локальный демон, чтобы выбрать папку.","chat_hint_prefix": "Агент будет работать на месте в","chat_hint_worktree_prefix": "Агент будет работать в изолированной рабочей копии",diff --git a/packages/views/locales/zh-Hans/chat.json b/packages/views/locales/zh-Hans/chat.jsonindex c377fcfd6f..0f3c2dc941 100644--- a/packages/views/locales/zh-Hans/chat.json+++ b/packages/views/locales/zh-Hans/chat.json@@ -82,7 +82,7 @@"skill_bundle_unavailable": "无法下载该智能体的 skill,本次运行未能启动。通常是网络连接问题,请重试。","runtime_cli_timeout": "本地 OpenClaw CLI 响应超时。请检查本地 OpenClaw CLI 状态,或调大超时配置(MULTICA_OPENCLAW_CLI_TIMEOUT)后再重试。","environment_prepare_failed": "运行智能体的机器未能准备好本次运行环境,因此未能启动。下方报错会说明具体失败原因(常见为磁盘空间、权限、目录被占用或本地配置无法读取),与智能体和模型提供商无关。",- "local_directory_missing": "该项目关联的本地文件夹在运行智能体的那台机器上已不存在,因此运行未能启动。请恢复该文件夹后再试;如需更换文件夹,请在那台机器的桌面端打开项目的 \"资源 → 本地文件夹\" 重新关联,浏览器无法选择文件夹。",+ "local_directory_missing": "该项目关联的本地文件夹在运行智能体的那台机器上已不存在,因此运行未能启动。请恢复该文件夹后再试;如需更换文件夹,请在那台机器的桌面端打开项目,在 \"资源\" 中移除旧文件夹,再通过 \"添加 → 本地文件夹...\" 重新关联,浏览器无法选择文件夹。","provider_network": "与模型服务的连接中断,回复没能完成。检查网络后重试。","provider_auth_or_access": "服务商拒绝了该智能体的凭据或访问权限。请检查 API Key 或账号状态——可能已过期或权限已失效。","provider_quota_limit": "智能体的模型账号额度已用尽。充值或更换账号后再试。",diff --git a/packages/views/locales/zh-Hans/projects.json b/packages/views/locales/zh-Hans/projects.jsonindex 2e8566d0d4..8e05d99dd0 100644--- a/packages/views/locales/zh-Hans/projects.json+++ b/packages/views/locales/zh-Hans/projects.json@@ -142,9 +142,23 @@},"resources": {"section_header": "资源",- "repos_group": "仓库",- "repos_add": "添加仓库",- "repos_empty": "还没有仓库。",+ "add": "添加",+ "add_repo": "GitHub 仓库",+ "add_repo_hint": "任何电脑上的运行都会检出它",+ "add_local": "本地文件夹...",+ "add_local_hint": "仅本机上的运行使用",+ "add_local_desktop_only": "仅桌面端可用",+ "add_local_exists": "本机已设置文件夹",+ "empty": "添加一个仓库或本地文件夹,供智能体工作。",+ "empty_read_only": "还没有仓库或本地文件夹。",+ "row_menu": "{{name}} 的操作",+ "copy_url": "复制链接",+ "copy_path": "复制路径",+ "toast_copied": "已复制",+ "local_dialog_title": "添加本地文件夹",+ "local_dialog_description": "本机上的运行将直接使用这个文件夹,不再检出仓库。",+ "local_dialog_change": "更换...",+ "local_dialog_mode_label": "运行方式","repos_input_placeholder": "搜索或粘贴 GitHub 链接...","repos_add_url": "添加 {{repo}}","repos_search_empty": "没有匹配的仓库。",@@ -154,13 +168,9 @@"toast_attach_failed": "添加失败","toast_removed": "已移除","toast_remove_failed": "移除失败",- "local_group": "本地文件夹",- "local_group_hint": "每台电脑一个,只在那台电脑上生效。","local_this_computer": "本机","local_unknown_computer": "另一台电脑","local_offline": "离线",- "local_slot_description": "在本机运行时直接使用你的文件夹,不再检出仓库。",- "local_pick": "选择文件夹...","local_daemon_offline_hint": "启动本地守护进程后才能选择文件夹。","chat_hint_prefix": "智能体将直接在以下目录中工作:","chat_hint_worktree_prefix": "智能体将在以下仓库的独立 worktree 中工作:",diff --git a/packages/views/locales/zh-Hant/chat.json b/packages/views/locales/zh-Hant/chat.jsonindex 543c122f6e..0700a7e302 100644--- a/packages/views/locales/zh-Hant/chat.json+++ b/packages/views/locales/zh-Hant/chat.json@@ -82,7 +82,7 @@"skill_bundle_unavailable": "沒能下載到 AI 代理的 skill,這次回覆沒有啟動。通常是網路連線問題,請重試。","runtime_cli_timeout": "本機 OpenClaw CLI 在回應前逾時。請檢查本機 OpenClaw CLI 設定,或調高 MULTICA_OPENCLAW_CLI_TIMEOUT 後再重試。","environment_prepare_failed": "執行 AI 代理的那臺機器沒能把這次執行準備好,任務沒有啟動。下方的原始錯誤會說明是哪一步失敗——常見的是磁碟空間、權限、目錄仍被佔用,或本地配置讀不出來。與 AI 代理和模型廠商無關。",- "local_directory_missing": "這個專案關聯的本地資料夾在執行 AI 代理的那臺機器上已不存在,任務沒有啟動。恢復這個資料夾後再試;如果要換一個資料夾,需要在那臺機器的桌面端開啟專案的「資源 → 本地資料夾」重新關聯,瀏覽器裡無法選擇資料夾。",+ "local_directory_missing": "這個專案關聯的本地資料夾在執行 AI 代理的那臺機器上已不存在,任務沒有啟動。恢復這個資料夾後再試;如果要換一個資料夾,需要在那臺機器的桌面端開啟專案,在「資源」中移除舊資料夾,再透過「新增 → 本地資料夾...」重新關聯,瀏覽器裡無法選擇資料夾。","provider_network": "與模型服務的連線中斷,回覆沒能完成。檢查網路後重試。","provider_auth_or_access": "服務商拒絕了該 AI 代理的憑證或存取權限。請檢查 API Key 或帳號狀態——可能已過期或權限已失效。","provider_quota_limit": "AI 代理的模型帳號額度已用盡。充值或更換帳號後再試。",diff --git a/packages/views/locales/zh-Hant/projects.json b/packages/views/locales/zh-Hant/projects.jsonindex 697f8117a5..1a4ff1e7c8 100644--- a/packages/views/locales/zh-Hant/projects.json+++ b/packages/views/locales/zh-Hant/projects.json@@ -142,9 +142,23 @@},"resources": {"section_header": "資源",- "repos_group": "倉庫",- "repos_add": "新增倉庫",- "repos_empty": "還沒有倉庫。",+ "add": "新增",+ "add_repo": "GitHub 倉庫",+ "add_repo_hint": "任何電腦上的執行都會檢出它",+ "add_local": "本地資料夾...",+ "add_local_hint": "僅本機上的執行使用",+ "add_local_desktop_only": "僅桌面端可用",+ "add_local_exists": "本機已設定資料夾",+ "empty": "新增一個倉庫或本地資料夾,供 AI 代理工作。",+ "empty_read_only": "還沒有倉庫或本地資料夾。",+ "row_menu": "{{name}} 的操作",+ "copy_url": "複製連結",+ "copy_path": "複製路徑",+ "toast_copied": "已複製",+ "local_dialog_title": "新增本地資料夾",+ "local_dialog_description": "本機上的執行將直接使用這個資料夾,不再檢出倉庫。",+ "local_dialog_change": "更換...",+ "local_dialog_mode_label": "執行方式","repos_input_placeholder": "搜尋或貼上 GitHub 連結...","repos_add_url": "新增 {{repo}}","repos_search_empty": "沒有匹配的倉庫。",@@ -154,13 +168,9 @@"toast_attach_failed": "新增失敗","toast_removed": "已移除","toast_remove_failed": "移除失敗",- "local_group": "本地資料夾",- "local_group_hint": "每台電腦一個,只在那台電腦上生效。","local_this_computer": "本機","local_unknown_computer": "另一台電腦","local_offline": "離線",- "local_slot_description": "在本機執行時直接使用你的資料夾,不再檢出倉庫。",- "local_pick": "選擇資料夾...","local_daemon_offline_hint": "啟動本地守護程序後才能選擇資料夾。","chat_hint_prefix": "AI 代理將直接在以下目錄中工作:","chat_hint_worktree_prefix": "AI 代理將在以下倉庫的獨立 worktree 中工作:",diff --git a/packages/views/projects/components/project-resources-github-ref.test.tsx b/packages/views/projects/components/project-resources-github-ref.test.tsxindex 8cb34f6c92..6a78c61b3f 100644--- a/packages/views/projects/components/project-resources-github-ref.test.tsx+++ b/packages/views/projects/components/project-resources-github-ref.test.tsx@@ -99,9 +99,17 @@ vi.mock("../../platform/use-local-daemon-status", () => ({useLocalDaemonStatus: () => ({ daemonId: null, deviceName: null, running: false }),}));vi.mock("sonner", () => ({ toast: { success: vi.fn(), error: vi.fn() } }));+const clipboard = vi.hoisted(() => ({ copyText: vi.fn() }));+vi.mock("@multica/ui/lib/clipboard", () => clipboard);import { ProjectResourcesSection } from "./project-resources-section";+async function openRepoPanel() {+ fireEvent.click(screen.getByRole("button", { name: "Add" }));+ fireEvent.click(await screen.findByRole("menuitem", { name: /^GitHub repository/ }));+ await screen.findByLabelText(/paste a github url/i);+}+describe("ProjectResourcesSection — github_repo checkout ref", () => {beforeEach(() => {updateMock.mockClear();@@ -129,15 +137,20 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {<ProjectResourcesSection projectId="p1" /></QueryClientProvider>,);- const [firstButton, secondButton] = screen.getAllByRole("button", { name: /remove/i });- fireEvent.click(firstButton!);+ const [firstButton, secondButton] = screen.getAllByRole("button", { name: /^actions for/i });+ const removeFrom = async (trigger: HTMLElement) => {+ fireEvent.click(trigger);+ fireEvent.click(await screen.findByRole("menuitem", { name: /remove/i }));+ };+ await removeFrom(firstButton!);await waitFor(() => expect(firstButton).toBeDisabled());expect(firstButton).toHaveAttribute("aria-busy", "true");expect(secondButton).toBeEnabled();fireEvent.click(firstButton!);+ expect(screen.queryByRole("menuitem", { name: /remove/i })).toBeNull();expect(remove).toHaveBeenCalledTimes(1);- fireEvent.click(secondButton!);+ await removeFrom(secondButton!);await waitFor(() => expect(secondButton).toBeDisabled());expect(remove).toHaveBeenCalledTimes(2);await act(async () => {@@ -159,8 +172,8 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {renderWithI18n(<ProjectResourcesSection projectId="p1" readOnly />);expect(screen.getByText("Release line")).toBeTruthy();expect(screen.getByText("release/2026-09")).toBeTruthy();- expect(screen.queryByRole("button", { name: /add repository/i })).toBeNull();- expect(screen.queryByRole("button", { name: /remove/i })).toBeNull();+ expect(screen.queryByRole("button", { name: "Add" })).toBeNull();+ expect(screen.queryByRole("button", { name: /^actions for/i })).toBeNull();expect(screen.queryByRole("button", { name: /release\/2026-09/ })).toBeNull();});@@ -176,7 +189,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {expect(screen.getAllByText("multica-ai/api")).not.toHaveLength(0);expect(screen.getByText(AVAILABLE_REPO.description)).toBeTruthy();- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();expect(screen.getByText(ATTACHABLE_REPO.description)).toBeTruthy();fireEvent.click(screen.getByRole("button", { name: /multica-ai\/daemon/i }),@@ -249,7 +262,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {it("attaches a repo with the ref typed alongside its URL", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();const urlInput = screen.getByLabelText(/paste a github url/i);fireEvent.change(urlInput, {target: { value: "https://github.com/multica-ai/other" },@@ -275,7 +288,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {])("offers to add %s that is not in the workspace list", async (_label, address) => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();const input = screen.getByLabelText(/paste a github url/i);fireEvent.change(input, { target: { value: address } });@@ -289,10 +302,10 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {});});- it.each(["multica", "agent sdk"])("keeps %j a search rather than an address", (term) => {+ it.each(["multica", "agent sdk"])("keeps %j a search rather than an address", async (term) => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();const input = screen.getByLabelText(/paste a github url/i);fireEvent.change(input, { target: { value: term } });@@ -305,7 +318,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {it("saves the decoded branch from a pasted GitHub URL without page parameters", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();// What someone copies out of the address bar when they want a branch.// Stored whole, this is a clone URL that does not exist.fireEvent.change(screen.getByLabelText(/paste a github url/i), {@@ -333,7 +346,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {it("normalises a pasted browse URL even when a branch is already filled in", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();const urlInput = () => screen.getByLabelText(/paste a github url/i) as HTMLInputElement;const refInput = () => screen.getByLabelText(/starting branch/i) as HTMLInputElement;@@ -364,7 +377,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {])("clears the previous branch when replacing a browse URL with %s", async (url) => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();const input = screen.getByLabelText(/paste a github url/i);fireEvent.change(input, {target: { value: "https://github.com/multica-ai/one/tree/release/2026-09" },@@ -385,7 +398,7 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {it("omits the ref key entirely when the field is left empty", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();fireEvent.change(screen.getByLabelText(/paste a github url/i), {target: { value: "https://github.com/multica-ai/other" },});@@ -398,10 +411,10 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {});});- it("blocks attaching when the ref is invalid, without touching the URL field", () => {+ it("blocks attaching when the ref is invalid, without touching the URL field", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();fireEvent.change(screen.getByLabelText(/paste a github url/i), {target: { value: "https://github.com/multica-ai/other" },});@@ -420,12 +433,11 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {it("says 'Default branch' when nothing is pinned, rather than showing nothing", () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- // `.group` is the row root; the link's immediate parent is only its top line.- const pinnedRow = screen.getByText("Release line").closest(".group") as HTMLElement;+ const pinnedRow = screen.getByText("Release line").closest("[data-resource-row]") as HTMLElement;expect(within(pinnedRow).queryByText("release/2026-09")).toBeTruthy();expect(within(pinnedRow).queryByText(/default branch/i)).toBeNull();- const plainRow = screen.getAllByText("multica-ai/api")[0]?.closest(".group") as HTMLElement;+ const plainRow = screen.getAllByText("multica-ai/api")[0]?.closest("[data-resource-row]") as HTMLElement;expect(within(plainRow).queryByText(/default branch/i)).toBeTruthy();expect(within(plainRow).queryByText("release/2026-09")).toBeNull();});@@ -479,24 +491,34 @@ describe("ProjectResourcesSection — github_repo checkout ref", () => {// One field serves both search and paste; only a URL turns it into an// attach form, so a search term never offers to attach itself.- it("filters workspace repositories for a search term without offering to attach it", () => {+ it("filters workspace repositories for a search term without offering to attach it", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- fireEvent.click(screen.getByRole("button", { name: /add repository/i }));+ await openRepoPanel();fireEvent.change(screen.getByLabelText(/paste a github url/i), {target: { value: "daemon" },});expect(screen.getByRole("button", { name: /multica-ai\/daemon/i })).toBeTruthy();- expect(screen.queryByRole("button", { name: /multica-ai\/api/i })).toBeNull();+ expect(screen.queryByRole("button", { name: /^multica-ai\/api/i })).toBeNull();expect(screen.queryByLabelText(/starting branch/i)).toBeNull();});- // Picking a folder needs this machine's daemon, so web has nothing to offer- // in the group until a folder exists somewhere.- it("leaves out the local folder group on web when the project has none", () => {+ it("copies a repository's URL from its row menu", async () => {+ clipboard.copyText.mockResolvedValue(true);+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);+ fireEvent.click(screen.getByRole("button", { name: "Actions for Release line" }));+ fireEvent.click(await screen.findByRole("menuitem", { name: "Copy URL" }));+ await waitFor(() => expect(clipboard.copyText).toHaveBeenCalledWith("https://github.com/multica-ai/multica"));+ });++ // Picking a folder needs this machine's daemon, so web keeps the entry and+ // says where it works instead.+ it("tells web that folders are added from the desktop app", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- expect(screen.getByText("Repositories")).toBeTruthy();- expect(screen.queryByText("Local folders")).toBeNull();+ fireEvent.click(screen.getByRole("button", { name: "Add" }));+ const item = await screen.findByRole("menuitem", { name: /^Local folder/ });+ expect(item.getAttribute("aria-disabled")).toBe("true");+ expect(item.textContent).toContain("Only in the desktop app");});});diff --git a/packages/views/projects/components/project-resources-local-directory.test.tsx b/packages/views/projects/components/project-resources-local-directory.test.tsxindex c75ac105dd..ba0250edbd 100644--- a/packages/views/projects/components/project-resources-local-directory.test.tsx+++ b/packages/views/projects/components/project-resources-local-directory.test.tsx@@ -1,7 +1,7 @@// @vitest-environment jsdomimport { describe, it, expect, vi, beforeEach } from "vitest";-import { fireEvent, screen, waitFor } from "@testing-library/react";+import { fireEvent, screen, waitFor, within } from "@testing-library/react";import { renderWithI18n } from "../../test/i18n";import en from "../../locales/en/projects.json";@@ -14,6 +14,7 @@ const state = vi.hoisted(() => ({updateMock: vi.fn(),pickDirectory: vi.fn(),validateLocalDirectory: vi.fn(),+ copyText: vi.fn(),}));const NOW = Date.now();@@ -98,19 +99,33 @@ vi.mock("../../platform/use-local-daemon-status", () => ({useLocalDaemonStatus: () => state.daemon,}));vi.mock("sonner", () => ({ toast: { success: vi.fn(), error: vi.fn() } }));+vi.mock("@multica/ui/lib/clipboard", () => ({ copyText: state.copyText }));import { ProjectResourcesSection } from "./project-resources-section";const strings = en.resources;-function pickFolder(isGitRepo: boolean) {+async function openAddMenu() {+ fireEvent.click(screen.getByRole("button", { name: strings.add }));+ return screen.findByRole("menuitem", {+ name: (name) => name.startsWith(strings.add_local),+ });+}++async function pickFolder(isGitRepo: boolean) {state.pickDirectory.mockResolvedValueOnce({ok: true,path: "/Users/dev/work/game-client",basename: "game-client",});state.validateLocalDirectory.mockResolvedValueOnce({ ok: true, is_git_repo: isGitRepo });- fireEvent.click(screen.getByRole("button", { name: strings.local_pick }));+ fireEvent.click(await openAddMenu());+ return screen.findByRole("dialog");+}++async function openRowMenu(name: string) {+ fireEvent.click(screen.getByRole("button", { name: `Actions for ${name}` }));+ return screen.findByRole("menu");}beforeEach(() => {@@ -122,6 +137,7 @@ beforeEach(() => {state.updateMock.mockReset().mockResolvedValue({});state.pickDirectory.mockReset();state.validateLocalDirectory.mockReset();+ state.copyText.mockReset().mockResolvedValue(true);});describe("ProjectResourcesSection — local folders", () => {@@ -137,24 +153,40 @@ describe("ProjectResourcesSection — local folders", () => {// A folder is identified by its path, so a rename only changed the title and// read as a broken edit action beside the other controls (MUL-7525). What// remains is the one setting that changes how tasks run on the folder.- it("offers the execution mode and remove actions, and no rename", () => {+ it("offers the execution mode and remove actions, and no rename", async () => {state.resources = [folder("game-client", "daemon-1")];renderWithI18n(<ProjectResourcesSection projectId="p1" />);expect(screen.getByRole("button", { name: strings.mode_badge_worktree })).toBeInTheDocument();- expect(screen.getByRole("button", { name: strings.remove_tooltip })).toBeInTheDocument();- expect(screen.queryByRole("button", { name: /rename/i })).not.toBeInTheDocument();+ const menu = await openRowMenu("game-client");+ expect(within(menu).getByRole("menuitem", { name: strings.remove_tooltip })).toBeInTheDocument();+ expect(within(menu).queryByRole("menuitem", { name: /rename/i })).not.toBeInTheDocument();expect(screen.queryByRole("textbox")).not.toBeInTheDocument();});+ it("copies a folder's path from its row menu", async () => {+ state.resources = [folder("game-client", "daemon-1")];+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);+ const menu = await openRowMenu("game-client");+ fireEvent.click(within(menu).getByRole("menuitem", { name: strings.copy_path }));+ await waitFor(() => expect(state.copyText).toHaveBeenCalledWith("/Users/dev/work/game-client"));+ });++ it("asks for a repository or folder when the project has neither", () => {+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);+ expect(screen.getByText(strings.empty)).toBeInTheDocument();+ });+// The server allows one folder per computer, so a machine that already has- // one offers no way to add a second.- it("does not offer another folder on a computer that already has one", () => {+ // one offers no way to add a second, and says why.+ it("does not offer another folder on a computer that already has one", async () => {state.resources = [folder("game-client", "daemon-1")];renderWithI18n(<ProjectResourcesSection projectId="p1" />);- expect(screen.queryByRole("button", { name: strings.local_pick })).not.toBeInTheDocument();+ const item = await openAddMenu();+ expect(item).toHaveAttribute("aria-disabled", "true");+ expect(item).toHaveTextContent(strings.add_local_exists);});- it("lists folders under the computer they belong to, with that computer's state", () => {+ it("names the computer each folder belongs to, with that computer's state", async () => {state.runtimes = [runtime("daemon-1", "macbook.local", "online"),runtime("daemon-2", "studio-pc.local", "offline"),@@ -162,12 +194,28 @@ describe("ProjectResourcesSection — local folders", () => {state.resources = [folder("server-checkout", "daemon-2")];renderWithI18n(<ProjectResourcesSection projectId="p1" />);- expect(screen.getByText("studio-pc.local")).toBeInTheDocument();- expect(screen.getByText(`· ${strings.local_offline}`)).toBeInTheDocument();- expect(screen.getByText("server-checkout")).toBeInTheDocument();- // This computer has no folder yet, so it shows the slot to choose one.- expect(screen.getByText(strings.local_this_computer)).toBeInTheDocument();- expect(screen.getByRole("button", { name: strings.local_pick })).toBeEnabled();+ const row = screen.getByText("server-checkout").closest("[data-resource-row]") as HTMLElement;+ expect(within(row).getByText("studio-pc.local")).toBeInTheDocument();+ expect(within(row).getByText(strings.local_offline)).toBeInTheDocument();+ // This computer has no folder yet, so the Add menu offers one.+ const item = await openAddMenu();+ expect(item).not.toHaveAttribute("aria-disabled", "true");+ expect(item).toHaveTextContent(strings.add_local_hint);+ });++ it("marks this computer's folder and lists it first", () => {+ state.runtimes = [+ runtime("daemon-1", "macbook.local", "online"),+ runtime("daemon-2", "studio-pc.local", "online"),+ ];+ state.resources = [folder("server-checkout", "daemon-2"), folder("game-client", "daemon-1")];+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);++ const rows = document.querySelectorAll("[data-resource-row]");+ expect(rows[0]).toHaveTextContent("game-client");+ expect(within(rows[0] as HTMLElement).getByText(strings.local_this_computer)).toBeInTheDocument();+ expect(rows[1]).toHaveTextContent("server-checkout");+ expect(within(rows[1] as HTMLElement).queryByText(strings.local_offline)).not.toBeInTheDocument();});it("falls back to a generic name for a computer with no registered runtime", () => {@@ -178,7 +226,7 @@ describe("ProjectResourcesSection — local folders", () => {// Picking needs this machine's daemon, so web cannot add a folder; editing// one only rewrites the resource, so that stays available.- it("lets web edit existing folders but not add one", () => {+ it("lets web edit existing folders but not add one", async () => {state.desktop = false;state.daemon = { daemonId: null, deviceName: null, running: false };state.runtimes = [runtime("daemon-2", "studio-pc.local", "online")];@@ -186,13 +234,15 @@ describe("ProjectResourcesSection — local folders", () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);expect(screen.getByText("studio-pc.local")).toBeInTheDocument();- expect(screen.queryByText(`· ${strings.local_offline}`)).not.toBeInTheDocument();- expect(screen.queryByRole("button", { name: strings.local_pick })).not.toBeInTheDocument();+ expect(screen.queryByText(strings.local_offline)).not.toBeInTheDocument();expect(screen.getByRole("button", { name: strings.mode_badge_worktree })).toBeInTheDocument();- expect(screen.getByRole("button", { name: strings.remove_tooltip })).toBeInTheDocument();+ expect(screen.getByRole("button", { name: "Actions for server-checkout" })).toBeInTheDocument();+ const item = await openAddMenu();+ expect(item).toHaveAttribute("aria-disabled", "true");+ expect(item).toHaveTextContent(strings.add_local_desktop_only);});- it("lists folders read-only, with no slot on this computer and nothing to change", () => {+ it("lists folders read-only, with nothing to add or change", () => {state.resources = [folder("game-client", "daemon-1"), folder("server-checkout", "daemon-2")];renderWithI18n(<ProjectResourcesSection projectId="p1" readOnly />);@@ -200,35 +250,37 @@ describe("ProjectResourcesSection — local folders", () => {expect(screen.getByText("server-checkout")).toBeInTheDocument();expect(screen.getAllByText(strings.mode_badge_worktree)).toHaveLength(2);expect(screen.queryByRole("button", { name: strings.mode_badge_worktree })).not.toBeInTheDocument();- expect(screen.queryByRole("button", { name: strings.remove_tooltip })).not.toBeInTheDocument();+ expect(screen.queryByRole("button", { name: /^Actions for/ })).not.toBeInTheDocument();+ expect(screen.queryByRole("button", { name: strings.add })).not.toBeInTheDocument();});- it("shows no local folders read-only when there are none, even on desktop", () => {+ it("says there is nothing yet, read-only, without offering to add", () => {renderWithI18n(<ProjectResourcesSection projectId="p1" readOnly />);- expect(screen.queryByText(strings.local_group)).not.toBeInTheDocument();- expect(screen.queryByRole("button", { name: strings.local_pick })).not.toBeInTheDocument();+ expect(screen.getByText(strings.empty_read_only)).toBeInTheDocument();+ expect(screen.queryByRole("button", { name: strings.add })).not.toBeInTheDocument();});- it("asks to start the daemon before a folder can be chosen", () => {+ it("asks to start the daemon before a folder can be chosen", async () => {state.daemon = { daemonId: null, deviceName: "MacBook", running: false };renderWithI18n(<ProjectResourcesSection projectId="p1" />);- expect(screen.getByText(strings.local_daemon_offline_hint)).toBeInTheDocument();- expect(screen.getByRole("button", { name: strings.local_pick })).toBeDisabled();+ const item = await openAddMenu();+ expect(item).toHaveAttribute("aria-disabled", "true");+ expect(item).toHaveTextContent(strings.local_daemon_offline_hint);});// The mode is part of what the user is choosing — whether tasks edit this// folder or hand back a branch — so it is asked before anything is created.- it("asks for the mode in place and creates the folder with it", async () => {+ it("asks for the mode in a dialog and creates the folder with it", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- pickFolder(true);+ const dialog = await pickFolder(true);- expect(await screen.findByText("/Users/dev/work/game-client")).toBeInTheDocument();- const [direct, parallel] = screen.getAllByRole("radio");+ expect(within(dialog).getByText("/Users/dev/work/game-client")).toBeInTheDocument();+ const [direct, parallel] = within(dialog).getAllByRole("radio");expect(parallel).toHaveAttribute("aria-checked", "true");expect(state.createMock).not.toHaveBeenCalled();fireEvent.click(direct!);- fireEvent.click(screen.getByRole("button", { name: strings.mode_add }));+ fireEvent.click(within(dialog).getByRole("button", { name: strings.mode_add }));await waitFor(() =>expect(state.createMock).toHaveBeenCalledWith({@@ -246,31 +298,46 @@ describe("ProjectResourcesSection — local folders", () => {it("keeps the picked folder on screen with the server's reason when adding fails", async () => {state.createMock.mockRejectedValueOnce(new Error("this computer already has a folder"));renderWithI18n(<ProjectResourcesSection projectId="p1" />);- pickFolder(true);+ const dialog = await pickFolder(true);- fireEvent.click(await screen.findByRole("button", { name: strings.mode_add }));+ fireEvent.click(within(dialog).getByRole("button", { name: strings.mode_add }));- expect(await screen.findByText("this computer already has a folder")).toBeInTheDocument();- expect(screen.getByText("/Users/dev/work/game-client")).toBeInTheDocument();+ expect(await within(dialog).findByText("this computer already has a folder")).toBeInTheDocument();+ expect(within(dialog).getByText("/Users/dev/work/game-client")).toBeInTheDocument();+ });++ it("swaps the picked folder for another one from the dialog", async () => {+ renderWithI18n(<ProjectResourcesSection projectId="p1" />);+ const dialog = await pickFolder(true);++ state.pickDirectory.mockResolvedValueOnce({+ ok: true,+ path: "/Users/dev/work/notes",+ basename: "notes",+ });+ state.validateLocalDirectory.mockResolvedValueOnce({ ok: true, is_git_repo: false });+ fireEvent.click(within(dialog).getByRole("button", { name: strings.local_dialog_change }));++ expect(await within(dialog).findByText("/Users/dev/work/notes")).toBeInTheDocument();+ expect(within(dialog).getAllByRole("radio")[0]).toHaveAttribute("aria-checked", "true");});it("starts a non-git folder on direct editing, with parallel closed", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- pickFolder(false);+ const dialog = await pickFolder(false);- await screen.findByText("/Users/dev/work/game-client");- const [direct, parallel] = screen.getAllByRole("radio");+ const [direct, parallel] = within(dialog).getAllByRole("radio");expect(direct).toHaveAttribute("aria-checked", "true");expect(parallel).toBeDisabled();});- it("returns to the slot when the picked folder is cancelled", async () => {+ it("creates nothing when the picked folder is cancelled", async () => {renderWithI18n(<ProjectResourcesSection projectId="p1" />);- pickFolder(true);+ const dialog = await pickFolder(true);- fireEvent.click(await screen.findByRole("button", { name: strings.mode_cancel }));+ fireEvent.click(within(dialog).getByRole("button", { name: strings.mode_cancel }));- expect(screen.getByRole("button", { name: strings.local_pick })).toBeInTheDocument();+ await waitFor(() => expect(screen.queryByRole("dialog")).not.toBeInTheDocument());expect(state.createMock).not.toHaveBeenCalled();});diff --git a/packages/views/projects/components/project-resources-section.tsx b/packages/views/projects/components/project-resources-section.tsxindex 6bfdd907e2..9553f11f9e 100644--- a/packages/views/projects/components/project-resources-section.tsx+++ b/packages/views/projects/components/project-resources-section.tsx@@ -1,14 +1,16 @@"use client";-import { useMemo, useState } from "react";+import { useMemo, useRef, useState } from "react";import { useQuery } from "@tanstack/react-query";import {+ Copy,FolderGit,FolderOpen,GitBranch,Laptop,Link2,Monitor,+ MoreHorizontal,Pencil,Plus,Search,@@ -39,6 +41,21 @@ import {import { useConfigStore } from "@multica/core/config";import { Button } from "@multica/ui/components/ui/button";import { Spinner } from "@multica/ui/components/ui/spinner";+import {+ Dialog,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+} from "@multica/ui/components/ui/dialog";+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuSeparator,+ DropdownMenuTrigger,+} from "@multica/ui/components/ui/dropdown-menu";import {Popover,PopoverContent,@@ -51,6 +68,7 @@ import {} from "@multica/ui/components/ui/tooltip";import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";import { IconButton } from "@multica/ui/components/common/icon-button";+import { copyText } from "@multica/ui/lib/clipboard";import { cn } from "@multica/ui/lib/utils";import {isDesktopShell,@@ -66,19 +84,29 @@ import {} from "./local-directory-mode-options";import { GithubRefField, githubRefHasError } from "./github-ref-field";import { localDirectoryLabel } from "./local-directory-label";-import { buildRuntimeMachines } from "../../runtimes/components/runtime-machines";+import {+ buildRuntimeMachines,+ type RuntimeMachine,+} from "../../runtimes/components/runtime-machines";import { useT } from "../../i18n";import { githubShortLabel } from "../../common/github-url";-import { ObjectSection, ObjectSectionCard } from "../../layout/object-page";+import {+ ObjectSection,+ ObjectSectionAction,+ ObjectSectionCard,+ ObjectSectionEmpty,+} from "../../layout/object-page";// Project Resources section of the project page.//-// Grouped by what a resource applies to: repositories apply to every run on-// every machine, while a local folder only applies to runs on the one machine-// it is pinned to (at most one per machine). Add a new resource_type by:+// One list, one Add menu. Repositories apply to every run on every machine,+// while a local folder only applies to runs on the one machine it is pinned to+// (at most one per machine), so a folder row names its machine. Add a new+// resource_type by:// (1) extending the server validator// (2) extending ProjectResourceType in @multica/core/types-// (3) giving it a group here; unknown types fall through to a plain row+// (3) giving it a row and an Add menu entry here; unknown types fall+// through to a plain rowtype GithubResource = ProjectResource & { resource_ref: GithubRepoResourceRef };type LocalDirectoryResource = ProjectResource & {resource_ref: LocalDirectoryResourceRef;@@ -134,6 +162,7 @@ const chipClassName = cn("transition-colors hover:bg-surface-selected hover:text-foreground data-[popup-open]:bg-surface-selected data-[popup-open]:text-foreground",);+export function ProjectResourcesSection({projectId,readOnly = false,@@ -144,6 +173,7 @@ export function ProjectResourcesSection({}) {const { t } = useT("projects");const wsId = useWorkspaceId();+ const workspace = useCurrentWorkspace();const { data: resources = [] } = useQuery(projectResourcesOptions(wsId, projectId),);@@ -157,197 +187,680 @@ export function ProjectResourcesSection({// still lists existing folders, and changing their mode or removing them// only rewrites the resource, which works from anywhere.const desktopMode = isDesktopShell();+ const canAddFolder = desktopMode && !readOnly;++ const daemonStatus = useLocalDaemonStatus();+ const localDaemonId = daemonStatus.daemonId;+ // Runtimes only name the machines folders live on, so a project without+ // folders (and a guest who cannot add one) never asks for them.+ const { data: runtimes = [] } = useQuery({+ ...runtimeListOptions(wsId),+ enabled: folders.length > 0 || canAddFolder,+ });+ // Whether this server checks execution_mode on save at all. One declared+ // boolean, no inference — servers that predate it drop execution_mode and+ // answer 201.+ const serverValidatesWorktree = useConfigStore(+ (state) => state.localWorktreeSupported,+ );+ // Machine names and liveness come from the runtimes each daemon registers,+ // titled the same way as the runtimes page.+ const machines = useMemo(+ () =>+ buildRuntimeMachines(runtimes, {+ now: Date.now(),+ localDaemonId,+ localMachineName: daemonStatus.deviceName,+ }),+ [runtimes, localDaemonId, daemonStatus.deviceName],+ );+ const currentMachineTitle =+ (localDaemonId ? machines.find((m) => m.daemonId === localDaemonId)?.title : undefined) ??+ daemonStatus.deviceName ??+ undefined;++ const isCurrent = (folder: LocalDirectoryResource) =>+ desktopMode && localDaemonId !== null && folder.resource_ref.daemon_id === localDaemonId;+ // This computer's folder first: it is the one that applies to runs here.+ const orderedFolders = [...folders.filter(isCurrent), ...folders.filter((f) => !isCurrent(f))];+ const hasCurrentFolder = orderedFolders.some(isCurrent);return (- <ObjectSection collapsible title={t(($) => $.resources.section_header)}>- <ObjectSectionCard>- <div className="px-3 py-2.5">- <RepositoryGroup wsId={wsId} projectId={projectId} repos={repos} readOnly={readOnly} />- </div>- {((desktopMode && !readOnly) || folders.length > 0) && (- <div className="px-3 py-2.5">- <LocalFolderGroup- wsId={wsId}- projectId={projectId}- folders={folders}- desktopMode={desktopMode}+ <ObjectSection+ collapsible+ title={t(($) => $.resources.section_header)}+ count={resources.length > 0 ? resources.length : undefined}+ action={+ readOnly ? undefined : (+ <AddResourceMenu+ wsId={wsId}+ projectId={projectId}+ attachedUrls={new Set(repos.map((r) => r.resource_ref.url))}+ workspaceRepos={workspace?.repos ?? []}+ canAddFolder={canAddFolder}+ hasCurrentFolder={hasCurrentFolder}+ daemonStatus={daemonStatus}+ runtimes={runtimes}+ serverValidatesWorktree={serverValidatesWorktree}+ />+ )+ }+ >+ {resources.length === 0 ? (+ <ObjectSectionEmpty+ icon={FolderGit}+ description={+ readOnly+ ? t(($) => $.resources.empty_read_only)+ : t(($) => $.resources.empty)+ }+ />+ ) : (+ <ObjectSectionCard>+ {repos.map((resource) => (+ <GithubRepoRow+ key={resource.id}+ resource={resource}+ description={+ workspace?.repos?.find((repo) => repo.url === resource.resource_ref.url)+ ?.description+ }readOnly={readOnly}/>- </div>- )}- {others.length > 0 && (- <div className="space-y-1.5 px-3 py-2.5">- {others.map((resource) => (- <UnknownResourceRow key={resource.id} resource={resource} readOnly={readOnly} />- ))}- </div>- )}- </ObjectSectionCard>+ ))}+ {orderedFolders.map((folder) => (+ <LocalFolderRow+ key={folder.id}+ resource={folder}+ current={isCurrent(folder)}+ currentMachineTitle={currentMachineTitle}+ machine={machines.find((m) => m.daemonId === folder.resource_ref.daemon_id)}+ serverValidatesWorktree={serverValidatesWorktree}+ readOnly={readOnly}+ />+ ))}+ {others.map((resource) => (+ <UnknownResourceRow key={resource.id} resource={resource} readOnly={readOnly} />+ ))}+ </ObjectSectionCard>+ )}</ObjectSection>);}-function GroupHeader({- label,- action,-}: {+// ---------------------------------------------------------------------------+// Adding++type PendingFolder = {+ path: string;label: string;- action?: React.ReactNode;+ mode: LocalDirectoryExecutionMode;+ /** undefined = unknown (older desktop build); treated as "cannot verify". */+ isGitRepo: boolean | undefined;+};++/**+ * The section's one Add entry. A repository is searched or pasted in a+ * popover anchored to the same button; a folder goes through the system+ * picker and then a dialog that asks for the execution mode before anything+ * is created — it is part of what the user is choosing (whether tasks edit+ * this folder or hand back a branch), not a setting to discover afterwards.+ */+function AddResourceMenu({+ wsId,+ projectId,+ attachedUrls,+ workspaceRepos,+ canAddFolder,+ hasCurrentFolder,+ daemonStatus,+ runtimes,+ serverValidatesWorktree,+}: {+ wsId: string;+ projectId: string;+ attachedUrls: Set<string>;+ workspaceRepos: { url: string; description?: string | null }[];+ canAddFolder: boolean;+ hasCurrentFolder: boolean;+ daemonStatus: LocalDaemonStatus;+ runtimes: AgentRuntime[];+ serverValidatesWorktree: boolean;}) {+ const { t } = useT("projects");+ const createResource = useCreateProjectResource(wsId, projectId);+ const [anchor, setAnchor] = useState<HTMLButtonElement | null>(null);+ const [repoOpen, setRepoOpen] = useState(false);+ // The menu hands focus back to its trigger as it closes, which would pull+ // focus out of the repository popover opening in its place.+ const openingRepo = useRef(false);+ const [picking, setPicking] = useState(false);+ const [pending, setPending] = useState<PendingFolder | null>(null);+ const [saving, setSaving] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const daemonId = daemonStatus.daemonId;+ const daemonReady = daemonStatus.running && daemonId !== null;++ // The server allows one folder per computer, so the entry explains why it+ // is unavailable rather than disappearing.+ const folderBlocker = !canAddFolder+ ? t(($) => $.resources.add_local_desktop_only)+ : !daemonReady+ ? t(($) => $.resources.local_daemon_offline_hint)+ : hasCurrentFolder+ ? t(($) => $.resources.add_local_exists)+ : null;++ const attachRepo = async (url: string, ref?: string) => {+ try {+ await createResource.mutateAsync({+ resource_type: "github_repo",+ // Omit the key entirely when empty rather than sending "": an absent+ // ref is what "use the default branch" looks like on the wire.+ resource_ref: ref ? { url, ref } : { url },+ });+ toast.success(t(($) => $.resources.toast_attached));+ setRepoOpen(false);+ } catch (err) {+ toast.error(errorMessage(err, t(($) => $.resources.toast_attach_failed)));+ }+ };++ const pickFolder = async () => {+ if (picking || !daemonReady) return;+ setPicking(true);+ try {+ const picked = await pickDirectory();+ if (!picked.ok) {+ if (picked.reason && picked.reason !== "cancelled") {+ toast.error(picked.error ?? t(($) => $.resources.toast_local_pick_failed));+ }+ return;+ }+ const path = picked.path ?? "";+ const validation = await validateLocalDirectory(path);+ if (!validation.ok) {+ toast.error(+ localValidationMessage(validation, {+ not_absolute: t(($) => $.resources.local_validate_not_absolute),+ not_found: t(($) => $.resources.local_validate_not_found),+ not_a_directory: t(($) => $.resources.local_validate_not_a_directory),+ not_readable: t(($) => $.resources.local_validate_not_readable),+ not_writable: t(($) => $.resources.local_validate_not_writable),+ unsupported: t(($) => $.resources.local_validate_unsupported),+ fallback: t(($) => $.resources.toast_local_pick_failed),+ }),+ );+ return;+ }+ setError(null);+ setPending({+ path,+ label: picked.basename ?? path,+ // Same preselection rule as the create-project flow: a git repo this+ // daemon can actually run worktree mode on starts on parallel,+ // anything else starts on direct. The user still confirms.+ mode:+ validation.is_git_repo === true &&+ serverValidatesWorktree &&+ runtimeAdvertisesLocalWorktree(runtimes, daemonId)+ ? "worktree"+ : "in_place",+ isGitRepo: validation.is_git_repo,+ });+ } catch (err) {+ toast.error(errorMessage(err, t(($) => $.resources.toast_local_pick_failed)));+ } finally {+ setPicking(false);+ }+ };++ const addFolder = async () => {+ if (!pending || !daemonId || saving) return;+ setSaving(true);+ setError(null);+ try {+ await createResource.mutateAsync({+ resource_type: "local_directory",+ resource_ref: {+ local_path: pending.path,+ daemon_id: daemonId,+ label: pending.label,+ execution_mode: pending.mode,+ },+ });+ toast.success(t(($) => $.resources.toast_local_attached));+ setPending(null);+ } catch (err) {+ // Keep the choice on screen: the likely failures (the one-per-machine+ // conflict, the daemon-version gate) are things the user acts on here.+ setError(errorMessage(err, t(($) => $.resources.toast_attach_failed)));+ } finally {+ setSaving(false);+ }+ };+return (- <div className="flex h-6 items-center gap-1 text-micro font-medium text-muted-foreground">- <span className="truncate">{label}</span>- {action && <span className="ml-auto">{action}</span>}- </div>+ <>+ <DropdownMenu>+ <DropdownMenuTrigger+ ref={setAnchor}+ render={<ObjectSectionAction icon={Plus} disabled={picking} />}+ >+ {t(($) => $.resources.add)}+ </DropdownMenuTrigger>+ <DropdownMenuContent+ align="end"+ className="w-72"+ finalFocus={() => {+ const skip = openingRepo.current;+ openingRepo.current = false;+ return !skip;+ }}+ >+ <AddMenuItem+ icon={<FolderGit />}+ title={t(($) => $.resources.add_repo)}+ hint={t(($) => $.resources.add_repo_hint)}+ onClick={() => {+ openingRepo.current = true;+ setRepoOpen(true);+ }}+ />+ <AddMenuItem+ icon={<FolderOpen />}+ title={t(($) => $.resources.add_local)}+ hint={folderBlocker ?? t(($) => $.resources.add_local_hint)}+ disabled={folderBlocker !== null}+ onClick={() => void pickFolder()}+ />+ </DropdownMenuContent>+ </DropdownMenu>+ <Popover open={repoOpen} onOpenChange={setRepoOpen}>+ <PopoverContent anchor={anchor} align="end" className="w-72 p-2">+ <AddRepositoryPanel+ workspaceRepos={workspaceRepos}+ attachedUrls={attachedUrls}+ busy={createResource.isPending}+ onAttach={attachRepo}+ />+ </PopoverContent>+ </Popover>+ <Dialog+ open={pending !== null}+ onOpenChange={(open) => {+ if (!open && !saving) setPending(null);+ }}+ >+ {pending && (+ <DialogContent className="sm:max-w-md">+ <DialogHeader>+ <DialogTitle>{t(($) => $.resources.local_dialog_title)}</DialogTitle>+ <DialogDescription>+ {t(($) => $.resources.local_dialog_description)}+ </DialogDescription>+ </DialogHeader>+ <div className="flex items-center gap-2 rounded-lg border py-2 pr-1.5 pl-2.5">+ <FolderOpen className="size-4 shrink-0 text-muted-foreground" />+ <div className="min-w-0 flex-1">+ <div className="truncate text-body font-medium">{pending.label}</div>+ <div className="break-all font-mono text-micro text-muted-foreground">+ {pending.path}+ </div>+ </div>+ <Button+ variant="ghost"+ size="xs"+ disabled={picking || saving}+ onClick={() => void pickFolder()}+ >+ {t(($) => $.resources.local_dialog_change)}+ </Button>+ </div>+ <div className="space-y-1.5">+ <div className="text-caption font-medium text-muted-foreground">+ {t(($) => $.resources.local_dialog_mode_label)}+ </div>+ <LocalDirectoryModeOptions+ value={pending.mode}+ onChange={(mode) => setPending({ ...pending, mode })}+ unavailableReason={worktreeUnavailableReason(+ pending.isGitRepo,+ serverValidatesWorktree,+ )}+ />+ </div>+ {error && <InlineError message={error} />}+ <DialogFooter>+ <Button+ variant="outline"+ size="sm"+ onClick={() => setPending(null)}+ disabled={saving}+ >+ {t(($) => $.resources.mode_cancel)}+ </Button>+ <Button+ size="sm"+ onClick={() => void addFolder()}+ disabled={saving}+ aria-busy={saving}+ >+ {t(($) => $.resources.mode_add)}+ </Button>+ </DialogFooter>+ </DialogContent>+ )}+ </Dialog>+ </>);}-function InlineError({ message }: { message: string }) {+function AddMenuItem({+ icon,+ title,+ hint,+ disabled,+ onClick,+}: {+ icon: React.ReactNode;+ title: string;+ hint: string;+ disabled?: boolean;+ onClick: () => void;+}) {return (- <div className="flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-2.5 py-1.5 text-caption text-destructive">- <TriangleAlert className="size-3.5 mt-0.5 shrink-0" />- <span className="min-w-0 break-words">{message}</span>- </div>+ <DropdownMenuItem+ disabled={disabled}+ onClick={onClick}+ className="items-start [&_svg]:mt-0.5"+ >+ {icon}+ <span className="min-w-0">+ <span className="block">{title}</span>+ <span className="block text-caption text-muted-foreground">{hint}</span>+ </span>+ </DropdownMenuItem>);}-function useRemoveResource(resource: ProjectResource) {- const { t } = useT("projects");- const deleteResource = useDeleteProjectResource(- resource.workspace_id,- resource.project_id,+// ---------------------------------------------------------------------------+// Rows++function ResourceRow({+ icon: Icon,+ dim = false,+ name,+ chip,+ aside,+ menu,+}: {+ icon: typeof FolderGit;+ dim?: boolean;+ name: React.ReactNode;+ chip?: React.ReactNode;+ aside?: React.ReactNode;+ menu?: React.ReactNode;+}) {+ return (+ <div+ data-resource-row=""+ className={cn(+ "group/resource flex min-h-11 items-center gap-3 py-1.5 pr-2 pl-3 text-body",+ dim && "opacity-60",+ )}+ >+ <Icon className="size-4 shrink-0 text-muted-foreground" />+ <div className="flex min-w-0 items-center gap-2">+ {name}+ {chip}+ </div>+ {/* Zero basis: takes only what the name leaves, so the name never truncates first.+ Safe alignment clips overflow on the right instead of spilling over the chip. */}+ <div className="flex min-w-0 flex-1 items-center justify-end-safe gap-1 overflow-hidden text-caption text-muted-foreground">+ {aside}+ </div>+ {menu ?? <span aria-hidden="true" className="size-6 shrink-0" />}+ </div>);- const remove = async () => {- if (deleteResource.isPending) return;- try {- await deleteResource.mutateAsync(resource.id);- toast.success(t(($) => $.resources.toast_removed));- } catch (err) {- toast.error(errorMessage(err, t(($) => $.resources.toast_remove_failed)));- }- };- return { remove, removing: deleteResource.isPending };}-function RemoveButton({- onRemove,- removing,- alwaysVisible = false,+/** A row's ⋯ menu: one secondary action, then Remove. */+function ResourceRowMenu({+ resource,+ name,+ copyLabel,+ copyValue,}: {- onRemove: () => void;- removing: boolean;- alwaysVisible?: boolean;+ resource: ProjectResource;+ name: string;+ copyLabel: string;+ copyValue: string;}) {const { t } = useT("projects");+ const { remove, removing } = useRemoveResource(resource);+ const copy = async () => {+ if (await copyText(copyValue)) toast.success(t(($) => $.resources.toast_copied));+ };return (- <TooltipHint label={t(($) => $.resources.remove_tooltip)}>- <button- type="button"- onClick={onRemove}- disabled={removing}- aria-busy={removing}- className={cn(- "shrink-0 rounded-sm p-0.5 transition-opacity hover:bg-accent",- !alwaysVisible &&- "opacity-0 group-hover:opacity-100 focus-visible:opacity-100 disabled:opacity-100",- )}- aria-label={t(($) => $.resources.remove_tooltip)}+ <DropdownMenu>+ <DropdownMenuTrigger+ render={+ <IconButton+ label={t(($) => $.resources.row_menu, { name })}+ size="icon-xs"+ disabled={removing}+ aria-busy={removing}+ className={cn(+ "text-muted-foreground",+ !removing &&+ "opacity-0 group-hover/resource:opacity-100 focus-visible:opacity-100 data-[popup-open]:opacity-100 [@media(pointer:coarse)]:opacity-100",+ )}+ />+ }>- {removing ? (- <Spinner className="size-3" aria-hidden="true" />- ) : (- <Trash2 className="size-3 text-muted-foreground" />- )}- </button>- </TooltipHint>+ {removing ? <Spinner className="size-3" aria-hidden="true" /> : <MoreHorizontal />}+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end" className="w-auto min-w-40">+ <DropdownMenuItem onClick={() => void copy()}>+ <Copy className="size-3.5" />+ {copyLabel}+ </DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuItem variant="destructive" onClick={() => void remove()}>+ <Trash2 className="size-3.5" />+ {t(($) => $.resources.remove_tooltip)}+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>);}-// ----------------------------------------------------------------------------// Repositories--function RepositoryGroup({- wsId,- projectId,- repos,+function GithubRepoRow({+ resource,+ description,readOnly,}: {- wsId: string;- projectId: string;- repos: GithubResource[];+ resource: GithubResource;+ description?: string | null;readOnly: boolean;}) {const { t } = useT("projects");- const workspace = useCurrentWorkspace();- const createResource = useCreateProjectResource(wsId, projectId);- const [addOpen, setAddOpen] = useState(false);- const attachedUrls = new Set(repos.map((r) => r.resource_ref.url));+ const ref = resource.resource_ref;+ const display = resource.label || githubShortLabel(ref.url);+ // Workspace repository descriptions are source-of-truth metadata. They stay+ // live here rather than being copied into the resource label, while an+ // explicit resource label remains the user's preferred primary text.+ const liveDescription = resource.label ? undefined : description?.trim();- const handleAttach = async (url: string, ref?: string) => {- try {- await createResource.mutateAsync({- resource_type: "github_repo",- // Omit the key entirely when empty rather than sending "": an absent- // ref is what "use the default branch" looks like on the wire.- resource_ref: ref ? { url, ref } : { url },- });- toast.success(t(($) => $.resources.toast_attached));- setAddOpen(false);- } catch (err) {- toast.error(errorMessage(err, t(($) => $.resources.toast_attach_failed)));- }- };+ return (+ <ResourceRow+ icon={FolderGit}+ name={+ <Tooltip>+ <TooltipTrigger+ render={+ <a+ href={ref.url}+ target="_blank"+ rel="noopener noreferrer"+ className="min-w-0 truncate font-medium hover:underline"+ >+ {display}+ </a>+ }+ />+ <TooltipContent side="top">{ref.url}</TooltipContent>+ </Tooltip>+ }+ chip={<GithubRefChip resource={resource} readOnly={readOnly} />}+ aside={liveDescription ? <span className="truncate">{liveDescription}</span> : undefined}+ menu={+ readOnly ? undefined : (+ <ResourceRowMenu+ resource={resource}+ name={display}+ copyLabel={t(($) => $.resources.copy_url)}+ copyValue={ref.url}+ />+ )+ }+ />+ );+}++function LocalFolderRow({+ resource,+ current,+ currentMachineTitle,+ machine,+ serverValidatesWorktree,+ readOnly,+}: {+ resource: LocalDirectoryResource;+ current: boolean;+ currentMachineTitle?: string;+ machine?: RuntimeMachine;+ serverValidatesWorktree: boolean;+ readOnly: boolean;+}) {+ const { t } = useT("projects");+ // The name is the folder's own (or whatever a label update stored); there is+ // deliberately no rename. A folder is identified by its path (MUL-7525).+ const display = localDirectoryLabel(resource);+ const path = resource.resource_ref.local_path;+ const MachineIcon = current ? Laptop : Monitor;+ const machineTitle = current+ ? currentMachineTitle+ : (machine?.title ?? t(($) => $.resources.local_unknown_computer));+ const machineNote = current+ ? t(($) => $.resources.local_this_computer)+ : machine !== undefined && machine.health !== "online"+ ? t(($) => $.resources.local_offline)+ : undefined;return (- <div className="space-y-1.5">- <GroupHeader- label={t(($) => $.resources.repos_group)}- action={- readOnly ? undefined : (- <Popover open={addOpen} onOpenChange={setAddOpen}>- <PopoverTrigger- render={- <IconButton- size="icon-xs"- label={t(($) => $.resources.repos_add)}- >- <Plus />- </IconButton>- }- />- <PopoverContent align="end" className="w-72 p-2">- <AddRepositoryPanel- workspaceRepos={workspace?.repos ?? []}- attachedUrls={attachedUrls}- busy={createResource.isPending}- onAttach={handleAttach}- />- </PopoverContent>- </Popover>- )- }- />- {repos.length === 0 ? (- <p className="text-caption text-muted-foreground">- {t(($) => $.resources.repos_empty)}- </p>- ) : (- repos.map((resource) => (- <GithubRepoRow- key={resource.id}+ // Folders on other machines are de-emphasised but stay editable: dropping+ // or reconfiguring a stale registration only rewrites the resource, which+ // works from any device.+ <ResourceRow+ icon={FolderOpen}+ dim={!current}+ name={+ <Tooltip>+ <TooltipTrigger+ render={<span className="min-w-0 truncate font-medium">{display}</span>}+ />+ <TooltipContent side="top">+ <span className="font-mono text-micro">{path}</span>+ </TooltipContent>+ </Tooltip>+ }+ chip={+ <ExecutionModeChip+ resource={resource}+ serverValidatesWorktree={serverValidatesWorktree}+ readOnly={readOnly}+ />+ }+ aside={+ <>+ <MachineIcon className="size-3 shrink-0" />+ {machineTitle && <span className="truncate">{machineTitle}</span>}+ {machineTitle && machineNote && <span aria-hidden="true">·</span>}+ {machineNote && <span className="shrink-0">{machineNote}</span>}+ </>+ }+ menu={+ readOnly ? undefined : (+ <ResourceRowMenuresource={resource}- description={- workspace?.repos?.find((repo) => repo.url === resource.resource_ref.url)- ?.description- }- readOnly={readOnly}+ name={display}+ copyLabel={t(($) => $.resources.copy_path)}+ copyValue={path}/>- ))- )}+ )+ }+ />+ );+}++function UnknownResourceRow({ resource, readOnly }: { resource: ProjectResource; readOnly: boolean }) {+ const { remove, removing } = useRemoveResource(resource);+ const { t } = useT("projects");+ return (+ <ResourceRow+ icon={FolderGit}+ name={+ <span className="min-w-0 truncate text-muted-foreground">+ {resource.label || resource.resource_type}+ </span>+ }+ menu={+ readOnly ? undefined : (+ <IconButton+ label={t(($) => $.resources.remove_tooltip)}+ size="icon-xs"+ className="text-muted-foreground"+ disabled={removing}+ aria-busy={removing}+ onClick={() => void remove()}+ >+ {removing ? <Spinner className="size-3" aria-hidden="true" /> : <Trash2 />}+ </IconButton>+ )+ }+ />+ );+}++function InlineError({ message }: { message: string }) {+ return (+ <div className="flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-2.5 py-1.5 text-caption text-destructive">+ <TriangleAlert className="size-3.5 mt-0.5 shrink-0" />+ <span className="min-w-0 break-words">{message}</span></div>);}+function useRemoveResource(resource: ProjectResource) {+ const { t } = useT("projects");+ const deleteResource = useDeleteProjectResource(+ resource.workspace_id,+ resource.project_id,+ );+ const remove = async () => {+ if (deleteResource.isPending) return;+ try {+ await deleteResource.mutateAsync(resource.id);+ toast.success(t(($) => $.resources.toast_removed));+ } catch (err) {+ toast.error(errorMessage(err, t(($) => $.resources.toast_remove_failed)));+ }+ };+ return { remove, removing: deleteResource.isPending };+}+/*** One field for both ways of adding a repository: typing filters the* workspace's repositories, and a pasted clone URL turns the panel into an@@ -480,86 +993,34 @@ function AddRepositoryPanel({<TooltipTriggerrender={<span className="block truncate">- {githubShortLabel(repo.url)}- </span>- }- />- <TooltipContent side="top">{repo.url}</TooltipContent>- </Tooltip>- {repo.description?.trim() && (- <span className="block truncate text-micro text-muted-foreground">- {repo.description.trim()}- </span>- )}- </span>- {isAttached && (- <span className="text-micro text-muted-foreground">- {t(($) => $.resources.attached_badge)}- </span>- )}- </button>- );- })}- </div>- )- )}- </div>- );-}--function GithubRepoRow({- resource,- description,- readOnly,-}: {- resource: GithubResource;- description?: string | null;- readOnly: boolean;-}) {- const { remove, removing } = useRemoveResource(resource);- const ref = resource.resource_ref;- const display = resource.label || githubShortLabel(ref.url);- // Workspace repository descriptions are source-of-truth metadata. They stay- // live here rather than being copied into the resource label, while an- // explicit resource label remains the user's preferred primary text.- const liveDescription = resource.label ? undefined : description?.trim();-- return (- <div className="group text-caption">- <div className="flex items-center gap-2">- <FolderGit className="size-3.5 shrink-0 text-muted-foreground" />- <Tooltip>- <TooltipTrigger- render={- <a- href={ref.url}- target="_blank"- rel="noopener noreferrer"- className="min-w-0 flex-1 truncate hover:underline"- >- {display}- </a>- }- />- <TooltipContent side="top">{ref.url}</TooltipContent>- </Tooltip>- {!readOnly && <RemoveButton onRemove={remove} removing={removing} />}- </div>- {/* The branch gets its own line rather than a badge beside the name: a- custom label takes the name slot, and this panel is narrow enough- that an inline badge truncates the repository away. */}- <div className="flex min-w-0 items-center gap-1.5 pl-[1.375rem] pt-0.5">- <GithubRefChip resource={resource} readOnly={readOnly} />- {liveDescription && (- <span className="min-w-0 truncate text-micro text-muted-foreground">- {liveDescription}- </span>- )}- </div>+ {githubShortLabel(repo.url)}+ </span>+ }+ />+ <TooltipContent side="top">{repo.url}</TooltipContent>+ </Tooltip>+ {repo.description?.trim() && (+ <span className="block truncate text-micro text-muted-foreground">+ {repo.description.trim()}+ </span>+ )}+ </span>+ {isAttached && (+ <span className="text-micro text-muted-foreground">+ {t(($) => $.resources.attached_badge)}+ </span>+ )}+ </button>+ );+ })}+ </div>+ )+ )}</div>);}+/*** The branch a repository's tasks start from, editable in place.*@@ -683,193 +1144,6 @@ function GithubRefChip({ resource, readOnly }: { resource: GithubResource; readO}// ----------------------------------------------------------------------------// Local folders--function LocalFolderGroup({- wsId,- projectId,- folders,- desktopMode,- readOnly,-}: {- wsId: string;- projectId: string;- folders: LocalDirectoryResource[];- desktopMode: boolean;- readOnly: boolean;-}) {- const { t } = useT("projects");- const daemonStatus = useLocalDaemonStatus();- const localDaemonId = daemonStatus.daemonId;- const { data: runtimes = [] } = useQuery(runtimeListOptions(wsId));- // Whether this server checks execution_mode on save at all. One declared- // boolean, no inference — servers that predate it drop execution_mode and- // answer 201.- const serverValidatesWorktree = useConfigStore(- (state) => state.localWorktreeSupported,- );-- // Machine names and liveness come from the runtimes each daemon registers,- // titled the same way as the runtimes page.- const machines = useMemo(- () =>- buildRuntimeMachines(runtimes, {- now: Date.now(),- localDaemonId,- localMachineName: daemonStatus.deviceName,- }),- [runtimes, localDaemonId, daemonStatus.deviceName],- );-- const foldersByDaemon = new Map<string, LocalDirectoryResource[]>();- for (const folder of folders) {- const id = folder.resource_ref.daemon_id;- foldersByDaemon.set(id, [...(foldersByDaemon.get(id) ?? []), folder]);- }- const currentFolders = localDaemonId- ? (foldersByDaemon.get(localDaemonId) ?? [])- : [];- const otherDaemonIds = [...foldersByDaemon.keys()].filter(- (id) => id !== localDaemonId,- );- const currentMachine = localDaemonId- ? machines.find((m) => m.daemonId === localDaemonId)- : undefined;- const currentTitle = currentMachine?.title ?? daemonStatus.deviceName;-- return (- <div className="space-y-1.5">- <GroupHeader label={t(($) => $.resources.local_group)} />- <p className="-mt-1 text-micro text-muted-foreground">- {t(($) => $.resources.local_group_hint)}- </p>- {desktopMode && (!readOnly || currentFolders.length > 0) && (- <MachineBlock- current- title={currentTitle ?? t(($) => $.resources.local_this_computer)}- showCurrentTag={!!currentTitle}- >- {currentFolders.length > 0 ? (- currentFolders.map((folder) => (- <LocalFolderRow- key={folder.id}- resource={folder}- current- serverValidatesWorktree={serverValidatesWorktree}- readOnly={readOnly}- />- ))- ) : (- <LocalFolderSlot- wsId={wsId}- projectId={projectId}- daemonStatus={daemonStatus}- runtimes={runtimes}- serverValidatesWorktree={serverValidatesWorktree}- />- )}- </MachineBlock>- )}- {otherDaemonIds.map((daemonId) => {- const machine = machines.find((m) => m.daemonId === daemonId);- return (- <MachineBlock- key={daemonId}- title={machine?.title ?? t(($) => $.resources.local_unknown_computer)}- offline={machine !== undefined && machine.health !== "online"}- >- {(foldersByDaemon.get(daemonId) ?? []).map((folder) => (- <LocalFolderRow- key={folder.id}- resource={folder}- current={false}- serverValidatesWorktree={serverValidatesWorktree}- readOnly={readOnly}- />- ))}- </MachineBlock>- );- })}- </div>- );-}--function MachineBlock({- title,- current = false,- showCurrentTag = false,- offline = false,- children,-}: {- title: string;- current?: boolean;- showCurrentTag?: boolean;- offline?: boolean;- children: React.ReactNode;-}) {- const { t } = useT("projects");- const Icon = current ? Laptop : Monitor;- return (- <div className="space-y-1">- <div className="flex min-w-0 items-center gap-1.5 text-micro text-muted-foreground">- <Icon className="size-3 shrink-0" />- <span className={cn("truncate", current && "text-foreground")}>{title}</span>- {showCurrentTag && (- <span className="shrink-0">{t(($) => $.resources.local_this_computer)}</span>- )}- {offline && (- <span className="shrink-0">· {t(($) => $.resources.local_offline)}</span>- )}- </div>- <div className="space-y-1.5 pl-[1.125rem]">{children}</div>- </div>- );-}--function LocalFolderRow({- resource,- current,- serverValidatesWorktree,- readOnly,-}: {- resource: LocalDirectoryResource;- current: boolean;- serverValidatesWorktree: boolean;- readOnly: boolean;-}) {- const { remove, removing } = useRemoveResource(resource);- // The name is the folder's own (or whatever a label update stored); there is- // deliberately no rename. A folder is identified by its path (MUL-7525).- const display = localDirectoryLabel(resource);-- return (- // Folders on other machines are de-emphasised but stay editable: dropping- // or reconfiguring a stale registration only rewrites the resource, which- // works from any device.- <div className={cn("group text-caption", !current && "opacity-60")}>- <div className="flex items-center gap-2">- <FolderOpen className="size-3.5 shrink-0 text-muted-foreground" />- <Tooltip>- <TooltipTrigger- render={<span className="min-w-0 flex-1 truncate">{display}</span>}- />- <TooltipContent side="top">- <span className="font-mono text-micro">{resource.resource_ref.local_path}</span>- </TooltipContent>- </Tooltip>- {!readOnly && <RemoveButton onRemove={remove} removing={removing} />}- </div>- <div className="pl-[1.375rem] pt-0.5">- <ExecutionModeChip- resource={resource}- serverValidatesWorktree={serverValidatesWorktree}- readOnly={readOnly}- />- </div>- </div>- );-}-/*** How runs use a folder, always visible — "direct" included — because it is* the first thing someone asks when a task queues (or does not). Picking an@@ -970,187 +1244,6 @@ function ExecutionModeChip({);}-type PendingFolder = {- path: string;- label: string;- mode: LocalDirectoryExecutionMode;- /** undefined = unknown (older desktop build); treated as "cannot verify". */- isGitRepo: boolean | undefined;-};--/**- * This machine's place in the group while it has no folder. Choosing one asks- * for the execution mode before anything is created: it is part of what the- * user is choosing — whether tasks edit this folder or hand back a branch —- * not a setting to discover afterwards.- */-function LocalFolderSlot({- wsId,- projectId,- daemonStatus,- runtimes,- serverValidatesWorktree,-}: {- wsId: string;- projectId: string;- daemonStatus: LocalDaemonStatus;- runtimes: AgentRuntime[];- serverValidatesWorktree: boolean;-}) {- const { t } = useT("projects");- const createResource = useCreateProjectResource(wsId, projectId);- const [picking, setPicking] = useState(false);- const [pending, setPending] = useState<PendingFolder | null>(null);- const [saving, setSaving] = useState(false);- const [error, setError] = useState<string | null>(null);- const daemonId = daemonStatus.daemonId;- const ready = daemonStatus.running && daemonId !== null;-- const pick = async () => {- if (picking || !ready) return;- setPicking(true);- try {- const picked = await pickDirectory();- if (!picked.ok) {- if (picked.reason && picked.reason !== "cancelled") {- toast.error(picked.error ?? t(($) => $.resources.toast_local_pick_failed));- }- return;- }- const path = picked.path ?? "";- const validation = await validateLocalDirectory(path);- if (!validation.ok) {- toast.error(- localValidationMessage(validation, {- not_absolute: t(($) => $.resources.local_validate_not_absolute),- not_found: t(($) => $.resources.local_validate_not_found),- not_a_directory: t(($) => $.resources.local_validate_not_a_directory),- not_readable: t(($) => $.resources.local_validate_not_readable),- not_writable: t(($) => $.resources.local_validate_not_writable),- unsupported: t(($) => $.resources.local_validate_unsupported),- fallback: t(($) => $.resources.toast_local_pick_failed),- }),- );- return;- }- setError(null);- setPending({- path,- label: picked.basename ?? path,- // Same preselection rule as the create-project flow: a git repo this- // daemon can actually run worktree mode on starts on parallel,- // anything else starts on direct. The user still confirms.- mode:- validation.is_git_repo === true &&- serverValidatesWorktree &&- runtimeAdvertisesLocalWorktree(runtimes, daemonId)- ? "worktree"- : "in_place",- isGitRepo: validation.is_git_repo,- });- } catch (err) {- toast.error(errorMessage(err, t(($) => $.resources.toast_local_pick_failed)));- } finally {- setPicking(false);- }- };-- const add = async () => {- if (!pending || !daemonId || saving) return;- setSaving(true);- setError(null);- try {- await createResource.mutateAsync({- resource_type: "local_directory",- resource_ref: {- local_path: pending.path,- daemon_id: daemonId,- label: pending.label,- execution_mode: pending.mode,- },- });- toast.success(t(($) => $.resources.toast_local_attached));- setPending(null);- } catch (err) {- // Keep the choice on screen: the likely failures (the one-per-machine- // conflict, the daemon-version gate) are things the user acts on here.- setError(errorMessage(err, t(($) => $.resources.toast_attach_failed)));- } finally {- setSaving(false);- }- };-- if (pending) {- return (- <div className="space-y-2 rounded-md border p-2">- <div className="flex items-start gap-2 text-caption">- <FolderOpen className="mt-0.5 size-3.5 shrink-0 text-muted-foreground" />- <div className="min-w-0 flex-1">- <div className="truncate font-medium">{pending.label}</div>- <div className="break-all font-mono text-micro text-muted-foreground">- {pending.path}- </div>- </div>- </div>- <LocalDirectoryModeOptions- value={pending.mode}- onChange={(mode) => setPending({ ...pending, mode })}- unavailableReason={worktreeUnavailableReason(- pending.isGitRepo,- serverValidatesWorktree,- )}- />- {error && <InlineError message={error} />}- <div className="flex justify-end gap-1.5">- <Button- variant="ghost"- size="sm"- onClick={() => setPending(null)}- disabled={saving}- >- {t(($) => $.resources.mode_cancel)}- </Button>- <Button size="sm" onClick={() => void add()} disabled={saving}>- {t(($) => $.resources.mode_add)}- </Button>- </div>- </div>- );- }-- return (- <div className="space-y-2 rounded-md border border-dashed px-2.5 py-2">- <p className="text-micro text-muted-foreground">- {ready- ? t(($) => $.resources.local_slot_description)- : t(($) => $.resources.local_daemon_offline_hint)}- </p>- <Button- variant="outline"- size="sm"- className="h-7 text-caption"- disabled={!ready || picking}- onClick={() => void pick()}- >- <FolderOpen className="size-3" />- {t(($) => $.resources.local_pick)}- </Button>- </div>- );-}--function UnknownResourceRow({ resource, readOnly }: { resource: ProjectResource; readOnly: boolean }) {- const { remove, removing } = useRemoveResource(resource);- return (- <div className="flex items-center gap-2 text-caption text-muted-foreground">- <span className="truncate flex-1">- {resource.label || resource.resource_type}- </span>- {!readOnly && <RemoveButton onRemove={remove} removing={removing} alwaysVisible />}- </div>- );-}-/*** Which blocker (if any) applies to the worktree option.*