@oh-my-pi/pi-web-ui 1.341.0 → 2.0.1337

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 (61) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/example/package.json +2 -1
  3. package/example/src/main.ts +1 -1
  4. package/package.json +3 -2
  5. package/scripts/count-prompt-tokens.ts +1 -1
  6. package/src/ChatPanel.ts +8 -8
  7. package/src/components/AgentInterface.ts +9 -9
  8. package/src/components/AttachmentTile.ts +3 -3
  9. package/src/components/ConsoleBlock.ts +1 -1
  10. package/src/components/CustomProviderCard.ts +1 -1
  11. package/src/components/Input.ts +1 -1
  12. package/src/components/MessageEditor.ts +2 -2
  13. package/src/components/MessageList.ts +1 -1
  14. package/src/components/Messages.ts +4 -4
  15. package/src/components/ProviderKeyInput.ts +3 -3
  16. package/src/components/SandboxedIframe.ts +4 -4
  17. package/src/components/sandbox/ArtifactsRuntimeProvider.ts +2 -2
  18. package/src/components/sandbox/AttachmentsRuntimeProvider.ts +3 -3
  19. package/src/components/sandbox/ConsoleRuntimeProvider.ts +1 -1
  20. package/src/components/sandbox/FileDownloadRuntimeProvider.ts +1 -1
  21. package/src/components/sandbox/RuntimeMessageRouter.ts +1 -1
  22. package/src/dialogs/ApiKeyPromptDialog.ts +2 -2
  23. package/src/dialogs/AttachmentOverlay.ts +2 -2
  24. package/src/dialogs/CustomProviderDialog.ts +3 -3
  25. package/src/dialogs/ModelSelector.ts +6 -6
  26. package/src/dialogs/PersistentStorageDialog.ts +1 -1
  27. package/src/dialogs/ProvidersModelsTab.ts +5 -5
  28. package/src/dialogs/SessionListDialog.ts +4 -4
  29. package/src/dialogs/SettingsDialog.ts +1 -1
  30. package/src/index.ts +62 -62
  31. package/src/storage/app-storage.ts +5 -5
  32. package/src/storage/backends/indexeddb-storage-backend.ts +1 -1
  33. package/src/storage/store.ts +1 -1
  34. package/src/storage/stores/custom-providers-store.ts +2 -2
  35. package/src/storage/stores/provider-keys-store.ts +2 -2
  36. package/src/storage/stores/sessions-store.ts +2 -2
  37. package/src/storage/stores/settings-store.ts +2 -2
  38. package/src/tools/artifacts/ArtifactPill.ts +1 -1
  39. package/src/tools/artifacts/Console.ts +1 -1
  40. package/src/tools/artifacts/DocxArtifact.ts +2 -2
  41. package/src/tools/artifacts/ExcelArtifact.ts +2 -2
  42. package/src/tools/artifacts/GenericArtifact.ts +2 -2
  43. package/src/tools/artifacts/HtmlArtifact.ts +6 -6
  44. package/src/tools/artifacts/ImageArtifact.ts +2 -2
  45. package/src/tools/artifacts/MarkdownArtifact.ts +2 -2
  46. package/src/tools/artifacts/PdfArtifact.ts +2 -2
  47. package/src/tools/artifacts/SvgArtifact.ts +2 -2
  48. package/src/tools/artifacts/TextArtifact.ts +2 -2
  49. package/src/tools/artifacts/artifacts-tool-renderer.ts +5 -5
  50. package/src/tools/artifacts/artifacts.ts +17 -17
  51. package/src/tools/artifacts/index.ts +7 -7
  52. package/src/tools/extract-document.ts +5 -5
  53. package/src/tools/index.ts +4 -4
  54. package/src/tools/javascript-repl.ts +6 -6
  55. package/src/tools/renderer-registry.ts +1 -1
  56. package/src/tools/renderers/BashRenderer.ts +3 -3
  57. package/src/tools/renderers/CalculateRenderer.ts +3 -3
  58. package/src/tools/renderers/DefaultRenderer.ts +3 -3
  59. package/src/tools/renderers/GetCurrentTimeRenderer.ts +3 -3
  60. package/src/utils/attachment-utils.ts +1 -1
  61. package/src/utils/auth-token.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [2.0.1337] - 2026-01-03
6
+
7
+ ## [1.500.0] - 2026-01-03
8
+
5
9
  ## [1.341.0] - 2026-01-03
6
10
 
7
11
  ## [1.338.0] - 2026-01-03
@@ -8,7 +8,8 @@
8
8
  "build": "vite build",
9
9
  "preview": "vite preview",
10
10
  "clean": "rm -rf dist",
11
- "check": "biome check --write . && tsgo --noEmit"
11
+ "check": "biome check --write . && tsgo --noEmit",
12
+ "fix": "biome check --write --unsafe ."
12
13
  },
13
14
  "dependencies": {
14
15
  "@mariozechner/mini-lit": "^0.2.0",
@@ -25,7 +25,7 @@ import "./app.css";
25
25
  import { icon } from "@mariozechner/mini-lit";
26
26
  import { Button } from "@mariozechner/mini-lit/dist/Button.js";
27
27
  import { Input } from "@mariozechner/mini-lit/dist/Input.js";
28
- import { createSystemNotification, customConvertToLlm, registerCustomMessageRenderers } from "./custom-messages.js";
28
+ import { createSystemNotification, customConvertToLlm, registerCustomMessageRenderers } from "./custom-messages";
29
29
 
30
30
  // Register custom message renderers
31
31
  registerCustomMessageRenderers();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-web-ui",
3
- "version": "1.341.0",
3
+ "version": "2.0.1337",
4
4
  "description": "Reusable web UI components for AI chat interfaces powered by @oh-my-pi/pi-ai",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -14,7 +14,8 @@
14
14
  "dev:example": "bun --cwd=example run dev",
15
15
  "dev": "bun run dev:css & bun run dev:example",
16
16
  "build:css": "tailwindcss -i ./src/app.css -o ./dist/app.css --minify",
17
- "check": "biome check --write . && tsgo --noEmit && bun --cwd=example run check"
17
+ "check": "biome check --write . && tsgo --noEmit && bun --cwd=example run check",
18
+ "fix": "biome check --write --unsafe . && bun --cwd=example run fix"
18
19
  },
