diff --git a/src/agents/compaction.retry.test.ts b/src/agents/compaction.retry.test.ts index 30f81ca6664..31404e2e9b2 100644 --- a/src/agents/compaction.retry.test.ts +++ b/src/agents/compaction.retry.test.ts @@ -56,7 +56,7 @@ describe("compaction retry integration", () => { } as unknown as NonNullable; const invokeGenerateSummary = (signal = new AbortController().signal) => - mockGenerateSummary(testMessages, testModel, 1000, "test-api-key", undefined, signal); + mockGenerateSummary(testMessages, testModel, 1000, "test-api-key", signal); const runSummaryRetry = (options: Parameters[1]) => retryAsync(() => invokeGenerateSummary(), options); diff --git a/src/agents/compaction.ts b/src/agents/compaction.ts index 29bc934e412..8cc5b4f8233 100644 --- a/src/agents/compaction.ts +++ b/src/agents/compaction.ts @@ -212,7 +212,6 @@ async function summarizeChunks(params: { messages: AgentMessage[]; model: NonNullable; apiKey: string; - headers?: Record; signal: AbortSignal; reserveTokens: number; maxChunkTokens: number; @@ -240,7 +239,6 @@ async function summarizeChunks(params: { params.model, params.reserveTokens, params.apiKey, - params.headers, params.signal, effectiveInstructions, summary, @@ -267,7 +265,6 @@ export async function summarizeWithFallback(params: { messages: AgentMessage[]; model: NonNullable; apiKey: string; - headers?: Record; signal: AbortSignal; reserveTokens: number; maxChunkTokens: number; @@ -337,7 +334,6 @@ export async function summarizeInStages(params: { messages: AgentMessage[]; model: NonNullable; apiKey: string; - headers?: Record; signal: AbortSignal; reserveTokens: number; maxChunkTokens: number; diff --git a/src/agents/pi-extensions/compaction-safeguard.ts b/src/agents/pi-extensions/compaction-safeguard.ts index 06065e9411d..03de80d09fb 100644 --- a/src/agents/pi-extensions/compaction-safeguard.ts +++ b/src/agents/pi-extensions/compaction-safeguard.ts @@ -614,18 +614,8 @@ export default function compactionSafeguardExtension(api: ExtensionAPI): void { return { cancel: true }; } - const auth = await ctx.modelRegistry.getApiKeyAndHeaders(model); - if (!auth.ok) { - log.warn( - `Compaction safeguard: failed to resolve auth; cancelling compaction to preserve history. ${auth.error}`, - ); - setCompactionSafeguardCancelReason( - ctx.sessionManager, - `Compaction safeguard could not resolve request auth for ${model.provider}/${model.id}: ${auth.error}`, - ); - return { cancel: true }; - } - if (!auth.apiKey && !auth.headers) { + const apiKey = await ctx.modelRegistry.getApiKey(model); + if (!apiKey) { log.warn( "Compaction safeguard: no request auth available; cancelling compaction to preserve history.", ); @@ -635,8 +625,6 @@ export default function compactionSafeguardExtension(api: ExtensionAPI): void { ); return { cancel: true }; } - const apiKey = auth.apiKey ?? ""; - const headers = auth.headers; try { const modelContextWindow = resolveContextWindowTokens(model); @@ -700,7 +688,6 @@ export default function compactionSafeguardExtension(api: ExtensionAPI): void { messages: pruned.droppedMessagesList, model, apiKey, - headers, signal, reserveTokens: Math.max(1, Math.floor(preparation.settings.reserveTokens)), maxChunkTokens: droppedMaxChunkTokens, @@ -772,7 +759,6 @@ export default function compactionSafeguardExtension(api: ExtensionAPI): void { messages: messagesToSummarize, model, apiKey, - headers, signal, reserveTokens, maxChunkTokens, @@ -789,7 +775,6 @@ export default function compactionSafeguardExtension(api: ExtensionAPI): void { messages: turnPrefixMessages, model, apiKey, - headers, signal, reserveTokens, maxChunkTokens, diff --git a/src/agents/skills-install.download.test.ts b/src/agents/skills-install.download.test.ts index 49d20867fd1..bd8559b60fe 100644 --- a/src/agents/skills-install.download.test.ts +++ b/src/agents/skills-install.download.test.ts @@ -60,13 +60,7 @@ function buildEntry(name: string): SkillEntry { description: `${name} test skill`, filePath: path.join(skillDir, "SKILL.md"), baseDir: skillDir, - sourceInfo: { - path: path.join(skillDir, "SKILL.md"), - source: "openclaw-workspace", - scope: "project", - origin: "top-level", - baseDir: skillDir, - }, + source: "openclaw-workspace", disableModelInvocation: false, }, frontmatter: {}, diff --git a/src/agents/skills-install.ts b/src/agents/skills-install.ts index 95dd3310320..ef6c334d0b6 100644 --- a/src/agents/skills-install.ts +++ b/src/agents/skills-install.ts @@ -444,9 +444,9 @@ export async function installSkill(params: SkillInstallRequest): Promise { description: "test", filePath: "/tmp/os-scoped", baseDir: "/tmp", - sourceInfo: { - path: "/tmp/os-scoped", - source: "test", - scope: "project", - origin: "top-level", - baseDir: "/tmp", - }, + source: "test", disableModelInvocation: false, }, frontmatter: {}, diff --git a/src/agents/skills-status.ts b/src/agents/skills-status.ts index f2dd451a73c..02ff68e2efc 100644 --- a/src/agents/skills-status.ts +++ b/src/agents/skills-status.ts @@ -189,7 +189,7 @@ function buildSkillStatus( const bundled = bundledNames && bundledNames.size > 0 ? bundledNames.has(entry.skill.name) - : entry.skill.sourceInfo.source === "openclaw-bundled"; + : entry.skill.source === "openclaw-bundled"; const { emoji, homepage, required, missing, requirementsSatisfied, configChecks } = evaluateEntryRequirementsForCurrentPlatform({ @@ -205,7 +205,7 @@ function buildSkillStatus( return { name: entry.skill.name, description: entry.skill.description, - source: entry.skill.sourceInfo.source, + source: entry.skill.source, bundled, filePath: entry.skill.filePath, baseDir: entry.skill.baseDir, diff --git a/src/agents/skills.buildworkspaceskillstatus.test.ts b/src/agents/skills.buildworkspaceskillstatus.test.ts index eb6e40ad279..4b3cca8808f 100644 --- a/src/agents/skills.buildworkspaceskillstatus.test.ts +++ b/src/agents/skills.buildworkspaceskillstatus.test.ts @@ -24,13 +24,7 @@ function makeEntry(params: { description: `desc:${params.name}`, filePath: `/tmp/${params.name}/SKILL.md`, baseDir: `/tmp/${params.name}`, - sourceInfo: { - path: `/tmp/${params.name}/SKILL.md`, - source: params.source ?? "openclaw-workspace", - scope: "project", - origin: "top-level", - baseDir: `/tmp/${params.name}`, - }, + source: params.source ?? "openclaw-workspace", disableModelInvocation: false, }, frontmatter: {}, diff --git a/src/agents/skills.resolveskillspromptforrun.test.ts b/src/agents/skills.resolveskillspromptforrun.test.ts index d8cc67c461e..305e11f2f4e 100644 --- a/src/agents/skills.resolveskillspromptforrun.test.ts +++ b/src/agents/skills.resolveskillspromptforrun.test.ts @@ -17,13 +17,7 @@ describe("resolveSkillsPromptForRun", () => { description: "Demo", filePath: "/app/skills/demo-skill/SKILL.md", baseDir: "/app/skills/demo-skill", - sourceInfo: { - path: "/app/skills/demo-skill/SKILL.md", - source: "openclaw-bundled", - scope: "project", - origin: "top-level", - baseDir: "/app/skills/demo-skill", - }, + source: "openclaw-bundled", disableModelInvocation: false, }, frontmatter: {}, diff --git a/src/agents/skills/compact-format.test.ts b/src/agents/skills/compact-format.test.ts index aa85779e94b..20f3b8a256e 100644 --- a/src/agents/skills/compact-format.test.ts +++ b/src/agents/skills/compact-format.test.ts @@ -14,13 +14,7 @@ function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/S description: desc, filePath, baseDir: `/skills/${name}`, - sourceInfo: { - path: filePath, - source: "workspace", - scope: "project", - origin: "top-level", - baseDir: `/skills/${name}`, - }, + source: "workspace", disableModelInvocation: false, }; } diff --git a/src/agents/skills/config.ts b/src/agents/skills/config.ts index cf25b6fc50e..2dfe78acd5c 100644 --- a/src/agents/skills/config.ts +++ b/src/agents/skills/config.ts @@ -50,7 +50,7 @@ function normalizeAllowlist(input: unknown): string[] | undefined { const BUNDLED_SOURCES = new Set(["openclaw-bundled"]); function isBundledSkill(entry: SkillEntry): boolean { - return BUNDLED_SOURCES.has(entry.skill.sourceInfo.source); + return BUNDLED_SOURCES.has(entry.skill.source); } export function resolveBundledAllowlist(config?: OpenClawConfig): string[] | undefined { diff --git a/src/cli/skills-cli.formatting.test.ts b/src/cli/skills-cli.formatting.test.ts index 57f6d3a50c6..19d4ba0b2ed 100644 --- a/src/cli/skills-cli.formatting.test.ts +++ b/src/cli/skills-cli.formatting.test.ts @@ -38,13 +38,7 @@ describe("skills-cli (e2e)", () => { description: "Capture UI screenshots", filePath: path.join(baseDir, "SKILL.md"), baseDir, - sourceInfo: { - path: path.join(baseDir, "SKILL.md"), - source: "openclaw-bundled", - scope: "project", - origin: "top-level", - baseDir, - }, + source: "openclaw-bundled", disableModelInvocation: false, } as SkillEntry["skill"], frontmatter: {}, diff --git a/src/security/audit-extra.async.ts b/src/security/audit-extra.async.ts index 55765b717ce..5e9c4036e09 100644 --- a/src/security/audit-extra.async.ts +++ b/src/security/audit-extra.async.ts @@ -1261,7 +1261,7 @@ export async function collectInstalledSkillsCodeSafetyFindings(params: { for (const workspaceDir of workspaceDirs) { const entries = loadWorkspaceSkillEntries(workspaceDir, { config: params.cfg }); for (const entry of entries) { - if (entry.skill.sourceInfo.source === "openclaw-bundled") { + if (entry.skill.source === "openclaw-bundled") { continue; } diff --git a/ui/src/ui/app-render.helpers.ts b/ui/src/ui/app-render.helpers.ts index e85913dd46d..e0a097210fa 100644 --- a/ui/src/ui/app-render.helpers.ts +++ b/ui/src/ui/app-render.helpers.ts @@ -109,8 +109,9 @@ function renderCronFilterIcon(hiddenCount: number) { - ${hiddenCount > 0 - ? html` 0 + ? html`${hiddenCount}` - : ""} + : "" + } `; } @@ -311,11 +313,13 @@ export function renderChatControls(state: AppViewState) { state.sessionsHideCron = !hideCron; }} aria-pressed=${hideCron} - title=${hideCron - ? hiddenCronCount > 0 - ? t("chat.showCronSessionsHidden", { count: String(hiddenCronCount) }) - : t("chat.showCronSessions") - : t("chat.hideCronSessions")} + title=${ + hideCron + ? hiddenCronCount > 0 + ? t("chat.showCronSessionsHidden", { count: String(hiddenCronCount) }) + : t("chat.showCronSessions") + : t("chat.hideCronSessions") + } > ${renderCronFilterIcon(hiddenCronCount)} @@ -941,9 +945,9 @@ export function renderTopbarThemeModeToggle(state: AppViewState) { (opt) => html` ` - : nothing} + : nothing + }
- ${state.updateAvailable && - state.updateAvailable.latestVersion !== state.updateAvailable.currentVersion && - !isUpdateBannerDismissed(state.updateAvailable) - ? html`
${renderExecApprovalPrompt(state)} ${renderGatewayUrlConfirmation(state)} ${nothing} diff --git a/ui/src/ui/chat/grouped-render.ts b/ui/src/ui/chat/grouped-render.ts index 3dc1187ff86..d9a9edfb7e3 100644 --- a/ui/src/ui/chat/grouped-render.ts +++ b/ui/src/ui/chat/grouped-render.ts @@ -177,9 +177,11 @@ export function renderMessageGroup( ${timestamp} ${renderMessageMeta(meta)} ${normalizedRole === "assistant" && isTtsSupported() ? renderTtsButton(group) : nothing} - ${opts.onDelete - ? renderDeleteButton(opts.onDelete, normalizedRole === "user" ? "left" : "right") - : nothing} + ${ + opts.onDelete + ? renderDeleteButton(opts.onDelete, normalizedRole === "user" ? "left" : "right") + : nothing + } @@ -695,70 +697,84 @@ function renderGroupedMessage( return html`
- ${hasActions - ? html`
+ ${ + hasActions + ? html`
${canExpand ? renderExpandButton(markdown!, onOpenSidebar!) : nothing} ${canCopyMarkdown ? renderCopyAsMarkdownButton(markdown!) : nothing}
` - : nothing} - ${isToolMessage - ? html` + : nothing + } + ${ + isToolMessage + ? html`
${icons.zap} Tool output - ${toolSummaryLabel - ? html`${toolSummaryLabel}` - : toolPreview - ? html`${toolPreview}` - : nothing} + ${ + toolSummaryLabel + ? html`${toolSummaryLabel}` + : toolPreview + ? html`${toolPreview}` + : nothing + }
${renderMessageImages(images)} - ${reasoningMarkdown - ? html`
+ ${ + reasoningMarkdown + ? html`
${unsafeHTML(toSanitizedMarkdownHtml(reasoningMarkdown))}
` - : nothing} - ${jsonResult - ? html`
+ : nothing + } + ${ + jsonResult + ? html`
JSON ${jsonSummaryLabel(jsonResult.parsed)}
${jsonResult.pretty}
` - : markdown - ? html`
+ : markdown + ? html`
${unsafeHTML(toSanitizedMarkdownHtml(markdown))}
` - : nothing} + : nothing + } ${hasToolCards ? renderCollapsedToolCards(toolCards, onOpenSidebar) : nothing}
` - : html` + : html` ${renderMessageImages(images)} - ${reasoningMarkdown - ? html`
+ ${ + reasoningMarkdown + ? html`
${unsafeHTML(toSanitizedMarkdownHtml(reasoningMarkdown))}
` - : nothing} - ${jsonResult - ? html`
+ : nothing + } + ${ + jsonResult + ? html`
JSON ${jsonSummaryLabel(jsonResult.parsed)}
${jsonResult.pretty}
` - : markdown - ? html`
+ : markdown + ? html`
${unsafeHTML(toSanitizedMarkdownHtml(markdown))}
` - : nothing} + : nothing + } ${hasToolCards ? renderCollapsedToolCards(toolCards, onOpenSidebar) : nothing} - `} + ` + }
`; } diff --git a/ui/src/ui/chat/tool-cards.ts b/ui/src/ui/chat/tool-cards.ts index 2e79283fe88..0a5d85542ca 100644 --- a/ui/src/ui/chat/tool-cards.ts +++ b/ui/src/ui/chat/tool-cards.ts @@ -81,35 +81,49 @@ export function renderToolCardSidebar(card: ToolCard, onOpenSidebar?: (content: @click=${handleClick} role=${canClick ? "button" : nothing} tabindex=${canClick ? "0" : nothing} - @keydown=${canClick - ? (e: KeyboardEvent) => { - if (e.key !== "Enter" && e.key !== " ") { - return; + @keydown=${ + canClick + ? (e: KeyboardEvent) => { + if (e.key !== "Enter" && e.key !== " ") { + return; + } + e.preventDefault(); + handleClick?.(); } - e.preventDefault(); - handleClick?.(); - } - : nothing} + : nothing + } >
${icons[display.icon]} ${display.label}
- ${canClick - ? html`${hasText ? "View" : ""} ${icons.check}` - : nothing} - ${isEmpty && !canClick - ? html`${icons.check}` - : nothing} + : nothing + } + ${ + isEmpty && !canClick + ? html`${icons.check}` + : nothing + }
${detail ? html`
${detail}
` : nothing} - ${isEmpty ? html`
Completed
` : nothing} - ${showCollapsed - ? html`
${getTruncatedPreview(card.text!)}
` - : nothing} + ${ + isEmpty + ? html` +
Completed
+ ` + : nothing + } + ${ + showCollapsed + ? html`
${getTruncatedPreview(card.text!)}
` + : nothing + } ${showInline ? html`
${card.text}
` : nothing}
`; diff --git a/ui/src/ui/icons.ts b/ui/src/ui/icons.ts index 4c10abc1f6c..9cba6e36ef1 100644 --- a/ui/src/ui/icons.ts +++ b/ui/src/ui/icons.ts @@ -121,7 +121,9 @@ export const icons = { `, - check: html` `, + check: html` + + `, arrowDown: html` @@ -142,12 +144,8 @@ export const icons = { `, brain: html` - - + + @@ -238,7 +236,9 @@ export const icons = { `, - circle: html` `, + circle: html` + + `, puzzle: html` `, - stop: html` `, + stop: html` + + `, pin: html` diff --git a/ui/src/ui/views/agents-panels-overview.ts b/ui/src/ui/views/agents-panels-overview.ts index eefb35e2bcf..2dafff0d28e 100644 --- a/ui/src/ui/views/agents-panels-overview.ts +++ b/ui/src/ui/views/agents-panels-overview.ts @@ -115,13 +115,13 @@ export function renderAgentOverview(params: {
- ${configDirty - ? html` -
- You have unsaved config changes. -
- ` - : nothing} + ${ + configDirty + ? html` +
You have unsaved config changes.
+ ` + : nothing + }
Model Selection
@@ -134,13 +134,17 @@ export function renderAgentOverview(params: { @change=${(e: Event) => onModelChange(agent.id, (e.target as HTMLSelectElement).value || null)} > - ${isDefault - ? html` ` - : html` + ${ + isDefault + ? html` + + ` + : html` - `} + ` + } ${buildModelOptions(configForm, effectivePrimary ?? undefined, params.modelCatalog)} diff --git a/ui/src/ui/views/agents-panels-status-files.ts b/ui/src/ui/views/agents-panels-status-files.ts index 634f1a753d4..02f660171b2 100644 --- a/ui/src/ui/views/agents-panels-status-files.ts +++ b/ui/src/ui/views/agents-panels-status-files.ts @@ -179,19 +179,24 @@ export function renderAgentChannels(params: {
Last refresh: ${lastSuccessLabel}
- ${params.error - ? html`
${params.error}
` - : nothing} - ${!params.snapshot - ? html` -
- Load channels to see live status. -
- ` - : nothing} - ${entries.length === 0 - ? html`
No channels found.
` - : html` + ${ + params.error + ? html`
${params.error}
` + : nothing + } + ${ + !params.snapshot + ? html` +
Load channels to see live status.
+ ` + : nothing + } + ${ + entries.length === 0 + ? html` +
No channels found.
+ ` + : html`
${entries.map((entry) => { const summary = summarizeChannelAccounts(entry.accounts); @@ -217,28 +222,33 @@ export function renderAgentChannels(params: {
${status}
${configLabel}
${enabled}
- ${summary.configured === 0 - ? html` - - ` - : nothing} - ${extras.length > 0 - ? extras.map((extra) => html`
${extra.label}: ${extra.value}
`) - : nothing} + ${ + summary.configured === 0 + ? html` + + ` + : nothing + } + ${ + extras.length > 0 + ? extras.map((extra) => html`
${extra.label}: ${extra.value}
`) + : nothing + }
`; })}
- `} + ` + } `; @@ -289,26 +299,33 @@ export function renderAgentCron(params: {
${formatNextRun(params.status?.nextWakeAtMs ?? null)}
- ${params.error - ? html`
${params.error}
` - : nothing} + ${ + params.error + ? html`
${params.error}
` + : nothing + }
Agent Cron Jobs
Scheduled jobs targeting this agent.
- ${jobs.length === 0 - ? html`
No jobs assigned.
` - : html` + ${ + jobs.length === 0 + ? html` +
No jobs assigned.
+ ` + : html`
${jobs.map( (job) => html`
${job.name}
- ${job.description - ? html`
${job.description}
` - : nothing} + ${ + job.description + ? html`
${job.description}
` + : nothing + }
${formatCronSchedule(job)} @@ -333,7 +350,8 @@ export function renderAgentCron(params: { `, )}
- `} + ` + }
`; } @@ -376,46 +394,60 @@ export function renderAgentFiles(params: { ${params.agentFilesLoading ? "Loading…" : "Refresh"} - ${list - ? html`
+ ${ + list + ? html`
Workspace: ${list.workspace}
` - : nothing} - ${params.agentFilesError - ? html`
+ : nothing + } + ${ + params.agentFilesError + ? html`
${params.agentFilesError}
` - : nothing} - ${!list - ? html` -
- Load the agent workspace files to edit core instructions. -
- ` - : files.length === 0 - ? html`
No files found.
` - : html` + : nothing + } + ${ + !list + ? html` +
+ Load the agent workspace files to edit core instructions. +
+ ` + : files.length === 0 + ? html` +
No files found.
+ ` + : html`
${files.map((file) => { const isActive = active === file.name; const label = file.name.replace(/\.md$/i, ""); return html` `; })}
- ${!activeEntry - ? html`
Select a file to edit.
` - : html` + ${ + !activeEntry + ? html` +
Select a file to edit.
+ ` + : html`
${activeEntry.path}
@@ -450,13 +482,15 @@ export function renderAgentFiles(params: {
- ${activeEntry.missing - ? html` -
- This file is missing. Saving will create it in the agent workspace. -
- ` - : nothing} + ${ + activeEntry.missing + ? html` +
+ This file is missing. Saving will create it in the agent workspace. +
+ ` + : nothing + }
`; @@ -128,8 +130,9 @@ export function renderNostrCard(params: { style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;" >
Profile
- ${summaryConfigured - ? html` + ${ + summaryConfigured + ? html` - ${vs.pinnedExpanded - ? html` + ${ + vs.pinnedExpanded + ? html`
${entries.map( ({ index, text, role }) => html` @@ -768,7 +771,8 @@ function renderPinnedSection( )}
` - : nothing} + : nothing + } `; } @@ -801,9 +805,11 @@ function renderSlashMenu( requestUpdate(); }} > - ${vs.slashMenuCommand?.icon - ? html`${icons[vs.slashMenuCommand.icon]}` - : nothing} + ${ + vs.slashMenuCommand?.icon + ? html`${icons[vs.slashMenuCommand.icon]}` + : nothing + } ${arg} /${vs.slashMenuCommand?.name} ${arg} @@ -845,9 +851,9 @@ function renderSlashMenu( ${entries.map( ({ cmd, globalIdx }) => html`
selectSlashCommand(cmd, props, requestUpdate)} @@ -860,11 +866,15 @@ function renderSlashMenu( /${cmd.name} ${cmd.args ? html`${cmd.args}` : nothing} ${cmd.description} - ${cmd.argOptions?.length - ? html`${cmd.argOptions.length} options` - : cmd.executeLocal && !cmd.args - ? html` instant ` - : nothing} + ${ + cmd.argOptions?.length + ? html`${cmd.argOptions.length} options` + : cmd.executeLocal && !cmd.args + ? html` + instant + ` + : nothing + }
`, )} @@ -944,49 +954,46 @@ export function renderChat(props: ChatProps) { @click=${handleCodeBlockCopy} >
- ${props.loading - ? html` -
-
-
-
-
-
-
+ ${ + props.loading + ? html` +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ` - : nothing} + ` + : nothing + } ${isEmpty && !vs.searchOpen ? renderWelcomeState(props) : nothing} - ${isEmpty && vs.searchOpen - ? html`
No matching messages
` - : nothing} + ${ + isEmpty && vs.searchOpen + ? html` +
No matching messages
+ ` + : nothing + } ${repeat( chatItems, (item) => item.key, @@ -1164,8 +1171,9 @@ export function renderChat(props: ChatProps) { > ${props.disabledReason ? html`
${props.disabledReason}
` : nothing} ${props.error ? html`
${props.error}
` : nothing} - ${props.focusMode - ? html` + ${ + props.focusMode + ? html`
` - : nothing} + : nothing + }
- ${props.queue.length - ? html` + ${ + props.queue.length + ? html`
Queued (${props.queue.length})
@@ -1219,8 +1231,10 @@ export function renderChat(props: ChatProps) { (item) => html`
- ${item.text || - (item.attachments?.length ? `Image (${item.attachments.length})` : "")} + ${ + item.text || + (item.attachments?.length ? `Image (${item.attachments.length})` : "") + }
` - : nothing} + : nothing + } ${renderFallbackIndicator(props.fallbackStatus)} ${renderCompactionIndicator(props.compactionStatus)} ${renderContextNotice(activeSession, props.sessions?.defaults?.contextTokens ?? null)} - ${props.showNewMessages - ? html` + ${ + props.showNewMessages + ? html` ` - : nothing} + : nothing + }
@@ -1260,9 +1277,11 @@ export function renderChat(props: ChatProps) { @change=${(e: Event) => handleFileSelect(e, props)} /> - ${vs.sttRecording && vs.sttInterimText - ? html`
${vs.sttInterimText}
` - : nothing} + ${ + vs.sttRecording && vs.sttInterimText + ? html`
${vs.sttInterimText}
` + : nothing + } - `} + ` + }
`; - })()} + })() + }
- ${props.issues.length > 0 - ? html`
+ ${ + props.issues.length > 0 + ? html`
${JSON.stringify(props.issues, null, 2)}
` - : nothing} + : nothing + }
`; diff --git a/ui/src/ui/views/cron.ts b/ui/src/ui/views/cron.ts index 3d19cdb6d64..b6632b35667 100644 --- a/ui/src/ui/views/cron.ts +++ b/ui/src/ui/views/cron.ts @@ -341,12 +341,14 @@ function focusFormField(id: string) { function renderFieldLabel(text: string, required = false) { return html` ${text} - ${required - ? html` + ${ + required + ? html` ${t("cron.form.requiredSr")} ` - : nothing} + : nothing + } `; } @@ -400,11 +402,13 @@ export function renderCron(props: CronProps) {
${t("cron.summary.enabled")}
- ${props.status - ? props.status.enabled - ? t("cron.summary.yes") - : t("cron.summary.no") - : t("common.na")} + ${ + props.status + ? props.status.enabled + ? t("cron.summary.yes") + : t("cron.summary.no") + : t("common.na") + }
@@ -543,15 +547,18 @@ export function renderCron(props: CronProps) {
- ${props.jobs.length === 0 - ? html`
${t("cron.jobs.noMatching")}
` - : html` + ${ + props.jobs.length === 0 + ? html`
${t("cron.jobs.noMatching")}
` + : html`
${props.jobs.map((job) => renderJob(job, props))}
- `} - ${props.jobsHasMore - ? html` + ` + } + ${ + props.jobsHasMore + ? html`
` - : nothing} + : nothing + }
@@ -573,9 +581,11 @@ export function renderCron(props: CronProps) {
${t("cron.runs.title")}
- ${props.runsScope === "all" - ? t("cron.runs.subtitleAll") - : t("cron.runs.subtitleJob", { title: selectedRunTitle })} + ${ + props.runsScope === "all" + ? t("cron.runs.subtitleAll") + : t("cron.runs.subtitleJob", { title: selectedRunTitle }) + }
@@ -666,21 +676,24 @@ export function renderCron(props: CronProps) { })}
- ${props.runsScope === "job" && props.runsJobId == null - ? html` + ${ + props.runsScope === "job" && props.runsJobId == null + ? html`
${t("cron.runs.selectJobHint")}
` - : runs.length === 0 - ? html` + : runs.length === 0 + ? html`
${t("cron.runs.noMatching")}
` - : html` + : html`
${runs.map((entry) => renderRun(entry, props.basePath, props.onNavigateToChat))}
- `} - ${(props.runsScope === "all" || props.runsJobId != null) && props.runsHasMore - ? html` + ` + } + ${ + (props.runsScope === "all" || props.runsJobId != null) && props.runsHasMore + ? html`
` - : nothing} + : nothing + } @@ -833,13 +847,16 @@ export function renderCron(props: CronProps) {
- ${props.form.payloadKind === "systemEvent" - ? t("cron.form.systemEventHelp") - : t("cron.form.agentTurnHelp")} + ${ + props.form.payloadKind === "systemEvent" + ? t("cron.form.systemEventHelp") + : t("cron.form.agentTurnHelp") + }
- ${isAgentTurn - ? html` + ${ + isAgentTurn + ? html` - ${isCronSchedule - ? html` + ${ + isCronSchedule + ? html` - ${isTrustedProxy - ? "" - : html` + ${ + isTrustedProxy + ? "" + : html` - `} + ` + }