@evandu/super-pi 0.1.278 → 0.1.280
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.
- package/desktop/main.cjs +5 -1
- package/dist/.super-pi-check-inputs.json +2 -2
- package/dist/client/.super-pi-client-sources.json +4 -4
- package/dist/client/assets/{CodeMirrorEditor-CmfIAppR.js → CodeMirrorEditor-D-UuYizz.js} +1 -1
- package/dist/client/assets/{GitDiffEditor-BZ2Kff1j.js → GitDiffEditor-Bt1n2la-.js} +1 -1
- package/dist/client/assets/{index-sXiJhOAC.js → index-rWE1xu-t.js} +5 -5
- package/dist/client/index.html +1 -1
- package/dist/server/application/rsi-service.js +17 -4
- package/package.json +1 -2
package/desktop/main.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const { handoffDesktop } = require("./restart-handoff.cjs");
|
|
|
12
12
|
const { ensureShellEntries } = require("./shell-entries.cjs");
|
|
13
13
|
const { loadWindowState, trackWindowState } = require("./window-state.cjs");
|
|
14
14
|
const desktopVersion = require("../package.json").version;
|
|
15
|
+
const trace = stage => { if (process.env.SUPER_PI_DESKTOP_DIAGNOSTICS === "1") console.log(`[desktop] ${stage} pid=${process.pid}`); };
|
|
15
16
|
|
|
16
17
|
const exec = promisify(execFile), root = resolve(__dirname, "..");
|
|
17
18
|
const dataDir = process.env.SUPER_PI_DATA_DIR || join(homedir(), ".super-pi");
|
|
@@ -71,6 +72,7 @@ async function nodeBinary() {
|
|
|
71
72
|
return node;
|
|
72
73
|
}
|
|
73
74
|
async function startManager() {
|
|
75
|
+
trace("manager-start");
|
|
74
76
|
const saved = await config();
|
|
75
77
|
const port = Number(process.env.SUPER_PI_DESKTOP_PORT || saved.port || 3080);
|
|
76
78
|
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("本地服务端口无效");
|
|
@@ -119,6 +121,7 @@ async function setAutoStart(enabled) {
|
|
|
119
121
|
function show() { if (mainWindow?.isMinimized()) mainWindow.restore(); mainWindow?.show(); windowMemory?.restore(); mainWindow?.focus(); }
|
|
120
122
|
function external(url) { try { const parsed = new URL(url); if (["http:", "https:", "mailto:"].includes(parsed.protocol) && !parsed.username && !parsed.password) void shell.openExternal(parsed.href); } catch {} }
|
|
121
123
|
async function createWindow() {
|
|
124
|
+
trace("window-create");
|
|
122
125
|
await ensureShellEntries({ app, shell, node: await nodeBinary(), root, dataDir });
|
|
123
126
|
const image = nativeImage.createFromPath(join(__dirname, "icon.png"));
|
|
124
127
|
if (process.platform === "darwin") app.dock?.setIcon(image);
|
|
@@ -160,6 +163,7 @@ async function createWindow() {
|
|
|
160
163
|
tray = new Tray(trayImage); tray.setToolTip("Super Pi · 本地管理服务运行中"); tray.setContextMenu(trayMenu); tray.on("double-click", show); tray.on("click", show);
|
|
161
164
|
Menu.setApplicationMenu(Menu.buildFromTemplate([{ label: "Super Pi", submenu: [{ label: "在浏览器打开", click: () => external(origin) }, { label: "隐藏到托盘", click: () => mainWindow.hide() }, { type: "separator" }, { role: "quit", label: "退出 Super Pi" }] }, { role: "editMenu", label: "编辑" }, { role: "viewMenu", label: "视图" }, { role: "windowMenu", label: "窗口" }]));
|
|
162
165
|
await mainWindow.loadURL(origin);
|
|
166
|
+
trace("window-loaded");
|
|
163
167
|
monitorUpdates();
|
|
164
168
|
if (!process.argv.includes("--hidden")) show();
|
|
165
169
|
}
|
|
@@ -176,5 +180,5 @@ else {
|
|
|
176
180
|
void fetch(`${origin}/api/shutdown`, { method: "POST", signal: AbortSignal.timeout(5000) }).catch(() => {}).finally(() => { setTimeout(() => { if (server.exitCode === null) server.kill(); app.quit(); }, 1000); });
|
|
177
181
|
}
|
|
178
182
|
});
|
|
179
|
-
app.whenReady().then(startManager).then(createWindow).catch(error => { dialog.showErrorBox("Super Pi 启动失败", error.message); quitting = true; server?.kill(); app.quit(); });
|
|
183
|
+
app.whenReady().then(startManager).then(createWindow).catch(error => { console.error("Super Pi desktop startup failed:", error); dialog.showErrorBox("Super Pi 启动失败", error.message); quitting = true; server?.kill(); app.quit(); });
|
|
180
184
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"hash": "
|
|
2
|
+
"hash": "a523ccec5b169bc1489aa8883b02cb2a2d0b017029e72307c477c7235042d525",
|
|
3
3
|
"files": {
|
|
4
|
-
"src/client/AnchoredPopover.tsx": "
|
|
4
|
+
"src/client/AnchoredPopover.tsx": "3d683cc9e4305678141c83987a37a36b3da30e20d7bd17ea8e48a72504475605",
|
|
5
5
|
"src/client/App.tsx": "0f0b71bd86ade3a426026544f3570114c0b67dfd6fa41776c7358a26a5286805",
|
|
6
6
|
"src/client/CacheWarmingSettings.tsx": "cce26c4547634b76c08c681a4b9605f884d8502f554f12ff8c30cbd2fd0bd9c0",
|
|
7
7
|
"src/client/CodeMirrorEditor.tsx": "af0d14129d19f44515fcd1b679627245eb746ccc7fe4aeeae4d0e8c3ade51476",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"src/client/NativeToolsPanel.tsx": "31e544b6def3cf0b09d86c485846c48cf787c518575b34aaceb930a8a68c96b6",
|
|
31
31
|
"src/client/PresentationPreview.css": "8b9ee9b74d46b51007df18cfb8743666b677be2155a4ab94378df67a16648592",
|
|
32
32
|
"src/client/PresentationPreview.tsx": "fdc0eb533ee54936dcf21eb766071185ff71f26079b6a08e70827639e64dfca8",
|
|
33
|
-
"src/client/ProjectControlPanel.tsx": "
|
|
33
|
+
"src/client/ProjectControlPanel.tsx": "d77ecc6fdb0583fa82de204d0723e24abefd64440f4867dcbacebd34fc9f9e58",
|
|
34
34
|
"src/client/ProviderNetworkSettings.tsx": "917c46fa6c4d24ec3e90f3365d313e7b97c070cf09d4d5c81cdea0fd31686138",
|
|
35
35
|
"src/client/RsiPanel.tsx": "21d1de1a8d8de69735e3afc1d2616b2f480fa17296df1db7f0d3cde5a2c9ff70",
|
|
36
36
|
"src/client/ScheduledTasksPanel.tsx": "ed69d3617b6e4dc1a815cbf1a8d675c7c2010061b9fe2eac216813527c9cd7ab",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"src/client/workbench-navigation.ts": "3b229752a8ce4a45eba7aeff040eb33001413190141f1e9b8e5f38246a1761e2",
|
|
103
103
|
"src/client/workbench-search-panel.css": "6978c03db4f17411e9064242b0ff786a520ee8cf58fe8a9d0ea42872ba3737f0"
|
|
104
104
|
},
|
|
105
|
-
"recordedAt": "2026-11-
|
|
105
|
+
"recordedAt": "2026-11-22T13:29:17.402Z"
|
|
106
106
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-D978o95T.js","assets/rolldown-runtime-XKyaHtl9.js","assets/dist-B3-a6uF0.js","assets/dist-CX_Hm4GS.js","assets/dist-Cus6_oaF.js","assets/dist-J6XWqRpB.js","assets/dist-scBkrwv-.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{c as t,d as n,f as r,l as i,n as a,r as o,u as s}from"./index-
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{c as t,d as n,f as r,l as i,n as a,r as o,u as s}from"./index-rWE1xu-t.js";var c=e(r(),1),l=n(),u=262144,d=131072;function f(e){return e.split(`.`).pop()?.toLowerCase()??``}function p(e,t,n=!1){let r=e=>n?`var(--git-diff-${e.slice(5)}, var(${e}))`:`var(${e})`;return e.HighlightStyle.define([{tag:t.tags.keyword,color:r(`--cm-keyword`)},{tag:t.tags.string,color:r(`--cm-string`)},{tag:t.tags.number,color:r(`--cm-number`)},{tag:t.tags.comment,color:r(`--cm-comment`),fontStyle:`italic`},{tag:t.tags.function(t.tags.variableName),color:r(`--cm-function`)},{tag:t.tags.typeName,color:r(`--cm-type`)},{tag:t.tags.className,color:r(`--cm-type`)},{tag:t.tags.propertyName,color:r(`--cm-property`)},{tag:t.tags.operator,color:r(`--cm-operator`)},{tag:t.tags.variableName,color:r(`--cm-variable`)}])}function m({path:e,value:n,onChange:r,jumpToLine:m,onSave:h,workspaceId:g,blame:_,onPosition:v,readOnly:y=!1,languageOverride:b}){let x=(0,c.useRef)(null),S=(0,c.useRef)(null),C=(0,c.useRef)(void 0),w=(0,c.useRef)(null),T=(0,c.useRef)(null),E=(0,c.useRef)(null),D=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(r),j=(0,c.useRef)(h);A.current=r,j.current=h;let[M,N]=(0,c.useState)(!1),[P,F]=(0,c.useState)(!1),[I,L]=(0,c.useState)(`0,0`),[R,z]=(0,c.useState)(0);(0,c.useEffect)(()=>{let t=!1,r,a,c,l,d;return(async()=>{try{let m=b??f(e),h=i(m),[_,v,M,P,I,R,B,V]=await Promise.all([s(()=>import(`./dist-D978o95T.js`).then(e=>e.S),__vite__mapDeps([0,1])),s(()=>import(`./dist-B3-a6uF0.js`).then(e=>e.s),__vite__mapDeps([2,1,0])),s(()=>import(`./dist-CX_Hm4GS.js`),__vite__mapDeps([3,0,1,2,4,5])),s(()=>import(`./dist-scBkrwv-.js`),__vite__mapDeps([6,0,1,2])),s(()=>import(`./dist-J6XWqRpB.js`).then(e=>e.d),__vite__mapDeps([5,1,0,2,4])),s(()=>import(`./dist-Cus6_oaF.js`).then(e=>e.n),__vite__mapDeps([4,1])),h?h().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${m}:`,e),null)):Promise.resolve(null),o().catch(e=>(console.warn(`[CodeMirror] Failed to build the blame extension:`,e),null))]);if(t||!x.current)return;l=I,d=R,T.current=_.Annotation.define(),E.current=_.Transaction.addToHistory;let H=n.length<=u&&B!==null;a=new _.Compartment;let U=[v.lineNumbers(),v.highlightActiveLine(),v.drawSelection(),M.history(),v.keymap.of([M.indentWithTab,...M.defaultKeymap,...M.historyKeymap,...P.searchKeymap,{key:`Mod-s`,run:()=>(j.current(),!0)}]),v.EditorView.updateListener.of(e=>{e.docChanged&&!(T.current&&e.transactions.some(e=>e.annotation(T.current)===!0))&&A.current(e.state.doc.toString()),e.selectionSet&&L(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),v.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(y&&U.push(_.EditorState.readOnly.of(!0),v.EditorView.editable.of(!1)),V&&!y&&(c=new _.Compartment,U.splice(1,0,c.of([])),U.push(V.base)),B)try{U.push(B)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${m}:`,e),H=!1}if(H&&a&&l&&d)try{U.push(a.of(l.syntaxHighlighting(p(l,d))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${m}:`,e),H=!1}let W=C.current,G=W?.scope===JSON.stringify([g,e])&&W.state.doc.toString()===n,K=G?W.state.update({effects:_.StateEffect.reconfigure.of(U)}).state:_.EditorState.create({doc:n,extensions:U});if(r=new v.EditorView({state:K,parent:x.current}),G&&(r.scrollDOM.scrollTop=W.top,r.scrollDOM.scrollLeft=W.left),t){r.destroy();return}S.current=r,N(H),F(!0),D.current=V,O.current=c??null,k.current=null,z(e=>e+1);let q=new MutationObserver(()=>{let e=S.current;if(e&&H&&a&&l&&d)try{e.dispatch({effects:a.reconfigure(l.syntaxHighlighting(p(l,d)))})}catch{}});w.current=q,q.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),t||F(!0)}})(),()=>{t=!0,w.current?.disconnect(),w.current=null,r&&(C.current={scope:JSON.stringify([g,e]),state:r.state,top:r.scrollDOM.scrollTop,left:r.scrollDOM.scrollLeft}),r?.destroy(),S.current=null,F(!1),x.current&&(x.current.textContent=``)}},[e,y,b]),(0,c.useEffect)(()=>{let e=S.current;if(!e)return;let t=e.state.doc.toString();t!==n&&e.dispatch({changes:{from:0,to:t.length,insert:n},annotations:T.current?T.current.of(!0):void 0})},[n]),(0,c.useEffect)(()=>{let e=S.current;if(!e||!m)return;let t=e.state.doc.line(Math.min(Math.max(1,m.line),e.state.doc.lines)),n=Math.min(t.to,t.from+(m.column??1)-1);e.dispatch({selection:{anchor:t.to,head:n},scrollIntoView:!0}),e.focus()},[m,P]);let B=!!(_&&_.state===`ready`&&_.response&&_.path===e&&_.workspaceId===g);(0,c.useEffect)(()=>{let t=S.current,n=D.current,r=O.current;if(!t||!n||!r)return;let i=_&&_.state===`ready`&&_.response&&_.path===e&&_.workspaceId===g?_.response:null,o=i?a(i):null;k.current!==o&&(k.current=o,t.dispatch({effects:[n.setBlame.of(o),r.reconfigure(o?n.gutter:[])]}))},[_?.state,_?.response,_?.path,_?.workspaceId,e,g,R]);let V=S.current?.state.doc.toString()??n,H=V.length<=d?V:V.slice(0,d),U=b??f(e),W=t(U),G=S.current?.state,K=G?.selection.main.head,q=K===void 0?void 0:G?.doc.lineAt(K),J=q?.number,Y=K!==void 0&&q?K-q.from+1:void 0;return(0,c.useEffect)(()=>{P&&J!==void 0&&Y!==void 0&&v?.({line:J,column:Y,language:M&&W||`纯文本`,highlight:M?U:`plain`})},[P,J,Y,M,W,U,v]),(0,c.useEffect)(()=>()=>v?.(),[v]),(0,l.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":H,"data-file-content-truncated":V.length>d?`1`:`0`,"data-file-selection":I,"data-file-editor-ready":P?`1`:`0`,"data-file-blame-gutter":B?`1`:void 0,onMouseDown:()=>S.current?.focus(),children:[(0,l.jsx)(`div`,{className:`file-cm`,ref:x,"aria-label":`${y?`查看`:`编辑`} ${e}`}),(!P||!v)&&(0,l.jsxs)(`div`,{className:`file-editor-status`,children:[!P&&(0,l.jsx)(`span`,{"data-file-editor-loading":`1`,children:`正在加载编辑器…`}),P&&K!==void 0&&q&&(0,l.jsxs)(`span`,{children:[`第 `,q.number,` 行,第 `,K-q.from+1,` 列`]}),P&&!M&&(0,l.jsx)(`span`,{"data-file-highlight-status":`plain`,children:`纯文本`}),P&&M&&W&&(0,l.jsx)(`span`,{"data-file-highlight-status":U,children:W})]})]})}export{m as CodeMirrorEditor,p as themeHighlightStyle};
|