mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
feat(app): show a subagent's model and stats where the composer would be (#57473)
This commit is contained in:
committed by
GitHub
Unverified
parent
db6999e2a4
commit
05947ee285
@@ -0,0 +1,10 @@
|
||||
import { expect, story } from "../../storybook/playwright/story"
|
||||
|
||||
story("a subagent session shows its model where the composer would be", async ({ mount, page }) => {
|
||||
await mount("app-current-session-surface--child-session")
|
||||
|
||||
const bar = page.locator('[data-component="subagent-bar"]')
|
||||
await expect(bar.locator('[data-slot="subagent-model"]')).toHaveText("Anthropic / Claude Opus 5.5")
|
||||
await expect(bar).toContainText(/high/i)
|
||||
await expect(page.locator('[data-component="composer"]')).toHaveCount(0)
|
||||
})
|
||||
@@ -20,23 +20,7 @@ export function createComposerControls(input: { model?: ModelSelection } = {}) {
|
||||
const providers = useProviders(() => sdk().directory)
|
||||
const models = useGlobal().models
|
||||
|
||||
const canonical = (provider: { id: string; canonical?: string }) =>
|
||||
provider.canonical ?? provider.id.replace(/^console-/, "")
|
||||
|
||||
// Like the model picker, a Console-managed provider drops its "Workspace / " prefix unless the
|
||||
// same provider is also connected directly and the workspace is what tells them apart.
|
||||
const providerName = (providerID: string, catalog = providers.all()) => {
|
||||
const provider = catalog.get(providerID)
|
||||
|
||||
if (!provider) return providerID
|
||||
const all = [...catalog.values()]
|
||||
const managed = consoleProviderGroup(all)
|
||||
|
||||
if (!managed?.providers.includes(provider)) return provider.name
|
||||
const direct = all.some((item) => !managed.providers.includes(item) && canonical(item) === canonical(provider))
|
||||
|
||||
return direct ? provider.name : consoleProviderName(managed, provider.name)
|
||||
}
|
||||
const providerName = (providerID: string, catalog = providers.all()) => composerProviderName(providerID, catalog)
|
||||
|
||||
const loading = () => {
|
||||
const selection = input.model ?? local.model
|
||||
@@ -109,6 +93,24 @@ export function createComposerControls(input: { model?: ModelSelection } = {}) {
|
||||
})
|
||||
}
|
||||
|
||||
// Like the model picker, a Console-managed provider drops its "Workspace / " prefix unless the
|
||||
// same provider is also connected directly and the workspace is what tells them apart.
|
||||
export function composerProviderName(providerID: string, catalog: ReturnType<typeof normalizeProviderList>["all"]) {
|
||||
const provider = catalog.get(providerID)
|
||||
|
||||
if (!provider) return providerID
|
||||
const all = [...catalog.values()]
|
||||
const managed = consoleProviderGroup(all)
|
||||
|
||||
if (!managed?.providers.includes(provider)) return provider.name
|
||||
const direct = all.some((item) => !managed.providers.includes(item) && canonical(item) === canonical(provider))
|
||||
|
||||
return direct ? provider.name : consoleProviderName(managed, provider.name)
|
||||
}
|
||||
|
||||
const canonical = (provider: { id: string; canonical?: string }) =>
|
||||
provider.canonical ?? provider.id.replace(/^console-/, "")
|
||||
|
||||
export function createComposerModelSelection(input: {
|
||||
agent: () => { name: string; model?: ModelKey; variant?: string } | undefined
|
||||
}) {
|
||||
|
||||
@@ -206,7 +206,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'ማንኛውንም ነገር ይጠይቁ… "{{example}}"',
|
||||
"prompt.mode.shell": "ሼል",
|
||||
"prompt.mode.normal": "ፕሮምፕት",
|
||||
"session.child.promptDisabled": "ንዑስ ክፍለ ጊዜዎች ሊጠየቁ አይችሉም።",
|
||||
"session.child.backToParent": "ወደ ዋናው ክፍለ ጊዜ ተመለስ",
|
||||
"prompt.action.attachFile": "ፋይሎችን አክል",
|
||||
"prompt.toast.attachmentDuplicate.title": "ይህ ፋይል አስቀድሞ ተሰቅሏል",
|
||||
|
||||
@@ -219,7 +219,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'اسأل أي شيء… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "موجّه",
|
||||
"session.child.promptDisabled": "لا يمكن إرسال موجّهات إلى جلسات الوكلاء الفرعيين.",
|
||||
"session.child.backToParent": "العودة إلى الجلسة الرئيسية.",
|
||||
"prompt.action.attachFile": "إضافة ملفات",
|
||||
"prompt.toast.attachmentDuplicate.title": "تم تحميل هذا الملف بالفعل",
|
||||
|
||||
@@ -208,7 +208,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Nə istəsəniz soruşun… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Alt agent sessiyalarına prompt göndərmək olmaz.",
|
||||
"session.child.backToParent": "Əsas sessiyaya qayıt.",
|
||||
"prompt.action.attachFile": "Fayllar əlavə et",
|
||||
"prompt.toast.attachmentDuplicate.title": "Bu fayl artıq yüklənib",
|
||||
|
||||
@@ -207,7 +207,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Попитайте каквото и да е… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "подкана",
|
||||
"session.child.promptDisabled": "Субагентните сесии не могат да бъдат подканени.",
|
||||
"session.child.backToParent": "Назад към основната сесия.",
|
||||
"prompt.action.attachFile": "Добавете файлове",
|
||||
"prompt.toast.attachmentDuplicate.title": "Този файл вече е качен",
|
||||
|
||||
@@ -211,7 +211,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'কিছু জিজ্ঞাসা করুন… "{{example}}"',
|
||||
"prompt.mode.shell": "শেল",
|
||||
"prompt.mode.normal": "প্রম্পট",
|
||||
"session.child.promptDisabled": "সাবজেন্ট সেশন প্রম্পট করা যাবে না.",
|
||||
"session.child.backToParent": "মূল সেশনে ফিরে যান।",
|
||||
"prompt.action.attachFile": "ফাইল যোগ করুন",
|
||||
"prompt.toast.attachmentDuplicate.title": "এই ফাইল ইতিমধ্যে আপলোড করা হয়েছে",
|
||||
|
||||
@@ -423,7 +423,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Pergunte qualquer coisa… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Não é possível enviar prompts em sessões de subagentes.",
|
||||
"session.child.backToParent": "Voltar à sessão principal.",
|
||||
"prompt.action.attachFile": "Adicionar arquivos",
|
||||
"prompt.toast.attachmentDuplicate.title": "Este arquivo já foi enviado",
|
||||
|
||||
@@ -225,7 +225,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Pitaj bilo šta… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Sesijama podagenta nije moguće slati upite.",
|
||||
"session.child.backToParent": "Nazad na glavnu sesiju.",
|
||||
|
||||
"prompt.action.attachFile": "Dodaj datoteke",
|
||||
|
||||
@@ -206,7 +206,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Pregunta qualsevol cosa… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Indicació",
|
||||
"session.child.promptDisabled": "No es poden demanar sessions de subagent.",
|
||||
"session.child.backToParent": "Torna a la sessió principal.",
|
||||
"prompt.action.attachFile": "Afegeix fitxers",
|
||||
"prompt.toast.attachmentDuplicate.title": "Aquest fitxer ja s'ha penjat",
|
||||
|
||||
@@ -206,7 +206,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Zeptejte se na cokoliv… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Nelze vyžádat relace podagenta.",
|
||||
"session.child.backToParent": "Zpět k hlavní relaci.",
|
||||
"prompt.action.attachFile": "Přidat soubory",
|
||||
"prompt.toast.attachmentDuplicate.title": "Tento soubor již byl nahrán",
|
||||
|
||||
@@ -354,7 +354,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Spørg om hvad som helst… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Der kan ikke sendes prompts til underagentsessioner.",
|
||||
"session.child.backToParent": "Tilbage til hovedsessionen.",
|
||||
|
||||
"prompt.action.attachFile": "Vedhæft fil",
|
||||
|
||||
@@ -355,7 +355,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Beliebige Frage stellen… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Unteragenten-Sitzungen können keine Prompts erhalten.",
|
||||
"session.child.backToParent": "Zurück zur Hauptsitzung.",
|
||||
"prompt.action.attachFile": "Datei anhängen",
|
||||
"prompt.toast.attachmentDuplicate.title": "Diese Datei wurde bereits hochgeladen",
|
||||
|
||||
@@ -211,7 +211,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'ކޮންމެ އެއްޗަކާ އަހާލަން… "\u2068{{example}}\u2069".',
|
||||
"prompt.mode.shell": "ޝެލް",
|
||||
"prompt.mode.normal": "ޕްރޮމްޕްޓް",
|
||||
"session.child.promptDisabled": "ސަބްއޭޖެންޓް ސެޝަންތަކަށް ޕްރޮމްޕްޓް ނުކުރެވޭނެއެވެ.",
|
||||
"session.child.backToParent": "އަނބުރާ މައި ސެޝަނަށް.",
|
||||
"prompt.action.attachFile": "ފައިލްތައް އިތުރުކުރުން",
|
||||
"prompt.toast.attachmentDuplicate.title": "މި ފައިލް މިހާރު ވަނީ އަޕްލޯޑްކޮށްފައެވެ",
|
||||
|
||||
@@ -218,7 +218,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'ག་ཅི་ཡང་དྲིས… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "འདི་འཕྲོ་ལས",
|
||||
"session.child.promptDisabled": "ཡན་ལག་ལས་ཚབ་ལཱ་ཡུན་ཚུ་ བརྡ་སྟོན་འབད་མི་བཏུབ།",
|
||||
"session.child.backToParent": "ལཱ་ཡུན་ངོ་མ་ལུ་ལོག་འགྱོ།",
|
||||
"prompt.action.attachFile": "ཡིག་སྣོད་ཚུ་ཁ་སྐོང་རྐྱབས།",
|
||||
"prompt.toast.attachmentDuplicate.title": "ཡིག་སྣོད་འདི་ཧེ་མ་ལས་སྐྱེལ་བཙུགས་འབད་ཡི།",
|
||||
|
||||
@@ -207,7 +207,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Ρωτήστε οτιδήποτε… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Προτροπή",
|
||||
"session.child.promptDisabled": "Δεν είναι δυνατή η αποστολή προτροπών σε συνεδρίες υποπρακτόρων.",
|
||||
"session.child.backToParent": "Επιστροφή στην κύρια συνεδρία.",
|
||||
"prompt.action.attachFile": "Προσθήκη αρχείων",
|
||||
"prompt.toast.attachmentDuplicate.title": "Αυτό το αρχείο έχει ήδη μεταφορτωθεί",
|
||||
|
||||
@@ -302,8 +302,11 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Ask anything… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Subagent sessions cannot be prompted.",
|
||||
"session.child.backToParent": "Back to main session.",
|
||||
"session.child.backToParent": "Main session",
|
||||
"session.child.status.running": "Running",
|
||||
"session.child.status.succeeded": "Done",
|
||||
"session.child.status.failed": "Failed",
|
||||
"session.child.status.interrupted": "Interrupted",
|
||||
|
||||
"prompt.action.attachFile": "Add files",
|
||||
|
||||
|
||||
@@ -440,7 +440,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Pregunta cualquier cosa… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "No se pueden enviar prompts a las sesiones de subagentes.",
|
||||
"session.child.backToParent": "Volver a la sesión principal.",
|
||||
|
||||
"prompt.action.attachFile": "Añadir archivos",
|
||||
|
||||
@@ -206,7 +206,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Küsige mida tahes… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Viip",
|
||||
"session.child.promptDisabled": "Alamagendi seansse ei saa küsida.",
|
||||
"session.child.backToParent": "Tagasi põhiseansse.",
|
||||
"prompt.action.attachFile": "Lisa faile",
|
||||
"prompt.toast.attachmentDuplicate.title": "See fail on juba üles laaditud",
|
||||
|
||||
@@ -216,7 +216,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'هر چیزی بپرسید… "{{example}}"',
|
||||
"prompt.mode.shell": "پوسته",
|
||||
"prompt.mode.normal": "پرامپت",
|
||||
"session.child.promptDisabled": "جلسات Subagent را نمی توان درخواست کرد.",
|
||||
"session.child.backToParent": "بازگشت به جلسه اصلی",
|
||||
"prompt.action.attachFile": "فایل ها را اضافه کنید",
|
||||
"prompt.toast.attachmentDuplicate.title": "این فایل قبلا آپلود شده است",
|
||||
|
||||
@@ -339,7 +339,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Kysy mitä tahansa… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Kehote",
|
||||
"session.child.promptDisabled": "Aliagentti-istuntoihin ei voi lähettää kehotteita.",
|
||||
"session.child.backToParent": "Takaisin pääistuntoon.",
|
||||
"prompt.action.attachFile": "Lisää tiedostoja",
|
||||
"prompt.toast.attachmentDuplicate.title": "Tämä tiedosto on jo ladattu",
|
||||
|
||||
@@ -206,7 +206,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Spyr nakað sum helst… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Subagent setur kunnu ikki biðjast um.",
|
||||
"session.child.backToParent": "Aftur til høvuðsløtu.",
|
||||
"prompt.action.attachFile": "Legg fílur til",
|
||||
"prompt.toast.attachmentDuplicate.title": "Hendan fílan er longu løgd upp.",
|
||||
|
||||
@@ -427,7 +427,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Demandez n\'importe quoi… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Invite",
|
||||
"session.child.promptDisabled": "Les sessions de sous-agents ne peuvent pas recevoir de messages.",
|
||||
"session.child.backToParent": "Revenir à la session principale.",
|
||||
"prompt.action.attachFile": "Joindre un fichier",
|
||||
"prompt.toast.attachmentDuplicate.title": "Ce fichier a déjà été téléversé",
|
||||
|
||||
@@ -215,7 +215,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'אפשר לשאול כל דבר… "{{example}}"',
|
||||
"prompt.mode.shell": "מעטפת",
|
||||
"prompt.mode.normal": "פרומפט",
|
||||
"session.child.promptDisabled": "לא ניתן לשלוח פרומפט להפעלה של סוכן משנה.",
|
||||
"session.child.backToParent": "חזרה להפעלה הראשית.",
|
||||
"prompt.action.attachFile": "הוסף קבצים",
|
||||
"prompt.toast.attachmentDuplicate.title": "הקובץ הזה כבר הועלה",
|
||||
|
||||
@@ -212,7 +212,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'कुछ भी पूछें… "{{example}}"',
|
||||
"prompt.mode.shell": "शेल",
|
||||
"prompt.mode.normal": "प्रॉम्प्ट",
|
||||
"session.child.promptDisabled": "सबएजेंट सेशन में प्रॉम्प्ट नहीं भेजा जा सकता।",
|
||||
"session.child.backToParent": "मुख्य सेशन पर वापस जाएँ।",
|
||||
"prompt.action.attachFile": "फ़ाइलें जोड़ें",
|
||||
"prompt.toast.attachmentDuplicate.title": "यह फ़ाइल पहले ही अपलोड की जा चुकी है",
|
||||
|
||||
@@ -219,7 +219,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Pitajte bilo što… "{{example}}"',
|
||||
"prompt.mode.shell": "Ljuska",
|
||||
"prompt.mode.normal": "Upit",
|
||||
"session.child.promptDisabled": "Sesije subagenta ne mogu se tražiti.",
|
||||
"session.child.backToParent": "Povratak na glavnu sesiju.",
|
||||
"prompt.action.attachFile": "Dodajte datoteke",
|
||||
"prompt.toast.attachmentDuplicate.title": "Ova datoteka je već učitana",
|
||||
|
||||
@@ -219,7 +219,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Kérdezz bármit… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Utasítás",
|
||||
"session.child.promptDisabled": "Az alügynöki munkamenetek nem kérhetők fel.",
|
||||
"session.child.backToParent": "Vissza a fő munkamenethez.",
|
||||
"prompt.action.attachFile": "Fájlok hozzáadása",
|
||||
"prompt.toast.attachmentDuplicate.title": "Ezt a fájlt már feltöltötték",
|
||||
|
||||
@@ -207,7 +207,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": "Հարցրեք որևէ բան… «{{example}}»",
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Հուշում",
|
||||
"session.child.promptDisabled": "Ենթագենտի նիստերը չեն կարող հուշվել:",
|
||||
"session.child.backToParent": "Վերադառնալ հիմնական նիստին։",
|
||||
"prompt.action.attachFile": "Ավելացնել ֆայլեր",
|
||||
"prompt.toast.attachmentDuplicate.title": "Այս ֆայլն արդեն վերբեռնվել է",
|
||||
|
||||
@@ -233,7 +233,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Tanyakan apa saja… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Sesi subagen tidak dapat diberi prompt.",
|
||||
"session.child.backToParent": "Kembali ke sesi utama.",
|
||||
|
||||
"prompt.action.attachFile": "Tambah berkas",
|
||||
|
||||
@@ -219,7 +219,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Spyrðu hvað sem er… "{{example}}"',
|
||||
"prompt.mode.shell": "Skel",
|
||||
"prompt.mode.normal": "Kvaðning",
|
||||
"session.child.promptDisabled": "Ekki er hægt að biðja um undirboðslotur.",
|
||||
"session.child.backToParent": "Aftur í aðalfund.",
|
||||
"prompt.action.attachFile": "Bæta við skrám",
|
||||
"prompt.toast.attachmentDuplicate.title": "Þessari skrá hefur þegar verið hlaðið upp",
|
||||
|
||||
@@ -360,7 +360,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Chiedi qualsiasi cosa… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Non è possibile inviare prompt alle sessioni dei subagenti.",
|
||||
"session.child.backToParent": "Torna alla sessione principale.",
|
||||
"prompt.action.attachFile": "Aggiungi file",
|
||||
"prompt.toast.attachmentDuplicate.title": "Questo file è già stato caricato",
|
||||
|
||||
@@ -215,7 +215,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": '何でも聞いてください… "{{example}}"',
|
||||
"prompt.mode.shell": "シェル",
|
||||
"prompt.mode.normal": "プロンプト",
|
||||
"session.child.promptDisabled": "サブエージェントのセッションにはプロンプトを送信できません。",
|
||||
"session.child.backToParent": "メインセッションに戻る。",
|
||||
"prompt.action.attachFile": "ファイルを添付",
|
||||
"prompt.toast.attachmentDuplicate.title": "このファイルはすでにアップロードされています",
|
||||
|
||||
@@ -206,7 +206,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'იკითხეთ რაიმე… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "მოთხოვნა",
|
||||
"session.child.promptDisabled": "სუბაგენტის სესიების მოთხოვნა შეუძლებელია.",
|
||||
"session.child.backToParent": "უკან მთავარ სესიაზე.",
|
||||
"prompt.action.attachFile": "ფაილების დამატება",
|
||||
"prompt.toast.attachmentDuplicate.title": "ეს ფაილი უკვე ატვირთულია",
|
||||
|
||||
@@ -211,7 +211,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'សួរអ្វីក៏បាន… "{{example}}"',
|
||||
"prompt.mode.shell": "សែល",
|
||||
"prompt.mode.normal": "ប្រអប់បញ្ចូល",
|
||||
"session.child.promptDisabled": "សម័យ Subagent មិនអាចត្រូវបានសួរ។",
|
||||
"session.child.backToParent": "ត្រឡប់ទៅសម័យមេ។",
|
||||
"prompt.action.attachFile": "បន្ថែមឯកសារ",
|
||||
"prompt.toast.attachmentDuplicate.title": "ឯកសារនេះត្រូវបានផ្ទុកឡើងរួចហើយ",
|
||||
|
||||
@@ -444,7 +444,6 @@ export const dict = {
|
||||
"model.tooltip.provider": "공급자",
|
||||
"model.tooltip.reasoning": "추론",
|
||||
"common.clear": "지우기",
|
||||
"session.child.promptDisabled": "하위 에이전트 세션에는 프롬프트를 입력할 수 없습니다.",
|
||||
"session.child.backToParent": "메인 세션으로 돌아가기.",
|
||||
|
||||
"error.page.description.localServerStartup": "로컬 서버를 시작하는 동안 오류가 발생했습니다.",
|
||||
|
||||
@@ -211,7 +211,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'ຖາມຫຍັງ … "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "ບໍ່ສາມາດສົ່ງ prompt ໃຫ້ເຊດຊັນ subagent ໄດ້.",
|
||||
"session.child.backToParent": "ກັບໄປທີ່ເຊດຊັນຫຼັກ.",
|
||||
"prompt.action.attachFile": "ເພີ່ມໄຟລ໌",
|
||||
"prompt.toast.attachmentDuplicate.title": "ໄຟລ໌ນີ້ໄດ້ຖືກອັບໂຫລດໄປກ່ອນແລ້ວ",
|
||||
|
||||
@@ -219,7 +219,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Paklauskite bet ko… "{{example}}"',
|
||||
"prompt.mode.shell": "Apvalkalas",
|
||||
"prompt.mode.normal": "Užklausa",
|
||||
"session.child.promptDisabled": "Poagento seansui negalima siųsti užklausų.",
|
||||
"session.child.backToParent": "Grįžti į pagrindinį seansą.",
|
||||
"prompt.action.attachFile": "Pridėti failus",
|
||||
"prompt.toast.attachmentDuplicate.title": "Šis failas jau buvo įkeltas",
|
||||
|
||||
@@ -206,7 +206,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Uzdodiet jebko… "{{example}}"',
|
||||
"prompt.mode.shell": "Čaula",
|
||||
"prompt.mode.normal": "Uzdot",
|
||||
"session.child.promptDisabled": "Apakšaģenta sesijās nevar uzdot jautājumus.",
|
||||
"session.child.backToParent": "Atpakaļ uz galveno sesiju.",
|
||||
"prompt.action.attachFile": "Pievienot failus",
|
||||
"prompt.toast.attachmentDuplicate.title": "Šis fails jau ir augšupielādēts",
|
||||
|
||||
@@ -207,7 +207,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Прашај што било… "{{example}}"',
|
||||
"prompt.mode.shell": "Школка",
|
||||
"prompt.mode.normal": "Прашај",
|
||||
"session.child.promptDisabled": "Сесиите на субагентите не можат да бидат поттикнати.",
|
||||
"session.child.backToParent": "Назад на главната сесија.",
|
||||
"prompt.action.attachFile": "Додадете датотеки",
|
||||
"prompt.toast.attachmentDuplicate.title": "Оваа датотека е веќе поставена",
|
||||
|
||||
@@ -207,7 +207,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Юу ч асуугаарай… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Промпт",
|
||||
"session.child.promptDisabled": "Subagent сессийг сануулах боломжгүй.",
|
||||
"session.child.backToParent": "Үндсэн хуралдаан руу буцах.",
|
||||
"prompt.action.attachFile": "Файл нэмэх",
|
||||
"prompt.toast.attachmentDuplicate.title": "Энэ файлыг аль хэдийн байршуулсан байна",
|
||||
|
||||
@@ -212,7 +212,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Tanya apa-apa… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Arahan",
|
||||
"session.child.promptDisabled": "Sesi subagen tidak boleh diprompt.",
|
||||
"session.child.backToParent": "Kembali ke sesi utama.",
|
||||
"prompt.action.attachFile": "Tambah fail",
|
||||
"prompt.toast.attachmentDuplicate.title": "Fail ini telah dimuat naik",
|
||||
|
||||
@@ -212,7 +212,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'ဘာမဆိုမေးပါ… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Subagent ဆက်ရှင်များကို တောင်းဆို၍မရပါ။",
|
||||
"session.child.backToParent": "ပင်မစက်ရှင်သို့ ပြန်သွားရန်။",
|
||||
"prompt.action.attachFile": "ဖိုင်များထည့်ပါ။",
|
||||
"prompt.toast.attachmentDuplicate.title": "ဤဖိုင်ကို အပ်လုဒ်လုပ်ပြီးပါပြီ။",
|
||||
|
||||
@@ -211,7 +211,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'केहि सोध्नुहोस्… "{{example}}"',
|
||||
"prompt.mode.shell": "शेल",
|
||||
"prompt.mode.normal": "प्रम्प्ट",
|
||||
"session.child.promptDisabled": "Subagent सत्रहरू प्रोम्प्ट गर्न सकिँदैन।",
|
||||
"session.child.backToParent": "मुख्य सत्रमा फर्कनुहोस्।",
|
||||
"prompt.action.attachFile": "फाइलहरू थप्नुहोस्",
|
||||
"prompt.toast.attachmentDuplicate.title": "यो फाइल पहिले नै अपलोड गरिएको छ",
|
||||
|
||||
@@ -411,7 +411,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Vraag wat je wilt… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Je kunt geen prompts naar subagentsessies sturen.",
|
||||
"session.child.backToParent": "Terug naar de hoofdsessie.",
|
||||
"prompt.action.attachFile": "Bestanden toevoegen",
|
||||
"prompt.toast.attachmentDuplicate.title": "Dit bestand is al geüpload",
|
||||
|
||||
@@ -761,7 +761,6 @@ export const dict = {
|
||||
|
||||
"common.clear": "Tøm",
|
||||
|
||||
"session.child.promptDisabled": "Underagentsesjoner kan ikke motta forespørsler.",
|
||||
"session.child.backToParent": "Tilbake til hovedsesjonen.",
|
||||
|
||||
"error.page.description.localServerStartup": "Det oppstod en feil under oppstart av den lokale serveren.",
|
||||
|
||||
@@ -214,7 +214,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'کجھ وی پچھ… "\u2068{{example}}\u2069"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "پرامپٹ",
|
||||
"session.child.promptDisabled": "ذیلی ایجنٹ سیشناں نو اشارہ نئیں کیتا جا سکدا۔",
|
||||
"session.child.backToParent": "مین سیشن تے واپس جاؤ۔",
|
||||
"prompt.action.attachFile": "فائلاں شامل کرو",
|
||||
"prompt.toast.attachmentDuplicate.title": "ایہہ فائل پہلے ای اپ لوڈ ہو چکی اے",
|
||||
|
||||
@@ -210,7 +210,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Zapytaj o cokolwiek… "{{example}}"',
|
||||
"prompt.mode.shell": "Terminal",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Nie można wysyłać promptów w sesjach podagentów.",
|
||||
"session.child.backToParent": "Wróć do głównej sesji.",
|
||||
"prompt.action.attachFile": "Dodaj pliki",
|
||||
"prompt.toast.attachmentDuplicate.title": "Ten plik został już przesłany",
|
||||
|
||||
@@ -206,7 +206,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": "Întreabă orice… „{{example}}”",
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Solicitare",
|
||||
"session.child.promptDisabled": "Sesiunile subagent nu pot fi interogate.",
|
||||
"session.child.backToParent": "Înapoi la sesiunea principală.",
|
||||
"prompt.action.attachFile": "Adaugă fișiere",
|
||||
"prompt.toast.attachmentDuplicate.title": "Acest fișier a fost deja încărcat",
|
||||
|
||||
@@ -224,7 +224,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Спросите что угодно… "{{example}}"',
|
||||
"prompt.mode.shell": "Оболочка",
|
||||
"prompt.mode.normal": "Промпт",
|
||||
"session.child.promptDisabled": "В сессиях субагентов нельзя отправлять запросы.",
|
||||
"session.child.backToParent": "Вернуться к основной сессии.",
|
||||
|
||||
"prompt.action.attachFile": "Прикрепить файл",
|
||||
|
||||
@@ -210,7 +210,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'ඕනෑම දෙයක් අසන්න… "{{example}}"',
|
||||
"prompt.mode.shell": "ෂෙල්",
|
||||
"prompt.mode.normal": "ප්රොම්ප්ට්",
|
||||
"session.child.promptDisabled": "උපකාරක සැසි ඉල්ලා සිටිය නොහැක.",
|
||||
"session.child.backToParent": "ප්රධාන සැසිය වෙත ආපසු.",
|
||||
"prompt.action.attachFile": "ගොනු එකතු කරන්න",
|
||||
"prompt.toast.attachmentDuplicate.title": "මෙම ගොනුව දැනටමත් උඩුගත කර ඇත",
|
||||
|
||||
@@ -232,7 +232,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": "Opýtajte sa na čokoľvek… „{{example}}“",
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Výzva",
|
||||
"session.child.promptDisabled": "V reláciách podagenta nie je možné zadávať výzvy.",
|
||||
"session.child.backToParent": "Späť na hlavnú reláciu.",
|
||||
"prompt.action.attachFile": "Pridať súbory",
|
||||
"prompt.toast.attachmentDuplicate.title": "Tento súbor už bol nahraný",
|
||||
|
||||
@@ -232,7 +232,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Vprašajte karkoli … "{{example}}"',
|
||||
"prompt.mode.shell": "školjka",
|
||||
"prompt.mode.normal": "Poziv",
|
||||
"session.child.promptDisabled": "Sej podagenta ni mogoče pozvati.",
|
||||
"session.child.backToParent": "Nazaj na glavno sejo.",
|
||||
"prompt.action.attachFile": "Dodajte datoteke",
|
||||
"prompt.toast.attachmentDuplicate.title": "Ta datoteka je že naložena",
|
||||
|
||||
@@ -207,7 +207,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Pyet çdo gjë… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Kërkesë",
|
||||
"session.child.promptDisabled": "Seancat e nënagjentit nuk mund të kërkohen.",
|
||||
"session.child.backToParent": "Kthehu në sesionin kryesor.",
|
||||
"prompt.action.attachFile": "Shtoni skedarë",
|
||||
"prompt.toast.attachmentDuplicate.title": "Ky skedar tashmë është ngarkuar",
|
||||
|
||||
@@ -220,7 +220,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Питајте било шта… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Промпт",
|
||||
"session.child.promptDisabled": "сесије субагента не могу да буду упитане.",
|
||||
"session.child.backToParent": "Назад на главну сесију.",
|
||||
"prompt.action.attachFile": "Додајте датотеке",
|
||||
"prompt.toast.attachmentDuplicate.title": "Ова датотека је већ отпремљена",
|
||||
|
||||
@@ -405,7 +405,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Fråga vad som helst… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Det går inte att skicka promptar till underagentsessioner.",
|
||||
"session.child.backToParent": "Tillbaka till huvudsessionen.",
|
||||
"prompt.action.attachFile": "Lägg till filer",
|
||||
"prompt.toast.attachmentDuplicate.title": "Den här filen har redan laddats upp",
|
||||
|
||||
@@ -207,7 +207,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Ҳама чизро пурсед… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Промпт",
|
||||
"session.child.promptDisabled": "Сеансҳои субагентро дархост кардан мумкин нест.",
|
||||
"session.child.backToParent": "Бозгашт ба ҷаласаи асосӣ.",
|
||||
"prompt.action.attachFile": "Илова кардани файлҳо",
|
||||
"prompt.toast.attachmentDuplicate.title": "Ин файл аллакай бор карда шудааст",
|
||||
|
||||
@@ -230,7 +230,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'ถามอะไรก็ได้… "{{example}}"',
|
||||
"prompt.mode.shell": "เชลล์",
|
||||
"prompt.mode.normal": "พรอมต์",
|
||||
"session.child.promptDisabled": "ไม่สามารถส่งพรอมต์ในเซสชันเอเจนต์ย่อยได้",
|
||||
"session.child.backToParent": "กลับไปยังเซสชันหลัก",
|
||||
|
||||
"prompt.action.attachFile": "แนบไฟล์",
|
||||
|
||||
@@ -207,7 +207,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Islän zadyňyzy soraň … "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "Subagent sessiýalary soralyp bilinmez.",
|
||||
"session.child.backToParent": "Esasy sessiýa dolan.",
|
||||
"prompt.action.attachFile": "Faýl goşuň",
|
||||
"prompt.toast.attachmentDuplicate.title": "Bu faýl eýýäm ýüklendi",
|
||||
|
||||
@@ -237,7 +237,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Bir şeyler sorun… "{{example}}"',
|
||||
"prompt.mode.shell": "Kabuk",
|
||||
"prompt.mode.normal": "İstem",
|
||||
"session.child.promptDisabled": "Alt ajan oturumlarına istem gönderilemez.",
|
||||
"session.child.backToParent": "Ana oturuma dön.",
|
||||
|
||||
"prompt.action.attachFile": "Dosya ekle",
|
||||
|
||||
@@ -253,7 +253,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Запитайте що завгодно… "{{example}}"',
|
||||
"prompt.mode.shell": "Команда",
|
||||
"prompt.mode.normal": "Запит",
|
||||
"session.child.promptDisabled": "Сесії підагентів не можна надсилати запити.",
|
||||
"session.child.backToParent": "Назад до основної сесії.",
|
||||
|
||||
"prompt.action.attachFile": "Додати файли",
|
||||
|
||||
@@ -215,7 +215,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'کچھ بھی پوچھیں… "\u2068{{example}}\u2069"',
|
||||
"prompt.mode.shell": "شیل",
|
||||
"prompt.mode.normal": "پرامپٹ",
|
||||
"session.child.promptDisabled": "ذیلی ایجنٹ کے سیشنز میں پرامپٹ نہیں دیا جا سکتا۔",
|
||||
"session.child.backToParent": "مرکزی سیشن پر واپس جائیں۔",
|
||||
"prompt.action.attachFile": "فائلیں شامل کریں۔",
|
||||
"prompt.toast.attachmentDuplicate.title": "یہ فائل پہلے ہی اپ لوڈ ہو چکی ہے",
|
||||
|
||||
@@ -207,7 +207,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Har qanday narsani so\'rang… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Tezkor",
|
||||
"session.child.promptDisabled": "Subagent seanslarini so'rash mumkin emas.",
|
||||
"session.child.backToParent": "Asosiy sessiyaga qaytish.",
|
||||
"prompt.action.attachFile": "Fayllarni qo'shish",
|
||||
"prompt.toast.attachmentDuplicate.title": "Bu fayl allaqachon yuklangan",
|
||||
|
||||
@@ -217,7 +217,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": 'Hỏi bất cứ điều gì… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Lời nhắc",
|
||||
"session.child.promptDisabled": "Không thể gửi lời nhắc trong phiên tác nhân phụ.",
|
||||
"session.child.backToParent": "Quay lại phiên chính.",
|
||||
"prompt.action.attachFile": "Thêm tệp",
|
||||
"prompt.toast.attachmentDuplicate.title": "Tệp này đã được tải lên",
|
||||
|
||||
@@ -250,7 +250,6 @@ export const dict = {
|
||||
"prompt.placeholder.normal": '随便问点什么… "{{example}}"',
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "无法向子智能体会话发送提示词。",
|
||||
"session.child.backToParent": "返回主会话。",
|
||||
"prompt.action.attachFile": "附加文件",
|
||||
"prompt.toast.attachmentDuplicate.title": "此文件已上传",
|
||||
|
||||
@@ -232,7 +232,6 @@ export const dict = {
|
||||
"prompt.placeholder.shell": "輸入 shell 命令… {{example}}",
|
||||
"prompt.mode.shell": "Shell",
|
||||
"prompt.mode.normal": "Prompt",
|
||||
"session.child.promptDisabled": "無法在子代理程式工作階段中輸入提示詞。",
|
||||
"session.child.backToParent": "返回主要工作階段。",
|
||||
|
||||
"prompt.action.attachFile": "附加檔案",
|
||||
|
||||
@@ -35,6 +35,9 @@ import { SessionQueuePanel } from "./queue-panel"
|
||||
import { SessionActivityChips, type SessionActivityItem } from "./activity-chips"
|
||||
import { useOpenSessionRoute } from "../session-identity-header"
|
||||
import { resolveSessionComposerSelection } from "./selection"
|
||||
import { composerProviderName } from "@/composer/selection"
|
||||
import { useProviders } from "@/providers/catalog/providers"
|
||||
import { SubagentBar } from "./subagent-bar"
|
||||
import { createSessionRequestModel } from "../requests/model"
|
||||
import type { Region } from "@/runtime/extension/panels"
|
||||
import { SessionLocationMissing } from "./location-missing"
|
||||
@@ -393,9 +396,46 @@ export function ActiveSessionComposerRegion(props: {
|
||||
)
|
||||
}
|
||||
|
||||
const providers = useProviders(() => props.session.data.info()?.location.directory)
|
||||
|
||||
const subagentModel = () => {
|
||||
const ref =
|
||||
props.session.data.info()?.model ??
|
||||
props.session.history.messages().findLast((message) => message.type === "assistant")?.model
|
||||
|
||||
if (!ref) return
|
||||
const catalog = providers.all()
|
||||
|
||||
return {
|
||||
provider: composerProviderName(ref.providerID, catalog),
|
||||
name: catalog.get(ref.providerID)?.models[ref.id]?.name.replace("(latest)", "").trim() ?? ref.id,
|
||||
variant: ref.variant,
|
||||
}
|
||||
}
|
||||
|
||||
const subagentStatus = () => {
|
||||
if (props.session.data.working()) return "running"
|
||||
|
||||
return props.session.data.info()?.outcome
|
||||
}
|
||||
|
||||
return (
|
||||
<SessionComposerRegion
|
||||
controller={props.model.region}
|
||||
subagent={
|
||||
<Show when={props.session.data.info()}>
|
||||
{(info) => (
|
||||
<SubagentBar
|
||||
agent={info().agent}
|
||||
model={subagentModel()}
|
||||
status={subagentStatus()}
|
||||
started={info().time.created}
|
||||
ended={subagentStatus() === "running" ? undefined : (info().time.idle ?? info().time.updated)}
|
||||
onBack={props.model.region.openParent}
|
||||
/>
|
||||
)}
|
||||
</Show>
|
||||
}
|
||||
composer={
|
||||
<Show
|
||||
when={missing()}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Show, type JSX } from "solid-js"
|
||||
import { useLanguage } from "@/runtime/i18n/language"
|
||||
import { SessionPermissionDock } from "@/session/requests/session-permission-dock"
|
||||
import { SessionQuestionDock } from "@/session/requests/session-question-dock"
|
||||
import { SessionWebSearchDock } from "@/session/requests/session-websearch-dock"
|
||||
@@ -12,14 +11,14 @@ type SessionComposerRegionState = Pick<
|
||||
|
||||
export type SessionComposerRegionViewController = Pick<
|
||||
SessionComposerRegionController,
|
||||
"centered" | "onResponseSubmit" | "openParent" | "setPromptRef" | "setDockRef" | "parentID" | "child" | "showComposer"
|
||||
"centered" | "onResponseSubmit" | "setDockRef" | "child" | "showComposer"
|
||||
> & { state: SessionComposerRegionState }
|
||||
|
||||
export function SessionComposerRegion(props: {
|
||||
controller: SessionComposerRegionViewController
|
||||
composer: JSX.Element
|
||||
subagent: JSX.Element
|
||||
}) {
|
||||
const language = useLanguage()
|
||||
const controller = props.controller
|
||||
|
||||
return (
|
||||
@@ -68,21 +67,7 @@ export function SessionComposerRegion(props: {
|
||||
}}
|
||||
>
|
||||
<Show when={controller.child()} fallback={<Show when={!controller.state.blocked()}>{props.composer}</Show>}>
|
||||
<div
|
||||
ref={controller.setPromptRef}
|
||||
class="w-full rounded-[12px] border border-border-weak-base bg-background-base p-3 text-16-regular text-text-weak"
|
||||
>
|
||||
<span>{language.t("session.child.promptDisabled")} </span>
|
||||
<Show when={controller.parentID()}>
|
||||
<button
|
||||
type="button"
|
||||
class="text-text-base transition-colors hover:text-text-strong"
|
||||
onClick={controller.openParent}
|
||||
>
|
||||
{language.t("session.child.backToParent")}
|
||||
</button>
|
||||
</Show>
|
||||
</div>
|
||||
{props.subagent}
|
||||
</Show>
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
import { Button } from "@opencode/ui/button"
|
||||
import { Icon } from "@opencode/ui/icon"
|
||||
import { Keybind } from "@opencode/ui/keybind"
|
||||
import { SessionProgressIndicatorV2 } from "@opencode/session-ui/v2/session-progress-indicator-v2"
|
||||
import { createEffect, createSignal, Match, onCleanup, Show, Switch } from "solid-js"
|
||||
import { useLanguage } from "@/runtime/i18n/language"
|
||||
import { formatKeybind } from "@/shell/commands/command"
|
||||
import { formatElapsed } from "./activity-chips"
|
||||
|
||||
export type SubagentStatus = "running" | "succeeded" | "failed" | "interrupted"
|
||||
|
||||
// A subagent session takes no prompts, so its composer slot shows what the run is: the composer's geometry with the
|
||||
// agent, model and variant where the composer's chips sit, the run's state where the placeholder sits, and the way back
|
||||
// where the send button sits.
|
||||
export function SubagentBar(props: {
|
||||
agent?: string
|
||||
model?: { provider?: string; name: string; variant?: string }
|
||||
status?: SubagentStatus
|
||||
started: number
|
||||
ended?: number
|
||||
onBack: () => void
|
||||
}) {
|
||||
const language = useLanguage()
|
||||
const [now, setNow] = createSignal(Date.now())
|
||||
|
||||
createEffect(() => {
|
||||
if (props.status !== "running") return
|
||||
|
||||
setNow(Date.now())
|
||||
const timer = setInterval(() => setNow(Date.now()), 1000)
|
||||
onCleanup(() => clearInterval(timer))
|
||||
})
|
||||
|
||||
return (
|
||||
<div
|
||||
data-component="subagent-bar"
|
||||
data-dock-border-underlay="true"
|
||||
class="w-full overflow-clip rounded-xl bg-v2-background-bg-base text-[13px] font-[440] leading-5 tabular-nums [[data-color-scheme=dark]_&]:bg-v2-background-bg-layer-01"
|
||||
>
|
||||
<div class="min-h-[60px] px-4 pt-4 pb-2 text-v2-text-text-faint">
|
||||
<Show when={props.status}>
|
||||
{(status) => (
|
||||
<>
|
||||
{language.t(`session.child.status.${status()}`)}
|
||||
{" · "}
|
||||
{formatElapsed((props.ended ?? now()) - props.started, language.t)}
|
||||
</>
|
||||
)}
|
||||
</Show>
|
||||
</div>
|
||||
<div class="flex h-11 items-center px-2">
|
||||
<span class="flex size-7 shrink-0 items-center justify-center text-v2-icon-icon-muted">
|
||||
<Switch>
|
||||
<Match when={props.status === "running"}>
|
||||
<SessionProgressIndicatorV2 />
|
||||
</Match>
|
||||
<Match when={props.status === "succeeded"}>
|
||||
<Icon name="check" size="small" />
|
||||
</Match>
|
||||
<Match when={props.status === "failed"}>
|
||||
<Icon name="circle-xmark" size="small" />
|
||||
</Match>
|
||||
<Match when={props.status === "interrupted"}>
|
||||
<Icon name="outline-xmark" size="small" />
|
||||
</Match>
|
||||
</Switch>
|
||||
</span>
|
||||
<div class="ms-1 me-3 flex min-w-0 flex-1 items-center gap-1 whitespace-nowrap text-v2-text-text-muted">
|
||||
<Show when={props.agent}>
|
||||
{(agent) => <span class="shrink-0 px-[11px] capitalize">{agent()}</span>}
|
||||
</Show>
|
||||
<Show when={props.model}>
|
||||
{(model) => (
|
||||
<>
|
||||
<span data-slot="subagent-model" class="flex min-w-0 px-[11px]">
|
||||
<Show when={model().provider}>
|
||||
<span class="shrink-0 text-v2-text-text-faint">{model().provider}</span>
|
||||
<span class="shrink-0 whitespace-pre text-v2-text-text-faint">{" / "}</span>
|
||||
</Show>
|
||||
<span class="truncate">{model().name}</span>
|
||||
</span>
|
||||
<Show when={model().variant !== "default" && model().variant}>
|
||||
<span class="shrink-0 px-[11px] capitalize">{model().variant}</span>
|
||||
</Show>
|
||||
</>
|
||||
)}
|
||||
</Show>
|
||||
</div>
|
||||
<Button type="button" variant="ghost-faint" size="small" class="gap-1.5 px-1.5" onClick={props.onBack}>
|
||||
{language.t("session.child.backToParent")}
|
||||
<span class="hidden sm:block">
|
||||
<Keybind keys={[formatKeybind("esc", language.t)]} variant="neutral" />
|
||||
</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -208,7 +208,29 @@ export const ChildSession = {
|
||||
title="Inspect the child Session"
|
||||
description={description}
|
||||
document={subagentDocument}
|
||||
child={{ parentID: "ses_story_parent" }}
|
||||
child={{
|
||||
agent: "surveyor",
|
||||
model: { provider: "Anthropic", name: "Claude Opus 5.5", variant: "high" },
|
||||
status: "running",
|
||||
started: Date.now() - 65_000,
|
||||
}}
|
||||
/>
|
||||
),
|
||||
}
|
||||
|
||||
export const ChildSessionDone = {
|
||||
render: () => (
|
||||
<SessionPreview
|
||||
title="Inspect a finished child Session"
|
||||
description={description}
|
||||
document={subagentDocument}
|
||||
child={{
|
||||
agent: "surveyor",
|
||||
model: { provider: "Anthropic", name: "Claude Opus 5.5", variant: "high" },
|
||||
status: "succeeded",
|
||||
started: 0,
|
||||
ended: 252_000,
|
||||
}}
|
||||
/>
|
||||
),
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
type SessionComposerRegionViewController,
|
||||
} from "@/session/composer/session-composer-region"
|
||||
import { SessionActivityChips, type SessionActivityItem } from "@/session/composer/activity-chips"
|
||||
import { SubagentBar } from "@/session/composer/subagent-bar"
|
||||
import { SessionPanelFrame, SessionRouteFrame } from "@/session/session-frame"
|
||||
import type { FormInfo, PermissionRequest, SessionStatus } from "@opencode/client/promise"
|
||||
import type { SessionDocument } from "@opencode/session-ui/document"
|
||||
@@ -18,7 +19,7 @@ import type { ComposerPersistedState } from "@/composer/types"
|
||||
import { Button } from "@opencode/ui/button"
|
||||
import { Icon } from "@opencode/ui/icon"
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/solid-query"
|
||||
import { Show } from "solid-js"
|
||||
import { Show, type ComponentProps } from "solid-js"
|
||||
import { createStore } from "solid-js/store"
|
||||
import { useLanguage } from "@/runtime/i18n/language"
|
||||
import type { WebSearchRequestModel } from "./requests/websearch"
|
||||
@@ -86,7 +87,7 @@ export type SessionPreviewProps = {
|
||||
draft?: string
|
||||
request?: { type: "permission"; value: PermissionRequest } | { type: "question" | "websearch"; value: FormInfo }
|
||||
reviewOpened?: boolean
|
||||
child?: { parentID: string }
|
||||
child?: Omit<ComponentProps<typeof SubagentBar>, "onBack">
|
||||
activity?: {
|
||||
subagents: SessionActivityItem[]
|
||||
shells: SessionActivityItem[]
|
||||
@@ -245,10 +246,7 @@ function SessionSurfaceState(props: SessionPreviewProps & { onReset: () => void
|
||||
setState("request", undefined)
|
||||
setState("activity", "Submitted the answer locally")
|
||||
},
|
||||
openParent: () => setState("activity", "Opened the parent Session locally"),
|
||||
setPromptRef() {},
|
||||
setDockRef() {},
|
||||
parentID: () => props.child?.parentID,
|
||||
child: () => !!props.child,
|
||||
showComposer: () => true,
|
||||
} satisfies SessionComposerRegionViewController
|
||||
@@ -286,6 +284,16 @@ function SessionSurfaceState(props: SessionPreviewProps & { onReset: () => void
|
||||
</div>
|
||||
<SessionComposerRegion
|
||||
controller={region}
|
||||
subagent={
|
||||
<Show when={props.child}>
|
||||
{(child) => (
|
||||
<SubagentBar
|
||||
{...child()}
|
||||
onBack={() => setState("activity", "Opened the parent Session locally")}
|
||||
/>
|
||||
)}
|
||||
</Show>
|
||||
}
|
||||
composer={
|
||||
<div class="relative">
|
||||
<SessionActivityChips
|
||||
|
||||
Reference in New Issue
Block a user