@hienlh/ppm 0.17.44 → 0.17.46

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 (70) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/assets/skills/ppm/SKILL.md +1 -1
  3. package/assets/skills/ppm/references/cli-reference.md +4 -4
  4. package/assets/skills/ppm/references/http-api.md +1 -1
  5. package/dist/web/assets/{ai-resource-editor-CQWFrDeG.js → ai-resource-editor-C6whUvqU.js} +1 -1
  6. package/dist/web/assets/{audio-preview-Cyb8SLCu.js → audio-preview-zCaVGICs.js} +1 -1
  7. package/dist/web/assets/chat-tab-34EBK6a-.js +13 -0
  8. package/dist/web/assets/{code-editor-DTqFVL_2.js → code-editor-B-3Ys0pn.js} +2 -2
  9. package/dist/web/assets/{conflict-editor-BFiY6VyT.js → conflict-editor-CmbzavrH.js} +1 -1
  10. package/dist/web/assets/{csv-preview-DpeN7hH8.js → csv-preview-DSe1UKLQ.js} +1 -1
  11. package/dist/web/assets/{database-viewer-D9OT6V9B.js → database-viewer-BC3tMeSZ.js} +1 -1
  12. package/dist/web/assets/{diff-viewer-LqH4ARjy.js → diff-viewer-CH7HtuY_.js} +1 -1
  13. package/dist/web/assets/{docx-preview-Dqzlw47y.js → docx-preview-CXw0EiKN.js} +1 -1
  14. package/dist/web/assets/{extension-webview-DsNuZtJO.js → extension-webview-BKNPTGJ4.js} +1 -1
  15. package/dist/web/assets/{git-log-panel-mcn-Atil.js → git-log-panel-4at7vGet.js} +1 -1
  16. package/dist/web/assets/{glide-data-grid-CyZAiAgS.js → glide-data-grid-BJBoXCv5.js} +1 -1
  17. package/dist/web/assets/{group-chat-tab-CRkPysZw.js → group-chat-tab-XNIsuLbW.js} +1 -1
  18. package/dist/web/assets/{image-preview-DnNyBpmU.js → image-preview-Hqu7-Pbv.js} +1 -1
  19. package/dist/web/assets/{index-D4KFhwmL.js → index-BR5KVuwx.js} +3 -3
  20. package/dist/web/assets/index-hIIXGoXQ.css +2 -0
  21. package/dist/web/assets/{keybindings-store-CtrEuZpU.js → keybindings-store-B_JMJIhN.js} +1 -1
  22. package/dist/web/assets/{markdown-renderer-DDFElf1k.js → markdown-renderer-CPm8QbIv.js} +1 -1
  23. package/dist/web/assets/{markdown-renderer-BFwR1QYD.js → markdown-renderer-WnJVcJ2v.js} +1 -1
  24. package/dist/web/assets/{notification-store-BTo6li6s.js → notification-store-CD8j6i20.js} +1 -1
  25. package/dist/web/assets/{pdf-preview-DDRKbO4z.js → pdf-preview-CA71gMQU.js} +1 -1
  26. package/dist/web/assets/{postgres-viewer-0UqxqUYu.js → postgres-viewer-CkZu5Ary.js} +1 -1
  27. package/dist/web/assets/{settings-tab-0VKOVbt2.js → settings-tab-Cy2JvRdN.js} +1 -1
  28. package/dist/web/assets/{sql-query-editor-Cf76aKfw.js → sql-query-editor-DxaQ6kWk.js} +1 -1
  29. package/dist/web/assets/{sqlite-viewer-CO6dK1CU.js → sqlite-viewer-1fDZK9Jx.js} +1 -1
  30. package/dist/web/assets/{system-monitor-tab-BFBwiME3.js → system-monitor-tab-B64gFhnE.js} +1 -1
  31. package/dist/web/assets/{terminal-tab-lu0ZsZmQ.js → terminal-tab-Dl-I2wBS.js} +1 -1
  32. package/dist/web/assets/{tool-cards-CMQowijv.js → tool-cards-HHgeNBqk.js} +2 -2
  33. package/dist/web/assets/{use-monaco-theme-DU3LWaPu.js → use-monaco-theme-uP8s-9Qb.js} +1 -1
  34. package/dist/web/assets/{video-preview-CHUzaq4s.js → video-preview-sGT5PM0H.js} +1 -1
  35. package/dist/web/index.html +2 -2
  36. package/dist/web/sw.js +1 -1
  37. package/package.json +2 -2
  38. package/scripts/check-ppm-dir-usage.sh +0 -0
  39. package/scripts/install.sh +0 -0
  40. package/scripts/release.sh +0 -0
  41. package/src/cli/commands/stop.ts +6 -3
  42. package/src/providers/claude-agent-sdk.ts +66 -2
  43. package/src/server/routes/accounts.ts +6 -2
  44. package/src/server/routes/chat.ts +45 -2
  45. package/src/server/ws/chat.ts +110 -12
  46. package/src/services/account-selector.service.ts +98 -11
  47. package/src/services/autostart-generator.ts +5 -5
  48. package/src/services/autostart-register.ts +14 -0
  49. package/src/services/claude-usage.service.ts +29 -3
  50. package/src/services/db.service.ts +120 -1
  51. package/src/services/ppm-dir.ts +16 -0
  52. package/src/services/subprocess-retention.ts +63 -0
  53. package/src/services/supervisor.ts +87 -34
  54. package/src/services/windows-process-tree.ts +118 -4
  55. package/src/shared/turn-usage.ts +230 -0
  56. package/src/types/chat.ts +3 -1
  57. package/src/web/components/chat/chat-tab.tsx +3 -2
  58. package/src/web/components/chat/message-action-bar.tsx +0 -3
  59. package/src/web/components/chat/message-list.tsx +5 -1
  60. package/src/web/components/chat/session-debug-dialog.tsx +125 -0
  61. package/src/web/components/chat/turn-change-rollup.tsx +1 -3
  62. package/src/web/components/chat/turn-cost-warning.tsx +85 -0
  63. package/src/web/hooks/use-chat.ts +3 -0
  64. package/src/web/hooks/use-usage.ts +8 -3
  65. package/dist/web/assets/chat-tab-uBmb2rFB.js +0 -13
  66. package/dist/web/assets/index-BEB87kj8.css +0 -2
  67. package/packages/vscode-compat/node_modules/.bin/tsc.bunx +0 -0
  68. package/packages/vscode-compat/node_modules/.bin/tsc.exe +0 -0
  69. package/packages/vscode-compat/node_modules/.bin/tsserver.bunx +0 -0
  70. package/packages/vscode-compat/node_modules/.bin/tsserver.exe +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.17.46] - 2026-08-31
