@draht/web-ui 2026.7.13 → 2026.7.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/AgentInterface.d.ts +1 -1
  3. package/dist/components/AgentInterface.d.ts.map +1 -1
  4. package/dist/components/AgentInterface.js +11 -5
  5. package/dist/components/AgentInterface.js.map +1 -1
  6. package/package.json +10 -5
  7. package/example/README.md +0 -61
  8. package/example/index.html +0 -13
  9. package/example/package.json +0 -25
  10. package/example/src/app.css +0 -1
  11. package/example/src/custom-messages.ts +0 -99
  12. package/example/src/env.d.ts +0 -1
  13. package/example/src/main.ts +0 -421
  14. package/example/tsconfig.json +0 -23
  15. package/example/vite.config.ts +0 -6
  16. package/scripts/count-prompt-tokens.ts +0 -88
  17. package/src/ChatPanel.ts +0 -209
  18. package/src/app.css +0 -68
  19. package/src/components/AgentInterface.ts +0 -403
  20. package/src/components/AttachmentTile.ts +0 -107
  21. package/src/components/ConsoleBlock.ts +0 -72
  22. package/src/components/CustomProviderCard.ts +0 -100
  23. package/src/components/ExpandableSection.ts +0 -46
  24. package/src/components/Input.ts +0 -113
  25. package/src/components/MessageEditor.ts +0 -405
  26. package/src/components/MessageList.ts +0 -98
  27. package/src/components/Messages.ts +0 -383
  28. package/src/components/ProviderKeyInput.ts +0 -153
  29. package/src/components/SandboxedIframe.ts +0 -626
  30. package/src/components/StreamingMessageContainer.ts +0 -103
  31. package/src/components/ThinkingBlock.ts +0 -43
  32. package/src/components/message-renderer-registry.ts +0 -28
  33. package/src/components/sandbox/ArtifactsRuntimeProvider.ts +0 -220
  34. package/src/components/sandbox/AttachmentsRuntimeProvider.ts +0 -66
  35. package/src/components/sandbox/ConsoleRuntimeProvider.ts +0 -186
  36. package/src/components/sandbox/FileDownloadRuntimeProvider.ts +0 -110
  37. package/src/components/sandbox/RuntimeMessageBridge.ts +0 -82
  38. package/src/components/sandbox/RuntimeMessageRouter.ts +0 -216
  39. package/src/components/sandbox/SandboxRuntimeProvider.ts +0 -52
  40. package/src/dialogs/ApiKeyPromptDialog.ts +0 -75
  41. package/src/dialogs/AttachmentOverlay.ts +0 -636
  42. package/src/dialogs/CustomProviderDialog.ts +0 -274
  43. package/src/dialogs/ModelSelector.ts +0 -370
  44. package/src/dialogs/PersistentStorageDialog.ts +0 -144
  45. package/src/dialogs/ProvidersModelsTab.ts +0 -212
  46. package/src/dialogs/SessionListDialog.ts +0 -150
  47. package/src/dialogs/SettingsDialog.ts +0 -218
  48. package/src/index.ts +0 -120
  49. package/src/prompts/prompts.ts +0 -282
  50. package/src/storage/app-storage.ts +0 -60
  51. package/src/storage/backends/indexeddb-storage-backend.ts +0 -193
  52. package/src/storage/store.ts +0 -33
  53. package/src/storage/stores/custom-providers-store.ts +0 -62
  54. package/src/storage/stores/provider-keys-store.ts +0 -33
  55. package/src/storage/stores/sessions-store.ts +0 -136
  56. package/src/storage/stores/settings-store.ts +0 -34
  57. package/src/storage/types.ts +0 -206
  58. package/src/tools/artifacts/ArtifactElement.ts +0 -14
  59. package/src/tools/artifacts/ArtifactPill.ts +0 -26
  60. package/src/tools/artifacts/Console.ts +0 -93
  61. package/src/tools/artifacts/DocxArtifact.ts +0 -213
  62. package/src/tools/artifacts/ExcelArtifact.ts +0 -231
  63. package/src/tools/artifacts/GenericArtifact.ts +0 -117
  64. package/src/tools/artifacts/HtmlArtifact.ts +0 -195
  65. package/src/tools/artifacts/ImageArtifact.ts +0 -116
  66. package/src/tools/artifacts/MarkdownArtifact.ts +0 -82
  67. package/src/tools/artifacts/PdfArtifact.ts +0 -201
  68. package/src/tools/artifacts/SvgArtifact.ts +0 -119
  69. package/src/tools/artifacts/TextArtifact.ts +0 -148
  70. package/src/tools/artifacts/artifacts-tool-renderer.ts +0 -310
  71. package/src/tools/artifacts/artifacts.ts +0 -713
  72. package/src/tools/artifacts/index.ts +0 -7
  73. package/src/tools/extract-document.ts +0 -275
  74. package/src/tools/index.ts +0 -46
  75. package/src/tools/javascript-repl.ts +0 -293
  76. package/src/tools/renderer-registry.ts +0 -130
  77. package/src/tools/renderers/BashRenderer.ts +0 -52
  78. package/src/tools/renderers/CalculateRenderer.ts +0 -58
  79. package/src/tools/renderers/DefaultRenderer.ts +0 -103
  80. package/src/tools/renderers/GetCurrentTimeRenderer.ts +0 -92
  81. package/src/tools/types.ts +0 -15
  82. package/src/utils/attachment-utils.ts +0 -472
  83. package/src/utils/auth-token.ts +0 -22
  84. package/src/utils/format.ts +0 -42
  85. package/src/utils/i18n.ts +0 -653
  86. package/src/utils/model-discovery.ts +0 -277
  87. package/src/utils/proxy-utils.ts +0 -139
  88. package/src/utils/test-sessions.ts +0 -2357
  89. package/tsconfig.build.json +0 -20
  90. package/tsconfig.json +0 -7
