@evandu/super-pi 0.1.122 → 0.1.124

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 (46) hide show
  1. package/dist/.super-pi-check-inputs.json +2 -2
  2. package/dist/client/.super-pi-client-sources.json +7 -7
  3. package/dist/client/assets/{CodeMirrorEditor-B2AXs2YB.js → CodeMirrorEditor-bNGSS1rQ.js} +2 -2
  4. package/dist/client/assets/{dist-CjyJqaHj.js → dist-BNFxxYvs.js} +1 -1
  5. package/dist/client/assets/{dist-DOQGcum7.js → dist-BZ-HTc7j.js} +1 -1
  6. package/dist/client/assets/{dist-DOuFuHYr.js → dist-BZB9Z8C-.js} +1 -1
  7. package/dist/client/assets/{dist-CWcEOVNV.js → dist-BdNKDCbA.js} +1 -1
  8. package/dist/client/assets/{dist-D11ifrNu.js → dist-Bea-jKEE.js} +1 -1
  9. package/dist/client/assets/{dist-CRpnXCSn.js → dist-Bf28S0tQ.js} +1 -1
  10. package/dist/client/assets/{dist-CrYrGCRr.js → dist-BkzoxIX4.js} +1 -1
  11. package/dist/client/assets/{dist-D899ixlt.js → dist-Boojk5ek.js} +1 -1
  12. package/dist/client/assets/{dist-GQ99vtKx.js → dist-BuO7_0WE.js} +1 -1
  13. package/dist/client/assets/{dist-Wq0CGa1P.js → dist-BwJvT1Pb.js} +1 -1
  14. package/dist/client/assets/{dist-4hqZVn6B.js → dist-C1MR_bG_.js} +1 -1
  15. package/dist/client/assets/{dist-CvUxw4HU.js → dist-C1W6z7MQ.js} +1 -1
  16. package/dist/client/assets/{dist-CAFUK38E.js → dist-CIxJmM-_.js} +1 -1
  17. package/dist/client/assets/{dist-Dp9eqvWE.js → dist-CROgPs2p.js} +1 -1
  18. package/dist/client/assets/{dist-CcAEnfzB.js → dist-CwC6b2Cl.js} +1 -1
  19. package/dist/client/assets/{dist-BqlvAjyT.js → dist-D-1R5iHi.js} +1 -1
  20. package/dist/client/assets/{dist-CoqrRbfm.js → dist-D8wvXcz3.js} +1 -1
  21. package/dist/client/assets/{dist-Ip0mRDF1.js → dist-DAs0bmNx.js} +1 -1
  22. package/dist/client/assets/{dist-B0G3TOfE.js → dist-DXsLC1J6.js} +1 -1
  23. package/dist/client/assets/{dist-DC4KdKrw.js → dist-D_E1E9X4.js} +1 -1
  24. package/dist/client/assets/{dist-Cxo9Qf8Y.js → dist-RFhXNQyY.js} +1 -1
  25. package/dist/client/assets/{dist--hp7cqEH.js → dist-U-IA_cdZ.js} +1 -1
  26. package/dist/client/assets/{index-CCnIvjP6.css → index-4kjGwKOr.css} +1 -1
  27. package/dist/client/assets/index-LL00oFAG.js +99 -0
  28. package/dist/client/index.html +2 -2
  29. package/dist/server/application/provider-service.d.ts +51 -2
  30. package/dist/server/application/provider-service.js +166 -11
  31. package/dist/server/application/run-service.js +14 -7
  32. package/dist/server/command-handler.js +21 -0
  33. package/dist/server/http-server.js +8 -0
  34. package/dist/server/index.js +2 -0
  35. package/dist/server/pi-session-events.d.ts +6 -1
  36. package/dist/server/providers.d.ts +101 -0
  37. package/dist/server/providers.js +241 -35
  38. package/dist/server/runtime.d.ts +1 -1
  39. package/dist/server/runtime.js +42 -20
  40. package/dist/server/store.d.ts +15 -0
  41. package/dist/server/store.js +34 -0
  42. package/dist/server/terminal.d.ts +51 -0
  43. package/dist/server/terminal.js +81 -12
  44. package/dist/server/types.d.ts +38 -0
  45. package/package.json +3 -1
  46. package/dist/client/assets/index-B0TMoUBp.js +0 -99