4
+
5
+ ### Fixed
6
+ - **Continuing a long chat no longer costs several times more than it should** — a chat's whole history is re-sent to Claude on every message, and that is only cheap while it still matches a cached copy, which is held per account and expires after five minutes. Refreshing a tab, switching apps on a phone or letting a laptop sleep ended the chat's process, and the next message went to whichever account came next in the rotation — paying full price for the entire history again. A chat now stays on one account and keeps its process across a reconnect.
7
+ - **A chat no longer hops between accounts when they are all near their 5-hour limit** — it used to swap accounts on every message in exactly the situation where swapping costs the most, since each swap re-sends the history uncached. It now stays put unless another account genuinely has room.
8
+ - **A chat no longer stays stuck on an account whose weekly limit is spent** — the check only looked at the 5-hour window, so an account with nothing left for the week kept serving as soon as that window reset.
9
+ - **The chat header shows the account serving *this* chat** — with two chats open on two accounts it named whichever one ran most recently, so at least one of them was wrong.
10
+ - **Usage for a newly added account appears right away** — it used to stay blank until the next scheduled refresh.
11
+
12
+ ### Added
13
+ - **A chat now tells you when a message cost more than it had to** — a note under the reply explains how much of the history was re-sent uncached, roughly how many times more that made the message cost, and what restarted the chat.
14
+ - **Per-message token and cache history** — the session debug panel (bug icon) lists recent messages with how much of the history came from cache, what it cost and which account served it, so an expensive chat can be compared against its own cheaper messages.
15
+
16
+ ### Changed
17
+ - **An idle chat releases its process once its cached history expires** — timed from its last message rather than from when the tab closed, so a process is never held alive protecting a cache that has already lapsed.
18
+ - **At most five idle chats keep a process warm** — beyond that the longest-idle one is released first, which bounds memory when chats are left open across several devices.
19
+ - **The account is no longer repeated under every reply** — it appears once in the header, for the chat it belongs to.
20
+
21
+ ## [0.17.45] - 2026-08-31
22
+
23
+ ### Fixed
24
+ - **Updating no longer leaves a second copy of PPM running** — each update started a replacement that the system service manager could not see, so it started one of its own as well. The abandoned copy kept its server, its chat agents and its own public tunnel alive, and the copies piled up with every release until the machine ran out of memory. Updates now hand back to the service manager, so exactly one copy survives.
25
+ - **Chat agents are shut down with the server that owns them** — on macOS and Linux they were only reachable through a shortcut that never actually applied, so they outlived their server by days, holding memory and keeping its port occupied. They are now found and stopped properly.
26
+ - **A port that is already taken is reported instead of quietly worked around** — PPM used to slide onto the next free port and keep running there as an extra instance. It now clears out its own leftovers and otherwise says what is holding the port.
27
+
3
28
  ## [0.17.44] - 2026-08-31
