diff --git a/calliope-backend/src/calliope/routers/agent.py b/calliope-backend/src/calliope/routers/agent.py index 1246296e..daca3595 100644 --- a/calliope-backend/src/calliope/routers/agent.py +++ b/calliope-backend/src/calliope/routers/agent.py @@ -97,7 +97,7 @@ class MemoryCreate(BaseModel): class MessageCreate(BaseModel): content: str = "" - mentions: list[MessageMention] = Field(default_factory=list, max_length=1) + mentions: list[MessageMention] = Field(default_factory=list, max_length=5) attachments: list[MessageAttachment] = Field(default_factory=list, max_length=8) answer_to: int | None = None # question/asked seq this message answers (card click) @@ -113,8 +113,10 @@ class MessageCreate(BaseModel): @field_validator("mentions") @classmethod def _one_workflow(cls, v: list[MessageMention]) -> list[MessageMention]: - if len(v) > 1: + if sum(m.type == "workflow" for m in v) > 1: raise ValueError("Only one @workflow mention per message") + if sum(m.type == "skill" for m in v) > 4: + raise ValueError("At most four skill mentions per message") return v diff --git a/calliope-backend/tests/test_agent_mention_limits.py b/calliope-backend/tests/test_agent_mention_limits.py new file mode 100644 index 00000000..ecf6e462 --- /dev/null +++ b/calliope-backend/tests/test_agent_mention_limits.py @@ -0,0 +1,36 @@ +"""Workflow uniqueness is independent of the selected task skills.""" +import pytest +from pydantic import ValidationError +from calliope.routers.agent import MessageCreate + + +def workflow(n=1): + return {"type": "workflow", "id": n, "name": f"workflow-{n}", "kind": "image"} + + +def skill(n=1): + return {"type": "skill", "name": f"skill-{n}"} + + +def test_workflow_and_skills_can_be_sent_together(): + message = MessageCreate(content="Create an image", mentions=[workflow(), *[skill(i) for i in range(4)]]) + assert len(message.mentions) == 5 + assert message.mentions[0].id == 1 + + +def test_legacy_single_workflow_is_accepted(): + assert MessageCreate(mentions=[workflow()]).mentions[0].type == "workflow" + + +def test_skills_without_workflow_are_accepted(): + assert len(MessageCreate(mentions=[skill(i) for i in range(4)]).mentions) == 4 + + +def test_second_workflow_is_still_rejected(): + with pytest.raises(ValidationError, match="Only one @workflow"): + MessageCreate(mentions=[workflow(), skill(), workflow(2)]) + + +def test_fifth_skill_is_rejected(): + with pytest.raises(ValidationError, match="At most four skill"): + MessageCreate(mentions=[skill(i) for i in range(5)]) diff --git a/calliope-web/src/lib/actions/spotlight.ts b/calliope-web/src/lib/actions/spotlight.ts new file mode 100644 index 00000000..c56b329c --- /dev/null +++ b/calliope-web/src/lib/actions/spotlight.ts @@ -0,0 +1,17 @@ +import type { Action } from 'svelte/action'; + +/** A local honeycomb highlight follows the pointer, independent of selected state. */ +export const spotlight: Action = (node) => { + const move = (event: PointerEvent) => { + if ( + document.documentElement.dataset.reduce === '1' || + event.pointerType === 'touch' + ) + return; + const rect = node.getBoundingClientRect(); + node.style.setProperty('--pointer-x', `${event.clientX - rect.left}px`); + node.style.setProperty('--pointer-y', `${event.clientY - rect.top}px`); + }; + node.addEventListener('pointermove', move); + return { destroy: () => node.removeEventListener('pointermove', move) }; +}; diff --git a/calliope-web/src/lib/components/desk/DeskWorkflowRail.svelte b/calliope-web/src/lib/components/desk/DeskWorkflowRail.svelte new file mode 100644 index 00000000..3fec2acf --- /dev/null +++ b/calliope-web/src/lib/components/desk/DeskWorkflowRail.svelte @@ -0,0 +1,483 @@ + + + + + diff --git a/calliope-web/src/lib/components/desk/StudioDesk.svelte b/calliope-web/src/lib/components/desk/StudioDesk.svelte index a031fb7d..83a137ae 100644 --- a/calliope-web/src/lib/components/desk/StudioDesk.svelte +++ b/calliope-web/src/lib/components/desk/StudioDesk.svelte @@ -15,7 +15,10 @@ import TakeFeed from '$lib/components/generate/TakeFeed.svelte'; import ResultRail from './ResultRail.svelte'; import { createTakeDeleteQueue } from '$lib/components/generate/takeDelete.svelte'; - import { readDeskContext, workbenchContextOf } from '$lib/components/generate/context'; + import { + readDeskContext, + workbenchContextOf, + } from '$lib/components/generate/context'; import { changedParams, classifySchema, @@ -29,9 +32,14 @@ type FormValue, type FormValues, } from '$lib/components/generate/schema'; - import { matchesFilter, workbenchCtxOf, type FeedFilter } from '$lib/components/generate/takes'; + import { + matchesFilter, + workbenchCtxOf, + type FeedFilter, + } from '$lib/components/generate/takes'; import InputRequirementBadge from './InputRequirementBadge.svelte'; import WorkflowBay from './WorkflowBay.svelte'; + import DeskWorkflowRail from './DeskWorkflowRail.svelte'; import { apiErrorMessage, assetUrl, @@ -103,16 +111,23 @@ ); const endpoints = $derived($settingsQuery.data?.comfyui_endpoints ?? []); - const activeId = $derived($settingsQuery.data?.comfyui_active_id ?? endpoints[0]?.id ?? ''); + const activeId = $derived( + $settingsQuery.data?.comfyui_active_id ?? endpoints[0]?.id ?? '', + ); const dryRun = $derived($settingsQuery.data?.dry_run === true); // Picker-side metadata: runnable rows of this kind + honest pending count. const allMetas = $derived($metaQuery.data ?? []); const metaById = $derived(new Map(allMetas.map((m) => [m.id, m]))); const deskMetas = $derived( - allMetas.filter((m) => m.is_enabled && m.usage !== null && !m.needs_mapping && m.kind === kind), + allMetas.filter( + (m) => + m.is_enabled && m.usage !== null && !m.needs_mapping && m.kind === kind, + ), + ); + const pendingCount = $derived( + allMetas.filter((m) => m.needs_mapping && m.kind === kind).length, ); - const pendingCount = $derived(allMetas.filter((m) => m.needs_mapping && m.kind === kind).length); // Full records, lazily fetched per id (selected workflow, feed jobs' // workflows, the bay's preview row) and cached until invalidated. @@ -206,7 +221,9 @@ // The SSE backlog replays old failures on every connect. const known = allJobs.find((j) => j.id === id); if (submittedIds.has(id) || (known && known.status !== 'failed')) { - toast.error(t('studio.jobFailedToast', { detail: String(ev.data.error ?? '') })); + toast.error( + t('studio.jobFailedToast', { detail: String(ev.data.error ?? '') }), + ); } flashTake(id, 400, shakeIds); } @@ -236,11 +253,16 @@ let mode = $state(untrack(initMode)); function initMode(): TaskMode { const q = page.url.searchParams.get('mode'); - return q && USAGE_BY_KIND[kind].includes(q as WorkflowUsage) ? (q as WorkflowUsage) : 'all'; + return q && USAGE_BY_KIND[kind].includes(q as WorkflowUsage) + ? (q as WorkflowUsage) + : 'all'; } let bayOpen = $state(false); let paramsOpen = $state(false); + let paramDraft = $state(null); + let paramEndpoint = $state(''); + let paramShowErrors = $state(false); let historyOpen = $state(false); let focusMode = $state(false); let bayActiveId = $state(null); @@ -254,7 +276,9 @@ function closeBay() { bayOpen = false; - void tick().then(() => document.querySelector('.model-selector')?.focus()); + void tick().then(() => + document.querySelector('.model-selector')?.focus(), + ); } function pickWorkflow(id: number) { @@ -274,7 +298,10 @@ } if ($metaQuery.isLoading) return; wfDeepLinkDone = true; - if (restoredWorkflowId && deskMetas.some((m) => m.id === restoredWorkflowId)) { + if ( + restoredWorkflowId && + deskMetas.some((m) => m.id === restoredWorkflowId) + ) { workflowId = restoredWorkflowId; return; } @@ -326,9 +353,15 @@ return null; const clean: FormValues = {}; for (const [key, value] of Object.entries(d.values)) { - if (typeof value === 'string' || (typeof value === 'number' && Number.isFinite(value))) + if ( + typeof value === 'string' || + (typeof value === 'number' && Number.isFinite(value)) + ) clean[key] = value; - else if (Array.isArray(value) && value.every((v) => typeof v === 'string')) + else if ( + Array.isArray(value) && + value.every((v) => typeof v === 'string') + ) clean[key] = value; } return { workflowId: d.workflowId, values: clean }; @@ -347,7 +380,9 @@ let promptEl = $state(null); let pickerFor = $state(null); - const currentWorkflow = $derived(workflowId != null ? (details.get(workflowId) ?? null) : null); + const currentWorkflow = $derived( + workflowId != null ? (details.get(workflowId) ?? null) : null, + ); const schema = $derived(currentWorkflow?.input_schema ?? []); const ds = $derived(classifySchema(schema, currentWorkflow?.kind ?? kind)); @@ -368,7 +403,9 @@ ) return; const usages = USAGE_BY_KIND[kind]; - const candidates = deskMetas.filter((m) => m.usage != null && usages.includes(m.usage)); + const candidates = deskMetas.filter( + (m) => m.usage != null && usages.includes(m.usage), + ); const pick = usages.map((u) => candidates.find((m) => m.usage === u)).find(Boolean) ?? candidates[0] ?? @@ -381,7 +418,11 @@ * the prompt / negative prompt (by role) and uploaded images, poured * into the new workflow's image slots in order. */ - function carryOver(prev: Workflow | null, prevValues: FormValues, next: Workflow): FormValues { + function carryOver( + prev: Workflow | null, + prevValues: FormValues, + next: Workflow, + ): FormValues { const out = schemaDefaults(next.input_schema ?? []); const nextDs = classifySchema(next.input_schema ?? [], next.kind); if (!prev) return out; @@ -396,15 +437,18 @@ const images: string[] = []; for (const s of prevDs.slots) { const v = prevValues[s.inp.nodeId]; - if (s.mediaKind === 'image' && !s.mask && typeof v === 'string' && v) images.push(v); + if (s.mediaKind === 'image' && !s.mask && typeof v === 'string' && v) + images.push(v); } for (const g of prevDs.lists) if (g.kind === 'image_list') images.push(...listPaths(prevValues, g)); for (const s of nextDs.slots) { - if (s.mediaKind === 'image' && !s.mask && images.length) out[s.inp.nodeId] = images.shift()!; + if (s.mediaKind === 'image' && !s.mask && images.length) + out[s.inp.nodeId] = images.shift()!; } const list = nextDs.lists.find((g) => g.kind === 'image_list'); - if (list && images.length) out[list.nodeId] = images.slice(0, list.max ?? 9); + if (list && images.length) + out[list.nodeId] = images.slice(0, list.max ?? 9); return out; } @@ -445,7 +489,11 @@ try { window.sessionStorage.setItem( draftKey, - JSON.stringify({ workflowId: wf.id, values: inputs, source: sourceFingerprint }), + JSON.stringify({ + workflowId: wf.id, + values: inputs, + source: sourceFingerprint, + }), ); } catch { /* Storage may be unavailable; the current form still works. */ @@ -462,7 +510,8 @@ const opts = d.duration.options; const v = String(ctx.durationSec); if (!opts?.length || opts.includes(v)) - out[d.duration.nodeId] = d.duration.kind === 'number' ? ctx.durationSec : v; + out[d.duration.nodeId] = + d.duration.kind === 'number' ? ctx.durationSec : v; } return out; } @@ -475,7 +524,8 @@ const defaults = schemaDefaults(schema); const next = { ...values }; for (const inp of [...ds.common, ...ds.advanced]) { - if (defaults[inp.nodeId] !== undefined) next[inp.nodeId] = defaults[inp.nodeId]; + if (defaults[inp.nodeId] !== undefined) + next[inp.nodeId] = defaults[inp.nodeId]; else delete next[inp.nodeId]; } values = next; @@ -489,7 +539,8 @@ const probeQuery = createQuery( toStore(() => ({ queryKey: ['comfy-probe', endpointId || null], - queryFn: () => comfy.testEndpoint({ endpoint_id: endpointId, timeout_sec: 5 }), + queryFn: () => + comfy.testEndpoint({ endpoint_id: endpointId, timeout_sec: 5 }), enabled: !!endpointId, staleTime: 60_000, refetchInterval: 60_000, @@ -514,13 +565,17 @@ } const errors = $derived(validateForm(schema, ds, values)); + const paramErrors = $derived(validateForm(schema, ds, paramDraft ?? values)); const brokenReasons = $derived( - (currentWorkflow?.warnings ?? []).filter((w) => w.level === 'error').map((w) => w.message), + (currentWorkflow?.warnings ?? []) + .filter((w) => w.level === 'error') + .map((w) => w.message), ); /** The single reason 生成 is off, in the order a user can fix things. */ const block = $derived.by(() => { - if (!currentWorkflow) return { text: t('desk.needWorkflow'), tone: 'warn', target: 'desk-wf' }; + if (!currentWorkflow) + return { text: t('desk.needWorkflow'), tone: 'warn', target: 'desk-wf' }; if (!endpoints.length || !endpointId) return { text: t('studio.errNoConn'), tone: 'err', target: 'desk-conn' }; if (connRec?.ok === false && !dryRun) { @@ -530,10 +585,13 @@ target: 'desk-conn', }; } - if (brokenReasons.length) return { text: t('studio.errWfBroken'), tone: 'err', params: true }; + if (brokenReasons.length) + return { text: t('studio.errWfBroken'), tone: 'err', params: true }; const missing = missingMedia(ds, values); const promptMissing = - !!ds.prompt && !!errors[ds.prompt.nodeId] && !String(values[ds.prompt.nodeId] ?? '').trim(); + !!ds.prompt && + !!errors[ds.prompt.nodeId] && + !String(values[ds.prompt.nodeId] ?? '').trim(); if (missing.length || promptMissing) { const labels = [ ...missing.map((m) => m.label), @@ -592,7 +650,9 @@ // HEL-684: the workbench source is sent along only while the context // bar is up (dismissing it = independent generation, nothing written // to any project) and only when the full real source identity is there. - const wbSendContext = $derived(ctx && !ctxDismissed ? workbenchContextOf(ctx) : undefined); + const wbSendContext = $derived( + ctx && !ctxDismissed ? workbenchContextOf(ctx) : undefined, + ); async function submit() { if (submitting || slotBusy) return; @@ -626,7 +686,9 @@ // 最近使用由后端在入队时记录 (queue/manager);这里只刷新轻量列表。 void client.invalidateQueries({ queryKey: ['workflows-meta'] }); } catch (err) { - toast.error(t('studio.submitFailedToast', { detail: apiErrorMessage(err) })); + toast.error( + t('studio.submitFailedToast', { detail: apiErrorMessage(err) }), + ); } finally { submitting = false; } @@ -663,7 +725,9 @@ }); let nowMs = $state(Date.now()); - const anyActive = $derived(allJobs.some((j) => j.status === 'pending' || j.status === 'running')); + const anyActive = $derived( + allJobs.some((j) => j.status === 'pending' || j.status === 'running'), + ); $effect(() => { if (!anyActive) return; const id = setInterval(() => (nowMs = Date.now()), 1000); @@ -676,7 +740,9 @@ allJobs .filter( (j) => - matchesFilter(j, filter) && !pendingIds.has(j.id) && jobStatusInfo(j).tone === 'ok', + matchesFilter(j, filter) && + !pendingIds.has(j.id) && + jobStatusInfo(j).tone === 'ok', ) .sort((a, b) => parseDbTs(b.created_at) - parseDbTs(a.created_at))[0] ?? null, @@ -700,16 +766,66 @@ } function openParams() { + paramDraft = Object.fromEntries( + Object.entries(values).map(([id, v]) => [ + id, + Array.isArray(v) ? [...v] : v, + ]), + ); + paramEndpoint = endpointId; + paramShowErrors = false; paramsOpen = true; } + function saveParams() { + if (!paramDraft) return; + const ids = new Set([...ds.common, ...ds.advanced].map((i) => i.nodeId)); + if ( + Object.entries(paramErrors).some( + ([id, message]) => ids.has(id) && message, + ) + ) { + paramShowErrors = true; + return; + } + const next = { ...values }; + for (const inp of [...ds.common, ...ds.advanced]) { + if (paramDraft[inp.nodeId] !== undefined) + next[inp.nodeId] = paramDraft[inp.nodeId]; + else delete next[inp.nodeId]; + } + values = next; + endpointTouched = true; + endpointId = paramEndpoint; + paramsOpen = false; + paramDraft = null; + } + function editParam(id: string, value: FormValue) { + if (paramsOpen && paramDraft) paramDraft = { ...paramDraft, [id]: value }; + else setVal(id, value); + } + function resetParamDraft() { + if (!paramDraft) return; + const defaults = schemaDefaults(schema); + const next = { ...paramDraft }; + for (const i of [...ds.common, ...ds.advanced]) { + if (defaults[i.nodeId] !== undefined) next[i.nodeId] = defaults[i.nodeId]; + else delete next[i.nodeId]; + } + paramDraft = next; + } function toggleInspector() { focusMode = !focusMode; - window.dispatchEvent(new CustomEvent('refract-focus', { detail: focusMode })); + window.dispatchEvent( + new CustomEvent('refract-focus', { detail: focusMode }), + ); } function closeInspector() { if (focusMode) toggleInspector(); } - $effect(() => () => window.dispatchEvent(new CustomEvent('refract-focus', { detail: false }))); + $effect( + () => () => + window.dispatchEvent(new CustomEvent('refract-focus', { detail: false })), + ); function mediumLink(next: DeskKind) { const url = new URL(page.url); url.pathname = '/' + next; @@ -719,9 +835,12 @@ } const imageSlotTarget = $derived( - ds.slots.find((s) => s.mediaKind === 'image' && !s.mask && s.fromResults) ?? null, + ds.slots.find((s) => s.mediaKind === 'image' && !s.mask && s.fromResults) ?? + null, + ); + const imageList = $derived( + ds.lists.find((g) => g.kind === 'image_list') ?? null, ); - const imageList = $derived(ds.lists.find((g) => g.kind === 'image_list') ?? null); function sendToSlot(path: string) { if (imageSlotTarget && !String(values[imageSlotTarget.inp.nodeId] ?? '')) { @@ -758,7 +877,8 @@ (job.payload?.input_values ?? {}) as Record, )) { if (typeof v === 'string' || typeof v === 'number') next[k] = v; - else if (Array.isArray(v) && v.every((p) => typeof p === 'string')) next[k] = v as string[]; + else if (Array.isArray(v) && v.every((p) => typeof p === 'string')) + next[k] = v as string[]; } workflowId = wf.id; lastWf = wf; @@ -776,7 +896,9 @@ toast.success(t('studio.retryQueuedToast')); await client.invalidateQueries({ queryKey: ['playground-jobs'] }); } catch (err) { - toast.error(t('studio.retryFailedToast', { detail: apiErrorMessage(err) })); + toast.error( + t('studio.retryFailedToast', { detail: apiErrorMessage(err) }), + ); } finally { busyId = null; } @@ -845,7 +967,9 @@ await client.invalidateQueries({ queryKey: ['playground-jobs'] }); await client.invalidateQueries({ queryKey: ['jobs'] }); } catch (err) { - toast.error(t('desk.attachFailedToast', { detail: apiErrorMessage(err) })); + toast.error( + t('desk.attachFailedToast', { detail: apiErrorMessage(err) }), + ); } finally { attachBusyId = null; } @@ -867,7 +991,8 @@ const list = ds.lists.find((g) => g.nodeId === nodeId); if (list) { const cur = listPaths(values, list); - if (cur.length >= (list.max ?? 9)) toast.error(t('studio.refFull', { max: list.max ?? 9 })); + if (cur.length >= (list.max ?? 9)) + toast.error(t('studio.refFull', { max: list.max ?? 9 })); else setVal(nodeId, [...cur, path]); } else { setVal(nodeId, path); @@ -880,7 +1005,11 @@ // ------------------------------------------------------------------ function typing(target: EventTarget | null): boolean { const el = target as HTMLElement | null; - return !!el && (el.isContentEditable || ['INPUT', 'TEXTAREA', 'SELECT'].includes(el.tagName)); + return ( + !!el && + (el.isContentEditable || + ['INPUT', 'TEXTAREA', 'SELECT'].includes(el.tagName)) + ); } function inLayer(target: EventTarget | null): boolean { @@ -908,16 +1037,26 @@ // ------------------------------------------------------------------ // Band (选定后的摘要带) helpers // ------------------------------------------------------------------ - const currentMeta = $derived(allMetas.find((m) => m.id === workflowId) ?? null); - const previewMeta = $derived(allMetas.find((m) => m.id === bayActiveId) ?? null); - const previewFull = $derived(bayActiveId != null ? (details.get(bayActiveId) ?? null) : null); + const currentMeta = $derived( + allMetas.find((m) => m.id === workflowId) ?? null, + ); + const previewMeta = $derived( + allMetas.find((m) => m.id === bayActiveId) ?? null, + ); + const previewFull = $derived( + bayActiveId != null ? (details.get(bayActiveId) ?? null) : null, + ); {#snippet ctxBanner()} {#if ctx} - (ctxDismissed = true)} /> + (ctxDismissed = true)} + /> {/if} {/snippet} @@ -925,216 +1064,228 @@ {/snippet} -{#snippet toolHeader()} -
- -
-
-