@@ -1,4 +1,4 @@
1
1
  {
2
- "hash": "efd68a2b2b8b92bd37384b6c6b92156733c944eb2f3d300396956d480c36e6e3",
3
- "recordedAt": "2026-10-23T05:28:47.523Z"
2
+ "hash": "2832b8e13e7d8001ccfa24495b47d56183870da84e8eff6a132563ff449f7157",
3
+ "recordedAt": "2026-10-23T11:11:50.179Z"
4
4
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "hash": "de8041b55f0a73c0856e5d452b1221f1b853321dddcd5e8c02c036d975043506",
2
+ "hash": "d19a6583f2d96826d3b6d69123e053138d1044e8056b74c87d4811a78df0cecd",
3
3
  "files": {
4
- "src/client/App.tsx": "06b1c2fe0999a5f89acf0de723ebb86ef09882fc2bc416410f4e12c7fe1553da",
4
+ "src/client/App.tsx": "4f6a1b915eaa200700b609bf4e318af1e5d657da7ffcc87b1aae67bd2b91cb69",
5
5
  "src/client/CodeMirrorEditor.tsx": "682248deb6d965b5417b8809763622cc48af0f7c06e8a5bfc4b1bc9698bf55f7",
6
6
  "src/client/ErrorBoundary.tsx": "d16376f9f6c7cc1fab8590c65a66438127642f7d6bb8023cec53d8a6cc9f3964",
7
7
  "src/client/FilesPanel.tsx": "d6975c9e249220c60efde1a1acf394e0575ca4469f36b3990742d91a5bbea0a6",
@@ -13,7 +13,7 @@
13
13
  "src/client/MemoryPanel.tsx": "2cc1f4ee709f6d56ede8b0ceced228ea4c935cfd1cc803275558dbbd5f5244fb",
14
14
  "src/client/SlashCommandMenu.tsx": "dd29113212c10515873305b5219a6edae80c938980903e0087aacaa0d8c1f18c",
15
15
  "src/client/Tabs.tsx": "6e48f318b1fe4678f438c6e2a41eeb49e89ee9c67b981f7d6154cd7060a048ab",
16
- "src/client/TerminalPanel.tsx": "4cbf3b7cbcb021eb5ca1c27daefb32f77253426645e53216b288ae673e87b01e",
16
+ "src/client/TerminalPanel.tsx": "6a8dbb0e0806ccfef6fd67ae16f580177dca9a7a8943fd5b801da555e424ad72",
17
17
  "src/client/WorkflowCard.tsx": "451e22b492e12ad3d7040c4a1af67477bb974137c18a6873574644fefcebdefe",
18
18
  "src/client/editor-languages.ts": "d5319cfd9b9f3b07c2599ba64ec49a9038304d09fa1702302f3b2b97493d0a69",
19
19
  "src/client/errors.ts": "4f6c3f7bb21a93b9caae6f12f981318db68c901fcb02a2ba548d3b2987631c36",
@@ -23,13 +23,13 @@
23
23
  "src/client/markdown.ts": "1499893ea5ce29d49f26c193cc0e6001ffa8a31d039ccee343ba407cd2cdbf1b",
24
24
  "src/client/pending-operations.ts": "8a5f9e9711c0f875c8ed194196c218162de5270298dad4091351d41294c859d7",
25
25
  "src/client/slash-commands.ts": "a202263497e3ca023e40f3462e04f858cfbddb5ed19a40d188bd5363f3762621",
26
- "src/client/styles.css": "50188bc0126329b0a6abfa5e0159dee0a01350cf642486fbc26150c9280ee9d1",
26
+ "src/client/styles.css": "e37c43d51a7b4d47c026657da0474edec941c66ab2606c07758e5d5268a8645e",
27
27
  "src/client/terminal-emulator.ts": "ffcc4f5fbddaf25cebcc9e03dbe5d7d0ad2c21586f5d169e57c04c82e2308b3b",
28
- "src/client/theme.tsx": "3b9170c97479d71a66d585a87510ad55a8c686db7685d847ac5597048ea4d930",
28
+ "src/client/theme.tsx": "29e0db10f924a449732efab0515e577034062c69f4db55158954d88f157f6119",
29
29
  "src/client/tool-sharing.ts": "679c97f6d40be466964f2f1076aa7ea55f4a585c3deff8214675070220921059",
30
30
  "src/client/tools.ts": "58fe41f0edbd490e3fab7f12f258b1dbc2163b653553b03ac61caf1543618e50",
31
- "src/client/types.ts": "7654e95b65053d639634e0bbee2b4524831571ec59c79d4b8384d1eeb662b0cf",
31
+ "src/client/types.ts": "2edfc9065bbc42a1bfe56a7748131e335e0afef5684dca0a8ee41642b78dfc3a",
32
32
  "src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5"
33
33
  },
34
- "recordedAt": "2026-10-23T06:50:25.497Z"
34
+ "recordedAt": "2026-10-23T11:56:45.911Z"
35
35
  }
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-CvUxw4HU.js","assets/dist-D899ixlt.js","assets/index-B0TMoUBp.js","assets/index-CCnIvjP6.css","assets/dist-B0G3TOfE.js","assets/dist-Ip0mRDF1.js","assets/dist-CjyJqaHj.js","assets/dist-DC4KdKrw.js","assets/dist-BqlvAjyT.js","assets/dist-Cxo9Qf8Y.js","assets/dist--hp7cqEH.js","assets/dist-CoqrRbfm.js","assets/dist-DOuFuHYr.js","assets/dist-CcAEnfzB.js","assets/dist-Wq0CGa1P.js","assets/dist-4hqZVn6B.js","assets/dist-CAFUK38E.js","assets/dist-DOQGcum7.js","assets/dist-GQ99vtKx.js","assets/dist-CrYrGCRr.js","assets/dist-CRpnXCSn.js","assets/dist-CWcEOVNV.js","assets/dist-Dp9eqvWE.js","assets/dist-D11ifrNu.js"])))=>i.map(i=>d[i]);
2
- import{a as e,n as t,r as n,t as r}from"./index-B0TMoUBp.js";var i=e(n(),1);async function a(e,t){let[{StreamLanguage:n},i]=await Promise.all([r(()=>import(`./dist-CvUxw4HU.js`),__vite__mapDeps([0,1,2,3,4,5])),e()]),a=i[t]??i.default??i;return n.define(a)}var o={cpp:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cc:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cxx:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hpp:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hh:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hxx:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),c:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),h:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cu:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cuh:()=>r(()=>import(`./dist-CjyJqaHj.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),js:()=>r(()=>import(`./dist-BqlvAjyT.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),jsx:()=>r(()=>import(`./dist-BqlvAjyT.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),mjs:()=>r(()=>import(`./dist-BqlvAjyT.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),cjs:()=>r(()=>import(`./dist-BqlvAjyT.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),ts:()=>r(()=>import(`./dist-BqlvAjyT.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),tsx:()=>r(()=>import(`./dist-BqlvAjyT.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0,jsx:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),mts:()=>r(()=>import(`./dist-BqlvAjyT.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),cts:()=>r(()=>import(`./dist-BqlvAjyT.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),py:()=>r(()=>import(`./dist--hp7cqEH.js`).then(e=>e.python()),__vite__mapDeps([10,5,2,3,0,1,4,7,9])),pyi:()=>r(()=>import(`./dist--hp7cqEH.js`).then(e=>e.python()),__vite__mapDeps([10,5,2,3,0,1,4,7,9])),java:()=>r(()=>import(`./dist-CoqrRbfm.js`).then(e=>e.java()),__vite__mapDeps([11,5,2,3,0,1,4,7])),php:()=>r(()=>import(`./dist-DOuFuHYr.js`).then(e=>e.php()),__vite__mapDeps([12,5,2,3,0,1,4,7,13,14,8,9])),sql:()=>r(()=>import(`./dist-4hqZVn6B.js`).then(e=>e.sql()),__vite__mapDeps([15,5,2,3,0,1,4,7,9])),yaml:()=>r(()=>import(`./dist-CAFUK38E.js`).then(e=>e.yaml()),__vite__mapDeps([16,5,2,3,0,1,4,7])),yml:()=>r(()=>import(`./dist-CAFUK38E.js`).then(e=>e.yaml()),__vite__mapDeps([16,5,2,3,0,1,4,7])),xml:()=>r(()=>import(`./dist-DOQGcum7.js`).then(e=>e.xml()),__vite__mapDeps([17,1,2,3,4,5,0,7])),json:()=>r(()=>import(`./dist-GQ99vtKx.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),jsonc:()=>r(()=>import(`./dist-GQ99vtKx.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),json5:()=>r(()=>import(`./dist-GQ99vtKx.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),html:()=>r(()=>import(`./dist-CcAEnfzB.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),htm:()=>r(()=>import(`./dist-CcAEnfzB.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),vue:()=>r(()=>import(`./dist-CcAEnfzB.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),svelte:()=>r(()=>import(`./dist-CcAEnfzB.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),css:()=>r(()=>import(`./dist-Wq0CGa1P.js`).then(e=>e.r).then(e=>e.css()),__vite__mapDeps([14,2,3,5,0,1,4,7])),md:()=>r(()=>import(`./dist-CrYrGCRr.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),markdown:()=>r(()=>import(`./dist-CrYrGCRr.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),mdx:()=>r(()=>import(`./dist-CrYrGCRr.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),rs:()=>r(()=>import(`./dist-CRpnXCSn.js`).then(e=>e.rust()),__vite__mapDeps([20,5,2,3,0,1,4,7])),go:()=>r(()=>import(`./dist-CWcEOVNV.js`).then(e=>e.go()),__vite__mapDeps([21,5,2,3,0,1,4,7,9])),sh:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),bash:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),zsh:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),fish:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),ps1:()=>a(()=>r(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),psm1:()=>a(()=>r(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),rb:()=>a(()=>r(()=>import(`./ruby-ChfNwlCY.js`),[]),`ruby`),swift:()=>a(()=>r(()=>import(`./swift-DKB6_1j6.js`),[]),`swift`),toml:()=>a(()=>r(()=>import(`./toml-BPTmHmyx.js`),[]),`toml`),ini:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),cfg:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),conf:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),properties:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),dockerfile:()=>a(()=>r(()=>import(`./dockerfile-BDePf5PZ.js`),[]),`dockerfile`),diff:()=>a(()=>r(()=>import(`./diff-ChtP43wD.js`),[]),`diff`),patch:()=>a(()=>r(()=>import(`./diff-ChtP43wD.js`),[]),`diff`)},s={cpp:`C++`,cc:`C++`,cxx:`C++`,hpp:`C++`,hh:`C++`,hxx:`C++`,cu:`CUDA C++`,cuh:`CUDA C++`,c:`C`,h:`C/C++ Header`,js:`JavaScript`,jsx:`JSX`,mjs:`JavaScript`,cjs:`JavaScript`,ts:`TypeScript`,tsx:`TSX`,mts:`TypeScript`,cts:`TypeScript`,py:`Python`,pyi:`Python Stub`,java:`Java`,php:`PHP`,sql:`SQL`,yaml:`YAML`,yml:`YAML`,xml:`XML`,json:`JSON`,jsonc:`JSON with Comments`,json5:`JSON5`,css:`CSS`,md:`Markdown`,markdown:`Markdown`,mdx:`MDX`,rs:`Rust`,go:`Go`,html:`HTML`,htm:`HTML`,vue:`Vue`,svelte:`Svelte`,sh:`Shell`,bash:`Bash`,zsh:`Zsh`,fish:`Fish`,ps1:`PowerShell`,psm1:`PowerShell`,rb:`Ruby`,swift:`Swift`,toml:`TOML`,ini:`INI`,cfg:`Config`,conf:`Config`,properties:`Properties`,dockerfile:`Dockerfile`,diff:`Diff`,patch:`Patch`};function c(e){return o[e.toLowerCase()]}function l(e){return s[e.toLowerCase()]}var u=t(),d=262144,f=131072;function p(e){return e.split(`.`).pop()?.toLowerCase()??``}function m(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function h(e,t){return e.HighlightStyle.define([{tag:t.tags.keyword,color:m(`--cm-keyword`)},{tag:t.tags.string,color:m(`--cm-string`)},{tag:t.tags.number,color:m(`--cm-number`)},{tag:t.tags.comment,color:m(`--cm-comment`),fontStyle:`italic`},{tag:t.tags.function(t.tags.variableName),color:m(`--cm-function`)},{tag:t.tags.typeName,color:m(`--cm-type`)},{tag:t.tags.className,color:m(`--cm-type`)},{tag:t.tags.propertyName,color:m(`--cm-property`)},{tag:t.tags.operator,color:m(`--cm-operator`)},{tag:t.tags.variableName,color:m(`--cm-variable`)}])}function g({path:e,value:t,onChange:n,jumpToLine:a,onSave:o}){let s=(0,i.useRef)(null),m=(0,i.useRef)(null),g=(0,i.useRef)(null),_=(0,i.useRef)(null),v=(0,i.useRef)(null),y=(0,i.useRef)(n),b=(0,i.useRef)(o);y.current=n,b.current=o;let[x,S]=(0,i.useState)(!1),[C,w]=(0,i.useState)(!1),[T,E]=(0,i.useState)(`0,0`);(0,i.useEffect)(()=>{let n=!1,i,a,o,l;return(async()=>{try{let u=p(e),f=c(u),[x,C,T,D,O,k,A]=await Promise.all([r(()=>import(`./dist-D899ixlt.js`).then(e=>e.x),__vite__mapDeps([1,2,3])),r(()=>import(`./dist-B0G3TOfE.js`).then(e=>e.s),__vite__mapDeps([4,2,3,1])),r(()=>import(`./dist-Dp9eqvWE.js`),__vite__mapDeps([22,1,2,3,4,5,0])),r(()=>import(`./dist-D11ifrNu.js`),__vite__mapDeps([23,1,2,3,4])),r(()=>import(`./dist-CvUxw4HU.js`),__vite__mapDeps([0,1,2,3,4,5])),r(()=>import(`./dist-Ip0mRDF1.js`).then(e=>e.n),__vite__mapDeps([5,2,3])),f?f().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${u}:`,e),null)):Promise.resolve(null)]);if(n||!s.current)return;o=O,l=k,_.current=x.Annotation.define(),v.current=x.Transaction.addToHistory;let j=t.length<=d&&A!==null;a=new x.Compartment;let M=[C.lineNumbers(),C.highlightActiveLine(),C.drawSelection(),T.history(),C.keymap.of([T.indentWithTab,...T.defaultKeymap,...T.historyKeymap,...D.searchKeymap,{key:`Mod-s`,run:()=>(b.current(),!0)}]),C.EditorView.updateListener.of(e=>{e.docChanged&&!(_.current&&e.transactions.some(e=>e.annotation(_.current)===!0))&&y.current(e.state.doc.toString()),e.selectionSet&&E(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),C.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(A)try{M.push(A)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${u}:`,e),j=!1}if(j&&a&&o&&l)try{M.push(a.of(o.syntaxHighlighting(h(o,l))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${u}:`,e),j=!1}if(i=new C.EditorView({state:x.EditorState.create({doc:t,extensions:M}),parent:s.current}),n){i.destroy();return}m.current=i,S(j),w(!0);let N=new MutationObserver(()=>{let e=m.current;if(e&&j&&a&&o&&l)try{e.dispatch({effects:a.reconfigure(o.syntaxHighlighting(h(o,l)))})}catch{}});g.current=N,N.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),n||w(!0)}})(),()=>{n=!0,g.current?.disconnect(),g.current=null,i?.destroy(),m.current=null,w(!1),s.current&&(s.current.textContent=``)}},[e]),(0,i.useEffect)(()=>{let e=m.current;if(!e)return;let n=e.state.doc.toString();n!==t&&e.dispatch({changes:{from:0,to:n.length,insert:t},annotations:_.current?_.current.of(!0):void 0})},[t]),(0,i.useEffect)(()=>{let e=m.current;if(!e||!a)return;let t=e.state.doc.line(Math.min(Math.max(1,a.line),e.state.doc.lines));e.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0}),e.focus()},[a,C]);let D=m.current?.state.doc.toString()??t,O=D.length<=f?D:D.slice(0,f),k=p(e),A=l(k);return(0,u.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":O,"data-file-content-truncated":D.length>f?`1`:`0`,"data-file-selection":T,"data-file-editor-ready":C?`1`:`0`,onMouseDown:()=>m.current?.focus(),children:[(0,u.jsx)(`div`,{className:`file-cm`,ref:s,"aria-label":`编辑 ${e}`}),!C&&(0,u.jsx)(`span`,{className:`file-cm-status`,"data-file-editor-loading":`1`,children:`⌛ 正在加载编辑器…`}),C&&!x&&(0,u.jsx)(`span`,{className:`file-cm-status`,"data-file-highlight-status":`plain`,children:`纯文本`}),C&&x&&A&&(0,u.jsx)(`span`,{className:`file-cm-status file-cm-status-lang`,"data-file-highlight-status":k,children:A})]})}export{g as CodeMirrorEditor};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-C1W6z7MQ.js","assets/dist-Boojk5ek.js","assets/index-LL00oFAG.js","assets/index-4kjGwKOr.css","assets/dist-DXsLC1J6.js","assets/dist-DAs0bmNx.js","assets/dist-BNFxxYvs.js","assets/dist-D_E1E9X4.js","assets/dist-D-1R5iHi.js","assets/dist-RFhXNQyY.js","assets/dist-U-IA_cdZ.js","assets/dist-D8wvXcz3.js","assets/dist-BZB9Z8C-.js","assets/dist-CwC6b2Cl.js","assets/dist-BwJvT1Pb.js","assets/dist-C1MR_bG_.js","assets/dist-CIxJmM-_.js","assets/dist-BZ-HTc7j.js","assets/dist-BuO7_0WE.js","assets/dist-BkzoxIX4.js","assets/dist-Bf28S0tQ.js","assets/dist-BdNKDCbA.js","assets/dist-CROgPs2p.js","assets/dist-Bea-jKEE.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,n as t,r as n,t as r}from"./index-LL00oFAG.js";var i=e(n(),1);async function a(e,t){let[{StreamLanguage:n},i]=await Promise.all([r(()=>import(`./dist-C1W6z7MQ.js`),__vite__mapDeps([0,1,2,3,4,5])),e()]),a=i[t]??i.default??i;return n.define(a)}var o={cpp:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cc:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cxx:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hpp:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hh:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hxx:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),c:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),h:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cu:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cuh:()=>r(()=>import(`./dist-BNFxxYvs.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),js:()=>r(()=>import(`./dist-D-1R5iHi.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),jsx:()=>r(()=>import(`./dist-D-1R5iHi.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),mjs:()=>r(()=>import(`./dist-D-1R5iHi.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),cjs:()=>r(()=>import(`./dist-D-1R5iHi.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),ts:()=>r(()=>import(`./dist-D-1R5iHi.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),tsx:()=>r(()=>import(`./dist-D-1R5iHi.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0,jsx:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),mts:()=>r(()=>import(`./dist-D-1R5iHi.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),cts:()=>r(()=>import(`./dist-D-1R5iHi.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),py:()=>r(()=>import(`./dist-U-IA_cdZ.js`).then(e=>e.python()),__vite__mapDeps([10,5,2,3,0,1,4,7,9])),pyi:()=>r(()=>import(`./dist-U-IA_cdZ.js`).then(e=>e.python()),__vite__mapDeps([10,5,2,3,0,1,4,7,9])),java:()=>r(()=>import(`./dist-D8wvXcz3.js`).then(e=>e.java()),__vite__mapDeps([11,5,2,3,0,1,4,7])),php:()=>r(()=>import(`./dist-BZB9Z8C-.js`).then(e=>e.php()),__vite__mapDeps([12,5,2,3,0,1,4,7,13,14,8,9])),sql:()=>r(()=>import(`./dist-C1MR_bG_.js`).then(e=>e.sql()),__vite__mapDeps([15,5,2,3,0,1,4,7,9])),yaml:()=>r(()=>import(`./dist-CIxJmM-_.js`).then(e=>e.yaml()),__vite__mapDeps([16,5,2,3,0,1,4,7])),yml:()=>r(()=>import(`./dist-CIxJmM-_.js`).then(e=>e.yaml()),__vite__mapDeps([16,5,2,3,0,1,4,7])),xml:()=>r(()=>import(`./dist-BZ-HTc7j.js`).then(e=>e.xml()),__vite__mapDeps([17,1,2,3,4,5,0,7])),json:()=>r(()=>import(`./dist-BuO7_0WE.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),jsonc:()=>r(()=>import(`./dist-BuO7_0WE.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),json5:()=>r(()=>import(`./dist-BuO7_0WE.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),html:()=>r(()=>import(`./dist-CwC6b2Cl.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),htm:()=>r(()=>import(`./dist-CwC6b2Cl.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),vue:()=>r(()=>import(`./dist-CwC6b2Cl.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),svelte:()=>r(()=>import(`./dist-CwC6b2Cl.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),css:()=>r(()=>import(`./dist-BwJvT1Pb.js`).then(e=>e.r).then(e=>e.css()),__vite__mapDeps([14,2,3,5,0,1,4,7])),md:()=>r(()=>import(`./dist-BkzoxIX4.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),markdown:()=>r(()=>import(`./dist-BkzoxIX4.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),mdx:()=>r(()=>import(`./dist-BkzoxIX4.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),rs:()=>r(()=>import(`./dist-Bf28S0tQ.js`).then(e=>e.rust()),__vite__mapDeps([20,5,2,3,0,1,4,7])),go:()=>r(()=>import(`./dist-BdNKDCbA.js`).then(e=>e.go()),__vite__mapDeps([21,5,2,3,0,1,4,7,9])),sh:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),bash:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),zsh:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),fish:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),ps1:()=>a(()=>r(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),psm1:()=>a(()=>r(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),rb:()=>a(()=>r(()=>import(`./ruby-ChfNwlCY.js`),[]),`ruby`),swift:()=>a(()=>r(()=>import(`./swift-DKB6_1j6.js`),[]),`swift`),toml:()=>a(()=>r(()=>import(`./toml-BPTmHmyx.js`),[]),`toml`),ini:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),cfg:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),conf:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),properties:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),dockerfile:()=>a(()=>r(()=>import(`./dockerfile-BDePf5PZ.js`),[]),`dockerfile`),diff:()=>a(()=>r(()=>import(`./diff-ChtP43wD.js`),[]),`diff`),patch:()=>a(()=>r(()=>import(`./diff-ChtP43wD.js`),[]),`diff`)},s={cpp:`C++`,cc:`C++`,cxx:`C++`,hpp:`C++`,hh:`C++`,hxx:`C++`,cu:`CUDA C++`,cuh:`CUDA C++`,c:`C`,h:`C/C++ Header`,js:`JavaScript`,jsx:`JSX`,mjs:`JavaScript`,cjs:`JavaScript`,ts:`TypeScript`,tsx:`TSX`,mts:`TypeScript`,cts:`TypeScript`,py:`Python`,pyi:`Python Stub`,java:`Java`,php:`PHP`,sql:`SQL`,yaml:`YAML`,yml:`YAML`,xml:`XML`,json:`JSON`,jsonc:`JSON with Comments`,json5:`JSON5`,css:`CSS`,md:`Markdown`,markdown:`Markdown`,mdx:`MDX`,rs:`Rust`,go:`Go`,html:`HTML`,htm:`HTML`,vue:`Vue`,svelte:`Svelte`,sh:`Shell`,bash:`Bash`,zsh:`Zsh`,fish:`Fish`,ps1:`PowerShell`,psm1:`PowerShell`,rb:`Ruby`,swift:`Swift`,toml:`TOML`,ini:`INI`,cfg:`Config`,conf:`Config`,properties:`Properties`,dockerfile:`Dockerfile`,diff:`Diff`,patch:`Patch`};function c(e){return o[e.toLowerCase()]}function l(e){return s[e.toLowerCase()]}var u=t(),d=262144,f=131072;function p(e){return e.split(`.`).pop()?.toLowerCase()??``}function m(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function h(e,t){return e.HighlightStyle.define([{tag:t.tags.keyword,color:m(`--cm-keyword`)},{tag:t.tags.string,color:m(`--cm-string`)},{tag:t.tags.number,color:m(`--cm-number`)},{tag:t.tags.comment,color:m(`--cm-comment`),fontStyle:`italic`},{tag:t.tags.function(t.tags.variableName),color:m(`--cm-function`)},{tag:t.tags.typeName,color:m(`--cm-type`)},{tag:t.tags.className,color:m(`--cm-type`)},{tag:t.tags.propertyName,color:m(`--cm-property`)},{tag:t.tags.operator,color:m(`--cm-operator`)},{tag:t.tags.variableName,color:m(`--cm-variable`)}])}function g({path:e,value:t,onChange:n,jumpToLine:a,onSave:o}){let s=(0,i.useRef)(null),m=(0,i.useRef)(null),g=(0,i.useRef)(null),_=(0,i.useRef)(null),v=(0,i.useRef)(null),y=(0,i.useRef)(n),b=(0,i.useRef)(o);y.current=n,b.current=o;let[x,S]=(0,i.useState)(!1),[C,w]=(0,i.useState)(!1),[T,E]=(0,i.useState)(`0,0`);(0,i.useEffect)(()=>{let n=!1,i,a,o,l;return(async()=>{try{let u=p(e),f=c(u),[x,C,T,D,O,k,A]=await Promise.all([r(()=>import(`./dist-Boojk5ek.js`).then(e=>e.x),__vite__mapDeps([1,2,3])),r(()=>import(`./dist-DXsLC1J6.js`).then(e=>e.s),__vite__mapDeps([4,2,3,1])),r(()=>import(`./dist-CROgPs2p.js`),__vite__mapDeps([22,1,2,3,4,5,0])),r(()=>import(`./dist-Bea-jKEE.js`),__vite__mapDeps([23,1,2,3,4])),r(()=>import(`./dist-C1W6z7MQ.js`),__vite__mapDeps([0,1,2,3,4,5])),r(()=>import(`./dist-DAs0bmNx.js`).then(e=>e.n),__vite__mapDeps([5,2,3])),f?f().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${u}:`,e),null)):Promise.resolve(null)]);if(n||!s.current)return;o=O,l=k,_.current=x.Annotation.define(),v.current=x.Transaction.addToHistory;let j=t.length<=d&&A!==null;a=new x.Compartment;let M=[C.lineNumbers(),C.highlightActiveLine(),C.drawSelection(),T.history(),C.keymap.of([T.indentWithTab,...T.defaultKeymap,...T.historyKeymap,...D.searchKeymap,{key:`Mod-s`,run:()=>(b.current(),!0)}]),C.EditorView.updateListener.of(e=>{e.docChanged&&!(_.current&&e.transactions.some(e=>e.annotation(_.current)===!0))&&y.current(e.state.doc.toString()),e.selectionSet&&E(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),C.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(A)try{M.push(A)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${u}:`,e),j=!1}if(j&&a&&o&&l)try{M.push(a.of(o.syntaxHighlighting(h(o,l))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${u}:`,e),j=!1}if(i=new C.EditorView({state:x.EditorState.create({doc:t,extensions:M}),parent:s.current}),n){i.destroy();return}m.current=i,S(j),w(!0);let N=new MutationObserver(()=>{let e=m.current;if(e&&j&&a&&o&&l)try{e.dispatch({effects:a.reconfigure(o.syntaxHighlighting(h(o,l)))})}catch{}});g.current=N,N.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),n||w(!0)}})(),()=>{n=!0,g.current?.disconnect(),g.current=null,i?.destroy(),m.current=null,w(!1),s.current&&(s.current.textContent=``)}},[e]),(0,i.useEffect)(()=>{let e=m.current;if(!e)return;let n=e.state.doc.toString();n!==t&&e.dispatch({changes:{from:0,to:n.length,insert:t},annotations:_.current?_.current.of(!0):void 0})},[t]),(0,i.useEffect)(()=>{let e=m.current;if(!e||!a)return;let t=e.state.doc.line(Math.min(Math.max(1,a.line),e.state.doc.lines));e.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0}),e.focus()},[a,C]);let D=m.current?.state.doc.toString()??t,O=D.length<=f?D:D.slice(0,f),k=p(e),A=l(k);return(0,u.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":O,"data-file-content-truncated":D.length>f?`1`:`0`,"data-file-selection":T,"data-file-editor-ready":C?`1`:`0`,onMouseDown:()=>m.current?.focus(),children:[(0,u.jsx)(`div`,{className:`file-cm`,ref:s,"aria-label":`编辑 ${e}`}),!C&&(0,u.jsx)(`span`,{className:`file-cm-status`,"data-file-editor-loading":`1`,children:`⌛ 正在加载编辑器…`}),C&&!x&&(0,u.jsx)(`span`,{className:`file-cm-status`,"data-file-highlight-status":`plain`,children:`纯文本`}),C&&x&&A&&(0,u.jsx)(`span`,{className:`file-cm-status file-cm-status-lang`,"data-file-highlight-status":k,children:A})]})}export{g as CodeMirrorEditor};