Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions apps/mobile/src/features/threads/LinkRequestCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
linkRequestFailureMessage,
linkRequestInitialMachine,
type LinkRequestItem,
linkRequestKeepsLink,
linkRequestSuggestedAddress,
linkRequestTarget,
rankMachinesByHint,
} from "@t3tools/client-runtime/link-request";
Expand Down Expand Up @@ -207,7 +209,8 @@ function LinkRequestSheet(props: {
const listed = useLinkableMachines(props.environmentId, true);
const machines = useMemo(() => rankMachinesByHint(listed, item.hint), [listed, item.hint]);
const [choice, setChoice] = useState<string | null>(null);
const [address, setAddress] = useState(item.url ?? "");
// Null until the user types; until then the field holds the suggested address.
const [typedAddress, setAddress] = useState<string | null>(null);
const [access, setAccess] = useState<AuthMcpClientAccess>(() => linkRequestDefaultAccess(item));
const [pairingCode, setPairingCode] = useState("");
const [busy, setBusy] = useState(false);
Expand All @@ -223,6 +226,7 @@ function LinkRequestSheet(props: {
});
const selected = choice ?? linkRequestInitialMachine(item, machines);
const target = linkRequestTarget(item, machines, selected, m);
const address = typedAddress ?? linkRequestSuggestedAddress(item, target);
const targetName =
target.kind === "machine"
? target.label
Expand All @@ -243,15 +247,15 @@ function LinkRequestSheet(props: {
Option.isSome(connected) &&
mayMint &&
!mintFailed.has(targetId);
const useExisting = target.kind === "machine" && target.linked;
const useExisting = linkRequestKeepsLink(item, target);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
const ready =
target.kind !== "none" &&
(useExisting ||
((!needsAddress || address.trim().length > 0) && (canMint || pairingCode.trim().length > 0)));

const prepareAnswer = async () => {
if (target.kind === "none") return null;
if (target.kind === "machine" && target.linked) {
if (useExisting && target.kind === "machine") {
return linkRequestAnswerInput(item, {
type: "use-existing",
environmentId: target.environmentId,
Expand Down Expand Up @@ -375,7 +379,7 @@ function LinkRequestSheet(props: {
/>
</SettingsSection>
) : null}
{needsAddress && item.url === undefined ? (
{needsAddress && item.url === undefined && !useExisting ? (
<View className="gap-2">
<TextInput
accessibilityLabel={gt("Address")}
Expand Down Expand Up @@ -407,6 +411,11 @@ function LinkRequestSheet(props: {
</Text>
) : target.kind === "none" ? null : (
<>
{target.kind === "machine" && target.linkedAccess !== null ? (
<Text className="font-sans text-sm leading-5 text-foreground-muted">
<T>Already linked. Linking again renews it with the access you pick.</T>
</Text>
) : null}
{canMint ? null : (
<View className="gap-2">
<TextInput
Expand Down Expand Up @@ -501,13 +510,14 @@ function MachineRow(props: {
}) {
const gt = useGT();
const { machine } = props;
const status = machine.linked
? gt("Linked")
: machine.connected
? null
: machine.connectOnly
? "T3 Connect"
: gt("Not connected");
const status =
machine.linkedAccess !== null
? gt("Linked")
: machine.connected
? null
: machine.connectOnly
? "T3 Connect"
: gt("Not connected");
return (
<Pressable
accessibilityRole="radio"
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "Verknüpfen fehlgeschlagen: Die andere Umgebung hat abgelehnt",
"21be308917bd450e": "Verknüpfen fehlgeschlagen: {failure}",
"acd01e781e2355cc": "Anfrage beendet",
"8855350e81d45c45": "Diese Verknüpfung wurde entfernt oder ist abgelaufen. Verknüpfe den Computer erneut.",
"c3e4bd0213cdc043": "Diese Verknüpfung erlaubt weniger, als diese Anfrage verlangt. Verknüpfe den Computer erneut.",
"97e4c50a99272f63": "Die Anfrage konnte nicht beantwortet werden. Versuche es erneut.",
"605a491783d18b3f": "Dieser Thread konnte nicht über {via} gelesen werden",
"50f19209548b70d9": "{via} braucht möglicherweise ein Update, bevor es verknüpfte Threads lesen kann.",
Expand Down Expand Up @@ -4228,6 +4230,7 @@
},
" verknüpft. Der Agent kann diese Verknüpfung so verwenden; ändere den Zugriff unter Einstellungen → Umgebungen."
],
"dc9a0b68d101e904": "Bereits verknüpft. Erneutes Verknüpfen verlängert sie mit dem gewählten Zugriff.",
"e8235ebb43ad7228": "Erstelle auf einem Rechner einen Link: Einstellungen → Freigabe & Zugriff → Autorisierte Clients → Link erstellen, und füge dann seinen Code hier ein.",
"a974e6c3c613e452": [
"Erstelle einen Link auf ",
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "Could not link: the other environment refused",
"21be308917bd450e": "Could not link: {failure}",
"acd01e781e2355cc": "Request ended",
"8855350e81d45c45": "That link was removed or expired. Link the machine again.",
"c3e4bd0213cdc043": "That link allows less than this request asks for. Link the machine again.",
"97e4c50a99272f63": "Could not answer the request. Try again.",
"605a491783d18b3f": "Could not read this thread through {via}",
"50f19209548b70d9": "{via} may need an update before it can read linked threads.",
Expand Down Expand Up @@ -4230,6 +4232,7 @@
},
". The agent can use that link as it is; change its access in Settings → Environments."
],
"dc9a0b68d101e904": "Already linked. Linking again renews it with the access you pick.",
"e8235ebb43ad7228": "Create a link on a machine: Settings → Sharing & access → Authorized clients → Create link, then paste its code here.",
"a974e6c3c613e452": [
"Create a link on ",
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "No se pudo vincular: el otro entorno lo rechazó",
"21be308917bd450e": "No se pudo vincular: {failure}",
"acd01e781e2355cc": "Solicitud finalizada",
"8855350e81d45c45": "Ese vínculo se eliminó o caducó. Vuelve a vincular la máquina.",
"c3e4bd0213cdc043": "Ese vínculo permite menos de lo que pide esta solicitud. Vuelve a vincular la máquina.",
"97e4c50a99272f63": "No se pudo responder a la solicitud. Inténtalo de nuevo.",
"605a491783d18b3f": "No se pudo leer este hilo a través de {via}",
"50f19209548b70d9": "Puede que {via} necesite actualizarse para poder leer hilos vinculados.",
Expand Down Expand Up @@ -4223,6 +4225,7 @@
},
". El agente puede usar ese vínculo tal cual; cambia su acceso en Ajustes → Entornos."
],
"dc9a0b68d101e904": "Ya está vinculado. Vincularlo de nuevo lo renueva con el acceso que elijas.",
"e8235ebb43ad7228": "Crea un enlace en una máquina: Ajustes → Compartir y acceso → Clientes autorizados → Crear enlace, y pega aquí su código.",
"a974e6c3c613e452": [
"Crea un enlace en ",
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "Association impossible : l’autre environnement a refusé",
"21be308917bd450e": "Association impossible : {failure}",
"acd01e781e2355cc": "Demande terminée",
"8855350e81d45c45": "Cette association a été supprimée ou a expiré. Associez à nouveau la machine.",
"c3e4bd0213cdc043": "Cette association autorise moins que ce que demande cette requête. Associez à nouveau la machine.",
"97e4c50a99272f63": "Impossible de répondre à la demande. Réessayez.",
"605a491783d18b3f": "Impossible de lire ce fil via {via}",
"50f19209548b70d9": "{via} a peut-être besoin d’une mise à jour pour lire les fils associés.",
Expand Down Expand Up @@ -4223,6 +4225,7 @@
},
". L’agent peut utiliser cette association telle quelle ; modifiez son accès dans Paramètres → Environnements."
],
"dc9a0b68d101e904": "Déjà associé. Associer à nouveau renouvelle l’association avec l’accès que vous choisissez.",
"e8235ebb43ad7228": "Créez un lien sur une machine : Paramètres → Partage et accès → Clients autorisés → Créer un lien, puis collez son code ici.",
"a974e6c3c613e452": [
"Créez un lien sur ",
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "リンクできませんでした: 相手の環境が拒否しました",
"21be308917bd450e": "リンクできませんでした: {failure}",
"acd01e781e2355cc": "リクエストが終了しました",
"8855350e81d45c45": "そのリンクは削除されたか、期限切れです。マシンをもう一度リンクしてください。",
"c3e4bd0213cdc043": "そのリンクで許可されている範囲は、このリクエストが求める範囲より狭いです。マシンをもう一度リンクしてください。",
"97e4c50a99272f63": "リクエストに応答できませんでした。もう一度お試しください。",
"605a491783d18b3f": "{via} 経由でこのスレッドを読み取れませんでした",
"50f19209548b70d9": "リンクされたスレッドを読み取るには、{via} の更新が必要な可能性があります。",
Expand Down Expand Up @@ -4219,6 +4221,7 @@
},
" にリンクされています。エージェントはそのリンクをそのまま使用できます。アクセス権は [設定] → [環境] で変更してください。"
],
"dc9a0b68d101e904": "すでにリンクされています。再度リンクすると、選択したアクセス権で更新されます。",
"e8235ebb43ad7228": "マシンでリンクを作成してください (設定 → 共有とアクセス → 認可済みクライアント → リンクを作成)。その後、コードをここに貼り付けてください。",
"a974e6c3c613e452": [
{
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "연결할 수 없음: 상대 환경이 거부했습니다",
"21be308917bd450e": "연결할 수 없음: {failure}",
"acd01e781e2355cc": "요청 종료됨",
"8855350e81d45c45": "해당 연결이 삭제되었거나 만료되었습니다. 머신을 다시 연결하세요.",
"c3e4bd0213cdc043": "해당 연결은 이 요청이 요구하는 것보다 적은 권한만 허용합니다. 머신을 다시 연결하세요.",
"97e4c50a99272f63": "요청에 응답할 수 없습니다. 다시 시도하세요.",
"605a491783d18b3f": "{via}을(를) 통해 이 스레드를 읽지 못했습니다",
"50f19209548b70d9": "연결된 스레드를 읽으려면 {via}을(를) 업데이트해야 할 수 있습니다.",
Expand Down Expand Up @@ -4223,6 +4225,7 @@
},
"에 연결되어 있습니다. 에이전트는 이 연결을 그대로 사용할 수 있으며, 액세스는 설정 → 환경에서 변경하세요."
],
"dc9a0b68d101e904": "이미 연결되어 있습니다. 다시 연결하면 선택한 액세스 권한으로 갱신됩니다.",
"e8235ebb43ad7228": "머신에서 링크를 만드세요: 설정 → 공유 및 액세스 → 승인된 클라이언트 → 링크 만들기. 그런 다음 코드를 여기에 붙여 넣으세요.",
"a974e6c3c613e452": [
{
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "Não foi possível vincular: o outro ambiente recusou",
"21be308917bd450e": "Não foi possível vincular: {failure}",
"acd01e781e2355cc": "Solicitação encerrada",
"8855350e81d45c45": "Esse vínculo foi removido ou expirou. Vincule a máquina novamente.",
"c3e4bd0213cdc043": "Esse vínculo permite menos do que esta solicitação pede. Vincule a máquina novamente.",
"97e4c50a99272f63": "Não foi possível responder à solicitação. Tente novamente.",
"605a491783d18b3f": "Não foi possível ler esta thread por {via}",
"50f19209548b70d9": "Talvez {via} precise de uma atualização para ler threads vinculadas.",
Expand Down Expand Up @@ -4223,6 +4225,7 @@
},
". O agente pode usar esse vínculo como está; altere o acesso em Configurações → Ambientes."
],
"dc9a0b68d101e904": "Já vinculado. Vincular novamente renova o vínculo com o acesso escolhido.",
"e8235ebb43ad7228": "Crie um link em uma máquina: Configurações → Compartilhamento e acesso → Clientes autorizados → Criar link e cole o código aqui.",
"a974e6c3c613e452": [
"Crie um link em ",
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "Не удалось привязать: другое окружение отказало",
"21be308917bd450e": "Не удалось привязать: {failure}",
"acd01e781e2355cc": "Запрос завершён",
"8855350e81d45c45": "Эта привязка удалена или истекла. Привяжите машину снова.",
"c3e4bd0213cdc043": "Эта привязка разрешает меньше, чем требует этот запрос. Привяжите машину снова.",
"97e4c50a99272f63": "Не удалось ответить на запрос. Повторите попытку.",
"605a491783d18b3f": "Не удалось прочитать этот тред через {via}",
"50f19209548b70d9": "Возможно, {via} нужно обновить, чтобы читать привязанные треды.",
Expand Down Expand Up @@ -4277,6 +4279,7 @@
},
". Агент может использовать эту привязку как есть; изменить её доступ можно в «Настройки → Окружения»."
],
"dc9a0b68d101e904": "Уже привязано. Повторная привязка продлевает её с выбранным уровнем доступа.",
"e8235ebb43ad7228": "Создайте ссылку на компьютере: Настройки → Общий доступ → Авторизованные клиенты → Создать ссылку, затем вставьте её код сюда.",
"a974e6c3c613e452": [
"Создайте ссылку на ",
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "Kunde inte länka: den andra miljön nekade",
"21be308917bd450e": "Kunde inte länka: {failure}",
"acd01e781e2355cc": "Begäran avslutades",
"8855350e81d45c45": "Länken har tagits bort eller gått ut. Länka maskinen igen.",
"c3e4bd0213cdc043": "Länken tillåter mindre än den här begäran kräver. Länka maskinen igen.",
"97e4c50a99272f63": "Kunde inte svara på begäran. Försök igen.",
"605a491783d18b3f": "Det gick inte att läsa den här tråden via {via}",
"50f19209548b70d9": "{via} kan behöva uppdateras innan den kan läsa länkade trådar.",
Expand Down Expand Up @@ -4229,6 +4231,7 @@
},
". Agenten kan använda den länken som den är; ändra dess åtkomst under Inställningar → Miljöer."
],
"dc9a0b68d101e904": "Redan länkad. Om du länkar igen förnyas den med den åtkomst du väljer.",
"e8235ebb43ad7228": "Skapa en länk på en dator: Inställningar → Delning och åtkomst → Auktoriserade klienter → Skapa länk, och klistra sedan in koden här.",
"a974e6c3c613e452": [
"Skapa en länk på ",
Expand Down
3 changes: 3 additions & 0 deletions apps/mobile/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
"289ec1df10840137": "无法关联:对方环境拒绝了请求",
"21be308917bd450e": "无法关联:{failure}",
"acd01e781e2355cc": "请求已结束",
"8855350e81d45c45": "该关联已被移除或已过期。请重新关联这台机器。",
"c3e4bd0213cdc043": "该关联允许的权限低于此请求的要求。请重新关联这台机器。",
"97e4c50a99272f63": "无法回复此请求。请重试。",
"605a491783d18b3f": "无法通过 {via} 读取此会话",
"50f19209548b70d9": "{via} 可能需要更新后才能读取关联的会话。",
Expand Down Expand Up @@ -4226,6 +4228,7 @@
},
"。智能体可以直接使用该关联;请在“设置 → 环境”中更改其访问权限。"
],
"dc9a0b68d101e904": "已关联。再次关联将使用你选择的访问权限续期。",
"e8235ebb43ad7228": "在某台机器上创建链接:设置 → 共享与访问 → 已授权的客户端 → 创建链接,然后在此处粘贴配对码。",
"a974e6c3c613e452": [
"在 ",
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/toolkits/orchestrator/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ const EnvironmentLinksTool = Tool.make("t3_environment_links", {

const EnvironmentLinkTool = Tool.make("t3_environment_link", {
description:
"Ask the user to link another machine, in a card. For a machine the user names that is not linked. Pass `hint` from their words, `environmentId` when one names it (already linked: returns `linked`), `url` only when the user gave an address. Returns `pending`; the outcome arrives as a message in this thread. Do not wait, poll, or call it again to check. Never ask for a pairing code in chat.",
"Ask the user, in a card, to link a machine they name that is unlinked or linked below the access needed. Pass `hint` from their words, `environmentId` when one names it (returns `linked` if it has `requestedAccess`), `url` only if the user gave one. Returns `pending`; the outcome arrives as a message here. Do not wait, poll, or call it again. Never ask for a pairing code in chat.",
parameters: OrchestratorMcpEnvironmentLinkInput,
success: OrchestratorMcpEnvironmentLinkResult,
failure: OrchestratorMcpFailure,
Expand Down
Loading
Loading