4
29
 
5
30
  ### Fixed
@@ -71,4 +71,4 @@ This skill covers the `ppm` CLI, its HTTP API, and its config DB. It does **not*
71
71
  - Third-party extensions (inspect via `ppm ext list`).
72
72
  - The Claude Agent SDK internals (separate skill).
73
73
 
74
- <!-- Generated for PPM v0.17.44 at build time. Re-run `ppm export skill --install` to refresh. -->
74
+ <!-- Generated for PPM v0.17.46 at build time. Re-run `ppm export skill --install` to refresh. -->
@@ -763,7 +763,7 @@ Show recent runs for a schedule
763
763
  Manage and inspect discovered skills & commands
764
764
 
765
765
  **Options:**
766
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm"`)
766
+ - `--project <path>` — Project path (default: `"/Users/hienlh/Projects/ppm"`)
767
767
 
768
768
  **Usage:** `ppm skills [options] [command]`
769
769
 
@@ -773,7 +773,7 @@ List all discovered skills and commands
773
773
 
774
774
  **Options:**
775
775
  - `--json` — JSON output
776
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm"`)
776
+ - `--project <path>` — Project path (default: `"/Users/hienlh/Projects/ppm"`)
777
777
 
778
778
  ### `ppm skills search`
779
779
 
@@ -781,7 +781,7 @@ Fuzzy search skills and commands
781
781
 
782
782
  **Options:**
783
783
  - `--json` — JSON output
784
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm"`)
784
+ - `--project <path>` — Project path (default: `"/Users/hienlh/Projects/ppm"`)
785
785
 
786
786
  **Usage:** `ppm skills search [options] <query>`
787
787
 
@@ -791,7 +791,7 @@ Show detailed info for a specific skill
791
791
 
792
792
  **Options:**
793
793
  - `--json` — JSON output
794
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm"`)
794
+ - `--project <path>` — Project path (default: `"/Users/hienlh/Projects/ppm"`)
795
795
 
796
796
  **Usage:** `ppm skills info [options] <name>`
797
797
 
