pi-web-ui 0.43.0 → 0.44.1
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/dist/server/client-state.js +2 -0
- package/dist/server/index.js +1 -0
- package/dist/server/settings-service.js +6 -0
- package/package.json +1 -1
- package/themes/md-preview.css +39 -0
- package/themes/white.css +39 -0
- package/web/dist/assets/{TerminalPanel-BeTRtKaL.js → TerminalPanel-D29yC6uX.js} +1 -1
- package/web/dist/assets/index-DcIUI-e4.js +19 -0
- package/web/dist/index.html +1 -1
- package/web/dist/assets/index-DPc38E4m.js +0 -19
|
@@ -177,6 +177,7 @@ export class ClientStateStore {
|
|
|
177
177
|
terminalToolsEnabled: s?.settings?.terminalToolsEnabled ?? true,
|
|
178
178
|
terminalBash: s?.settings?.terminalBash ?? false,
|
|
179
179
|
terminalBashIdleMs: s?.settings?.terminalBashIdleMs ?? 15_000,
|
|
180
|
+
thinkingWrap: s?.settings?.thinkingWrap ?? false,
|
|
180
181
|
visionBridgeEnabled: s?.settings?.visionBridgeEnabled ?? true,
|
|
181
182
|
visionBridgeModel: s?.settings?.visionBridgeModel ?? null,
|
|
182
183
|
visionBridgePromptMode: s?.settings?.visionBridgePromptMode === "replace" ? "replace" : "append",
|
|
@@ -199,6 +200,7 @@ export class ClientStateStore {
|
|
|
199
200
|
terminalToolsEnabled: settings.terminalToolsEnabled ?? cur.terminalToolsEnabled ?? true,
|
|
200
201
|
terminalBash: settings.terminalBash ?? cur.terminalBash ?? false,
|
|
201
202
|
terminalBashIdleMs: settings.terminalBashIdleMs ?? cur.terminalBashIdleMs ?? 15_000,
|
|
203
|
+
thinkingWrap: settings.thinkingWrap ?? cur.thinkingWrap ?? false,
|
|
202
204
|
visionBridgeEnabled: settings.visionBridgeEnabled ?? cur.visionBridgeEnabled ?? true,
|
|
203
205
|
visionBridgeModel: settings.visionBridgeModel ?? cur.visionBridgeModel ?? null,
|
|
204
206
|
visionBridgePromptMode: settings.visionBridgePromptMode ??
|
package/dist/server/index.js
CHANGED
|
@@ -716,6 +716,7 @@ wss.on("connection", (ws) => {
|
|
|
716
716
|
terminalToolsEnabled: msg.terminalToolsEnabled,
|
|
717
717
|
terminalBash: msg.terminalBash,
|
|
718
718
|
terminalBashIdleMs: msg.terminalBashIdleMs,
|
|
719
|
+
thinkingWrap: msg.thinkingWrap,
|
|
719
720
|
visionBridgeEnabled: msg.visionBridgeEnabled,
|
|
720
721
|
visionBridgeModel: msg.visionBridgeModel,
|
|
721
722
|
visionBridgePromptMode: msg.visionBridgePromptMode,
|
|
@@ -102,6 +102,7 @@ export class SettingsService {
|
|
|
102
102
|
terminalToolsEnabled: this.settings.terminalToolsEnabled,
|
|
103
103
|
terminalBash: this.settings.terminalBash,
|
|
104
104
|
terminalBashIdleMs: this.settings.terminalBashIdleMs,
|
|
105
|
+
thinkingWrap: this.settings.thinkingWrap,
|
|
105
106
|
visionBridgeEnabled: this.settings.visionBridgeEnabled,
|
|
106
107
|
visionBridgeModel: this.settings.visionBridgeModel,
|
|
107
108
|
visionBridgePromptMode: this.settings.visionBridgePromptMode,
|
|
@@ -170,6 +171,9 @@ export class SettingsService {
|
|
|
170
171
|
if (partial.terminalBashIdleMs !== undefined) {
|
|
171
172
|
this.settings.terminalBashIdleMs = Math.max(0, Math.floor(partial.terminalBashIdleMs) || 0);
|
|
172
173
|
}
|
|
174
|
+
if (partial.thinkingWrap !== undefined) {
|
|
175
|
+
this.settings.thinkingWrap = partial.thinkingWrap;
|
|
176
|
+
}
|
|
173
177
|
if (partial.visionBridgeEnabled !== undefined) {
|
|
174
178
|
this.settings.visionBridgeEnabled = partial.visionBridgeEnabled;
|
|
175
179
|
}
|
|
@@ -243,6 +247,8 @@ export class SettingsService {
|
|
|
243
247
|
],
|
|
244
248
|
// Presets don't capture vision-bridge prefs — keep the current ones.
|
|
245
249
|
visionBridgeEnabled: this.settings.visionBridgeEnabled,
|
|
250
|
+
// 纯 UI 偏好不进预设——保留当前值。
|
|
251
|
+
thinkingWrap: this.settings.thinkingWrap,
|
|
246
252
|
visionBridgeModel: this.settings.visionBridgeModel,
|
|
247
253
|
visionBridgePromptMode: this.settings.visionBridgePromptMode,
|
|
248
254
|
visionBridgePrompt: this.settings.visionBridgePrompt,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-web-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.1",
|
|
4
4
|
"description": "Web chat interface for the pi coding agent, powered by the pi SDK (@earendil-works/pi-coding-agent) — one-command run, Docker/systemd/launchd deployable",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/themes/md-preview.css
CHANGED
|
@@ -3459,6 +3459,45 @@ body.panel-resizing {
|
|
|
3459
3459
|
width: 12px;
|
|
3460
3460
|
height: 12px;
|
|
3461
3461
|
}
|
|
3462
|
+
|
|
3463
|
+
/* 编辑重问里的文件/路径附件 chip(非图片) */
|
|
3464
|
+
.msg-editor-img.file-chip {
|
|
3465
|
+
width: auto;
|
|
3466
|
+
height: auto;
|
|
3467
|
+
min-height: 28px;
|
|
3468
|
+
padding: 2px 22px 2px 6px;
|
|
3469
|
+
border-radius: 6px;
|
|
3470
|
+
border: 1px solid rgba(96, 165, 250, 0.45);
|
|
3471
|
+
background: rgba(96, 165, 250, 0.12);
|
|
3472
|
+
align-items: center;
|
|
3473
|
+
}
|
|
3474
|
+
.msg-editor-file {
|
|
3475
|
+
display: inline-flex;
|
|
3476
|
+
align-items: center;
|
|
3477
|
+
gap: 5px;
|
|
3478
|
+
font-size: 12px;
|
|
3479
|
+
color: var(--text-2);
|
|
3480
|
+
max-width: 260px;
|
|
3481
|
+
}
|
|
3482
|
+
.msg-editor-file-icon {
|
|
3483
|
+
flex: none;
|
|
3484
|
+
}
|
|
3485
|
+
.msg-editor-file-name {
|
|
3486
|
+
overflow: hidden;
|
|
3487
|
+
text-overflow: ellipsis;
|
|
3488
|
+
white-space: nowrap;
|
|
3489
|
+
}
|
|
3490
|
+
.msg-editor-img.file-chip .msg-editor-img-remove {
|
|
3491
|
+
top: 3px;
|
|
3492
|
+
right: 3px;
|
|
3493
|
+
}
|
|
3494
|
+
|
|
3495
|
+
/* 编辑重问里的瞬时提示(文件过大/读取失败) */
|
|
3496
|
+
.msg-editor-notice {
|
|
3497
|
+
font-size: 11px;
|
|
3498
|
+
color: var(--amber, #f59e0b);
|
|
3499
|
+
padding: 2px 2px 4px;
|
|
3500
|
+
}
|
|
3462
3501
|
/* 拖拽悬停时整个编辑器高亮 */
|
|
3463
3502
|
.msg-editor.drag-over .msg-editor-input {
|
|
3464
3503
|
border-color: var(--accent);
|
package/themes/white.css
CHANGED
|
@@ -3458,6 +3458,45 @@ body.panel-resizing {
|
|
|
3458
3458
|
width: 12px;
|
|
3459
3459
|
height: 12px;
|
|
3460
3460
|
}
|
|
3461
|
+
|
|
3462
|
+
/* 编辑重问里的文件/路径附件 chip(非图片) */
|
|
3463
|
+
.msg-editor-img.file-chip {
|
|
3464
|
+
width: auto;
|
|
3465
|
+
height: auto;
|
|
3466
|
+
min-height: 28px;
|
|
3467
|
+
padding: 2px 22px 2px 6px;
|
|
3468
|
+
border-radius: 6px;
|
|
3469
|
+
border: 1px solid rgba(96, 165, 250, 0.45);
|
|
3470
|
+
background: rgba(96, 165, 250, 0.12);
|
|
3471
|
+
align-items: center;
|
|
3472
|
+
}
|
|
3473
|
+
.msg-editor-file {
|
|
3474
|
+
display: inline-flex;
|
|
3475
|
+
align-items: center;
|
|
3476
|
+
gap: 5px;
|
|
3477
|
+
font-size: 12px;
|
|
3478
|
+
color: var(--text-2);
|
|
3479
|
+
max-width: 260px;
|
|
3480
|
+
}
|
|
3481
|
+
.msg-editor-file-icon {
|
|
3482
|
+
flex: none;
|
|
3483
|
+
}
|
|
3484
|
+
.msg-editor-file-name {
|
|
3485
|
+
overflow: hidden;
|
|
3486
|
+
text-overflow: ellipsis;
|
|
3487
|
+
white-space: nowrap;
|
|
3488
|
+
}
|
|
3489
|
+
.msg-editor-img.file-chip .msg-editor-img-remove {
|
|
3490
|
+
top: 3px;
|
|
3491
|
+
right: 3px;
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
/* 编辑重问里的瞬时提示(文件过大/读取失败) */
|
|
3495
|
+
.msg-editor-notice {
|
|
3496
|
+
font-size: 11px;
|
|
3497
|
+
color: var(--amber, #f59e0b);
|
|
3498
|
+
padding: 2px 2px 4px;
|
|
3499
|
+
}
|
|
3461
3500
|
/* 拖拽悬停时整个编辑器高亮 */
|
|
3462
3501
|
.msg-editor.drag-over .msg-editor-input {
|
|
3463
3502
|
border-color: var(--accent);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as d,j as n}from"./markdown-DRBrS2Nf.js";import{b as $,T as R,u as O,F as P,a as K,c as q,d as L,e as B,f as J,g as X,h as G,r as Q}from"./index-
|
|
1
|
+
import{a as d,j as n}from"./markdown-DRBrS2Nf.js";import{b as $,T as R,u as O,F as P,a as K,c as q,d as L,e as B,f as J,g as X,h as G,r as Q}from"./index-DcIUI-e4.js";import{D as U,o as V}from"./xterm-D1D2FVe3.js";import"./react-C9ovnpIm.js";function W({conversationId:s,terminalId:r,command:x,cwd:a,active:f,send:m,register:v}){const w=d.useRef(null),N=d.useRef(null),b=x?JSON.stringify(x):"";return d.useEffect(()=>{const p=w.current;if(!p)return;const t=new U({theme:$(),fontFamily:'"SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace',fontSize:13,cursorBlink:!0,scrollback:8e3}),c=new V;t.loadAddon(c),t.open(p),N.current={term:t,fit:c},f&&t.focus();const h=()=>{t.options.theme=$()};window.addEventListener(R,h),t.attachCustomKeyEventHandler(o=>{var F;if(o.type!=="keydown")return!0;const E=(F=o.key)==null?void 0:F.toLowerCase();if((o.ctrlKey||o.metaKey)&&E==="v")return!1;if(o.ctrlKey&&!o.shiftKey&&!o.altKey&&E==="c"&&t.hasSelection()){const T=t.textarea;return T&&(T.value=t.getSelection(),T.select()),!1}return!0});const g=v(s,r,{write:o=>t.write(o),dispose:()=>t.dispose()}),C=()=>{try{c.fit(),m({type:"terminal_resize",terminalId:r,conversationId:s,cols:t.cols,rows:t.rows})}catch{}},j=requestAnimationFrame(()=>{try{c.fit()}catch{}m(x?{type:"run_command",terminalId:r,conversationId:s,command:x,cols:t.cols,rows:t.rows}:{type:"terminal_create",terminalId:r,conversationId:s,cwd:a,cols:t.cols,rows:t.rows})}),k=t.onData(o=>{m({type:"terminal_input",terminalId:r,conversationId:s,data:o})});let y=null;return typeof ResizeObserver<"u"&&(y=new ResizeObserver(()=>{p.offsetWidth>0&&p.offsetHeight>0&&C()}),y.observe(p)),()=>{cancelAnimationFrame(j),k.dispose(),window.removeEventListener(R,h),y==null||y.disconnect(),g(),t.dispose(),N.current=null}},[s,r,b,m,v]),d.useEffect(()=>{if(!f)return;const p=requestAnimationFrame(()=>{const t=N.current;if(t){try{t.fit.fit(),m({type:"terminal_resize",terminalId:r,conversationId:s,cols:t.term.cols,rows:t.term.rows})}catch{}t.term.focus()}});return()=>cancelAnimationFrame(p)},[f]),n.jsx("div",{ref:w,className:`term-xterm ${f?"":"hidden"}`})}const A={name:"",command:"",cwd:"${pwd}"};function se({chat:s,send:r,terminal:x}){const a=O(),[f,m]=d.useState(null),[v,w]=d.useState(!1),[N,b]=d.useState(!1),[p,t]=d.useState(null),[c,h]=d.useState(A),[g,C]=d.useState(null),j=d.useRef(null);d.useEffect(()=>{s.terminals.length===0?m(null):s.terminals.some(e=>e.id===f)||m(s.terminals[s.terminals.length-1].id)},[s.terminals,f]),d.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]);const k=e=>{var u;if(!s.ready)return;const i=Q(),l=s.activeConversationId||((u=s.state)==null?void 0:u.conversationId)||"";x.create({...e,id:i,conversationId:l,cols:e.cols??80,rows:e.rows??24,running:!0,exitCode:null}),m(i),w(!1)},y=()=>{var e;return k({title:a("terminalTitle",{n:s.terminals.length+1}),cwd:((e=s.state)==null?void 0:e.cwd)??""})},o=e=>{var u;const i=e.name||e.command,l=s.terminals.find(_=>_.title===i);if(l){x.restart(l.id),m(l.id),r({type:"run_command",terminalId:l.id,conversationId:l.conversationId,command:e,cols:80,rows:24});return}k({title:i,cwd:((u=s.state)==null?void 0:u.cwd)??"",command:e})},E=e=>{const i=s.terminals.find(l=>l.id===e);if(i&&r({type:"terminal_kill",terminalId:e,conversationId:i.conversationId}),x.close(e),f===e){const l=s.terminals.filter(u=>u.id!==e);m(l.length>0?l[l.length-1].id:null)}},F=()=>{b(!0),t(null),h(A)},T=e=>{const i=s.commands[e];i&&(b(!1),t(e),h({name:i.name,command:i.command,cwd:i.cwd??""}))},D=()=>{b(!1),t(null)},S=()=>{const e=c.name.trim(),i=c.command.trim();if(!e||!i)return;const l=c.cwd.trim(),u={name:e,command:i,cwd:l||void 0},_=N?[...s.commands,u]:p!==null?s.commands.map((z,H)=>H===p?u:z):s.commands;r({type:"save_commands",commands:_}),D()},I=e=>{if(g===e){const i=s.commands.filter((l,u)=>u!==e);r({type:"save_commands",commands:i}),C(null),j.current&&clearTimeout(j.current)}else C(e),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>C(null),2500)},M=N||p!==null;return n.jsxs("div",{className:"terminal-view",children:[n.jsxs("aside",{className:`term-side term-commands ${v?"open":""}`,children:[n.jsxs("div",{className:"panel-header",children:[n.jsx("span",{className:"panel-title",children:a("commands")}),n.jsxs("div",{className:"panel-header-actions",children:[n.jsx("button",{type:"button",className:"panel-refresh",title:a("rerun"),onClick:()=>r({type:"list_commands"}),children:n.jsx(P,{})}),n.jsx("button",{type:"button",className:"panel-new",title:a("newCommand"),onClick:F,children:n.jsx(K,{})})]})]}),n.jsx("div",{className:"panel-body",children:M?n.jsxs("div",{className:"cmd-form",children:[n.jsx("label",{htmlFor:"cmd-name",children:a("name")}),n.jsx("input",{id:"cmd-name",className:"cmd-input",value:c.name,placeholder:a("exampleName"),autoFocus:!0,onChange:e=>h({...c,name:e.target.value})}),n.jsx("label",{htmlFor:"cmd-command",children:a("command")}),n.jsx("input",{id:"cmd-command",className:"cmd-input",value:c.command,placeholder:a("exampleCommand"),onChange:e=>h({...c,command:e.target.value}),onKeyDown:e=>{e.key==="Enter"&&!e.nativeEvent.isComposing&&S()}}),n.jsxs("label",{htmlFor:"cmd-cwd",children:[a("directory")," ",n.jsx("span",{className:"cmd-hint",children:a("cwdHint")})]}),n.jsx("input",{id:"cmd-cwd",className:"cmd-input",value:c.cwd,placeholder:"${pwd}",onChange:e=>h({...c,cwd:e.target.value}),onKeyDown:e=>{e.key==="Enter"&&!e.nativeEvent.isComposing&&S()}}),n.jsxs("div",{className:"cmd-form-actions",children:[n.jsx("button",{type:"button",className:"btn",onClick:D,children:a("cancel")}),n.jsx("button",{type:"button",className:"btn primary",disabled:!c.name.trim()||!c.command.trim(),onClick:S,children:a("save")})]})]}):n.jsxs(n.Fragment,{children:[s.commands.length===0&&n.jsx("div",{className:"panel-empty",children:a("noCommands")}),s.commands.map((e,i)=>n.jsxs("div",{className:"cmd-item",children:[n.jsx("button",{type:"button",className:"cmd-run",title:a("clickToRun"),onClick:()=>o(e),children:n.jsx(q,{})}),n.jsxs("button",{type:"button",className:"cmd-main",title:a("clickToRun"),onClick:()=>o(e),children:[n.jsx("span",{className:"cmd-name",children:e.name}),n.jsx("span",{className:"cmd-command",children:e.command}),e.cwd&&n.jsx("span",{className:"cmd-cwd",children:e.cwd})]}),n.jsx("button",{type:"button",className:"cmd-act",title:a("edit"),onClick:()=>T(i),children:n.jsx(L,{})}),n.jsx("button",{type:"button",className:`cmd-act del ${g===i?"confirm":""}`,title:a("delete"),onClick:()=>I(i),children:g===i?a("confirmQ"):n.jsx(B,{})})]},i))]})}),n.jsxs("div",{className:"term-tabs-block",children:[n.jsxs("div",{className:"panel-header",children:[n.jsx("span",{className:"panel-title",children:a("terminal")}),n.jsx("button",{type:"button",className:"panel-new",title:a("newTerminal"),onClick:y,children:n.jsx(K,{})})]}),n.jsxs("div",{className:"panel-body",children:[s.terminals.length===0&&n.jsx("div",{className:"panel-empty",children:a("noTerminal")}),s.terminals.map(e=>n.jsxs("div",{className:`term-tab ${e.id===f?"active":""}`,children:[n.jsxs("button",{type:"button",className:"term-tab-main",title:`${e.cwd}${e.command?`
|
|
2
2
|
> ${e.command.command}`:""}`,onClick:()=>{m(e.id),w(!1)},children:[n.jsx("span",{className:`term-tab-dot ${e.running?"run":"exit"}`}),n.jsxs("span",{className:"term-tab-title",children:[e.title,!e.running&&n.jsx("span",{className:"term-tab-exit",children:a("exited",{code:e.exitCode===null?"":` ${e.exitCode}`})})]})]}),n.jsx("button",{type:"button",className:"term-tab-close",title:a("closeTerminal"),onClick:()=>E(e.id),children:n.jsx(J,{})})]},e.id))]})]})]}),n.jsxs("div",{className:"term-main",children:[v&&n.jsx("div",{className:"drawer-backdrop",onClick:()=>w(!1)}),n.jsx("button",{type:"button",className:"term-side-toggle",title:a("commands"),onClick:()=>w(e=>!e),children:n.jsx(X,{})}),s.terminals.length===0?n.jsxs("div",{className:"term-empty",children:[n.jsx(G,{className:"term-empty-icon"}),n.jsx("div",{className:"term-empty-title",children:a("builtinTerminal")}),n.jsx("div",{className:"term-empty-sub",children:a("termEmptySub")})]}):s.terminals.map(e=>n.jsx(W,{conversationId:e.conversationId,terminalId:e.id,command:e.command,cwd:e.cwd,active:e.id===f,send:r,register:x.register},`${e.conversationId}:${e.id}`))]})]})}export{se as TerminalPanel};
|