diff --git a/apps/mobile/src/i18n/translations/de.json b/apps/mobile/src/i18n/translations/de.json index 5adf7cae2b1f..6b92d43612a1 100644 --- a/apps/mobile/src/i18n/translations/de.json +++ b/apps/mobile/src/i18n/translations/de.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Nebenchat", "23be753133ae6950": "Thread", "0001ae5846061bb6": "Thread auf {machine}", + "2cf76789768b6dd2": "Rechner dieses Threads", "eef7f4dacbc3c3f2": "Rechner", "422ced5cda40580e": "Basis-Branch fetchen", "47e6147265a28164": "Dateien auschecken", diff --git a/apps/mobile/src/i18n/translations/en.json b/apps/mobile/src/i18n/translations/en.json index 44804860b704..2d852804d0c9 100644 --- a/apps/mobile/src/i18n/translations/en.json +++ b/apps/mobile/src/i18n/translations/en.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Side chat", "23be753133ae6950": "Thread", "0001ae5846061bb6": "Thread on {machine}", + "2cf76789768b6dd2": "This thread's machine", "eef7f4dacbc3c3f2": "Machine", "422ced5cda40580e": "Fetch base branch", "47e6147265a28164": "Check out files", diff --git a/apps/mobile/src/i18n/translations/es.json b/apps/mobile/src/i18n/translations/es.json index b89e4cd636b2..e896a119a1c7 100644 --- a/apps/mobile/src/i18n/translations/es.json +++ b/apps/mobile/src/i18n/translations/es.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Chat lateral", "23be753133ae6950": "Hilo", "0001ae5846061bb6": "Hilo en {machine}", + "2cf76789768b6dd2": "Máquina de este hilo", "eef7f4dacbc3c3f2": "Máquina", "422ced5cda40580e": "Obtener la rama base", "47e6147265a28164": "Hacer checkout de archivos", diff --git a/apps/mobile/src/i18n/translations/fr.json b/apps/mobile/src/i18n/translations/fr.json index 75e6c8ed3b83..8b062bdbe9c0 100644 --- a/apps/mobile/src/i18n/translations/fr.json +++ b/apps/mobile/src/i18n/translations/fr.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Discussion annexe", "23be753133ae6950": "Fil", "0001ae5846061bb6": "Fil sur {machine}", + "2cf76789768b6dd2": "Machine de ce fil", "eef7f4dacbc3c3f2": "Machine", "422ced5cda40580e": "Récupérer la branche de base", "47e6147265a28164": "Extraire les fichiers", diff --git a/apps/mobile/src/i18n/translations/ja.json b/apps/mobile/src/i18n/translations/ja.json index ade01f9a68ae..85e697074b5b 100644 --- a/apps/mobile/src/i18n/translations/ja.json +++ b/apps/mobile/src/i18n/translations/ja.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "サイドチャット", "23be753133ae6950": "スレッド", "0001ae5846061bb6": "{machine} 上のスレッド", + "2cf76789768b6dd2": "このスレッドのマシン", "eef7f4dacbc3c3f2": "マシン", "422ced5cda40580e": "ベースブランチをフェッチ", "47e6147265a28164": "ファイルをチェックアウト", diff --git a/apps/mobile/src/i18n/translations/ko.json b/apps/mobile/src/i18n/translations/ko.json index e55249e7c76d..8bfa966ad2f7 100644 --- a/apps/mobile/src/i18n/translations/ko.json +++ b/apps/mobile/src/i18n/translations/ko.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "사이드 채팅", "23be753133ae6950": "스레드", "0001ae5846061bb6": "{machine}의 스레드", + "2cf76789768b6dd2": "이 스레드의 머신", "eef7f4dacbc3c3f2": "머신", "422ced5cda40580e": "기준 브랜치 가져오기", "47e6147265a28164": "파일 체크아웃", diff --git a/apps/mobile/src/i18n/translations/pt-BR.json b/apps/mobile/src/i18n/translations/pt-BR.json index e373faf86a05..ac430cc6f584 100644 --- a/apps/mobile/src/i18n/translations/pt-BR.json +++ b/apps/mobile/src/i18n/translations/pt-BR.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Chat paralelo", "23be753133ae6950": "Thread", "0001ae5846061bb6": "Thread em {machine}", + "2cf76789768b6dd2": "Máquina desta thread", "eef7f4dacbc3c3f2": "Máquina", "422ced5cda40580e": "Buscar o branch base", "47e6147265a28164": "Fazer checkout dos arquivos", diff --git a/apps/mobile/src/i18n/translations/ru.json b/apps/mobile/src/i18n/translations/ru.json index c56ae7ca4738..28a5a5367481 100644 --- a/apps/mobile/src/i18n/translations/ru.json +++ b/apps/mobile/src/i18n/translations/ru.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Боковой чат", "23be753133ae6950": "Тред", "0001ae5846061bb6": "Тред на {machine}", + "2cf76789768b6dd2": "Машина этого треда", "eef7f4dacbc3c3f2": "Машина", "422ced5cda40580e": "Получение базовой ветки", "47e6147265a28164": "Извлечение файлов", diff --git a/apps/mobile/src/i18n/translations/sv.json b/apps/mobile/src/i18n/translations/sv.json index 7887ac576fc1..5fa2f4c42dc7 100644 --- a/apps/mobile/src/i18n/translations/sv.json +++ b/apps/mobile/src/i18n/translations/sv.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Sidochatt", "23be753133ae6950": "Tråd", "0001ae5846061bb6": "Tråd på {machine}", + "2cf76789768b6dd2": "Den här trådens dator", "eef7f4dacbc3c3f2": "Dator", "422ced5cda40580e": "Hämta basgren", "47e6147265a28164": "Checka ut filer", diff --git a/apps/mobile/src/i18n/translations/zh.json b/apps/mobile/src/i18n/translations/zh.json index 5b3d7f7841bf..36e9d90ffc16 100644 --- a/apps/mobile/src/i18n/translations/zh.json +++ b/apps/mobile/src/i18n/translations/zh.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "侧聊", "23be753133ae6950": "会话", "0001ae5846061bb6": "{machine} 上的会话", + "2cf76789768b6dd2": "此会话的机器", "eef7f4dacbc3c3f2": "机器", "422ced5cda40580e": "获取基准分支", "47e6147265a28164": "检出文件", diff --git a/apps/server/src/peer/PeerLinkRequests.test.ts b/apps/server/src/peer/PeerLinkRequests.test.ts index 2eec22a90bfa..0f167564633a 100644 --- a/apps/server/src/peer/PeerLinkRequests.test.ts +++ b/apps/server/src/peer/PeerLinkRequests.test.ts @@ -1055,6 +1055,11 @@ it.live("naming a machine that is already linked returns the link at once, with // Not both: the address could name another machine than the id. const both = yield* a.call({ environmentId: box.environmentId, url: b.url }); expect(errorOf(both)).toMatchObject({ code: "invalid_request" }); + + // A mention can name the machine the agent runs on, which has nothing to link. + const own = yield* a.call({ environmentId: laptop.environmentId }); + expect(errorOf(own)).toMatchObject({ code: "invalid_request" }); + expect(yield* cardOf(a)).toBeUndefined(); }), ), ); diff --git a/apps/server/src/peer/PeerLinkRequests.ts b/apps/server/src/peer/PeerLinkRequests.ts index a33bb47d7ec1..e3cf0c8d08d5 100644 --- a/apps/server/src/peer/PeerLinkRequests.ts +++ b/apps/server/src/peer/PeerLinkRequests.ts @@ -209,6 +209,12 @@ const make = Effect.gen(function* () { "Pass either environmentId or url, not both. Pass neither to let the user pick the machine.", }); } + if (input.environmentId === scope.environmentId) { + return yield* new OrchestratorMcpFailure({ + code: "invalid_request", + message: "That is the machine you run on. Work here: it needs no link.", + }); + } // A machine already linked needs no card: the agent can use it now. if (input.environmentId !== undefined) { const linked = yield* usableLink(input.environmentId).pipe( diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 0db2fb8989ce..58c754241a08 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Nebenchat", "23be753133ae6950": "Thread", "0001ae5846061bb6": "Thread auf {machine}", + "2cf76789768b6dd2": "Rechner dieses Threads", "eef7f4dacbc3c3f2": "Rechner", "422ced5cda40580e": "Basis-Branch fetchen", "47e6147265a28164": "Dateien auschecken", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index 3aa61a18f6b2..ea9b92bb3cde 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Side chat", "23be753133ae6950": "Thread", "0001ae5846061bb6": "Thread on {machine}", + "2cf76789768b6dd2": "This thread's machine", "eef7f4dacbc3c3f2": "Machine", "422ced5cda40580e": "Fetch base branch", "47e6147265a28164": "Check out files", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index 60ddca69b570..7268bfa33d5b 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Chat lateral", "23be753133ae6950": "Hilo", "0001ae5846061bb6": "Hilo en {machine}", + "2cf76789768b6dd2": "Máquina de este hilo", "eef7f4dacbc3c3f2": "Máquina", "422ced5cda40580e": "Obtener la rama base", "47e6147265a28164": "Hacer checkout de archivos", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index fdcba31a1032..7fabc4bbc026 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Discussion annexe", "23be753133ae6950": "Fil", "0001ae5846061bb6": "Fil sur {machine}", + "2cf76789768b6dd2": "Machine de ce fil", "eef7f4dacbc3c3f2": "Machine", "422ced5cda40580e": "Récupérer la branche de base", "47e6147265a28164": "Extraire les fichiers", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index 13379225ecf2..e06ab31e56f5 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "サイドチャット", "23be753133ae6950": "スレッド", "0001ae5846061bb6": "{machine} 上のスレッド", + "2cf76789768b6dd2": "このスレッドのマシン", "eef7f4dacbc3c3f2": "マシン", "422ced5cda40580e": "ベースブランチをフェッチ", "47e6147265a28164": "ファイルをチェックアウト", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index cc8261d7681f..3e8733b6df01 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "사이드 채팅", "23be753133ae6950": "스레드", "0001ae5846061bb6": "{machine}의 스레드", + "2cf76789768b6dd2": "이 스레드의 머신", "eef7f4dacbc3c3f2": "머신", "422ced5cda40580e": "기준 브랜치 가져오기", "47e6147265a28164": "파일 체크아웃", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index a9ce3832a0b9..17bf3181294b 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Chat paralelo", "23be753133ae6950": "Thread", "0001ae5846061bb6": "Thread em {machine}", + "2cf76789768b6dd2": "Máquina desta thread", "eef7f4dacbc3c3f2": "Máquina", "422ced5cda40580e": "Buscar o branch base", "47e6147265a28164": "Fazer checkout dos arquivos", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index ee0fe30aa4f3..ec8551ed5ba3 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Боковой чат", "23be753133ae6950": "Тред", "0001ae5846061bb6": "Тред на {machine}", + "2cf76789768b6dd2": "Машина этого треда", "eef7f4dacbc3c3f2": "Машина", "422ced5cda40580e": "Получение базовой ветки", "47e6147265a28164": "Извлечение файлов", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index fb02753220b1..f2cee7065479 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "Sidochatt", "23be753133ae6950": "Tråd", "0001ae5846061bb6": "Tråd på {machine}", + "2cf76789768b6dd2": "Den här trådens dator", "eef7f4dacbc3c3f2": "Dator", "422ced5cda40580e": "Hämta basgren", "47e6147265a28164": "Checka ut filer", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index 04044302284b..19f88fd24fb7 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -2,6 +2,7 @@ "4bcfa3b976a421cf": "侧聊", "23be753133ae6950": "会话", "0001ae5846061bb6": "{machine} 上的会话", + "2cf76789768b6dd2": "此会话的机器", "eef7f4dacbc3c3f2": "机器", "422ced5cda40580e": "获取基准分支", "47e6147265a28164": "检出文件", diff --git a/packages/client-runtime/src/composerThreadItems.test.ts b/packages/client-runtime/src/composerThreadItems.test.ts index 26ec3e7fde0c..25f92c09a4ce 100644 --- a/packages/client-runtime/src/composerThreadItems.test.ts +++ b/packages/client-runtime/src/composerThreadItems.test.ts @@ -113,7 +113,7 @@ describe("matchComposerEnvironmentItems", () => { { environmentId: EnvironmentId.make("env-mini"), label: "Mac mini", machine: "mac-mini" }, ] as const; - it("offers the other machines matching the query, never the composer's own", () => { + it("offers the machines matching the query, naming the thread's own", () => { expect( matchComposerEnvironmentItems({ environments, @@ -138,7 +138,16 @@ describe("matchComposerEnvironmentItems", () => { environmentId: EnvironmentId.make("env-here"), query: "lap", }), - ).toEqual([]); + ).toEqual([ + { + id: "environment:env-here", + type: "environment", + environmentId: "env-here", + machine: "laptop", + label: "Laptop", + description: "This thread's machine", + }, + ]); expect( matchComposerEnvironmentItems({ environments, diff --git a/packages/client-runtime/src/composerThreadItems.ts b/packages/client-runtime/src/composerThreadItems.ts index 0dd14bae7683..d20f8975a2bd 100644 --- a/packages/client-runtime/src/composerThreadItems.ts +++ b/packages/client-runtime/src/composerThreadItems.ts @@ -103,8 +103,9 @@ export interface ComposerEnvironmentItem { /** * The machines the `@` picker offers, so the agent can link or work there: the client's paired - * machines and those the composer's environment links to. The composer's own environment is - * left out. Like threads, they need a query: bare `@` stays a file picker. + * machines and those the composer's environment links to. That includes the thread's own + * machine, which the user may still want to name. Like threads, they need a query: bare `@` + * stays a file picker. */ export function matchComposerEnvironmentItems( input: { @@ -125,17 +126,16 @@ export function matchComposerEnvironmentItems( machine: "server" as const, })).filter((environment) => !paired.has(environment.environmentId)); return [...input.environments, ...linkedOnly] - .filter( - (environment) => - environment.environmentId !== input.environmentId && - environment.label.toLowerCase().includes(query), - ) + .filter((environment) => environment.label.toLowerCase().includes(query)) .map((environment) => ({ id: `environment:${environment.environmentId}`, type: "environment", environmentId: environment.environmentId, machine: environment.machine, label: environment.label, - description: resolve(msg("Machine", { $context: "noun, search result type" })), + description: + environment.environmentId === input.environmentId + ? resolve(msg("This thread's machine")) + : resolve(msg("Machine", { $context: "noun, search result type" })), })); } diff --git a/packages/shared/src/composerContextReferences.ts b/packages/shared/src/composerContextReferences.ts index a6c2fc914b66..0deedf509206 100644 --- a/packages/shared/src/composerContextReferences.ts +++ b/packages/shared/src/composerContextReferences.ts @@ -372,7 +372,7 @@ function formatComposerContextProviderPayload(record: KnownComposerContextRecord return [ `label: ${record.label}`, `environmentId: ${record.environmentId}`, - "The user means this machine. Not linked here yet: call t3_environment_link with this environmentId. Linked: pass it as environmentId, or target.environmentId for delegate_task.", + "The user means this machine. Not linked here yet: call t3_environment_link with this environmentId, which says so if it is the machine you run on. Linked: pass it as environmentId, or target.environmentId for delegate_task.", ].join("\n"); } }