1 · 选择创作工具

- - {#if currentMeta?.usage}

- {usageLabel(currentMeta.usage)} · s.mediaKind), - ...ds.lists.map((l) => - l.kind === 'video_list' - ? 'video' - : l.kind === 'audio_list' - ? 'audio' - : 'image', - ), - ]), - ], - out: [kind], - } - : currentMeta.media_io} - /> -

{/if} - {#if !deskMetas.length && !$metaQuery.isLoading}

- 还没有可用工具。导入与配置 ↗ -

{/if} -
-{/snippet} - -
-
-
-

{kind === 'image' ? '图片创作' : '视频创作'}

-

选择工具,准备素材,生成你的作品。

-
-
- 工具配置 ↗ -
-
- {@render ctxBanner()} -
- - - {#if bayOpen}
-
-
-

找到适合这次创作的工具

-

先看用途和素材要求,再确定使用。

-
- -
-
-
- (bayActiveId = id)} - onPick={pickWorkflow} - onClose={closeBay} - /> -
- + + {@render ctxBanner()} +
+
+
+ 生成结果{selectedJob + ? '第 ' + selectedJob.id + ' 次生成' + : '等待你的第一件作品'}
-
{/if} +
+ {#if selectedJob} + j.kind === 'image' && + j.status === 'done' && + j.id !== selectedJob?.id, + )?.output_paths[0] ?? null} + bind:tab + job={selectedJob} + wf={selectedJob ? workflowOf(selectedJob) : undefined} + {nowMs} + open={true} + inactive={false} + canSendToSlot={!!imageSlotTarget || !!imageList} + {crossfade} + bind:videoEl + params={paramsTab} + onClose={closeInspector} + onReuse={reuse} + onRetry={retry} + onCancel={cancel} + onSendToSlot={sendToSlot} + onDelete={requestDelete} + />{:else}
+ ● AI 创作引擎 +

让灵感,成为作品

+
{kind === 'image' ? '◈' : '▷'}
+
+ {currentWorkflow?.name ?? + currentMeta?.name ?? + '选择工作流,开始创作'} +

+ {currentWorkflow?.description ?? + currentMeta?.description ?? + '选择左侧工作流,填写下方提示词与参数。'} +

+ 生成结果在这里显示,视频由你手动播放。 +
+
{/if} + {#if selectedJob && workbenchCtxOf(selectedJob) && selectedJob.status === 'done'}{/if} +
+ workflowOf(job)?.name ?? '工具已删除'} + jobs={allJobs.filter( + (j) => j.kind === kind && !pendingIds.has(j.id), + )} + selectedId={selectedJob?.id ?? null} + onSelect={(job) => selectTake(job, 'pointer')} + onHistory={() => (historyOpen = true)} + /> +
+ +
+
+
+
+

找到适合这次创作的工具

+

先看用途和素材要求,再确定使用。

+
+ +
+
+
+ (bayActiveId = id)} + onPick={pickWorkflow} + onClose={closeBay} + /> +
+ +
+
-{@render paramsTab()} + (paramDraft = null)} +> + {#snippet footer()}
+ 保存后应用到当前工作流 +
{/snippet} +
+
+ 配置或检查连接 ↗ +
+ {@render paramsTab()} +
+
- (pickerFor = null)}> + (pickerFor = null)} +> {#if imageResults.length}
{#each imageResults as entry (entry.path)} - {/each}
@@ -1204,11 +1392,6 @@ margin: 0 0 4px; font-weight: 650; } - .studio-heading p { - font-size: 12px; - color: var(--text-3); - margin: 0; - } .heading-actions { display: flex; gap: 8px; @@ -1259,35 +1442,6 @@ flex-shrink: 0; margin: 0; } - .medium-switch { - display: flex; - background: var(--bg); - padding: 3px; - border-radius: 8px; - margin-bottom: 16px; - } - .medium-switch button { - flex: 1; - border: 0; - background: none; - padding: 8px 4px; - font-size: 12px; - color: var(--text-3); - border-radius: 6px; - cursor: pointer; - } - .medium-switch button.active { - background: var(--surface); - color: var(--text); - box-shadow: 0 1px 4px #292a2d10; - } - .tool-header { - padding-bottom: 16px; - } - .tool-header h3 { - font-size: 13px; - margin: 0 0 10px; - } .model-selector { display: flex; flex-direction: column; @@ -1301,25 +1455,6 @@ cursor: pointer; color: var(--text); } - .model-selector strong { - font-size: 13px; - line-height: 1.5; - overflow-wrap: anywhere; - } - .model-selector span { - font-size: 12px; - color: var(--accent); - } - .tool-purpose { - font-size: 12px; - line-height: 1.6; - color: var(--text-3); - margin: 8px 0 0; - overflow-wrap: anywhere; - } - .studio-layout.picking { - grid-template-columns: minmax(0, 1fr); - } .tool-picker { min-height: 0; display: flex; @@ -1465,24 +1600,232 @@ .tool-picker-content { grid-template-columns: minmax(0, 1fr) 210px; } - .heading-actions > a { - display: none; - } } @media (max-height: 650px) { - .studio-heading p { - display: none; - } .refract-studio { gap: 8px; padding-top: 10px; padding-bottom: 10px; } - .studio-heading h1 { - font-size: 19px; - } .viewer { gap: 6px; } } + + .reference-desk { + display: flex; + flex: 1; + min-height: 0; + height: 100%; + min-width: 0; + } + .refract-studio { + flex: 1; + min-width: 0; + padding: 14px 20px 12px; + gap: 12px; + background: + radial-gradient(ellipse at 65% 15%, #7850ff0e, transparent 60%), + radial-gradient(ellipse at 0 90%, #00cae010, transparent 60%), #0f0f12; + } + .studio-heading { + min-height: 34px; + gap: 8px; + } + .heading-actions { + min-width: 0; + } + .model-selector { + border-radius: 999px; + padding: 7px 12px; + font-size: 11px; + display: block; + width: auto; + max-width: 320px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + background: #1b1c21; + color: #8c99a0; + } + .studio-layout { + display: flex; + flex-direction: column; + gap: 12px; + min-height: 0; + flex: 1; + } + .studio-form { + flex-shrink: 0; + border: 0; + border-radius: 18px; + overflow: visible; + background: transparent; + max-height: none; + width: 100%; + } + .viewer { + flex: 1; + min-height: 130px; + display: flex; + flex-direction: column; + } + .preview-area { + position: relative; + min-height: 100px; + flex: 1; + } + .viewer-head { + font-size: 10px; + } + .desk-welcome { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 13px; + min-height: 0; + overflow: auto; + padding: 10px 25px; + text-align: center; + } + .desk-welcome h1 { + font-size: 32px; + font-weight: 650; + letter-spacing: -0.8px; + margin: 0; + color: #eff8fc; + } + .desk-emblem { + font-size: 78px; + line-height: 1.2; + color: #27c0a2; + text-shadow: 0 0 25px #27c0a233; + } + .workflow-description { + max-width: 550px; + text-align: left; + background: #1a1a1c; + border: 1px solid #00cae059; + border-radius: 11px; + padding: 14px 17px; + font-size: 12px; + color: #cdd8df; + } + .workflow-description strong { + display: block; + color: #eef6fa; + } + .workflow-description p { + font-size: 11px; + line-height: 1.8; + margin: 5px 0; + } + .workflow-description small { + font-size: 10px; + color: #71838a; + } + .tool-picker { + max-height: 65vh; + min-height: 360px; + } + .tool-picker-content { + min-height: 320px; + } + .tool-list { + min-width: 0; + } + .runtime-setting { + padding: 15px; + border: 1px solid var(--line); + border-radius: 11px; + background: #ffffff04; + margin-bottom: 15px; + display: grid; + gap: 10px; + font-size: 12px; + } + .runtime-setting a { + color: var(--accent); + font-size: 11px; + } + .param-actions { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 10px; + } + .param-actions > span { + margin-right: auto; + color: #7f718f; + font-size: 10px; + } + .param-actions .purple { + min-width: 150px; + } + .focused :global(.workflow-rail) { + display: none; + } + @media (max-width: 1200px) { + .refract-studio { + padding: 12px 15px; + } + .studio-layout { + display: flex; + flex-direction: column; + } + .model-selector { + max-width: 250px; + } + .tool-picker-content { + grid-template-columns: minmax(0, 1fr) 250px; + } + } + @media (max-height: 760px) { + .refract-studio { + gap: 8px; + padding-top: 10px; + } + .desk-welcome { + gap: 7px; + } + .desk-welcome h1 { + font-size: 25px; + } + .desk-emblem { + font-size: 55px; + } + .workflow-description { + padding: 10px 13px; + } + .studio-layout { + gap: 8px; + } + .viewer { + min-height: 110px; + } + } + + .reference-preferences :global(.form) { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 12px; + } + .reference-preferences :global(.field) { + border: 1px solid #ffffff0d; + background: #ffffff04; + border-radius: 11px; + padding: 13px; + } + .reference-preferences :global(.field .label) { + font-size: 12px; + margin-bottom: 10px; + } + .reference-preferences :global(.field input), + .reference-preferences :global(.field select), + .reference-preferences :global(.field textarea) { + width: 100%; + font-size: 12px; + } diff --git a/calliope-web/src/lib/components/generate/Composer.svelte b/calliope-web/src/lib/components/generate/Composer.svelte index 4896656b..1c2cc816 100644 --- a/calliope-web/src/lib/components/generate/Composer.svelte +++ b/calliope-web/src/lib/components/generate/Composer.svelte @@ -5,11 +5,17 @@ import ComfyDynamicForm from '$lib/components/ComfyDynamicForm.svelte'; import type { Snippet } from 'svelte'; import SlotTray from './SlotTray.svelte'; - import { type BlockReason, type DeskSchema, type FormValue, type FormValues } from './schema'; + import { + type BlockReason, + type DeskSchema, + type FormValue, + type FormValues, + } from './schema'; /** Scrollable creative inputs with a separate, always visible submission footer. */ interface Props { header?: Snippet; + dock?: boolean; ds: DeskSchema; values: FormValues; current: Workflow | null; @@ -37,6 +43,7 @@ let { header, + dock = false, ds, values, current, @@ -74,13 +81,20 @@ const advancedInputs = $derived( ds.advanced.filter((i) => !commonInputs.some((c) => c.nodeId === i.nodeId)), ); - const promptVal = $derived(ds.prompt ? String(values[ds.prompt.nodeId] ?? '') : ''); - const promptErr = $derived(showErrors && ds.prompt ? errors[ds.prompt.nodeId] : undefined); + const promptVal = $derived( + ds.prompt ? String(values[ds.prompt.nodeId] ?? '') : '', + ); + const promptErr = $derived( + showErrors && ds.prompt ? errors[ds.prompt.nodeId] : undefined, + ); const endpointName = $derived( endpoints.find((e) => e.id === endpointId)?.name ?? t('desk.noConn'), ); - function patch(inputs: ComfyDynamicInput[], next: Record) { + function patch( + inputs: ComfyDynamicInput[], + next: Record, + ) { for (const inp of inputs) { const v = next[inp.nodeId]; if (v !== undefined && v !== values[inp.nodeId]) onSet(inp.nodeId, v); @@ -99,7 +113,7 @@ } -
+
{@render header?.()} {#if current} -
+

2 · 准备这次创作

{#if hasSlots}
{/if} - {#if ds.prompt} - - {#if promptErr}{/if} - {:else}

这个工具不需要填写画面描述,请准备下面的素材。

{/if} +
+ {#if ds.prompt}
+ +
+ Enter 换行 · Ctrl + Enter 生成{promptVal.length} 字 +
+ {#if promptErr}{/if} +
{:else}

+ 这个工具不需要填写提示词,请准备它需要的素材。 +

{/if} + {#if dock && ds.negative}
+ +
+ 避免的内容{String(values[ds.negative.nodeId] ?? '').length} 字 +
+ {#if showErrors && errors[ds.negative.nodeId]}{/if} +
{/if} +
- {#if commonInputs.length}
+ {#if !dock && commonInputs.length}

画面与生成设置

patch(commonInputs, v)} />
{/if} - {#if changedCount > 0} 0}{/if} - {#if advancedInputs.length}
+ {#if !dock && advancedInputs.length}
更多参数 · {advancedInputs.length} 项
{/if} {/if} -
- 运行设置 · {endpointName} - - 配置或检查连接 ↗ -
+ 运行设置 · {endpointName} + + 配置或检查连接 ↗ +
{/if}
+ {#if dock}
+ {#each commonInputs.slice(0, 3) as inp}{/each} +
{/if} {#if block}
@@ -349,4 +424,172 @@ .error { color: var(--err); } + + /* Dock composition keeps submission outside the scrollable media and prompts. */ + .dock { + height: auto; + min-height: 0; + } + .dock .composer { + background: rgba(19, 18, 25, 0.82); + backdrop-filter: blur(18px) saturate(1.4); + border: 1px solid #ffffff26; + border-radius: 18px; + box-shadow: 0 12px 40px #0009; + overflow: hidden; + } + .dock .composer:focus-within { + border-color: #f5b04273; + box-shadow: + 0 12px 40px #0009, + 0 0 0 1px #f5b04259, + 0 8px 28px #f5b0422e; + } + .dock .composer-scroll { + padding: 16px 18px 9px; + max-height: min(280px, 36vh); + overflow: auto; + } + .dock .input-section { + margin: 0; + padding: 0; + border: 0; + } + .dock .input-section > h3 { + display: none; + } + .dock .prompt-pair { + display: grid; + grid-template-columns: minmax(0, 1fr); + gap: 20px; + } + .dock .prompt-pair.dual { + grid-template-columns: 1fr 1fr; + } + .dock .negative { + border-left: 1px solid var(--line); + padding-left: 20px; + } + .dock .prompt-field { + min-width: 0; + } + .dock .prompt-field label { + font-size: 11px; + color: #87959e; + margin: 0 0 8px; + display: flex; + gap: 6px; + } + .dock .prompt-field:focus-within label { + color: #f5b042; + } + .dock .prompt { + border: 0 !important; + background: none !important; + box-shadow: none !important; + border-radius: 0; + padding: 0; + min-height: 65px; + height: 75px; + resize: vertical; + font-size: 13.4px; + line-height: 24.1px; + color: #fffaf2ed; + } + .dock .prompt:focus { + outline: 0 !important; + } + .prompt-counter { + display: flex; + justify-content: space-between; + font-size: 9px; + color: #657078; + margin-top: 5px; + } + .dock .slots { + margin-bottom: 12px; + max-height: 155px; + overflow: auto; + } + .dock .slots :global(.slots-grid) { + gap: 8px; + } + .dock .submit { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 8px; + padding: 10px 16px 13px; + position: relative; + background: transparent; + border-top: 1px solid #ffffff0a; + } + .dock-chips { + display: flex; + align-items: center; + gap: 6px; + flex-wrap: wrap; + flex: 1; + min-width: 0; + } + .parameter { + border: 1px solid #ffffff17; + background: #19171f; + border-radius: 8px; + padding: 7px 9px; + color: #c3bfcb; + font-size: 10px; + cursor: pointer; + max-width: 200px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + transition: + background-color 180ms ease, + border-color 180ms ease; + } + .dock .gen { + width: auto; + border-radius: 999px; + background: #f5b042; + color: #251b0a; + border-color: #f5b042; + box-shadow: none; + padding: 9px 18px; + font-size: 12px; + margin-left: auto; + flex-shrink: 0; + } + .dock .why, + .dock .ready { + font-size: 10px; + order: 3; + flex-basis: 100%; + margin: 0; + text-align: left; + min-height: 0; + padding: 0; + background: none; + border: 0; + } + .dock .why { + color: var(--warn); + cursor: pointer; + } + .dock .why.err { + color: var(--err); + } + .dock .ready { + display: none; + } + .dock .gen:hover { + background: #ffc96a; + } + .parameter:hover { + border-color: #f5b04255; + background: #f5b0420d; + } + .dock .gen:active { + transform: scale(var(--press-scale)); + } diff --git a/calliope-web/src/lib/components/home/AProjectCard.svelte b/calliope-web/src/lib/components/home/AProjectCard.svelte index 02111468..bbc9989a 100644 --- a/calliope-web/src/lib/components/home/AProjectCard.svelte +++ b/calliope-web/src/lib/components/home/AProjectCard.svelte @@ -35,7 +35,13 @@ ); // Five-stage creation progress (HEL-614) — real stage rows only. - const STAGE_SEGMENTS = ['script', 'style', 'storyboard', 'assets', 'shot'] as const; + const STAGE_SEGMENTS = [ + 'script', + 'style', + 'storyboard', + 'assets', + 'shot', + ] as const; function segClass(key: string): string { const state = stats.stage_status?.[key]; if (state === 'confirmed') return 'seg-confirmed'; @@ -45,7 +51,13 @@ } // Spec §2.1 allows the five avatar gradients as cover placeholders. - const PLACEHOLDER_GRADIENTS = ['#e8e6da', '#dae0e8', '#e9cfc4', '#e1e6c4', '#dcd3e2']; + const PLACEHOLDER_GRADIENTS = [ + '#1f262c', + '#253036', + '#2d2333', + '#26372c', + '#302836', + ]; const placeholderIdx = $derived(project.id % PLACEHOLDER_GRADIENTS.length); const placeholder = $derived(PLACEHOLDER_GRADIENTS[placeholderIdx]); // HEL-680 灰阶封面占位:1–2 亮阶配深图标,3–5 暗阶配浅图标 @@ -61,7 +73,9 @@ if (stats.stage_confirmed >= STAGE_SEGMENTS.length) { return { cls: 'st-done', label: t('home.statusDone') }; } - const current = STAGE_SEGMENTS.find((k) => stats.stage_status?.[k] !== 'confirmed'); + const current = STAGE_SEGMENTS.find( + (k) => stats.stage_status?.[k] !== 'confirmed', + ); const state = current ? stats.stage_status?.[current] : undefined; const stageName = current ? t(`workbench.stage.${current}`) : ''; if (state === 'running') { @@ -138,7 +152,9 @@ toast.success(t('projectCard.renamedTo', { title: renameValue })); }, onError: (err) => { - toast.error(err instanceof Error ? err.message : t('projectCard.renameFailed')); + toast.error( + err instanceof Error ? err.message : t('projectCard.renameFailed'), + ); }, }); @@ -158,7 +174,9 @@ toast.success(t('projectCard.deleted', { title: project.title })); }, onError: (err) => { - toast.error(err instanceof Error ? err.message : t('projectCard.deleteFailed')); + toast.error( + err instanceof Error ? err.message : t('projectCard.deleteFailed'), + ); }, }); @@ -201,11 +219,14 @@ {project.idea || t('home.noIdea')} {#each STAGE_SEGMENTS as key (key)} - + {/each} {stats.stage_confirmed}/5 {#if stats.active_jobs > 0} - {t('home.activeJobs', { n: stats.active_jobs })} + {t('home.activeJobs', { n: stats.active_jobs })} {/if} @@ -235,7 +256,12 @@ {#if menuOpen}
- 海岸与薄雾构成的灵感画面 + 海岸与薄雾构成的灵感画面
✳
VISUAL STUDY / 001
LIGHT, SPACE & POSSIBILITY
- 建筑几何参考FOUND IN THE IN-BETWEEN + 建筑几何参考FOUND IN THE IN-BETWEEN
Beyond
the ordinary.
@@ -74,7 +83,9 @@ grid-template-columns: 1fr 1.12fr; min-height: 322px; border-radius: 18px; - background: #e9e7df; + background: + radial-gradient(ellipse at 0 0, #7850ff1a, transparent 70%), #141419; + border: 1px solid var(--line); overflow: hidden; position: relative; } @@ -105,7 +116,7 @@ p { font-size: 12px; line-height: 1.9; - color: #71736b; + color: var(--text-3); margin: 0 0 23px; } .hero-buttons { diff --git a/calliope-web/src/lib/components/shell/AppShell.svelte b/calliope-web/src/lib/components/shell/AppShell.svelte index a9f63969..0e5333aa 100644 --- a/calliope-web/src/lib/components/shell/AppShell.svelte +++ b/calliope-web/src/lib/components/shell/AppShell.svelte @@ -1,5 +1,6 @@ {title} · 折光工作室{title} · AIGC工作台 -
-
- - +
@@ -442,7 +494,8 @@
- - +
@@ -544,10 +603,14 @@
  • {tag.label} - {jobTitle(job)} + {jobTitle(job)} {#if job.status === 'failed' && job.error !== 'cancelled'} - {jobStatusLabel(job.status)} + {jobStatusLabel(job.status)}
    @@ -677,417 +1087,712 @@ {:else if legacyRedirect === 'failed'} {:else} - - {#snippet actions()} - - {t('agentsPage.statusChip', { - n: skills.length, - m: skills.filter((s) => s.is_enabled).length, - })} - - {/snippet} - -
    -
    -
    CREATIVE COLLABORATORS
    -

    让专业搭档,加入创作。

    -

    一个故事需要不同的目光。选一位搭档,从对话开始。

    -
    -
    - {#each agents as agent (agent.key)} - {@const selected = agent.key === activeKey} - {@const busy = busyByAgent[agent.key] === true} - - {/each} -
    - -
    - - - - -
    - {#if activeAgent} -
    - - {activeAgent.char} - -
    -

    {activeAgent.name}

    -

    {t('agentsPage.independentNote')}

    -
    - - {#if running} - - {t('agentsPage.replying')} - {:else} - - {t('agentsPage.idle')} - {/if} - -
    - - - - - - -
    -
    - -
    - (draft = p)} - onAnswer={handleAnswer} - /> -
    - -
    - - {t('agentsPage.send')} - - -
    - {/if} -
    - - - {#if editorMode !== 'idle' || drawerOpen} - -
    (drawerOpen ? resetEditor() : undefined)} - aria-hidden="true" - >
    - {/if} -
    +
    + {skills.length} 个技能 · {skills.filter((s) => s.is_enabled) + .length} 个启用 +
    + +
    + +
    + +
    + {#if messages.length}{/if} +
    +
    0 || running} > -
    -

    - {activeAgent - ? t('agentsPage.installedTitle', { name: activeAgent.name }) - : t('agentsPage.skillManage')} -

    - - {t('agentsPage.installedCount', { - n: installedSkills.length, - m: installedSkills.filter((s) => s.is_enabled).length, - })} - -
    - {#if editorMode === 'edit' && editingDir} - - {/if} - {#if editorMode !== 'idle' || drawerOpen} - - {/if} -
    -
    - - {#if versionsOpen && editingDir} -
    -

    {t('agentsPage.versions')}

    - {#if !versions.length} -

    {t('agentsPage.versionsEmpty')}

    - {/if} - {#each versions as v (v.id)} -
    -
    - #{v.id} - {formatUtcString(v.created_at)} - {v.length}B + {#if $agentsQuery.isLoading}

    + 正在载入智能体… +

    {:else if $agentsQuery.isError}{:else if activeAgent} + {#if !messages.length && !running}
    +
    + ● AI {activeAgent.name} · 创作助手 +
    +

    {theme.title}

    +

    + {activeAgent.tagline} · 选择技能与工具,与智能体一起打磨创作。 +

    +
    {/if} + {#if messages.length || running}
    +
    +
    + AI {activeAgent.name} +

    {$sessionQuery.data?.title ?? '这次创作'}

    -
    + {#if $sessionQuery.data?.plan}{/if}{#if latestAssistant && !running}
    - {t('agentsPage.restore')} - -
    - {/each} -
    - {/if} - - {#if installedSkills.length} -
    - {#each installedSkills as skill (skill.dir)} - {@render skillRow( - skill, - [`v${skill.version}`, formatUpdatedAt(skill.updated_at)] - .filter(Boolean) - .join(' · '), - )} - {/each} -
    - {/if} - {#if editorMode === 'idle'} -
    - -

    {t('agentsPage.skillIdleHint')}

    -
    - {:else} -
    -
    -

    - {editorMode === 'add' ? t('agentsPage.newSkill') : t('agentsPage.editSkill')} -

    - {#if editorMode === 'edit' && editingVersion} - v{editingVersion} - {/if} -
    - - - -
    - {t('agentsPage.skillType')} -
    - {#each ['template', 'knowledge', 'rules'] as tp (tp)} - - {typeLabel(tp)} - - {/each} +
    {/if} +
    + (draft = p)} + onAnswer={handleAnswer} + />
    +
    {/if} +
    + +
    + {draft.length} / 20000
    - - - - - -
    - {t('agentsPage.assignTo')} -
    - {#each agents as agent (agent.key)} - - {/each} -
    - {#if showSkillErrors && skillErrors.bindings} - {skillErrors.bindings} - {/if} -
    - -
    - +
    {/each} +
    {/if} +
    + - {#if editorMode === 'edit' && editingVersion} - {t('agentsPage.saveNext', { v: editingVersion })} - {:else} - {t('agentsPage.save')} - {/if} - - {#if editorMode === 'edit'} - - - {/if} +
    + Ctrl + Enter 发送 · Enter 换行{#if running}{:else}{/if} +
    - + + + {#if !messages.length && !running}
    + {chosenStyle.name +
    + ✦ 从想法到作品 +

    一位创作搭档,陪你把故事讲好。

    +

    + 选择技能与模型,写下任务。智能体会展示真实的回复、技能使用与创作内容,需要确认时在对话中继续。 +

    +
    + {#each [8, 1, 2, 7, 0] as i}{agentStyles[i].name}{/each} +
    + +
    +
    + {/if} {/if} - - + +
    + {#snippet footer()}
    + 选定画风会加入这次任务要求 +
    {/snippet} +
    + {#each agentStyles as style, i}{/each} +
    + {#snippet footer()}
    + 由智能体按技能指导完成任务 +
    {/snippet} + + {#each applicableSkills.filter((s) => (skillLabel(s.dir) + s.description) + .toLowerCase() + .includes(skillSearch.toLowerCase())) as skill}{/each}{#if !applicableSkills.length}

    + 这个智能体还没有启用技能。可从技能管理中绑定已有技能,或新增技能。 +

    {/if}
    + {#snippet footer()}
    + 只修改当前智能体的模型绑定 +
    {/snippet}{#each $settingsQuery.data?.llm_profiles ?? [] as model}{/each}管理模型与连接 ↗
    +

    + 用于整理提示词和输入要求,实际图片/视频生成在创作台进行。 +

    + {#each runnableWorkflows as wf (wf.id)}{/each}管理工作流 ↗
    + {#each activeSessions as session (session.id)}{/each}{#if !activeSessions.length}

    + 这位智能体还没有对话记录。 +

    {/if}
    + + +
    + 当前模型:{selectedModel?.name ?? '默认大模型'} +

    + 长期创作规则通过知识、规则或模板技能维护;绑定后会用于这位智能体的任务。 +

    +
    +
    +
    + 技能库 +
    + {#each skills as skill (skill.dir)}{@render skillRow( + skill, + t('agentsPage.assigned', { n: skill.assigned_count }), + )}{/each} +
    + +
    + + {#snippet footer()}
    + +
    {/snippet} +

    + {resultKey === 'script' + ? '保存为故事构思阶段的待确认草稿,不会直接确认或覆盖已确认版本。' + : '这个阶段有多个结构化字段,内容会复制到剪贴板,再到项目中粘贴到需要的字段。'} +

    + {#if resultError}{/if}
    deleteSkillTarget && $deleteSkillMutation.mutate(deleteSkillTarget.dir)} + onconfirm={() => + deleteSkillTarget && $deleteSkillMutation.mutate(deleteSkillTarget.dir)} oncancel={() => (deleteSkillTarget = null)} /> {/if} @@ -1125,37 +1831,7 @@ color: var(--error); } - .page { - padding: 20px 24px 28px; - max-width: 1720px; - width: 100%; - box-sizing: border-box; - margin: 0 auto; - height: 100%; - display: flex; - flex-direction: column; - min-height: 0; - } - - .cols { - display: flex; - gap: 18px; - flex: 1; - min-height: 0; - align-items: stretch; - } - /* ── 左栏 ─────────────────────────────────────────────── */ - .left { - width: 236px; - flex-shrink: 0; - display: flex; - flex-direction: column; - gap: 14px; - min-height: 0; - overflow-y: auto; - padding-right: 2px; - } .col-title { font-size: 14.5px; font-weight: 600; @@ -1190,10 +1866,6 @@ .agent-row:hover { background: var(--surface-2); } - .agent-row.selected { - background: var(--surface-3); - border-color: var(--border-strong); - } .avatar { width: 34px; height: 34px; @@ -1206,15 +1878,6 @@ color: var(--text); flex-shrink: 0; } - .avatar.dark { - color: var(--accent-ink); - } - .avatar.lg { - width: 42px; - height: 42px; - border-radius: 11px; - font-size: 17px; - } .agent-meta { display: flex; flex-direction: column; @@ -1222,18 +1885,6 @@ min-width: 0; flex: 1; } - .agent-name { - font-size: 13.5px; - font-weight: 600; - color: var(--text); - } - .agent-sub { - font-size: 11px; - color: var(--text-3); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } .lib-head { display: flex; @@ -1244,11 +1895,6 @@ .lib-head .a-btn { margin-left: auto; } - .skill-lib { - display: flex; - flex-direction: column; - gap: 4px; - } .lib-empty { font-size: 11.5px; color: var(--text-3); @@ -1319,77 +1965,6 @@ } /* ── 中栏 ─────────────────────────────────────────────── */ - .mid { - flex: 1; - min-width: 0; - display: flex; - flex-direction: column; - background: var(--surface); - border: 1px solid var(--border); - border-radius: 12px; - overflow: hidden; - min-height: 0; - } - .chat-head { - display: flex; - align-items: center; - gap: 12px; - padding: 12px 16px; - border-bottom: 1px solid var(--border); - flex-wrap: wrap; - } - .chat-head-meta { - display: flex; - flex-direction: column; - gap: 1px; - min-width: 0; - } - .chat-head-meta h2 { - margin: 0; - font-size: 15px; - font-weight: 700; - color: var(--text); - } - .chat-head-meta p { - margin: 0; - font-size: 11.5px; - color: var(--text-3); - } - .status-tag { - display: inline-flex; - align-items: center; - gap: 6px; - padding: 3px 10px; - border-radius: 999px; - background: var(--surface-3); - font-size: 11px; - color: var(--text-2); - white-space: nowrap; - } - .status-tag.busy { - background: var(--run-soft); - color: var(--run); - } - .chat-head-actions { - display: flex; - align-items: center; - gap: 8px; - margin-left: auto; - flex-wrap: wrap; - } - .model-pick { - display: inline-flex; - align-items: center; - gap: 6px; - } - .model-label { - font-size: 11px; - color: var(--text-3); - white-space: nowrap; - } - .session-select { - max-width: 180px; - } .chat-body { flex: 1; @@ -1400,38 +1975,6 @@ padding: 10px 14px; } - .composer { - display: flex; - gap: 10px; - align-items: flex-end; - padding: 12px 14px; - border-top: 1px solid var(--border); - } - .composer textarea { - flex: 1; - resize: none; - background: var(--surface-2); - border: 1px solid var(--border-strong); - border-radius: 10px; - padding: 10px 12px; - color: var(--text); - font-family: inherit; - font-size: 13px; - line-height: 1.55; - min-height: 44px; - max-height: 180px; - } - .composer textarea:focus-visible { - outline: none; - border-color: var(--accent); - } - .composer textarea::placeholder { - color: var(--text-3); - } - .composer .send { - min-height: 38px; - } - /* ── 右栏 ─────────────────────────────────────────────── */ .right { width: 372px; @@ -1681,23 +2224,6 @@ .link-danger:hover { text-decoration: underline; } - - .dot { - width: 7px; - height: 7px; - border-radius: 999px; - display: inline-block; - flex-shrink: 0; - } - .dot.green { - background: var(--success); - } - .dot.amber { - background: var(--run); - } - .dot.amber.breathing { - animation: breathe 2s ease-in-out infinite; - } @keyframes breathe { 0%, 100% { @@ -1709,22 +2235,9 @@ box-shadow: 0 0 0 4px var(--accent-dim); } } - .chat-head-actions .a-select { - max-width: 220px; - padding: 5px 8px; - } - .manage-btn { - display: none; - } - .drawer-backdrop { - display: none; - } /* ── 窄屏(1024–1439px):右栏收为抽屉(spec §4.5)────── */ @media (max-width: 1439px) { - .manage-btn { - display: inline-flex; - } .right { position: fixed; top: 0; @@ -1740,46 +2253,9 @@ .right.open { transform: translateX(0); } - .drawer-backdrop { - display: block; - position: fixed; - inset: 0; - background: var(--overlay); - z-index: 55; - } - .session-select { - max-width: 140px; - } } @media (max-width: 1179px) { - .model-pick .model-label { - display: none; - } - } - - .page { - height: auto; - padding: 28px 36px 56px; - } - .refract-agent-title { - margin-bottom: 26px; - } - .eyebrow { - font-size: 10px; - color: var(--text-3); - letter-spacing: 1.3px; - } - .refract-agent-title h1 { - margin: 8px 0 7px; - font-size: 29px; - letter-spacing: -0.8px; - font-weight: 600; - } - .refract-agent-title p { - font-size: 11px; - color: var(--text-3); - margin: 0; } .agent-list { display: grid; @@ -1797,10 +2273,6 @@ background: var(--surface); gap: 16px; } - .agent-row.selected { - background: #f1f3ff; - border-color: var(--accent); - } .agent-row .avatar { width: 43px; height: 43px; @@ -1811,55 +2283,15 @@ .agent-meta { gap: 7px; } - .agent-name { - font-size: 15px; - } - .agent-sub { - font-size: 10px; - } - .cols { - min-height: 550px; - align-items: stretch; - position: relative; - } - .left { - width: 190px; - } - .left > .col-title { - display: none; - } - .mid { - border: 1px solid var(--line); - border-radius: 14px; - overflow: hidden; - background: var(--surface); - } - .chat-head { - flex-wrap: wrap; - gap: 12px; - } - .chat-head-actions { - flex-wrap: wrap; - margin: 0; - width: 100%; - border-top: 1px solid var(--line); - padding-top: 10px; - } .right { width: 280px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); } - .composer { - background: var(--surface); - } .lib-head { flex-wrap: wrap; } - .avatar.dark { - color: var(--text); - } @media (max-width: 1400px) { .right { position: absolute; @@ -1874,11 +2306,906 @@ .right.open { display: flex; } - .cols { - gap: 18px; + } + .reference-agents { + display: flex; + flex: 1; + height: 100%; + min-height: 0; + min-width: 0; + } + .agent-rail { + width: 263px; + min-height: 0; + flex-shrink: 0; + display: flex; + flex-direction: column; + border-right: 1px solid var(--line); + background: linear-gradient(#141419, #0f0f12); + } + .agent-rail > header { + height: 76px; + display: flex; + align-items: center; + gap: 12px; + padding: 14px 17px; + border-bottom: 1px solid var(--line); + background: radial-gradient(at 10% 50%, #7850ff24, transparent 70%); + flex-shrink: 0; + } + .agent-rail header i { + font-style: normal; + font-size: 22px; + color: #b99aff; + background: #7850ff18; + border: 1px solid #7850ff80; + width: 39px; + height: 39px; + border-radius: 50%; + display: grid; + place-items: center; + box-shadow: 0 0 22px #7850ff24; + } + .agent-rail header strong { + font-size: 17px; + color: #b99aff; + display: block; + } + .agent-rail header small { + display: block; + color: #7f768d; + font-size: 10px; + margin-top: 2px; + } + .agent-finder { + padding: 18px 12px 8px; + } + .agent-finder input { + width: 100%; + border: 1px solid #f5b04266; + background: #f5b0420d; + border-radius: 8px; + font-size: 11px; + padding: 8px 11px; + color: var(--text); + } + .agent-list-meta { + color: #6f6a7d; + font-size: 10px; + padding: 0 17px; + margin: 5px 0 10px; + } + .agent-list { + display: flex; + flex-direction: column; + gap: 6px; + margin: 0; + padding: 0 11px 8px; + overflow: auto; + flex: 1; + min-height: 0; + scrollbar-width: thin; + } + .agent-entry { + position: relative; + border-radius: 11.25px; + border: 1px solid transparent; + transition: + background-color 180ms ease, + border-color 180ms ease; + flex-shrink: 0; + } + .agent-entry.selected { + background: #ffffff26; + } + .agent-row { + display: flex; + flex-direction: row; + width: 100%; + min-height: 75px; + padding: 13px 9px; + gap: 11px; + border: 0; + border-radius: 11px; + background: none; + text-align: left; + align-items: center; + color: var(--text); + position: relative; + cursor: pointer; + } + .agent-row .avatar { + width: 38px; + height: 38px; + flex-shrink: 0; + display: grid; + place-items: center; + background: color-mix(in srgb, var(--agent-color) 15%, transparent); + border: 1px solid color-mix(in srgb, var(--agent-color) 20%, transparent); + color: var(--agent-color); + font-size: 21px; + border-radius: 9px; + transition: transform 180ms var(--ease-out); + } + .agent-meta { + display: block; + min-width: 0; + flex: 1; + padding-right: 6px; + } + .agent-meta b { + font-size: 12.1875px; + line-height: 1.5; + font-weight: 600; + display: block; + } + .agent-meta small { + display: block; + font-size: 10.3125px; + line-height: 1.5; + color: #ffffff88; + margin-top: 4px; + } + .agent-meta .replying { + color: #f5b042; + font-size: 9px; + } + .agent-pin { + position: absolute; + right: 6px; + top: 7px; + z-index: 2; + border: 1px solid #ffffff22; + background: #111827; + border-radius: 50%; + font-size: 10px; + width: 20px; + height: 20px; + color: #78839a; + opacity: 0; + transition: + opacity 180ms ease, + color 180ms ease, + border-color 180ms ease; + cursor: pointer; + padding: 0; + } + .agent-pin.pinned, + .agent-entry:focus-within .agent-pin, + .agent-entry:hover .agent-pin { + opacity: 1; + } + .agent-pin.pinned { + color: #ffd17c; + border-color: #ffd17c77; + } + .agent-rail > footer { + padding: 15px 14px; + border-top: 1px solid var(--line); + flex-shrink: 0; + } + .agent-rail footer button { + border: 0; + background: none; + color: #b99aff; + font-size: 11px; + cursor: pointer; + padding: 4px 0; + } + .agent-rail footer small { + display: block; + color: #76717f; + font-size: 10px; + line-height: 1.8; + } + .empty-rail { + color: #7f718f; + font-size: 11px; + padding: 12px; + } + .agent-stage { + position: relative; + background: #0b0a10; + flex: 1; + min-width: 0; + min-height: 0; + overflow: auto; + scrollbar-width: thin; + isolation: isolate; + } + .agent-scene { + position: absolute; + right: 0; + top: 45px; + width: min(950px, 95%); + height: 590px; + pointer-events: none; + z-index: -1; + overflow: hidden; + } + .agent-scene img { + width: 100%; + height: 100%; + object-fit: cover; + opacity: 0.78; + mask-image: linear-gradient(to right, transparent, #000 42%); + transition: filter 250ms ease; + } + .agent-scene:after { + content: ''; + position: absolute; + inset: 0; + background: linear-gradient(to top, #0b0a10, transparent 43%); + } + .agent-toolbar { + position: sticky; + top: 0; + z-index: 4; + display: flex; + gap: 8px; + align-items: center; + padding: 14px 25px; + background: linear-gradient(#0b0a10ef, #0b0a10cc); + backdrop-filter: blur(12px); + flex-wrap: wrap; + } + .agent-toolbar .grow { + flex: 1; + } + .agent-content { + position: relative; + max-width: 960px; + margin: auto; + padding: 35px 30px 35px; + } + .agent-intro { + min-height: 185px; + padding: 0 0 28px; + } + .agent-kicker { + font-size: 10px; + letter-spacing: 2px; + color: #c7a670; + margin-bottom: 14px; + } + .agent-intro h1 { + font-size: 45.75px; + line-height: 1.22; + font-weight: 700; + letter-spacing: -1px; + margin: 0 0 17px; + color: #fffaf2ed; + max-width: 540px; + text-shadow: 0 5px 24px #0006; + white-space: pre-line; + } + .agent-intro p { + font-size: 12px; + line-height: 1.8; + color: #fffaf299; + max-width: 620px; + margin: 0; + } + .agent-composer { + background: rgba(19, 18, 25, 0.82); + backdrop-filter: blur(18px) saturate(1.4); + border: 1px solid #ffffff26; + border-radius: 17.85px; + padding: 20px 21px 15px; + box-shadow: + 0 12px 40px #0009, + 0 2px 10px #0006; + position: relative; + transition: + border-color 180ms ease, + box-shadow 250ms var(--ease-out); + } + .agent-composer:before { + content: ''; + position: absolute; + left: 20px; + right: 20px; + top: 5px; + height: 5px; + background: radial-gradient(circle, #ffffff20 2px, transparent 2.5px) 0 + 0/18px 5px; + pointer-events: none; + } + .agent-composer:focus-within { + border-color: #f5b04273; + box-shadow: + 0 12px 40px #0009, + 0 0 0 1px #f5b04259, + 0 8px 28px #f5b0422e; + } + .agent-composer textarea { + display: block; + width: 100%; + min-height: 96px; + max-height: 250px; + resize: vertical; + background: none; + border: 0; + outline: none; + font-size: 13.395px; + line-height: 24.111px; + color: #fffaf2ed; + padding: 8px 0; + } + .agent-composer textarea::placeholder { + color: #88838e; + } + .agent-input-info { + display: flex; + align-items: center; + justify-content: space-between; + padding: 8px 0 10px; + gap: 12px; + } + .agent-input-info button { + color: #f5b042; + border: 0; + background: none; + font-size: 11px; + cursor: pointer; + padding: 0; + } + .agent-input-info small { + font-size: 9px; + color: #716b78; + } + .agent-controls { + display: flex; + gap: 7px; + align-items: center; + flex-wrap: wrap; + border-top: 1px solid #ffffff0a; + padding-top: 10px; + } + .agent-option, + .project-option { + border: 1px solid #ffffff17; + background: #19171f; + color: #ffffffb3; + border-radius: 8.925px; + padding: 7px 10px; + font-size: 11px; + display: inline-flex; + align-items: center; + gap: 6px; + line-height: 1.3; + max-width: 220px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + transition: + background-color 180ms ease, + border-color 180ms ease, + color 180ms ease, + transform 160ms var(--ease-out); + } + .agent-option { + cursor: pointer; + } + .agent-option img { + width: 18px; + height: 18px; + border-radius: 50%; + object-fit: cover; + } + .project-option select { + color: inherit; + background: none; + border: 0; + outline: none; + font-size: 11px; + max-width: 160px; + } + .project-option select option { + background: #19171f; + } + .agent-submit-row { + width: 100%; + display: flex; + align-items: center; + gap: 8px; + margin-top: 1px; + flex-wrap: wrap; + } + .agent-submit-row > small { + margin-left: auto; + color: #6f6879; + font-size: 9px; + } + .agent-send { + margin-left: auto; + border: 1px solid #f5b042; + background: #f5b042; + color: #241a09; + border-radius: 999px; + font-size: 12px; + padding: 10px 17px; + font-weight: 600; + cursor: pointer; + transition: + transform 160ms var(--ease-out), + background-color 180ms ease, + box-shadow 180ms ease; + } + .agent-send:disabled { + opacity: 0.5; + cursor: default; + } + .agent-send:active, + .agent-option:active { + transform: scale(var(--press-scale)); + } + .agent-welcome-card { + margin-top: 26px; + border: 1px solid #ffffff10; + background: linear-gradient(135deg, #111015, #211c2eee); + border-radius: 18px; + display: flex; + gap: 22px; + padding: 19px; + align-items: center; + } + .agent-welcome-card > img { + width: 164px; + height: 170px; + object-fit: cover; + border-radius: 12px; + flex-shrink: 0; + } + .agent-welcome-card > div { + min-width: 0; + flex: 1; + } + .agent-welcome-card span { + font-size: 10px; + display: inline-flex; + color: #bda5ff; + border-radius: 999px; + padding: 2px 9px; + background: #7850ff1f; + } + .agent-welcome-card h2 { + font-size: 20px; + line-height: 1.6; + margin: 8px 0; + color: #fffaf2ed; + font-weight: 650; + } + .agent-welcome-card p { + font-size: 11px; + color: #a29ba9; + line-height: 1.9; + margin: 0 0 12px; + } + .agent-frame-strip { + display: flex; + gap: 7px; + margin: 12px 0; + } + .agent-frame-strip img { + width: 48px; + height: 58px; + object-fit: cover; + border-radius: 6px; + opacity: 0.88; + } + .agent-welcome-card button { + color: #f5b042; + border: 1px solid #f5b0424d; + background: #f5b04208; + } + .agent-project-links { + display: flex; + gap: 12px; + margin-top: 25px; + } + .agent-project-links a { + flex: 1; + text-decoration: none; + padding: 17px; + border: 1px solid #ffffff0d; + background: #121016; + border-radius: 13px; + color: #d5c9dd; + font-size: 12px; + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; + } + .agent-project-links span { + font-size: 10px; + color: #776b86; + } + .agent-conversation { + border: 1px solid #ffffff12; + background: #13101aeb; + border-radius: 16px; + overflow: hidden; + margin-bottom: 16px; + } + .agent-conversation > header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + padding: 18px 20px; + border-bottom: 1px solid #ffffff0d; + background: linear-gradient(120deg, #b784ff0c, #f5b04208); + } + .agent-conversation > header span { + font-size: 10px; + color: #b784ff; + } + .agent-conversation h2 { + font-size: 18px; + color: #fffaf2ed; + margin: 5px 0; + } + .agent-conversation .session-status { + color: #f5b042; + } + .agent-conversation .chat-body { + height: min(45vh, 530px); + min-height: 240px; + display: flex; + padding: 10px; + } + .agent-conversation :global(.plan-panel) { + margin: 10px 14px; + } + .conversation { + padding-top: 18px; + } + .conversation .agent-composer textarea { + min-height: 70px; + } + .agent-attachments { + display: flex; + gap: 8px; + flex-wrap: wrap; + margin-bottom: 12px; + } + .agent-attachments > div { + display: flex; + align-items: center; + gap: 7px; + font-size: 10px; + background: #ffffff06; + border: 1px solid #ffffff12; + border-radius: 8px; + padding: 5px 8px; + } + .agent-attachments img { + width: 30px; + height: 30px; + object-fit: cover; + border-radius: 5px; + } + .agent-attachments span { + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .agent-attachments button { + border: 0; + background: none; + color: var(--text-3); + cursor: pointer; + } + .style-grid { + display: grid; + grid-template-columns: repeat(5, minmax(0, 1fr)); + gap: 20px 12px; + } + .style-card { + padding: 0; + background: none; + border: 0; + color: #ffffffa0; + font-size: 11px; + position: relative; + text-align: center; + cursor: pointer; + } + .style-card img { + display: block; + width: 100%; + height: 150px; + object-fit: cover; + border-radius: 10px; + border: 2px solid transparent; + transition: + border-color 180ms ease, + transform 180ms var(--ease-out), + box-shadow 180ms ease; + } + .style-card span { + display: block; + margin-top: 8px; + } + .style-card.selected img { + border-color: #f5b042; + box-shadow: 0 0 0 2px #f5b04226; + } + .style-card.selected { + color: #f5b042; + } + .style-card.selected:after { + content: '✓'; + position: absolute; + top: 6px; + right: 6px; + background: #f5b042; + color: #2d210d; + width: 20px; + height: 20px; + border-radius: 50%; + display: grid; + place-items: center; + } + .dialog-actions { + display: flex; + justify-content: flex-end; + align-items: center; + gap: 10px; + } + .dialog-actions small { + margin-right: auto; + font-size: 10px; + color: #7f718f; + } + .dialog-actions .purple { + min-width: 140px; + } + .skill-search { + display: flex; + gap: 8px; + margin-bottom: 15px; + } + .skill-search input { + flex: 1; + min-width: 0; + } + .skill-choice, + .model-choice { + padding: 15px 16px; + margin: 10px 0; + border: 1px solid #ffffff0e; + border-radius: 11px; + background: #ffffff03; + color: #d8cbe8; + display: block; + width: 100%; + text-align: left; + cursor: pointer; + transition: + background-color 180ms ease, + border-color 180ms ease; + } + .skill-choice.selected { + border-color: #f5b04266; + background: #f5b04207; + } + .model-choice.selected { + border-color: #b784ff60; + background: #7850ff0f; + } + .skill-choice b, + .model-choice b { + font-size: 13px; + display: block; + font-weight: 600; + } + .skill-choice small, + .model-choice small { + display: block; + color: #8e839a; + font-size: 11px; + line-height: 1.8; + margin-top: 6px; + } + .model-config-link { + color: #b784ff; + font-size: 11px; + display: block; + margin-top: 18px; + text-decoration: none; + } + .empty-skills, + .agent-error { + color: #9d8ca9; + font-size: 12px; + line-height: 1.8; + } + .reference-skills-editor.right { + position: static !important; + width: 100%; + height: auto; + min-height: 0; + max-height: none; + display: flex !important; + transform: none !important; + border: 0; + background: none; + box-shadow: none; + overflow: visible; + border-radius: 0; + padding: 0; + margin-top: 15px; + } + .reference-skills-editor .right-head { + padding: 10px 0; + border-bottom: 1px solid var(--line); + } + .reference-skills-editor .editor { + padding: 16px 0; + overflow: visible; + } + .reference-skills-editor .editor-actions { + position: sticky; + bottom: -22px; + background: #131219; + padding: 14px 0; + border-top: 1px solid var(--line); + z-index: 1; + } + .all-skill-library { + display: flex; + flex-direction: column; + gap: 7px; + } + .agent-management-model { + padding: 14px; + border: 1px solid #ffffff10; + border-radius: 11px; + background: #ffffff04; + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; + font-size: 12px; + } + .agent-management-model p { + width: 100%; + color: #8f7d9e; + font-size: 11px; + margin: 0; + line-height: 1.8; + } + .agent-management-model button { + margin-left: auto; + } + @media (hover: hover) and (pointer: fine) { + .agent-entry:hover { + border-color: #ffffff12; + background-color: #ffffff0a; } - .left { - width: 190px; + .agent-entry.selected:hover { + background-color: #ffffff26; + } + .agent-entry:hover .avatar { + transform: scale(1.05); + } + .agent-option:hover { + border-color: #f5b04255; + background: #f5b0420d; + color: #ffe0a5; + } + .agent-send:hover:not(:disabled) { + background: #ffc96a; + box-shadow: 0 4px 18px #f5b04235; + transform: translateY(-1px); + } + .style-card:hover img { + transform: translateY(-2px); + box-shadow: 0 5px 20px #0006; + } + .skill-choice:hover, + .model-choice:hover { + border-color: #b784ff44; + background: #ffffff06; + } + } + @media (max-width: 1200px) { + .agent-rail { + width: 240px; + } + .agent-content { + padding: 25px 24px; + } + .agent-intro h1 { + font-size: 38px; + } + .style-grid { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + .agent-welcome-card h2 { + font-size: 17px; + } + .agent-project-links span { + display: none; + } + } + @media (max-height: 760px) { + .agent-intro { + min-height: 155px; + padding-bottom: 22px; + } + .agent-content { + padding-top: 22px; + } + .agent-intro h1 { + font-size: 38px; + } + .agent-composer textarea { + min-height: 84px; + } + .agent-welcome-card > img { + height: 142px; + width: 125px; + } + .agent-toolbar { + padding-top: 10px; + padding-bottom: 10px; + } + } + :global(:root[data-reduce='1']) .agent-scene img, + :global(:root[data-reduce='1']) .style-card img { + transition: none; + } + :global(:root[data-reduce='1']) .style-card:hover img, + :global(:root[data-reduce='1']) .agent-entry:hover .avatar { + transform: none; + } + + .agent-result-actions { + padding: 10px 20px 0; + display: flex; + justify-content: flex-end; + } + .agent-result-editor { + width: 100%; + min-height: 260px; + resize: vertical; + line-height: 1.9; + font-size: 13px; + } + .result-project-label { + display: flex; + align-items: center; + gap: 15px; + font-size: 12px; + margin-bottom: 15px; + } + .result-project-label select { + flex: 1; + } + .result-error { + color: var(--err); + font-size: 12px; + } + + .agent-intro { + animation: agent-arrive 700ms cubic-bezier(0.22, 1, 0.36, 1) both; + } + .agent-content:not(.conversation) .agent-composer { + animation: agent-arrive 700ms cubic-bezier(0.22, 1, 0.36, 1) 220ms both; + } + @keyframes agent-arrive { + from { + opacity: 0; + transform: translateY(18px); + } + to { + opacity: 1; + transform: translateY(0); } } diff --git a/calliope-web/src/routes/app.css b/calliope-web/src/routes/app.css index b139655b..59572620 100644 --- a/calliope-web/src/routes/app.css +++ b/calliope-web/src/routes/app.css @@ -3,57 +3,58 @@ @tailwind utilities; :root { - color-scheme: light; - --accent-grad-hover: linear-gradient(#2c42c9, #2c42c9); - --accent-ring: #354fe040; - --accent-wash: #eceefc; + color-scheme: dark; + --accent-grad-hover: linear-gradient(135deg, #39dcee, #00b4c5); + --accent-ring: #00cae040; + --accent-wash: #00cae016; --btn-glow-hover: 0 3px 0 #2235a01f; - --composer-bg: #fbfaf7; - --composer-focus: #fbfaf7; - --float-bg: #fbfaf7; + --composer-bg: #131219d1; + --composer-focus: #131219e6; + --float-bg: #1b1c21; --on-media: #fff; --on-media-line: #ffffff66; --sel-shadow: 0 0 0 1px #354fe0; - --bg: #f4f2ed; - --bg-2: #fbfaf7; - --bg-3: #eeeee6; - --bg-4: #e8e9df; - --paper: #f4f2ed; - --lime: #e1eb9a; - --rose: #e9c0b5; - --line: #dfdfd6; - --line-2: #c6cabe; - --line-3: #b9bdb1; - --text: #292a2d; - --text-2: #656861; - --text-3: #74776e; - --accent: #354fe0; - --accent-hi: #354fe0; - --accent-lo: #2c42c9; - --accent-ink: #fff; - --accent-soft: #eceefc; - --accent-line: #a7b0e4; - --accent-grad: linear-gradient(#354fe0, #354fe0); + --bg: #0f0f12; + --bg-2: #141419; + --bg-3: #1b1c21; + --bg-4: #292b33; + --paper: #141419; + --lime: #203e39; + --rose: #402837; + --line: #ffffff14; + --line-2: #ffffff29; + --line-3: #ffffff40; + --text: #f5fbff; + --text-2: #b7bdc8; + --text-3: #8c99a0; + --accent: #00cae0; + --accent-hi: #79effa; + --accent-lo: #00a8b8; + --accent-ink: #071719; + --accent-soft: #00cae016; + --accent-line: #00cae059; + --accent-grad: linear-gradient(135deg, #00cae0, #00a8b8); --accent-glow: transparent; --btn-glow: 0 3px 0 #2235a01f; --page-glow: linear-gradient(transparent, transparent); - --ok: #617742; - --ok-soft: #e8eedc; - --run: #354fe0; - --run-soft: #eceefc; - --run-grad: linear-gradient(90deg, #354fe0, #7385ed); - --err: #a44136; - --err-solid: #a44136; - --err-soft: #f6e8e3; - --err-line: #d5a39b; - --warn: #81621d; - --warn-soft: #f0e8d5; - --overlay: #292a2d50; - --media-scrim: #fbfaf7ee; + --ok: #55d4ad; + --ok-soft: #10b98118; + --run: #a78bfa; + --run-soft: #7850ff18; + --run-grad: linear-gradient(90deg, #7850ff, #c4b5fd); + --err: #ff8c88; + --err-solid: #ef706b; + --err-soft: #ef706b18; + --err-line: #ef706b66; + --warn: #f5b042; + --warn-soft: #f5b04218; + --overlay: #000000bf; + --media-scrim: #101017ee; --media-text: #fff; --media-line: #ffffff66; - --stage-bg: #eae9e3; - --font: Arial, 'Noto Sans CJK SC', 'Microsoft YaHei', system-ui, sans-serif; + --stage-bg: #0f1117; + --font: + system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; --mono: ui-monospace, monospace; --fs-title: 15px; --fs-section: 14px; @@ -74,9 +75,9 @@ --r-md: 10px; --r-lg: 14px; --r-pill: 999px; - --shadow-float: 0 16px 50px #292a2d24, 0 0 0 1px var(--line); - --rail-w: 214px; - --topbar-h: 77px; + --shadow-float: 0 20px 60px #0008, 0 0 0 1px var(--line); + --rail-w: 78px; + --topbar-h: 54px; --tabbar-h: 0px; --sprocket: none; --frame-w: 0px; @@ -1140,3 +1141,55 @@ select:focus-visible { transition-duration: 0.01ms !important; scroll-behavior: auto !important; } + +/* Shared reference interface: explicit hover states and press feedback. */ +.reference-option { + position: relative; + isolation: isolate; + overflow: hidden; +} +.reference-option::after { + content: ''; + position: absolute; + inset: 0; + border-radius: inherit; + pointer-events: none; + opacity: 0; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='33' height='19'%3E%3Cpath d='M5.5 0h11l5.5 9.5-5.5 9.5h-11L0 9.5ZM22 9.5h11' fill='none' stroke='%23fff' stroke-opacity='.35'/%3E%3C/svg%3E"); + mask-image: radial-gradient( + 70px circle at var(--pointer-x, -100px) var(--pointer-y, -100px), + #000, + transparent + ); + transition: opacity 180ms ease; +} +@media (hover: hover) and (pointer: fine) { + .reference-option:hover::after { + opacity: 1; + } +} +:root[data-reduce='1'] .reference-option::after { + display: none; +} +@media (prefers-reduced-motion: reduce) { + .reference-option::after { + display: none; + } +} +.a-btn.gold { + background: linear-gradient(135deg, #ffd700, #f7931a); + color: #211703; + border-color: #f5b042; + border-radius: 999px; + box-shadow: + 0 2px 12px #ffd70035, + inset 0 1px 0 #ffffff4d; +} +.a-btn.gold:hover { + background: linear-gradient(135deg, #ffe250, #ffac3c); +} +.a-btn.purple { + background: linear-gradient(135deg, #8b5cf6bf, #6366f1b3); + color: white; + border-color: #a78bfa40; +} diff --git a/calliope-web/src/routes/workbench/[id]/+page.svelte b/calliope-web/src/routes/workbench/[id]/+page.svelte index 794f3929..c05501cf 100644 --- a/calliope-web/src/routes/workbench/[id]/+page.svelte +++ b/calliope-web/src/routes/workbench/[id]/+page.svelte @@ -1,7 +1,11 @@