- 移除 Calliope 旧壳死代码:/project/[id] 旧四段编辑器页面与 9 个遗留组件 (NavRail/StoryStage/AssetsStage/ScriptStage/QueueStage/ActivityPanel/ JobRow/AssetThumb/ProjectCard),/projects 死页面(308→/ 已有) - 素材库 /library 迁入 AppShell 新壳:a-chip 筛选、ui/Modal、ConfirmDialog 实心红两级删除、窄屏单列;移除 A 时期 308→/ 重定向;导航轨/更多菜单新增入口 - 智能体子系统去杂色:agentPalette 默认紫→中性、回退色板收敛为 avatar 五色族; AgentChat 气泡按 §3.2/3.6(用户 bg-3/Agent bg-2+line)、进行中指示改青、 紫色空态图标清除;AgentComposer 天蓝/金芯片收敛 - 首页/工作台/五面板/StageStepper/PromptBlock/JobChip 类名收敛到全局 a-btn/ a-input/a-tag/field;Stepper 补金色当前下划+已确认✓;镜头序号按规范用 accent-lo+mono;分页/工作台选择页金色越界改中性或青 - 金色纪律修正:次级文字操作(重试/测试/链接)与必填星标、任务「测试」标签 去金色;「默认」金标签按 §3.9 保留 - 断点收敛:1023/1279/900/780/700/640 → 1180/760(1440 增强保留) - canvas/build-scene 可用级 ≤760 纵向堆叠适配 + 硬编码色/旧 fallback 清理; AppHeader 去 Calliope 品牌与死链 - favicon 收口:static/favicon.png 金色品牌图标,移除 204 stub 与构建豁免 - i18n 七语种 +3 key(shell.navLibrary/library.loadError/library.subtitle)全对齐 - 新增 e2e/fpages.mjs:F 页面三档走查/重定向/五段导入编辑/规范色断言 38 项 Co-authored-by: multica-agent <github@multica.ai>
164 lines
3.3 KiB
Svelte
164 lines
3.3 KiB
Svelte
<script lang="ts">
|
|
import Icon from '$lib/components/ui/Icon.svelte';
|
|
import { t } from '$lib/i18n.svelte';
|
|
|
|
interface Props {
|
|
name: string;
|
|
args?: Record<string, unknown> | null;
|
|
result?: unknown;
|
|
phase: 'running' | 'done' | 'error';
|
|
}
|
|
|
|
let { name, args = null, result = null, phase }: Props = $props();
|
|
let open = $state(false);
|
|
|
|
function fmt(value: unknown): string {
|
|
try {
|
|
return JSON.stringify(value, null, 2) ?? '';
|
|
} catch {
|
|
return String(value);
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<div class="tool-card" class:error={phase === 'error'}>
|
|
<button type="button" class="head" onclick={() => (open = !open)} aria-expanded={open}>
|
|
<span class="dot" class:running={phase === 'running'}></span>
|
|
<span class="name mono">{name}</span>
|
|
{#if phase === 'running'}
|
|
<span class="state">{t('agentTool.running')}</span>
|
|
{:else if phase === 'error'}
|
|
<span class="state err-text">{t('agentTool.failed')}</span>
|
|
{:else}
|
|
<span class="state ok-text">{t('agentTool.done')}</span>
|
|
{/if}
|
|
<span class="chev"><Icon name="chevron-down" size={13} /></span>
|
|
</button>
|
|
{#if open}
|
|
<div class="body">
|
|
{#if args && Object.keys(args).length > 0}
|
|
<div class="section">
|
|
<span class="label">{t('agentTool.args')}</span>
|
|
<pre>{fmt(args)}</pre>
|
|
</div>
|
|
{/if}
|
|
{#if result != null}
|
|
<div class="section">
|
|
<span class="label">{t('agentTool.result')}</span>
|
|
<pre>{fmt(result)}</pre>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
|
|
<style>
|
|
.tool-card {
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius-sm);
|
|
background: var(--bg-elevated);
|
|
overflow: hidden;
|
|
}
|
|
.tool-card.error {
|
|
border-color: rgba(239, 68, 68, 0.45);
|
|
}
|
|
.head {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
width: 100%;
|
|
padding: 7px 10px;
|
|
background: transparent;
|
|
border: none;
|
|
cursor: pointer;
|
|
color: var(--text-secondary);
|
|
font-size: 12px;
|
|
text-align: left;
|
|
}
|
|
.head:hover {
|
|
color: var(--text-primary);
|
|
background: var(--bg-3);
|
|
}
|
|
.name {
|
|
flex: 1;
|
|
min-width: 0;
|
|
font-size: 12px;
|
|
color: var(--text-primary);
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.dot {
|
|
width: 7px;
|
|
height: 7px;
|
|
border-radius: 999px;
|
|
background: var(--text-muted);
|
|
flex-shrink: 0;
|
|
}
|
|
.dot.running {
|
|
background: var(--warning);
|
|
animation: pulse 1.1s ease-in-out infinite;
|
|
}
|
|
@keyframes pulse {
|
|
0%,
|
|
100% {
|
|
opacity: 0.35;
|
|
}
|
|
50% {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
.state {
|
|
font-size: 11px;
|
|
color: var(--text-muted);
|
|
margin-left: auto;
|
|
flex-shrink: 0;
|
|
}
|
|
.ok-text {
|
|
color: var(--success);
|
|
}
|
|
.err-text {
|
|
color: var(--error);
|
|
}
|
|
.chev {
|
|
display: inline-flex;
|
|
flex-shrink: 0;
|
|
transition: transform 0.15s;
|
|
}
|
|
.head[aria-expanded='true'] .chev {
|
|
transform: rotate(180deg);
|
|
}
|
|
.body {
|
|
border-top: 1px solid var(--border);
|
|
padding: 8px 10px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
.section {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
min-width: 0;
|
|
}
|
|
.label {
|
|
font-size: 10px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.06em;
|
|
color: var(--text-muted);
|
|
}
|
|
pre {
|
|
margin: 0;
|
|
padding: 8px;
|
|
background: var(--bg-primary);
|
|
border-radius: var(--radius-sm);
|
|
font-family: var(--font-mono);
|
|
font-size: 11px;
|
|
line-height: 1.5;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
max-height: 220px;
|
|
overflow-y: auto;
|
|
}
|
|
</style>
|