@@ -1,119 +0,0 @@
1
- import { CopyButton } from "@mariozechner/mini-lit/dist/CopyButton.js";
2
- import { DownloadButton } from "@mariozechner/mini-lit/dist/DownloadButton.js";
3
- import { PreviewCodeToggle } from "@mariozechner/mini-lit/dist/PreviewCodeToggle.js";
4
- import hljs from "highlight.js";
5
- import { html } from "lit";
6
- import { customElement, property, state } from "lit/decorators.js";
7
- import { unsafeHTML } from "lit/directives/unsafe-html.js";
8
- import { i18n } from "../../utils/i18n.js";
9
- import { ArtifactElement } from "./ArtifactElement.js";
10
-
11
- @customElement("svg-artifact")
12
- export class SvgArtifact extends ArtifactElement {
13
- @property() override filename = "";
14
-
15
- private _content = "";
16
- @state() private previewUrl = "";
17
-
18
- override get content(): string {
19
- return this._content;
20
- }
21
- override set content(value: string) {
22
- if (this._content === value) {
23
- return;
24
- }
25
- this._content = value;
26
- this.updatePreviewUrl();
27
- this.requestUpdate();
28
- }
29
-
30
- @state() private viewMode: "preview" | "code" = "preview";
31
-
32
- protected override createRenderRoot(): HTMLElement | DocumentFragment {
33
- return this; // light DOM
34
- }
35
-
36
- private setViewMode(mode: "preview" | "code") {
37
- this.viewMode = mode;
38
- }
39
-
40
- private revokePreviewUrl() {
41
- if (this.previewUrl) {
42
- URL.revokeObjectURL(this.previewUrl);
43
- this.previewUrl = "";
44
- }
45
- }
46
-
47
- private updatePreviewUrl() {
48
- this.revokePreviewUrl();
49
- if (!this._content) {
50
- return;
51
- }
52
- this.previewUrl = URL.createObjectURL(new Blob([this._content], { type: "image/svg+xml" }));
53
- }
54
-
55
- public getHeaderButtons() {
56
- const toggle = new PreviewCodeToggle();
57
- toggle.mode = this.viewMode;
58
- toggle.addEventListener("mode-change", (e: Event) => {
59
- this.setViewMode((e as CustomEvent).detail);
60
- });
61
-
62
- const copyButton = new CopyButton();
63
- copyButton.text = this._content;
64
- copyButton.title = i18n("Copy SVG");
65
- copyButton.showText = false;
66
-
67
- return html`
68
- <div class="flex items-center gap-2">
69
- ${toggle}
70
- ${copyButton}
71
- ${DownloadButton({ content: this._content, filename: this.filename, mimeType: "image/svg+xml", title: i18n("Download SVG") })}
72
- </div>
73
- `;
74
- }
75
-
76
- override connectedCallback() {
77
- super.connectedCallback();
78
- if (this._content && !this.previewUrl) {
79
- this.updatePreviewUrl();
80
- }
81
- }
82
-
83
- override disconnectedCallback() {
84
- super.disconnectedCallback();
85
- this.revokePreviewUrl();
86
- }
87
-
88
- override render() {
89
- return html`
90
- <div class="h-full flex flex-col">
91
- <div class="flex-1 overflow-auto">
92
- ${
93
- this.viewMode === "preview"
94
- ? html`<div class="h-full flex items-center justify-center p-4">
95
- ${
96
- this.previewUrl
97
- ? html`<img
98
- class="max-w-full max-h-full w-full h-full object-contain"
99
- src="${this.previewUrl}"
100
- alt="${this.filename}"
101
- />`
102
- : ""
103
- }
104
- </div>`
105
- : html`<pre class="m-0 p-4 text-xs"><code class="hljs language-xml">${unsafeHTML(
106
- hljs.highlight(this.content, { language: "xml", ignoreIllegals: true }).value,
107
- )}</code></pre>`
108
- }
109
- </div>
110
- </div>
111
- `;
112
- }
113
- }
114
-
115
- declare global {
116
- interface HTMLElementTagNameMap {
117
- "svg-artifact": SvgArtifact;
118
- }
119
- }
@@ -1,148 +0,0 @@
1
- import { CopyButton } from "@mariozechner/mini-lit/dist/CopyButton.js";
2
- import { DownloadButton } from "@mariozechner/mini-lit/dist/DownloadButton.js";
3
- import hljs from "highlight.js";
4
- import { html } from "lit";
5
- import { customElement, property } from "lit/decorators.js";
6
- import { unsafeHTML } from "lit/directives/unsafe-html.js";
7
- import { i18n } from "../../utils/i18n.js";
8
- import { ArtifactElement } from "./ArtifactElement.js";
9
-
10
- // Known code file extensions for highlighting
11
- const CODE_EXTENSIONS = [
12
- "js",
13
- "javascript",
14
- "ts",
15
- "typescript",
16
- "jsx",
17
- "tsx",
18
- "py",
19
- "python",
20
- "java",
21
- "c",
22
- "cpp",
23
- "cs",
24
- "php",
25
- "rb",
26
- "ruby",
27
- "go",
28
- "rust",
29
- "swift",
30
- "kotlin",
31
- "scala",
32
- "dart",
33
- "html",
34
- "css",
35
- "scss",
36
- "sass",
37
- "less",
38
- "json",
39
- "xml",
40
- "yaml",
41
- "yml",
42
- "toml",
43
- "sql",
44
- "sh",
45
- "bash",
46
- "ps1",
47
- "bat",
48
- "r",
49
- "matlab",
50
- "julia",
51
- "lua",
52
- "perl",
53
- "vue",
54
- "svelte",
55
- ];
56
-
57
- @customElement("text-artifact")
58
- export class TextArtifact extends ArtifactElement {
59
- @property() override filename = "";
60
-
61
- private _content = "";
62
- override get content(): string {
63
- return this._content;
64
- }
65
- override set content(value: string) {
66
- this._content = value;
67
- this.requestUpdate();
68
- }
69
-
70
- protected override createRenderRoot(): HTMLElement | DocumentFragment {
71
- return this; // light DOM
72
- }
73
-
74
- private isCode(): boolean {
75
- const ext = this.filename.split(".").pop()?.toLowerCase() || "";
76
- return CODE_EXTENSIONS.includes(ext);
77
- }
78
-
79
- private getLanguageFromExtension(ext: string): string {
80
- const languageMap: Record<string, string> = {
81
- js: "javascript",
82
- ts: "typescript",
83
- py: "python",
84
- rb: "ruby",
85
- yml: "yaml",
86
- ps1: "powershell",
87
- bat: "batch",
88
- };
89
- return languageMap[ext] || ext;
90
- }
91
-
92
- private getMimeType(): string {
93
- const ext = this.filename.split(".").pop()?.toLowerCase() || "";
94
- if (ext === "svg") return "image/svg+xml";
95
- if (ext === "md" || ext === "markdown") return "text/markdown";
96
- return "text/plain";
97
- }
98
-
99
- public getHeaderButtons() {
100
- const copyButton = new CopyButton();
101
- copyButton.text = this.content;
102
- copyButton.title = i18n("Copy");
103
- copyButton.showText = false;
104
-
105
- return html`
106
- <div class="flex items-center gap-1">
107
- ${copyButton}
108
- ${DownloadButton({
109
- content: this.content,
110
- filename: this.filename,
111
- mimeType: this.getMimeType(),
112
- title: i18n("Download"),
113
- })}
114
- </div>
115
- `;
116
- }
117
-
118
- override render() {
119
- const isCode = this.isCode();
120
- const ext = this.filename.split(".").pop() || "";
121
- return html`
122
- <div class="h-full flex flex-col">
123
- <div class="flex-1 overflow-auto">
124
- ${
125
- isCode
126
- ? html`
127
- <pre class="m-0 p-4 text-xs"><code class="hljs language-${this.getLanguageFromExtension(
128
- ext.toLowerCase(),
129
- )}">${unsafeHTML(
130
- hljs.highlight(this.content, {
131
- language: this.getLanguageFromExtension(ext.toLowerCase()),
132
- ignoreIllegals: true,
133
- }).value,
134
- )}</code></pre>
135
- `
136
- : html` <pre class="m-0 p-4 text-xs font-mono">${this.content}</pre> `
137
- }
138
- </div>
139
- </div>
140
- `;
141
- }
142
- }
143
-
144
- declare global {
145
- interface HTMLElementTagNameMap {
146
- "text-artifact": TextArtifact;
147
- }
148
- }
@@ -1,310 +0,0 @@
1
- import "@mariozechner/mini-lit/dist/CodeBlock.js";
2
- import type { ToolResultMessage } from "@draht/ai/compat";
3
- import { createRef, ref } from "lit/directives/ref.js";
4
- import { FileCode2 } from "lucide";
5
- import "../../components/ConsoleBlock.js";
6
- import { Diff } from "@mariozechner/mini-lit/dist/Diff.js";
7
- import { html, type TemplateResult } from "lit";
8
- import { i18n } from "../../utils/i18n.js";
9
- import { renderCollapsibleHeader, renderHeader } from "../renderer-registry.js";
10
- import type { ToolRenderer, ToolRenderResult } from "../types.js";
11
- import { ArtifactPill } from "./ArtifactPill.js";
12
- import type { ArtifactsPanel, ArtifactsParams } from "./artifacts.js";
13
-
14
- // Helper to extract text from content blocks
15
- function getTextOutput(result: ToolResultMessage<any> | undefined): string {
16
- if (!result) return "";
17
- return (
18
- result.content
19
- ?.filter((c) => c.type === "text")
20
- .map((c: any) => c.text)
21
- .join("\n") || ""
22
- );
23
- }
24
-
25
- // Helper to determine language for syntax highlighting
26
- function getLanguageFromFilename(filename?: string): string {
27
- if (!filename) return "text";
28
- const ext = filename.split(".").pop()?.toLowerCase();
29
- const languageMap: Record<string, string> = {
30
- js: "javascript",
31
- jsx: "javascript",
32
- ts: "typescript",
33
- tsx: "typescript",
34
- html: "html",
35
- css: "css",
36
- scss: "scss",
37
- json: "json",
38
- py: "python",
39
- md: "markdown",
40
- svg: "xml",
41
- xml: "xml",
42
- yaml: "yaml",
43
- yml: "yaml",
44
- sh: "bash",
45
- bash: "bash",
46
- sql: "sql",
47
- java: "java",
48
- c: "c",
49
- cpp: "cpp",
50
- cs: "csharp",
51
- go: "go",
52
- rs: "rust",
53
- php: "php",
54
- rb: "ruby",
55
- swift: "swift",
56
- kt: "kotlin",
57
- r: "r",
58
- };
59
- return languageMap[ext || ""] || "text";
60
- }
61
-
62
- export class ArtifactsToolRenderer implements ToolRenderer<ArtifactsParams, undefined> {
63
- constructor(public artifactsPanel?: ArtifactsPanel) {}
64
-
65
- render(
66
- params: ArtifactsParams | undefined,
67
- result: ToolResultMessage<undefined> | undefined,
68
- isStreaming?: boolean,
69
- ): ToolRenderResult {
70
- const state = result ? (result.isError ? "error" : "complete") : isStreaming ? "inprogress" : "complete";
71
-
72
- // Create refs for collapsible sections
73
- const contentRef = createRef<HTMLDivElement>();
74
- const chevronRef = createRef<HTMLSpanElement>();
75
-
76
- // Helper to get command labels
77
- const getCommandLabels = (command: string): { streaming: string; complete: string } => {
78
- const labels: Record<string, { streaming: string; complete: string }> = {
79
- create: { streaming: i18n("Creating artifact"), complete: i18n("Created artifact") },
80
- update: { streaming: i18n("Updating artifact"), complete: i18n("Updated artifact") },
81
- rewrite: { streaming: i18n("Rewriting artifact"), complete: i18n("Rewrote artifact") },
82
- get: { streaming: i18n("Getting artifact"), complete: i18n("Got artifact") },
83
- delete: { streaming: i18n("Deleting artifact"), complete: i18n("Deleted artifact") },
84
- logs: { streaming: i18n("Getting logs"), complete: i18n("Got logs") },
85
- };
86
- return labels[command] || { streaming: i18n("Processing artifact"), complete: i18n("Processed artifact") };
87
- };
88
-
89
- // Helper to render header text with inline artifact pill
90
- const renderHeaderWithPill = (labelText: string, filename?: string): TemplateResult => {
91
- if (filename) {
92
- return html`<span>${labelText} ${ArtifactPill(filename, this.artifactsPanel)}</span>`;
93
- }
94
- return html`<span>${labelText}</span>`;
95
- };
96
-
97
- // Error handling
98
- if (result?.isError) {
99
- const command = params?.command;
100
- const filename = params?.filename;
101
- const labels = command
102
- ? getCommandLabels(command)
103
- : { streaming: i18n("Processing artifact"), complete: i18n("Processed artifact") };
104
- const headerText = labels.streaming;
105
-
106
- // For create/update/rewrite errors, show code block + console/error
107
- if (command === "create" || command === "update" || command === "rewrite") {
108
- const content = params?.content || "";
109
- const { old_str, new_str } = params || {};
110
- const isDiff = command === "update";
111
- const diffContent =
112
- old_str !== undefined && new_str !== undefined ? Diff({ oldText: old_str, newText: new_str }) : "";
113
-
114
- const isHtml = filename?.endsWith(".html");
115
-
116
- return {
117
- content: html`
118
- <div>
119
- ${renderCollapsibleHeader(state, FileCode2, renderHeaderWithPill(headerText, filename), contentRef, chevronRef, false)}
120
- <div ${ref(contentRef)} class="max-h-0 overflow-hidden transition-all duration-300 space-y-3">
121
- ${isDiff ? diffContent : content ? html`<code-block .code=${content} language=${getLanguageFromFilename(filename)}></code-block>` : ""}
122
- ${
123
- isHtml
124
- ? html`<console-block .content=${getTextOutput(result) || i18n("An error occurred")} variant="error"></console-block>`
125
- : html`<div class="text-sm text-destructive">${getTextOutput(result) || i18n("An error occurred")}</div>`
126
- }
127
- </div>
128
- </div>
129
- `,
130
- isCustom: false,
131
- };
132
- }
133
-
134
- // For other errors, just show error message
135
- return {
136
- content: html`
137
- <div class="space-y-3">
138
- ${renderHeader(state, FileCode2, headerText)}
139
- <div class="text-sm text-destructive">${getTextOutput(result) || i18n("An error occurred")}</div>
140
- </div>
141
- `,
142
- isCustom: false,
143
- };
144
- }
145
-
146
- // Full params + result
147
- if (result && params) {
148
- const { command, filename, content } = params;
149
- const labels = command
150
- ? getCommandLabels(command)
151
- : { streaming: i18n("Processing artifact"), complete: i18n("Processed artifact") };
152
- const headerText = labels.complete;
153
-
154
- // GET command: show code block with file content
155
- if (command === "get") {
156
- const fileContent = getTextOutput(result) || i18n("(no output)");
157
- return {
158
- content: html`
159
- <div>
160
- ${renderCollapsibleHeader(state, FileCode2, renderHeaderWithPill(headerText, filename), contentRef, chevronRef, false)}
161
- <div ${ref(contentRef)} class="max-h-0 overflow-hidden transition-all duration-300">
162
- <code-block .code=${fileContent} language=${getLanguageFromFilename(filename)}></code-block>
163
- </div>
164
- </div>
165
- `,
166
- isCustom: false,
167
- };
168
- }
169
-
170
- // LOGS command: show console block
171
- if (command === "logs") {
172
- const logs = getTextOutput(result) || i18n("(no output)");
173
- return {
174
- content: html`
175
- <div>
176
- ${renderCollapsibleHeader(state, FileCode2, renderHeaderWithPill(headerText, filename), contentRef, chevronRef, false)}
177
- <div ${ref(contentRef)} class="max-h-0 overflow-hidden transition-all duration-300">
178
- <console-block .content=${logs}></console-block>
179
- </div>
180
- </div>
181
- `,
182
- isCustom: false,
183
- };
184
- }
185
-
186
- // CREATE/UPDATE/REWRITE: always show code block, + console block for .html files
187
- if (command === "create" || command === "rewrite") {
188
- const codeContent = content || "";
189
- const isHtml = filename?.endsWith(".html");
190
- const logs = getTextOutput(result) || "";
191
-
192
- return {
193
- content: html`
194
- <div>
195
- ${renderCollapsibleHeader(state, FileCode2, renderHeaderWithPill(headerText, filename), contentRef, chevronRef, false)}
196
- <div ${ref(contentRef)} class="max-h-0 overflow-hidden transition-all duration-300 space-y-3">
197
- ${codeContent ? html`<code-block .code=${codeContent} language=${getLanguageFromFilename(filename)}></code-block>` : ""}
198
- ${isHtml && logs ? html`<console-block .content=${logs}></console-block>` : ""}
199
- </div>
200
- </div>
201
- `,
202
- isCustom: false,
203
- };
204
- }
205
-
206
- if (command === "update") {
207
- const isHtml = filename?.endsWith(".html");
208
- const logs = getTextOutput(result) || "";
209
- return {
210
- content: html`
211
- <div>
212
- ${renderCollapsibleHeader(state, FileCode2, renderHeaderWithPill(headerText, filename), contentRef, chevronRef, false)}
213
- <div ${ref(contentRef)} class="max-h-0 overflow-hidden transition-all duration-300 space-y-3">
214
- ${Diff({ oldText: params.old_str || "", newText: params.new_str || "" })}
215
- ${isHtml && logs ? html`<console-block .content=${logs}></console-block>` : ""}
216
- </div>
217
- </div>
218
- `,
219
- isCustom: false,
220
- };
221
- }
222
-
223
- // For DELETE, just show header
224
- return {
225
- content: html`
226
- <div class="space-y-3">
227
- ${renderHeader(state, FileCode2, renderHeaderWithPill(headerText, filename))}
228
- </div>
229
- `,
230
- isCustom: false,
231
- };
232
- }
233
-
234
- // Params only (streaming or waiting for result)
235
- if (params) {
236
- const { command, filename, content, old_str, new_str } = params;
237
-
238
- // If no command yet
239
- if (!command) {
240
- return { content: renderHeader(state, FileCode2, i18n("Preparing artifact...")), isCustom: false };
241
- }
242
-
243
- const labels = getCommandLabels(command);
244
- const headerText = labels.streaming;
245
-
246
- // Render based on command type
247
- switch (command) {
248
- case "create":
249
- case "rewrite":
250
- return {
251
- content: html`
252
- <div>
253
- ${renderCollapsibleHeader(state, FileCode2, renderHeaderWithPill(headerText, filename), contentRef, chevronRef, false)}
254
- <div ${ref(contentRef)} class="max-h-0 overflow-hidden transition-all duration-300">
255
- ${
256
- content
257
- ? html`<code-block .code=${content} language=${getLanguageFromFilename(filename)}></code-block>`
258
- : ""
259
- }
260
- </div>
261
- </div>
262
- `,
263
- isCustom: false,
264
- };
265
-
266
- case "update":
267
- return {
268
- content: html`
269
- <div>
270
- ${renderCollapsibleHeader(state, FileCode2, renderHeaderWithPill(headerText, filename), contentRef, chevronRef, false)}
271
- <div ${ref(contentRef)} class="max-h-0 overflow-hidden transition-all duration-300">
272
- ${
273
- old_str !== undefined && new_str !== undefined
274
- ? Diff({ oldText: old_str, newText: new_str })
275
- : ""
276
- }
277
- </div>
278
- </div>
279
- `,
280
- isCustom: false,
281
- };
282
-
283
- case "get":
284
- case "logs":
285
- return {
286
- content: html`
287
- <div>
288
- ${renderCollapsibleHeader(state, FileCode2, renderHeaderWithPill(headerText, filename), contentRef, chevronRef, false)}
289
- <div ${ref(contentRef)} class="max-h-0 overflow-hidden transition-all duration-300"></div>
290
- </div>
291
- `,
292
- isCustom: false,
293
- };
294
-
295
- default:
296
- return {
297
- content: html`
298
- <div>
299
- ${renderHeader(state, FileCode2, renderHeaderWithPill(headerText, filename))}
300
- </div>
301
- `,
302
- isCustom: false,
303
- };
304
- }
305
- }
306
-
307
- // No params or result yet
308
- return { content: renderHeader(state, FileCode2, i18n("Preparing artifact...")), isCustom: false };
309
- }
310
- }