19
20
  "dependencies": {
20
21
  "@lmstudio/sdk": "^1.5.0",
@@ -3,7 +3,7 @@
3
3
  * Count tokens in system prompts using Anthropic's token counter API
4
4
  */
5
5
 
6
- import * as prompts from "../src/prompts/prompts.js";
6
+ import * as prompts from "../src/prompts/prompts";
7
7
 
8
8
  const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY;
9
9
 
package/src/ChatPanel.ts CHANGED
@@ -3,14 +3,14 @@ import { html, LitElement } from "lit";
3
3
  import { customElement, state } from "lit/decorators.js";
4
4
  import "./components/AgentInterface.js";
5
5
  import type { Agent, AgentTool } from "@oh-my-pi/pi-agent-core";
6
- import type { AgentInterface } from "./components/AgentInterface.js";
7
- import { ArtifactsRuntimeProvider } from "./components/sandbox/ArtifactsRuntimeProvider.js";
8
- import { AttachmentsRuntimeProvider } from "./components/sandbox/AttachmentsRuntimeProvider.js";
9
- import type { SandboxRuntimeProvider } from "./components/sandbox/SandboxRuntimeProvider.js";
10
- import { ArtifactsPanel, ArtifactsToolRenderer } from "./tools/artifacts/index.js";
11
- import { registerToolRenderer } from "./tools/renderer-registry.js";
12
- import type { Attachment } from "./utils/attachment-utils.js";
13
- import { i18n } from "./utils/i18n.js";
6
+ import type { AgentInterface } from "./components/AgentInterface";
7
+ import { ArtifactsRuntimeProvider } from "./components/sandbox/ArtifactsRuntimeProvider";
8
+ import { AttachmentsRuntimeProvider } from "./components/sandbox/AttachmentsRuntimeProvider";
9
+ import type { SandboxRuntimeProvider } from "./components/sandbox/SandboxRuntimeProvider";
10
+ import { ArtifactsPanel, ArtifactsToolRenderer } from "./tools/artifacts/index";
11
+ import { registerToolRenderer } from "./tools/renderer-registry";
12
+ import type { Attachment } from "./utils/attachment-utils";
13
+ import { i18n } from "./utils/i18n";
14
14
 
15
15
  const BREAKPOINT = 800; // px - switch between overlay and side-by-side
16
16
 
@@ -1,20 +1,20 @@
1
1
  import { streamSimple, type ToolResultMessage, type Usage } from "@oh-my-pi/pi-ai";
2
2
  import { html, LitElement } from "lit";
3
3
  import { customElement, property, query } from "lit/decorators.js";
4
- import { ModelSelector } from "../dialogs/ModelSelector.js";
5
- import type { MessageEditor } from "./MessageEditor.js";
4
+ import { ModelSelector } from "../dialogs/ModelSelector";
5
+ import type { MessageEditor } from "./MessageEditor";
6
6
  import "./MessageEditor.js";
7
7
  import "./MessageList.js";
8
8
  import "./Messages.js"; // Import for side effects to register the custom elements
9
- import { getAppStorage } from "../storage/app-storage.js";
9
+ import { getAppStorage } from "../storage/app-storage";
10
10
  import "./StreamingMessageContainer.js";
11
11
  import type { Agent, AgentEvent } from "@oh-my-pi/pi-agent-core";
12
- import type { Attachment } from "../utils/attachment-utils.js";
13
- import { formatUsage } from "../utils/format.js";
14
- import { i18n } from "../utils/i18n.js";
15
- import { createStreamFn } from "../utils/proxy-utils.js";
16
- import type { UserMessageWithAttachments } from "./Messages.js";
17
- import type { StreamingMessageContainer } from "./StreamingMessageContainer.js";
12
+ import type { Attachment } from "../utils/attachment-utils";
13
+ import { formatUsage } from "../utils/format";
14
+ import { i18n } from "../utils/i18n";
15
+ import { createStreamFn } from "../utils/proxy-utils";
16
+ import type { UserMessageWithAttachments } from "./Messages";
17
+ import type { StreamingMessageContainer } from "./StreamingMessageContainer";
18
18
 
19
19
  @customElement("agent-interface")
20
20
  export class AgentInterface extends LitElement {
@@ -3,9 +3,9 @@ import { LitElement } from "lit";
3
3
  import { customElement, property } from "lit/decorators.js";
4
4
  import { html } from "lit/html.js";
5
5
  import { FileSpreadsheet, FileText, X } from "lucide";
6
- import { AttachmentOverlay } from "../dialogs/AttachmentOverlay.js";
7
- import type { Attachment } from "../utils/attachment-utils.js";
8
- import { i18n } from "../utils/i18n.js";
6
+ import { AttachmentOverlay } from "../dialogs/AttachmentOverlay";
7
+ import type { Attachment } from "../utils/attachment-utils";
8
+ import { i18n } from "../utils/i18n";
9
9
 
10
10
  @customElement("attachment-tile")
11
11
  export class AttachmentTile extends LitElement {
@@ -3,7 +3,7 @@ import { LitElement } from "lit";
3
3
  import { property, state } from "lit/decorators.js";
4
4
  import { html } from "lit/html.js";
5
5
  import { Check, Copy } from "lucide";
6
- import { i18n } from "../utils/i18n.js";
6
+ import { i18n } from "../utils/i18n";
7
7
 
8
8
  export class ConsoleBlock extends LitElement {
9
9
  @property() content: string = "";
@@ -2,7 +2,7 @@ import { i18n } from "@mariozechner/mini-lit";
2
2
  import { Button } from "@mariozechner/mini-lit/dist/Button.js";
3
3
  import { html, LitElement, type TemplateResult } from "lit";
4
4
  import { customElement, property } from "lit/decorators.js";
5
- import type { CustomProvider } from "../storage/stores/custom-providers-store.js";
5
+ import type { CustomProvider } from "../storage/stores/custom-providers-store";
6
6
 
7
7
  @customElement("custom-provider-card")
8
8
  export class CustomProviderCard extends LitElement {
@@ -1,7 +1,7 @@
1
1
  import { type BaseComponentProps, fc } from "@mariozechner/mini-lit/dist/mini.js";
2
2
  import { html } from "lit";
3
3
  import { type Ref, ref } from "lit/directives/ref.js";
4
- import { i18n } from "../utils/i18n.js";
4
+ import { i18n } from "../utils/i18n";
5
5
 
6
6
  export type InputType = "text" | "email" | "password" | "number" | "url" | "tel" | "search";
7
7
  export type InputSize = "sm" | "md" | "lg";
@@ -6,8 +6,8 @@ import { html, LitElement } from "lit";
6
6
  import { customElement, property, state } from "lit/decorators.js";
7
7
  import { createRef, ref } from "lit/directives/ref.js";
8
8
  import { Brain, Loader2, Paperclip, Send, Sparkles, Square } from "lucide";
9
- import { type Attachment, loadAttachment } from "../utils/attachment-utils.js";
10
- import { i18n } from "../utils/i18n.js";
9
+ import { type Attachment, loadAttachment } from "../utils/attachment-utils";
10
+ import { i18n } from "../utils/i18n";
11
11
  import "./AttachmentTile.js";
12
12
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
13
13
 
@@ -6,7 +6,7 @@ import type {
6
6
  import { html, LitElement, type TemplateResult } from "lit";
7
7
  import { property } from "lit/decorators.js";
8
8
  import { repeat } from "lit/directives/repeat.js";
9
- import { renderMessage } from "./message-renderer-registry.js";
9
+ import { renderMessage } from "./message-renderer-registry";
10
10
 
11
11
  export class MessageList extends LitElement {
12
12
  @property({ type: Array }) messages: AgentMessage[] = [];
@@ -8,10 +8,10 @@ import type {
8
8
  } from "@oh-my-pi/pi-ai";
9
9
  import { html, LitElement, type TemplateResult } from "lit";
10
10
  import { customElement, property } from "lit/decorators.js";
11
- import { renderTool } from "../tools/index.js";
12
- import type { Attachment } from "../utils/attachment-utils.js";
13
- import { formatUsage } from "../utils/format.js";
14
- import { i18n } from "../utils/i18n.js";
11
+ import { renderTool } from "../tools/index";
12
+ import type { Attachment } from "../utils/attachment-utils";
13
+ import { formatUsage } from "../utils/format";
14
+ import { i18n } from "../utils/i18n";
15
15
  import "./ThinkingBlock.js";
16
16
  import type { AgentTool } from "@oh-my-pi/pi-agent-core";
17
17
 
@@ -4,9 +4,9 @@ import { Button } from "@mariozechner/mini-lit/dist/Button.js";
4
4
  import { type Context, complete, getModel } from "@oh-my-pi/pi-ai";
5
5
  import { html, LitElement } from "lit";
6
6
  import { customElement, property, state } from "lit/decorators.js";
7
- import { getAppStorage } from "../storage/app-storage.js";
8
- import { applyProxyIfNeeded } from "../utils/proxy-utils.js";
9
- import { Input } from "./Input.js";
7
+ import { getAppStorage } from "../storage/app-storage";
8
+ import { applyProxyIfNeeded } from "../utils/proxy-utils";
9
+ import { Input } from "./Input";
10
10
 
11
11
  // Test models for each provider
12
12
  const TEST_MODELS: Record<string, string> = {
@@ -1,9 +1,9 @@
1
1
  import { LitElement } from "lit";
2
2
  import { customElement, property } from "lit/decorators.js";
3
- import { ConsoleRuntimeProvider } from "./sandbox/ConsoleRuntimeProvider.js";
4
- import { RuntimeMessageBridge } from "./sandbox/RuntimeMessageBridge.js";
5
- import { type MessageConsumer, RUNTIME_MESSAGE_ROUTER } from "./sandbox/RuntimeMessageRouter.js";
6
- import type { SandboxRuntimeProvider } from "./sandbox/SandboxRuntimeProvider.js";
3
+ import { ConsoleRuntimeProvider } from "./sandbox/ConsoleRuntimeProvider";
4
+ import { RuntimeMessageBridge } from "./sandbox/RuntimeMessageBridge";
5
+ import { type MessageConsumer, RUNTIME_MESSAGE_ROUTER } from "./sandbox/RuntimeMessageRouter";
6
+ import type { SandboxRuntimeProvider } from "./sandbox/SandboxRuntimeProvider";
7
7
 
8
8
  export interface SandboxFile {
9
9
  fileName: string;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ARTIFACTS_RUNTIME_PROVIDER_DESCRIPTION_RO,
3
3
  ARTIFACTS_RUNTIME_PROVIDER_DESCRIPTION_RW,
4
- } from "../../prompts/prompts.js";
5
- import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider.js";
4
+ } from "../../prompts/prompts";
5
+ import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider";
6
6
 
7
7
  // Define minimal interface for ArtifactsPanel to avoid circular dependencies
8
8
  interface ArtifactsPanelLike {
@@ -1,6 +1,6 @@
1
- import { ATTACHMENTS_RUNTIME_DESCRIPTION } from "../../prompts/prompts.js";
2
- import type { Attachment } from "../../utils/attachment-utils.js";
3
- import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider.js";
1
+ import { ATTACHMENTS_RUNTIME_DESCRIPTION } from "../../prompts/prompts";
2
+ import type { Attachment } from "../../utils/attachment-utils";
3
+ import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider";
4
4
 
5
5
  /**
6
6
  * Attachments Runtime Provider
@@ -1,4 +1,4 @@
1
- import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider.js";
1
+ import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider";
2
2
 
3
3
  export interface ConsoleLog {
4
4
  type: "log" | "warn" | "error" | "info";
@@ -1,4 +1,4 @@
1
- import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider.js";
1
+ import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider";
2
2
 
3
3
  export interface DownloadableFile {
4
4
  fileName: string;
@@ -1,4 +1,4 @@
1
- import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider.js";
1
+ import type { SandboxRuntimeProvider } from "./SandboxRuntimeProvider";
2
2
 
3
3
  // Type declaration for chrome extension API (when available)
4
4
  declare const chrome: any;
@@ -3,8 +3,8 @@ import "../components/ProviderKeyInput.js";
3
3
  import { DialogContent, DialogHeader } from "@mariozechner/mini-lit/dist/Dialog.js";
4
4
  import { DialogBase } from "@mariozechner/mini-lit/dist/DialogBase.js";
5
5
  import { html } from "lit";
6
- import { getAppStorage } from "../storage/app-storage.js";
7
- import { i18n } from "../utils/i18n.js";
6
+ import { getAppStorage } from "../storage/app-storage";
7
+ import { i18n } from "../utils/i18n";
8
8
 
9
9
  @customElement("api-key-prompt-dialog")
10
10
  export class ApiKeyPromptDialog extends DialogBase {
@@ -7,8 +7,8 @@ import { state } from "lit/decorators.js";
7
7
  import { Download, X } from "lucide";
8
8
  import * as pdfjsLib from "pdfjs-dist";
9
9
  import * as XLSX from "xlsx";
10
- import type { Attachment } from "../utils/attachment-utils.js";
11
- import { i18n } from "../utils/i18n.js";
10
+ import type { Attachment } from "../utils/attachment-utils";
11
+ import { i18n } from "../utils/i18n";
12
12
 
13
13
  type FileType = "image" | "pdf" | "docx" | "pptx" | "excel" | "text";
14
14
 
@@ -7,9 +7,9 @@ import { Select } from "@mariozechner/mini-lit/dist/Select.js";
7
7
  import type { Model } from "@oh-my-pi/pi-ai";
8
8
  import { html, type TemplateResult } from "lit";
9
9
  import { state } from "lit/decorators.js";
10
- import { getAppStorage } from "../storage/app-storage.js";
11
- import type { CustomProvider, CustomProviderType } from "../storage/stores/custom-providers-store.js";
12
- import { discoverModels } from "../utils/model-discovery.js";
10
+ import { getAppStorage } from "../storage/app-storage";
11
+ import type { CustomProvider, CustomProviderType } from "../storage/stores/custom-providers-store";
12
+ import { discoverModels } from "../utils/model-discovery";
13
13
 
14
14
  export class CustomProviderDialog extends DialogBase {
15
15
  private provider?: CustomProvider;
@@ -8,12 +8,12 @@ import { html, type PropertyValues, type TemplateResult } from "lit";
8
8
  import { customElement, state } from "lit/decorators.js";
9
9
  import { createRef, ref } from "lit/directives/ref.js";
10
10
  import { Brain, Image as ImageIcon } from "lucide";
11
- import { Input } from "../components/Input.js";
12
- import { getAppStorage } from "../storage/app-storage.js";
13
- import type { AutoDiscoveryProviderType } from "../storage/stores/custom-providers-store.js";
14
- import { formatModelCost } from "../utils/format.js";
15
- import { i18n } from "../utils/i18n.js";
16
- import { discoverModels } from "../utils/model-discovery.js";
11
+ import { Input } from "../components/Input";
12
+ import { getAppStorage } from "../storage/app-storage";
13
+ import type { AutoDiscoveryProviderType } from "../storage/stores/custom-providers-store";
14
+ import { formatModelCost } from "../utils/format";
15
+ import { i18n } from "../utils/i18n";
16
+ import { discoverModels } from "../utils/model-discovery";
17
17
 
18
18
  @customElement("agent-model-selector")
19
19
  export class ModelSelector extends DialogBase {
@@ -3,7 +3,7 @@ import { DialogContent, DialogHeader } from "@mariozechner/mini-lit/dist/Dialog.
3
3
  import { DialogBase } from "@mariozechner/mini-lit/dist/DialogBase.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, state } from "lit/decorators.js";
6
- import { i18n } from "../utils/i18n.js";
6
+ import { i18n } from "../utils/i18n";
7
7
 
8
8
  @customElement("persistent-storage-dialog")
9
9
  export class PersistentStorageDialog extends DialogBase {
@@ -5,15 +5,15 @@ import { html, type TemplateResult } from "lit";
5
5
  import { customElement, state } from "lit/decorators.js";
6
6
  import "../components/CustomProviderCard.js";
7
7
  import "../components/ProviderKeyInput.js";
8
- import { getAppStorage } from "../storage/app-storage.js";
8
+ import { getAppStorage } from "../storage/app-storage";
9
9
  import type {
10
10
  AutoDiscoveryProviderType,
11
11
  CustomProvider,
12
12
  CustomProviderType,
13
- } from "../storage/stores/custom-providers-store.js";
14
- import { discoverModels } from "../utils/model-discovery.js";
15
- import { CustomProviderDialog } from "./CustomProviderDialog.js";
16
- import { SettingsTab } from "./SettingsDialog.js";
13
+ } from "../storage/stores/custom-providers-store";
14
+ import { discoverModels } from "../utils/model-discovery";
15
+ import { CustomProviderDialog } from "./CustomProviderDialog";
16
+ import { SettingsTab } from "./SettingsDialog";
17
17
 
18
18
  @customElement("providers-models-tab")
19
19
  export class ProvidersModelsTab extends SettingsTab {
@@ -2,10 +2,10 @@ import { DialogContent, DialogHeader } from "@mariozechner/mini-lit/dist/Dialog.
2
2
  import { DialogBase } from "@mariozechner/mini-lit/dist/DialogBase.js";
3
3
  import { html } from "lit";
4
4
  import { customElement, state } from "lit/decorators.js";
5
- import { getAppStorage } from "../storage/app-storage.js";
6
- import type { SessionMetadata } from "../storage/types.js";
7
- import { formatUsage } from "../utils/format.js";
8
- import { i18n } from "../utils/i18n.js";
5
+ import { getAppStorage } from "../storage/app-storage";
6
+ import type { SessionMetadata } from "../storage/types";
7
+ import { formatUsage } from "../utils/format";
8
+ import { i18n } from "../utils/i18n";
9
9
 
10
10
  @customElement("session-list-dialog")
11
11
  export class SessionListDialog extends DialogBase {
@@ -7,7 +7,7 @@ import { getProviders } from "@oh-my-pi/pi-ai";
7
7
  import { html, LitElement, type TemplateResult } from "lit";
8
8
  import { customElement, property, state } from "lit/decorators.js";
9
9
  import "../components/ProviderKeyInput.js";
10
- import { getAppStorage } from "../storage/app-storage.js";
10
+ import { getAppStorage } from "../storage/app-storage";
11
11
 
12
12
  // Base class for settings tabs
13
13
  export abstract class SettingsTab extends LitElement {
package/src/index.ts CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  export type { Agent, AgentMessage, AgentState, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
4
4
  export type { Model } from "@oh-my-pi/pi-ai";
5
- export { ChatPanel } from "./ChatPanel.js";
5
+ export { ChatPanel } from "./ChatPanel";
6
6
  // Components
7
- export { AgentInterface } from "./components/AgentInterface.js";
8
- export { AttachmentTile } from "./components/AttachmentTile.js";
9
- export { ConsoleBlock } from "./components/ConsoleBlock.js";
10
- export { ExpandableSection } from "./components/ExpandableSection.js";
11
- export { Input } from "./components/Input.js";
12
- export { MessageEditor } from "./components/MessageEditor.js";
13
- export { MessageList } from "./components/MessageList.js";
7
+ export { AgentInterface } from "./components/AgentInterface";
8
+ export { AttachmentTile } from "./components/AttachmentTile";
9
+ export { ConsoleBlock } from "./components/ConsoleBlock";
10
+ export { ExpandableSection } from "./components/ExpandableSection";
11
+ export { Input } from "./components/Input";
12
+ export { MessageEditor } from "./components/MessageEditor";
13
+ export { MessageList } from "./components/MessageList";
14
14
  // Message components
15
- export type { ArtifactMessage, UserMessageWithAttachments } from "./components/Messages.js";
15
+ export type { ArtifactMessage, UserMessageWithAttachments } from "./components/Messages";
16
16
  export {
17
17
  AssistantMessage,
18
18
  convertAttachments,
@@ -21,7 +21,7 @@ export {
21
21
  isUserMessageWithAttachments,
22
22
  ToolMessage,
23
23
  UserMessage,
24
- } from "./components/Messages.js";
24
+ } from "./components/Messages";
25
25
  // Message renderer registry
26
26
  export {
27
27
  getMessageRenderer,
@@ -29,53 +29,53 @@ export {
29
29
  type MessageRole,
30
30
  registerMessageRenderer,
31
31
  renderMessage,
32
- } from "./components/message-renderer-registry.js";
32
+ } from "./components/message-renderer-registry";
33
33
  export {
34
34
  type SandboxFile,
35
35
  SandboxIframe,
36
36
  type SandboxResult,
37
37
  type SandboxUrlProvider,
38
- } from "./components/SandboxedIframe.js";
39
- export { StreamingMessageContainer } from "./components/StreamingMessageContainer.js";
38
+ } from "./components/SandboxedIframe";
39
+ export { StreamingMessageContainer } from "./components/StreamingMessageContainer";
40
40
  // Sandbox Runtime Providers
41
- export { ArtifactsRuntimeProvider } from "./components/sandbox/ArtifactsRuntimeProvider.js";
42
- export { AttachmentsRuntimeProvider } from "./components/sandbox/AttachmentsRuntimeProvider.js";
43
- export { type ConsoleLog, ConsoleRuntimeProvider } from "./components/sandbox/ConsoleRuntimeProvider.js";
41
+ export { ArtifactsRuntimeProvider } from "./components/sandbox/ArtifactsRuntimeProvider";
42
+ export { AttachmentsRuntimeProvider } from "./components/sandbox/AttachmentsRuntimeProvider";
43
+ export { type ConsoleLog, ConsoleRuntimeProvider } from "./components/sandbox/ConsoleRuntimeProvider";
44
44
  export {
45
45
  type DownloadableFile,
46
46
  FileDownloadRuntimeProvider,
47
- } from "./components/sandbox/FileDownloadRuntimeProvider.js";
48
- export { RuntimeMessageBridge } from "./components/sandbox/RuntimeMessageBridge.js";
49
- export { RUNTIME_MESSAGE_ROUTER } from "./components/sandbox/RuntimeMessageRouter.js";
50
- export type { SandboxRuntimeProvider } from "./components/sandbox/SandboxRuntimeProvider.js";
51
- export { ThinkingBlock } from "./components/ThinkingBlock.js";
52
- export { ApiKeyPromptDialog } from "./dialogs/ApiKeyPromptDialog.js";
53
- export { AttachmentOverlay } from "./dialogs/AttachmentOverlay.js";
47
+ } from "./components/sandbox/FileDownloadRuntimeProvider";
48
+ export { RuntimeMessageBridge } from "./components/sandbox/RuntimeMessageBridge";
49
+ export { RUNTIME_MESSAGE_ROUTER } from "./components/sandbox/RuntimeMessageRouter";
50
+ export type { SandboxRuntimeProvider } from "./components/sandbox/SandboxRuntimeProvider";
51
+ export { ThinkingBlock } from "./components/ThinkingBlock";
52
+ export { ApiKeyPromptDialog } from "./dialogs/ApiKeyPromptDialog";
53
+ export { AttachmentOverlay } from "./dialogs/AttachmentOverlay";
54
54
  // Dialogs
55
- export { ModelSelector } from "./dialogs/ModelSelector.js";
56
- export { PersistentStorageDialog } from "./dialogs/PersistentStorageDialog.js";
57
- export { ProvidersModelsTab } from "./dialogs/ProvidersModelsTab.js";
58
- export { SessionListDialog } from "./dialogs/SessionListDialog.js";
59
- export { ApiKeysTab, ProxyTab, SettingsDialog, SettingsTab } from "./dialogs/SettingsDialog.js";
55
+ export { ModelSelector } from "./dialogs/ModelSelector";
56
+ export { PersistentStorageDialog } from "./dialogs/PersistentStorageDialog";
57
+ export { ProvidersModelsTab } from "./dialogs/ProvidersModelsTab";
58
+ export { SessionListDialog } from "./dialogs/SessionListDialog";
59
+ export { ApiKeysTab, ProxyTab, SettingsDialog, SettingsTab } from "./dialogs/SettingsDialog";
60
60
  // Prompts
61
61
  export {
62
62
  ARTIFACTS_RUNTIME_PROVIDER_DESCRIPTION_RO,
63
63
  ARTIFACTS_RUNTIME_PROVIDER_DESCRIPTION_RW,
64
64
  ATTACHMENTS_RUNTIME_DESCRIPTION,
65
- } from "./prompts/prompts.js";
65
+ } from "./prompts/prompts";
66
66
  // Storage
67
- export { AppStorage, getAppStorage, setAppStorage } from "./storage/app-storage.js";
68
- export { IndexedDBStorageBackend } from "./storage/backends/indexeddb-storage-backend.js";
69
- export { Store } from "./storage/store.js";
67
+ export { AppStorage, getAppStorage, setAppStorage } from "./storage/app-storage";
68
+ export { IndexedDBStorageBackend } from "./storage/backends/indexeddb-storage-backend";
69
+ export { Store } from "./storage/store";
70
70
  export type {
71
71
  AutoDiscoveryProviderType,
72
72
  CustomProvider,
73
73
  CustomProviderType,
74
- } from "./storage/stores/custom-providers-store.js";
75
- export { CustomProvidersStore } from "./storage/stores/custom-providers-store.js";
76
- export { ProviderKeysStore } from "./storage/stores/provider-keys-store.js";
77
- export { SessionsStore } from "./storage/stores/sessions-store.js";
78
- export { SettingsStore } from "./storage/stores/settings-store.js";
74
+ } from "./storage/stores/custom-providers-store";
75
+ export { CustomProvidersStore } from "./storage/stores/custom-providers-store";
76
+ export { ProviderKeysStore } from "./storage/stores/provider-keys-store";
77
+ export { SessionsStore } from "./storage/stores/sessions-store";
78
+ export { SettingsStore } from "./storage/stores/settings-store";
79
79
  export type {
80
80
  IndexConfig,
81
81
  IndexedDBConfig,
@@ -84,32 +84,32 @@ export type {
84
84
  StorageBackend,
85
85
  StorageTransaction,
86
86
  StoreConfig,
87
- } from "./storage/types.js";
87
+ } from "./storage/types";
88
88
  // Artifacts
89
- export { ArtifactElement } from "./tools/artifacts/ArtifactElement.js";
90
- export { ArtifactPill } from "./tools/artifacts/ArtifactPill.js";
91
- export { type Artifact, ArtifactsPanel, type ArtifactsParams } from "./tools/artifacts/artifacts.js";
92
- export { ArtifactsToolRenderer } from "./tools/artifacts/artifacts-tool-renderer.js";
93
- export { HtmlArtifact } from "./tools/artifacts/HtmlArtifact.js";
94
- export { ImageArtifact } from "./tools/artifacts/ImageArtifact.js";
95
- export { MarkdownArtifact } from "./tools/artifacts/MarkdownArtifact.js";
96
- export { SvgArtifact } from "./tools/artifacts/SvgArtifact.js";
97
- export { TextArtifact } from "./tools/artifacts/TextArtifact.js";
98
- export { createExtractDocumentTool, extractDocumentTool } from "./tools/extract-document.js";
89
+ export { ArtifactElement } from "./tools/artifacts/ArtifactElement";
90
+ export { ArtifactPill } from "./tools/artifacts/ArtifactPill";
91
+ export { type Artifact, ArtifactsPanel, type ArtifactsParams } from "./tools/artifacts/artifacts";
92
+ export { ArtifactsToolRenderer } from "./tools/artifacts/artifacts-tool-renderer";
93
+ export { HtmlArtifact } from "./tools/artifacts/HtmlArtifact";
94
+ export { ImageArtifact } from "./tools/artifacts/ImageArtifact";
95
+ export { MarkdownArtifact } from "./tools/artifacts/MarkdownArtifact";
96
+ export { SvgArtifact } from "./tools/artifacts/SvgArtifact";
97
+ export { TextArtifact } from "./tools/artifacts/TextArtifact";
98
+ export { createExtractDocumentTool, extractDocumentTool } from "./tools/extract-document";
99
99
  // Tools
100
- export { getToolRenderer, registerToolRenderer, renderTool, setShowJsonMode } from "./tools/index.js";
101
- export { createJavaScriptReplTool, javascriptReplTool } from "./tools/javascript-repl.js";
102
- export { renderCollapsibleHeader, renderHeader } from "./tools/renderer-registry.js";
103
- export { BashRenderer } from "./tools/renderers/BashRenderer.js";
104
- export { CalculateRenderer } from "./tools/renderers/CalculateRenderer.js";
100
+ export { getToolRenderer, registerToolRenderer, renderTool, setShowJsonMode } from "./tools/index";
101
+ export { createJavaScriptReplTool, javascriptReplTool } from "./tools/javascript-repl";
102
+ export { renderCollapsibleHeader, renderHeader } from "./tools/renderer-registry";
103
+ export { BashRenderer } from "./tools/renderers/BashRenderer";
104
+ export { CalculateRenderer } from "./tools/renderers/CalculateRenderer";
105
105
  // Tool renderers
106
- export { DefaultRenderer } from "./tools/renderers/DefaultRenderer.js";
107
- export { GetCurrentTimeRenderer } from "./tools/renderers/GetCurrentTimeRenderer.js";
108
- export type { ToolRenderer, ToolRenderResult } from "./tools/types.js";
109
- export type { Attachment } from "./utils/attachment-utils.js";
106
+ export { DefaultRenderer } from "./tools/renderers/DefaultRenderer";
107
+ export { GetCurrentTimeRenderer } from "./tools/renderers/GetCurrentTimeRenderer";
108
+ export type { ToolRenderer, ToolRenderResult } from "./tools/types";
109
+ export type { Attachment } from "./utils/attachment-utils";
110
110
  // Utils
111
- export { loadAttachment } from "./utils/attachment-utils.js";
112
- export { clearAuthToken, getAuthToken } from "./utils/auth-token.js";
113
- export { formatCost, formatModelCost, formatTokenCount, formatUsage } from "./utils/format.js";
114
- export { i18n, setLanguage, translations } from "./utils/i18n.js";
115
- export { applyProxyIfNeeded, createStreamFn, isCorsError, shouldUseProxyForProvider } from "./utils/proxy-utils.js";
111
+ export { loadAttachment } from "./utils/attachment-utils";
112
+ export { clearAuthToken, getAuthToken } from "./utils/auth-token";
113
+ export { formatCost, formatModelCost, formatTokenCount, formatUsage } from "./utils/format";
114
+ export { i18n, setLanguage, translations } from "./utils/i18n";
115
+ export { applyProxyIfNeeded, createStreamFn, isCorsError, shouldUseProxyForProvider } from "./utils/proxy-utils";
@@ -1,8 +1,8 @@
1
- import type { CustomProvidersStore } from "./stores/custom-providers-store.js";
2
- import type { ProviderKeysStore } from "./stores/provider-keys-store.js";
3
- import type { SessionsStore } from "./stores/sessions-store.js";
4
- import type { SettingsStore } from "./stores/settings-store.js";
5
- import type { StorageBackend } from "./types.js";
1
+ import type { CustomProvidersStore } from "./stores/custom-providers-store";
2
+ import type { ProviderKeysStore } from "./stores/provider-keys-store";
3
+ import type { SessionsStore } from "./stores/sessions-store";
4
+ import type { SettingsStore } from "./stores/settings-store";
5
+ import type { StorageBackend } from "./types";
6
6
 
7
7
  /**
8
8
  * High-level storage API providing access to all storage operations.
@@ -1,4 +1,4 @@
1
- import type { IndexedDBConfig, StorageBackend, StorageTransaction } from "../types.js";
1
+ import type { IndexedDBConfig, StorageBackend, StorageTransaction } from "../types";
2
2
 
3
3
  /**
4
4
  * IndexedDB implementation of StorageBackend.
@@ -1,4 +1,4 @@
1
- import type { StorageBackend, StoreConfig } from "./types.js";
1
+ import type { StorageBackend, StoreConfig } from "./types";
2
2
 
3
3
  /**
4
4
  * Base class for all storage stores.
@@ -1,6 +1,6 @@
1
1
  import type { Model } from "@oh-my-pi/pi-ai";
2
- import { Store } from "../store.js";
3
- import type { StoreConfig } from "../types.js";
2
+ import { Store } from "../store";
3
+ import type { StoreConfig } from "../types";
4
4
 
5
5
  export type AutoDiscoveryProviderType = "ollama" | "llama.cpp" | "vllm" | "lmstudio";
6
6
 
@@ -1,5 +1,5 @@
1
- import { Store } from "../store.js";
2
- import type { StoreConfig } from "../types.js";
1
+ import { Store } from "../store";
2
+ import type { StoreConfig } from "../types";
3
3
 
4
4
  /**
5
5
  * Store for LLM provider API keys (Anthropic, OpenAI, etc.).
@@ -1,6 +1,6 @@
1
1
  import type { AgentState } from "@oh-my-pi/pi-agent-core";
2
- import { Store } from "../store.js";
3
- import type { SessionData, SessionMetadata, StoreConfig } from "../types.js";
2
+ import { Store } from "../store";
3
+ import type { SessionData, SessionMetadata, StoreConfig } from "../types";
4
4
 
5
5
  /**
6
6
  * Store for chat sessions (data and metadata).
@@ -1,5 +1,5 @@
1
- import { Store } from "../store.js";
2
- import type { StoreConfig } from "../types.js";
1
+ import { Store } from "../store";
2
+ import type { StoreConfig } from "../types";
3
3
 
4
4
  /**
5
5
  * Store for application settings (theme, proxy config, etc.).
@@ -1,7 +1,7 @@
1
1
  import { icon } from "@mariozechner/mini-lit";
2
2
  import { html, type TemplateResult } from "lit";
3
3
  import { FileCode2 } from "lucide";
4
- import type { ArtifactsPanel } from "./artifacts.js";
4
+ import type { ArtifactsPanel } from "./artifacts";
5
5
 
6
6
  export function ArtifactPill(filename: string, artifactsPanel?: ArtifactsPanel): TemplateResult {
7
7
  const handleClick = (e: Event) => {
@@ -5,7 +5,7 @@ import { customElement, property, state } from "lit/decorators.js";
5
5
  import { createRef, type Ref, ref } from "lit/directives/ref.js";
6
6
  import { repeat } from "lit/directives/repeat.js";
7
7
  import { ChevronDown, ChevronRight, ChevronsDown, Lock } from "lucide";
8
- import { i18n } from "../../utils/i18n.js";
8
+ import { i18n } from "../../utils/i18n";
9
9
 
10
10
  interface LogEntry {
11
11
  type: "log" | "error";
@@ -2,8 +2,8 @@ import { DownloadButton } from "@mariozechner/mini-lit/dist/DownloadButton.js";
2
2
  import { renderAsync } from "docx-preview";
3
3
  import { html, type TemplateResult } from "lit";
4
4
  import { customElement, property, state } from "lit/decorators.js";
5
- import { i18n } from "../../utils/i18n.js";
6
- import { ArtifactElement } from "./ArtifactElement.js";
5
+ import { i18n } from "../../utils/i18n";
6
+ import { ArtifactElement } from "./ArtifactElement";
7
7
 
8
8
  @customElement("docx-artifact")
9
9
  export class DocxArtifact extends ArtifactElement {
@@ -2,8 +2,8 @@ import { DownloadButton } from "@mariozechner/mini-lit/dist/DownloadButton.js";
2
2
  import { html, type TemplateResult } from "lit";
3
3
  import { customElement, property, state } from "lit/decorators.js";
4
4
  import * as XLSX from "xlsx";
5
- import { i18n } from "../../utils/i18n.js";
6
- import { ArtifactElement } from "./ArtifactElement.js";
5
+ import { i18n } from "../../utils/i18n";
6
+ import { ArtifactElement } from "./ArtifactElement";
7
7
 
8
8
  @customElement("excel-artifact")
9
9
  export class ExcelArtifact extends ArtifactElement {
@@ -1,8 +1,8 @@
1
1
  import { DownloadButton } from "@mariozechner/mini-lit/dist/DownloadButton.js";
2
2
  import { html, type TemplateResult } from "lit";
3
3
  import { customElement, property } from "lit/decorators.js";
4
- import { i18n } from "../../utils/i18n.js";
5
- import { ArtifactElement } from "./ArtifactElement.js";
4
+ import { i18n } from "../../utils/i18n";
5
+ import { ArtifactElement } from "./ArtifactElement";
6
6
 
7
7
  @customElement("generic-artifact")
8
8
  export class GenericArtifact extends ArtifactElement {
@@ -4,13 +4,13 @@ import { customElement, property, state } from "lit/decorators.js";
4
4
  import { createRef, type Ref, ref } from "lit/directives/ref.js";
5
5
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
6
6
  import { RefreshCw } from "lucide";
7
- import type { SandboxIframe } from "../../components/SandboxedIframe.js";
8
- import { type MessageConsumer, RUNTIME_MESSAGE_ROUTER } from "../../components/sandbox/RuntimeMessageRouter.js";
9
- import type { SandboxRuntimeProvider } from "../../components/sandbox/SandboxRuntimeProvider.js";
10
- import { i18n } from "../../utils/i18n.js";
7
+ import type { SandboxIframe } from "../../components/SandboxedIframe";
8
+ import { type MessageConsumer, RUNTIME_MESSAGE_ROUTER } from "../../components/sandbox/RuntimeMessageRouter";
9
+ import type { SandboxRuntimeProvider } from "../../components/sandbox/SandboxRuntimeProvider";
10
+ import { i18n } from "../../utils/i18n";
11
11
  import "../../components/SandboxedIframe.js";
12
- import { ArtifactElement } from "./ArtifactElement.js";
13
- import type { Console } from "./Console.js";
12
+ import { ArtifactElement } from "./ArtifactElement";
13
+ import type { Console } from "./Console";
14
14
  import "./Console.js";
15
15
  import { icon } from "@mariozechner/mini-lit";
16
16
  import { Button } from "@mariozechner/mini-lit/dist/Button.js";
@@ -1,8 +1,8 @@
1
1
  import { DownloadButton } from "@mariozechner/mini-lit/dist/DownloadButton.js";
2
2
  import { html, type TemplateResult } from "lit";
3
3
  import { customElement, property } from "lit/decorators.js";
4
- import { i18n } from "../../utils/i18n.js";
5
- import { ArtifactElement } from "./ArtifactElement.js";
4
+ import { i18n } from "../../utils/i18n";
5
+ import { ArtifactElement } from "./ArtifactElement";
6
6
 
7
7
  @customElement("image-artifact")
8
8
  export class ImageArtifact extends ArtifactElement {
@@ -2,12 +2,12 @@ import hljs from "highlight.js";
2
2
  import { html } from "lit";
3
3
  import { customElement, property, state } from "lit/decorators.js";
4
4
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
5
- import { i18n } from "../../utils/i18n.js";
5
+ import { i18n } from "../../utils/i18n";
6
6
  import "@mariozechner/mini-lit/dist/MarkdownBlock.js";
7
7
  import { CopyButton } from "@mariozechner/mini-lit/dist/CopyButton.js";
8
8
  import { DownloadButton } from "@mariozechner/mini-lit/dist/DownloadButton.js";
9
9
  import { PreviewCodeToggle } from "@mariozechner/mini-lit/dist/PreviewCodeToggle.js";
10
- import { ArtifactElement } from "./ArtifactElement.js";
10
+ import { ArtifactElement } from "./ArtifactElement";
11
11
 
12
12
  @customElement("markdown-artifact")
13
13
  export class MarkdownArtifact extends ArtifactElement {
@@ -2,8 +2,8 @@ import { DownloadButton } from "@mariozechner/mini-lit/dist/DownloadButton.js";
2
2
  import { html, type TemplateResult } from "lit";
3
3
  import { customElement, property, state } from "lit/decorators.js";
4
4
  import * as pdfjsLib from "pdfjs-dist";
5
- import { i18n } from "../../utils/i18n.js";
6
- import { ArtifactElement } from "./ArtifactElement.js";
5
+ import { i18n } from "../../utils/i18n";
6
+ import { ArtifactElement } from "./ArtifactElement";
7
7
 
8
8
  // Configure PDF.js worker
9
9
  pdfjsLib.GlobalWorkerOptions.workerSrc = new URL("pdfjs-dist/build/pdf.worker.min.mjs", import.meta.url).toString();
@@ -5,8 +5,8 @@ import hljs from "highlight.js";
5
5
  import { html } from "lit";
6
6
  import { customElement, property, state } from "lit/decorators.js";
7
7
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
8
- import { i18n } from "../../utils/i18n.js";
9
- import { ArtifactElement } from "./ArtifactElement.js";
8
+ import { i18n } from "../../utils/i18n";
9
+ import { ArtifactElement } from "./ArtifactElement";
10
10
 
11
11
  @customElement("svg-artifact")
12
12
  export class SvgArtifact extends ArtifactElement {
@@ -4,8 +4,8 @@ import hljs from "highlight.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
6
6
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
7
- import { i18n } from "../../utils/i18n.js";
8
- import { ArtifactElement } from "./ArtifactElement.js";
7
+ import { i18n } from "../../utils/i18n";
8
+ import { ArtifactElement } from "./ArtifactElement";
9
9
 
10
10
  // Known code file extensions for highlighting
11
11
  const CODE_EXTENSIONS = [
@@ -5,11 +5,11 @@ import { FileCode2 } from "lucide";
5
5
  import "../../components/ConsoleBlock.js";
6
6
  import { Diff } from "@mariozechner/mini-lit/dist/Diff.js";
7
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";
8
+ import { i18n } from "../../utils/i18n";
9
+ import { renderCollapsibleHeader, renderHeader } from "../renderer-registry";
10
+ import type { ToolRenderer, ToolRenderResult } from "../types";
11
+ import { ArtifactPill } from "./ArtifactPill";
12
+ import type { ArtifactsPanel, ArtifactsParams } from "./artifacts";
13
13
 
14
14
  // Helper to extract text from content blocks
15
15
  function getTextOutput(result: ToolResultMessage<any> | undefined): string {
@@ -8,27 +8,27 @@ import { html, LitElement, type TemplateResult } from "lit";
8
8
  import { customElement, property, state } from "lit/decorators.js";
9
9
  import { createRef, type Ref, ref } from "lit/directives/ref.js";
10
10
  import { X } from "lucide";
11
- import type { ArtifactMessage } from "../../components/Messages.js";
12
- import { ArtifactsRuntimeProvider } from "../../components/sandbox/ArtifactsRuntimeProvider.js";
13
- import { AttachmentsRuntimeProvider } from "../../components/sandbox/AttachmentsRuntimeProvider.js";
14
- import type { SandboxRuntimeProvider } from "../../components/sandbox/SandboxRuntimeProvider.js";
11
+ import type { ArtifactMessage } from "../../components/Messages";
12
+ import { ArtifactsRuntimeProvider } from "../../components/sandbox/ArtifactsRuntimeProvider";
13
+ import { AttachmentsRuntimeProvider } from "../../components/sandbox/AttachmentsRuntimeProvider";
14
+ import type { SandboxRuntimeProvider } from "../../components/sandbox/SandboxRuntimeProvider";
15
15
  import {
16
16
  ARTIFACTS_RUNTIME_PROVIDER_DESCRIPTION_RO,
17
17
  ARTIFACTS_TOOL_DESCRIPTION,
18
18
  ATTACHMENTS_RUNTIME_DESCRIPTION,
19
- } from "../../prompts/prompts.js";
20
- import type { Attachment } from "../../utils/attachment-utils.js";
21
- import { i18n } from "../../utils/i18n.js";
22
- import type { ArtifactElement } from "./ArtifactElement.js";
23
- import { DocxArtifact } from "./DocxArtifact.js";
24
- import { ExcelArtifact } from "./ExcelArtifact.js";
25
- import { GenericArtifact } from "./GenericArtifact.js";
26
- import { HtmlArtifact } from "./HtmlArtifact.js";
27
- import { ImageArtifact } from "./ImageArtifact.js";
28
- import { MarkdownArtifact } from "./MarkdownArtifact.js";
29
- import { PdfArtifact } from "./PdfArtifact.js";
30
- import { SvgArtifact } from "./SvgArtifact.js";
31
- import { TextArtifact } from "./TextArtifact.js";
19
+ } from "../../prompts/prompts";
20
+ import type { Attachment } from "../../utils/attachment-utils";
21
+ import { i18n } from "../../utils/i18n";
22
+ import type { ArtifactElement } from "./ArtifactElement";
23
+ import { DocxArtifact } from "./DocxArtifact";
24
+ import { ExcelArtifact } from "./ExcelArtifact";
25
+ import { GenericArtifact } from "./GenericArtifact";
26
+ import { HtmlArtifact } from "./HtmlArtifact";
27
+ import { ImageArtifact } from "./ImageArtifact";
28
+ import { MarkdownArtifact } from "./MarkdownArtifact";
29
+ import { PdfArtifact } from "./PdfArtifact";
30
+ import { SvgArtifact } from "./SvgArtifact";
31
+ import { TextArtifact } from "./TextArtifact";
32
32
 
33
33
  // Simple artifact model
34
34
  export interface Artifact {
@@ -1,7 +1,7 @@
1
- export { ArtifactElement } from "./ArtifactElement.js";
2
- export { type Artifact, ArtifactsPanel, type ArtifactsParams } from "./artifacts.js";
3
- export { ArtifactsToolRenderer } from "./artifacts-tool-renderer.js";
4
- export { HtmlArtifact } from "./HtmlArtifact.js";
5
- export { MarkdownArtifact } from "./MarkdownArtifact.js";
6
- export { SvgArtifact } from "./SvgArtifact.js";
7
- export { TextArtifact } from "./TextArtifact.js";
1
+ export { ArtifactElement } from "./ArtifactElement";
2
+ export { type Artifact, ArtifactsPanel, type ArtifactsParams } from "./artifacts";
3
+ export { ArtifactsToolRenderer } from "./artifacts-tool-renderer";
4
+ export { HtmlArtifact } from "./HtmlArtifact";
5
+ export { MarkdownArtifact } from "./MarkdownArtifact";
6
+ export { SvgArtifact } from "./SvgArtifact";
7
+ export { TextArtifact } from "./TextArtifact";
@@ -4,11 +4,11 @@ import { type Static, Type } from "@sinclair/typebox";
4
4
  import { html } from "lit";
5
5
  import { createRef, ref } from "lit/directives/ref.js";
6
6
  import { FileText } from "lucide";
7
- import { EXTRACT_DOCUMENT_DESCRIPTION } from "../prompts/prompts.js";
8
- import { loadAttachment } from "../utils/attachment-utils.js";
9
- import { isCorsError } from "../utils/proxy-utils.js";
10
- import { registerToolRenderer, renderCollapsibleHeader, renderHeader } from "./renderer-registry.js";
11
- import type { ToolRenderer, ToolRenderResult } from "./types.js";
7
+ import { EXTRACT_DOCUMENT_DESCRIPTION } from "../prompts/prompts";
8
+ import { loadAttachment } from "../utils/attachment-utils";
9
+ import { isCorsError } from "../utils/proxy-utils";
10
+ import { registerToolRenderer, renderCollapsibleHeader, renderHeader } from "./renderer-registry";
11
+ import type { ToolRenderer, ToolRenderResult } from "./types";
12
12
 
13
13
  // ============================================================================
14
14
  // TYPES
@@ -1,10 +1,10 @@
1
1
  import type { ToolResultMessage } from "@oh-my-pi/pi-ai";
2
2
  import "./javascript-repl.js"; // Auto-registers the renderer
3
3
  import "./extract-document.js"; // Auto-registers the renderer
4
- import { getToolRenderer, registerToolRenderer } from "./renderer-registry.js";
5
- import { BashRenderer } from "./renderers/BashRenderer.js";
6
- import { DefaultRenderer } from "./renderers/DefaultRenderer.js";
7
- import type { ToolRenderResult } from "./types.js";
4
+ import { getToolRenderer, registerToolRenderer } from "./renderer-registry";
5
+ import { BashRenderer } from "./renderers/BashRenderer";
6
+ import { DefaultRenderer } from "./renderers/DefaultRenderer";
7
+ import type { ToolRenderResult } from "./types";
8
8
 
9
9
  // Register all built-in tool renderers
10
10
  registerToolRenderer("bash", new BashRenderer());
@@ -5,12 +5,12 @@ import { type Static, Type } from "@sinclair/typebox";
5
5
  import { html } from "lit";
6
6
  import { createRef, ref } from "lit/directives/ref.js";
7
7
  import { Code } from "lucide";
8
- import { type SandboxFile, SandboxIframe, type SandboxResult } from "../components/SandboxedIframe.js";
9
- import type { SandboxRuntimeProvider } from "../components/sandbox/SandboxRuntimeProvider.js";
10
- import { JAVASCRIPT_REPL_TOOL_DESCRIPTION } from "../prompts/prompts.js";
11
- import type { Attachment } from "../utils/attachment-utils.js";
12
- import { registerToolRenderer, renderCollapsibleHeader, renderHeader } from "./renderer-registry.js";
13
- import type { ToolRenderer, ToolRenderResult } from "./types.js";
8
+ import { type SandboxFile, SandboxIframe, type SandboxResult } from "../components/SandboxedIframe";
9
+ import type { SandboxRuntimeProvider } from "../components/sandbox/SandboxRuntimeProvider";
10
+ import { JAVASCRIPT_REPL_TOOL_DESCRIPTION } from "../prompts/prompts";
11
+ import type { Attachment } from "../utils/attachment-utils";
12
+ import { registerToolRenderer, renderCollapsibleHeader, renderHeader } from "./renderer-registry";
13
+ import type { ToolRenderer, ToolRenderResult } from "./types";
14
14
 
15
15
  // Execute JavaScript code with attachments using SandboxedIframe
16
16
  export async function executeJavaScript(
@@ -3,7 +3,7 @@ import { html, type TemplateResult } from "lit";
3
3
  import type { Ref } from "lit/directives/ref.js";
4
4
  import { ref } from "lit/directives/ref.js";
5
5
  import { ChevronsUpDown, ChevronUp, Loader } from "lucide";
6
- import type { ToolRenderer } from "./types.js";
6
+ import type { ToolRenderer } from "./types";
7
7
 
8
8
  // Registry of tool renderers
9
9
  export const toolRenderers = new Map<string, ToolRenderer>();
@@ -1,9 +1,9 @@
1
1
  import type { ToolResultMessage } from "@oh-my-pi/pi-ai";
2
2
  import { html } from "lit";
3
3
  import { SquareTerminal } from "lucide";
4
- import { i18n } from "../../utils/i18n.js";
5
- import { renderHeader } from "../renderer-registry.js";
6
- import type { ToolRenderer, ToolRenderResult } from "../types.js";
4
+ import { i18n } from "../../utils/i18n";
5
+ import { renderHeader } from "../renderer-registry";
6
+ import type { ToolRenderer, ToolRenderResult } from "../types";
7
7
 
8
8
  interface BashParams {
9
9
  command: string;
@@ -1,9 +1,9 @@
1
1
  import type { ToolResultMessage } from "@oh-my-pi/pi-ai";
2
2
  import { html } from "lit";
3
3
  import { Calculator } from "lucide";
4
- import { i18n } from "../../utils/i18n.js";
5
- import { renderHeader } from "../renderer-registry.js";
6
- import type { ToolRenderer, ToolRenderResult } from "../types.js";
4
+ import { i18n } from "../../utils/i18n";
5
+ import { renderHeader } from "../renderer-registry";
6
+ import type { ToolRenderer, ToolRenderResult } from "../types";
7
7
 
8
8
  interface CalculateParams {
9
9
  expression: string;
@@ -1,9 +1,9 @@
1
1
  import type { ToolResultMessage } from "@oh-my-pi/pi-ai";
2
2
  import { html } from "lit";
3
3
  import { Code } from "lucide";
4
- import { i18n } from "../../utils/i18n.js";
5
- import { renderHeader } from "../renderer-registry.js";
6
- import type { ToolRenderer, ToolRenderResult } from "../types.js";
4
+ import { i18n } from "../../utils/i18n";
5
+ import { renderHeader } from "../renderer-registry";
6
+ import type { ToolRenderer, ToolRenderResult } from "../types";
7
7
 
8
8
  export class DefaultRenderer implements ToolRenderer {
9
9
  render(params: any | undefined, result: ToolResultMessage | undefined, isStreaming?: boolean): ToolRenderResult {
@@ -1,9 +1,9 @@
1
1
  import type { ToolResultMessage } from "@oh-my-pi/pi-ai";
2
2
  import { html } from "lit";
3
3
  import { Clock } from "lucide";
4
- import { i18n } from "../../utils/i18n.js";
5
- import { renderHeader } from "../renderer-registry.js";
6
- import type { ToolRenderer, ToolRenderResult } from "../types.js";
4
+ import { i18n } from "../../utils/i18n";
5
+ import { renderHeader } from "../renderer-registry";
6
+ import type { ToolRenderer, ToolRenderResult } from "../types";
7
7
 
8
8
  interface GetCurrentTimeParams {
9
9
  timezone?: string;
@@ -3,7 +3,7 @@ import JSZip from "jszip";
3
3
  import type { PDFDocumentProxy } from "pdfjs-dist";
4
4
  import * as pdfjsLib from "pdfjs-dist";
5
5
  import * as XLSX from "xlsx";
6
- import { i18n } from "./i18n.js";
6
+ import { i18n } from "./i18n";
7
7
 
8
8
  // Configure PDF.js worker - we'll need to bundle this
9
9
  pdfjsLib.GlobalWorkerOptions.workerSrc = new URL("pdfjs-dist/build/pdf.worker.min.mjs", import.meta.url).toString();
@@ -1,5 +1,5 @@
1
1
  import PromptDialog from "@mariozechner/mini-lit/dist/PromptDialog.js";
2
- import { i18n } from "./i18n.js";
2
+ import { i18n } from "./i18n";
3
3
 
4
4
  export async function getAuthToken(): Promise<string | undefined> {
5
5
  let authToken: string | undefined = localStorage.getItem(`auth-token`) || "";