@@ -288,4 +288,4 @@ _Base URL: `http://localhost:8080` (default; override via `ppm config set port <
288
288
  - `ws://<host>/ws/terminal` — PTY terminal multiplexer
289
289
  - `ws://<host>/ws/extensions` — extension host channel
290
290
 
291
- <!-- Generated from src/server/routes/ for PPM v0.17.44 -->
291
+ <!-- Generated from src/server/routes/ for PPM v0.17.46 -->
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,y as n}from"./vendor-markdown-CKTlmXbz.js";import"./vendor-ui-DMRGWRuc.js";import{t as r}from"./save-BM4p9_9n.js";import{s as i}from"./api-client-COQtP-dB.js";import"./vendor-mermaid-CYOBtZtD.js";import"./settings-store-BbFtHCGd.js";import{n as a}from"./utils-E0yyGxXt.js";import{$t as o,D as s,E as c,Mt as l,O as u,T as d,en as f,jt as p,k as m,o as h}from"./index-D4KFhwmL.js";import{t as g}from"./use-monaco-theme-DU3LWaPu.js";var _=e(t(),1),v=n();function y({metadata:e}){let t=e?.filePath,n=e?.name,a=e?.resourceType??`skill`,y=e?.scope??`user`,x=e?.readOnly===!0,S=e?.shadowed===!0,C=e?.shadowedBy,w=e?.project??``,[T,E]=(0,_.useState)(``),[D,O]=(0,_.useState)(``),[k,A]=(0,_.useState)(!0),[j,M]=(0,_.useState)(null),[N,P]=(0,_.useState)(!1),F=g(),I=(0,_.useRef)(``),L=T!==D;(0,_.useEffect)(()=>{let e=!1;return A(!0),M(null),u(t,w).then(t=>{e||(E(t.content),O(t.content),I.current=t.content)}).catch(t=>{e||M(t.message)}).finally(()=>{e||A(!1)}),()=>{e=!0}},[t,w]);let R=(0,_.useCallback)(async()=>{if(x||N)return;let e=I.current;if(e!==D){P(!0);try{await m(t,e,w),O(e),E(e),i.success(`Saved`),s.getState().reload()}catch(e){i.error(e.message)}finally{P(!1)}}},[t,w,D,x,N]);(0,_.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),R())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[R]);let z=c[a];return(0,v.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,v.jsx)(z,{className:`size-4 text-text-subtle`}),(0,v.jsx)(`span`,{className:`text-sm font-semibold`,children:n}),(0,v.jsx)(d,{scope:y}),L&&!x&&(0,v.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,title:`Unsaved changes`}),(0,v.jsx)(`div`,{className:`flex-1`}),(0,v.jsxs)(`span`,{className:`hidden sm:block text-[11px] text-text-subtle`,children:[a,` · markdown`]}),!x&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{onClick:()=>E(D),disabled:!L||N,className:`flex items-center gap-1 rounded px-2 py-1 text-xs text-text-secondary hover:bg-surface-elevated disabled:opacity-40`,children:[(0,v.jsx)(p,{className:`size-3.5`}),` Revert`]}),(0,v.jsxs)(`button`,{onClick:()=>void R(),disabled:!L||N,className:`flex items-center gap-1 rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-40`,children:[N?(0,v.jsx)(f,{className:`size-3.5 animate-spin`}):(0,v.jsx)(r,{className:`size-3.5`}),` Save`]})]})]}),x&&(0,v.jsx)(b,{icon:o,tone:`muted`,children:`Bundled resource — read-only. Duplicate it (from the AI Resources panel) to make an editable copy.`}),S&&C&&(0,v.jsxs)(b,{icon:l,tone:`warn`,children:[`This `,a,` is overridden by another “`,C.name,`” from a higher-priority source (`,C.source,`). It is currently inactive.`]}),(0,v.jsx)(`div`,{className:`min-h-0 flex-1`,children:k?(0,v.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,v.jsx)(f,{className:`size-5 animate-spin text-primary`})}):j?(0,v.jsx)(`div`,{className:`p-6 text-center text-sm text-destructive`,children:j}):(0,v.jsx)(h,{height:`100%`,language:`markdown`,theme:F,value:T,onChange:e=>{let t=e??``;I.current=t,E(t)},options:{readOnly:x,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,lineNumbers:`on`}})})]})}function b({icon:e,tone:t,children:n}){return(0,v.jsxs)(`div`,{className:a(`flex items-start gap-2 px-3 py-2 text-[12px] shrink-0 border-b border-border`,t===`warn`?`bg-amber-500/10 text-amber-300`:`bg-surface-elevated text-text-secondary`),children:[(0,v.jsx)(e,{className:`mt-0.5 size-3.5 shrink-0`}),(0,v.jsx)(`span`,{children:n})]})}export{y as AiResourceEditor};
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,y as n}from"./vendor-markdown-CKTlmXbz.js";import"./vendor-ui-DMRGWRuc.js";import{t as r}from"./save-BM4p9_9n.js";import{s as i}from"./api-client-COQtP-dB.js";import"./vendor-mermaid-CYOBtZtD.js";import"./settings-store-BbFtHCGd.js";import{n as a}from"./utils-E0yyGxXt.js";import{$t as o,D as s,E as c,Mt as l,O as u,T as d,en as f,jt as p,k as m,o as h}from"./index-BR5KVuwx.js";import{t as g}from"./use-monaco-theme-uP8s-9Qb.js";var _=e(t(),1),v=n();function y({metadata:e}){let t=e?.filePath,n=e?.name,a=e?.resourceType??`skill`,y=e?.scope??`user`,x=e?.readOnly===!0,S=e?.shadowed===!0,C=e?.shadowedBy,w=e?.project??``,[T,E]=(0,_.useState)(``),[D,O]=(0,_.useState)(``),[k,A]=(0,_.useState)(!0),[j,M]=(0,_.useState)(null),[N,P]=(0,_.useState)(!1),F=g(),I=(0,_.useRef)(``),L=T!==D;(0,_.useEffect)(()=>{let e=!1;return A(!0),M(null),u(t,w).then(t=>{e||(E(t.content),O(t.content),I.current=t.content)}).catch(t=>{e||M(t.message)}).finally(()=>{e||A(!1)}),()=>{e=!0}},[t,w]);let R=(0,_.useCallback)(async()=>{if(x||N)return;let e=I.current;if(e!==D){P(!0);try{await m(t,e,w),O(e),E(e),i.success(`Saved`),s.getState().reload()}catch(e){i.error(e.message)}finally{P(!1)}}},[t,w,D,x,N]);(0,_.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),R())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[R]);let z=c[a];return(0,v.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,v.jsx)(z,{className:`size-4 text-text-subtle`}),(0,v.jsx)(`span`,{className:`text-sm font-semibold`,children:n}),(0,v.jsx)(d,{scope:y}),L&&!x&&(0,v.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,title:`Unsaved changes`}),(0,v.jsx)(`div`,{className:`flex-1`}),(0,v.jsxs)(`span`,{className:`hidden sm:block text-[11px] text-text-subtle`,children:[a,` · markdown`]}),!x&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{onClick:()=>E(D),disabled:!L||N,className:`flex items-center gap-1 rounded px-2 py-1 text-xs text-text-secondary hover:bg-surface-elevated disabled:opacity-40`,children:[(0,v.jsx)(p,{className:`size-3.5`}),` Revert`]}),(0,v.jsxs)(`button`,{onClick:()=>void R(),disabled:!L||N,className:`flex items-center gap-1 rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-40`,children:[N?(0,v.jsx)(f,{className:`size-3.5 animate-spin`}):(0,v.jsx)(r,{className:`size-3.5`}),` Save`]})]})]}),x&&(0,v.jsx)(b,{icon:o,tone:`muted`,children:`Bundled resource — read-only. Duplicate it (from the AI Resources panel) to make an editable copy.`}),S&&C&&(0,v.jsxs)(b,{icon:l,tone:`warn`,children:[`This `,a,` is overridden by another “`,C.name,`” from a higher-priority source (`,C.source,`). It is currently inactive.`]}),(0,v.jsx)(`div`,{className:`min-h-0 flex-1`,children:k?(0,v.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,v.jsx)(f,{className:`size-5 animate-spin text-primary`})}):j?(0,v.jsx)(`div`,{className:`p-6 text-center text-sm text-destructive`,children:j}):(0,v.jsx)(h,{height:`100%`,language:`markdown`,theme:F,value:T,onChange:e=>{let t=e??``;I.current=t,E(t)},options:{readOnly:x,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,lineNumbers:`on`}})})]})}function b({icon:e,tone:t,children:n}){return(0,v.jsxs)(`div`,{className:a(`flex items-start gap-2 px-3 py-2 text-[12px] shrink-0 border-b border-border`,t===`warn`?`bg-amber-500/10 text-amber-300`:`bg-surface-elevated text-text-secondary`),children:[(0,v.jsx)(e,{className:`mt-0.5 size-3.5 shrink-0`}),(0,v.jsx)(`span`,{children:n})]})}export{y as AiResourceEditor};
@@ -1 +1 @@
1
- import{y as e}from"./vendor-markdown-CKTlmXbz.js";import"./vendor-ui-DMRGWRuc.js";import{t}from"./createLucideIcon-ConhwJnb.js";import{t as n}from"./file-exclamation-point-DBEC-Kst.js";import"./api-client-COQtP-dB.js";import{t as r}from"./utils-E0yyGxXt.js";import{en as i}from"./index-D4KFhwmL.js";import{t as a}from"./use-blob-url-B3YovXF6.js";var o=t(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),s=e();function c({filePath:e,projectName:t}){let{blobUrl:c,error:l}=a(e,t);return l?(0,s.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,s.jsx)(n,{className:`size-10 text-text-subtle`}),(0,s.jsx)(`p`,{className:`text-sm`,children:`Failed to load audio.`})]}):c?(0,s.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-4 p-4 bg-surface`,children:[(0,s.jsx)(o,{className:`size-16 text-text-subtle`}),(0,s.jsx)(`p`,{className:`text-sm text-text-secondary truncate max-w-xs`,children:r(e)}),(0,s.jsx)(`audio`,{src:c,controls:!0,className:`w-full max-w-md`})]}):(0,s.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,s.jsx)(i,{className:`size-5 animate-spin text-text-subtle`})})}export{c as AudioPreview};
1
+ import{y as e}from"./vendor-markdown-CKTlmXbz.js";import"./vendor-ui-DMRGWRuc.js";import{t}from"./createLucideIcon-ConhwJnb.js";import{t as n}from"./file-exclamation-point-DBEC-Kst.js";import"./api-client-COQtP-dB.js";import{t as r}from"./utils-E0yyGxXt.js";import{en as i}from"./index-BR5KVuwx.js";import{t as a}from"./use-blob-url-B3YovXF6.js";var o=t(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),s=e();function c({filePath:e,projectName:t}){let{blobUrl:c,error:l}=a(e,t);return l?(0,s.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,s.jsx)(n,{className:`size-10 text-text-subtle`}),(0,s.jsx)(`p`,{className:`text-sm`,children:`Failed to load audio.`})]}):c?(0,s.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-4 p-4 bg-surface`,children:[(0,s.jsx)(o,{className:`size-16 text-text-subtle`}),(0,s.jsx)(`p`,{className:`text-sm text-text-secondary truncate max-w-xs`,children:r(e)}),(0,s.jsx)(`audio`,{src:c,controls:!0,className:`w-full max-w-md`})]}):(0,s.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,s.jsx)(i,{className:`size-5 animate-spin text-text-subtle`})})}export{c as AudioPreview};