ps-claw 1.1.1 → 1.1.2
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/package.json +3 -3
- package/web-ui/public/index.html +25 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ps-claw",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "PS Claw - AI Agent Gateway with multi-provider support, web UI, and CLI. Lightweight fork of OpenClaw.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
"postinstall": "echo 'Skipping postinstall'",
|
|
252
252
|
"postpack": "echo 'Skipping postpack'",
|
|
253
253
|
"preinstall": "echo 'Skipping preinstall'",
|
|
254
|
-
"prepack": "echo 'Skipping prepack
|
|
254
|
+
"prepack": "echo 'Skipping prepack — dist/ already included in files'",
|
|
255
255
|
"prepare": "echo 'Skipping prepare'",
|
|
256
256
|
"prepush:ci": "bash scripts/prepush-ci.sh",
|
|
257
257
|
"probe:anthropic:prompt": "node --import tsx scripts/anthropic-prompt-probe.ts",
|
|
@@ -596,4 +596,4 @@
|
|
|
596
596
|
"node": ">=22.19.0"
|
|
597
597
|
},
|
|
598
598
|
"packageManager": "pnpm@11.2.2+sha512.36e6621fad506178936455e70247b8808ef4ec25797a9f437a93281a020484e2607f6a469a22e982987c3dbb8866e3071514ab10a4a1749e06edcd1ec118436f"
|
|
599
|
-
}
|
|
599
|
+
}
|
package/web-ui/public/index.html
CHANGED
|
@@ -192,6 +192,22 @@ body{font-family:'Syne',sans-serif;background:var(--bg);color:var(--txt);display
|
|
|
192
192
|
.bbl th,.bbl td{border:1px solid var(--border2);padding:8px 12px;text-align:left}
|
|
193
193
|
.bbl th{background:var(--surface3);font-weight:700}
|
|
194
194
|
|
|
195
|
+
/* action tags */
|
|
196
|
+
.act{padding:4px 5px 4px 10px;margin:6px 0 2px;border-radius:8px;font-size:12px;font-weight:700;font-family:'JetBrains Mono',monospace;display:flex;align-items:center;gap:7px;line-height:1.3;word-break:break-word}
|
|
197
|
+
.act-cmd{background:rgba(59,130,246,.12);color:#3b82f6;border-left:3px solid #3b82f6}
|
|
198
|
+
.act-click{background:rgba(139,92,246,.12);color:#8b5cf6;border-left:3px solid #8b5cf6}
|
|
199
|
+
.act-app{background:rgba(16,185,129,.12);color:#10b981;border-left:3px solid #10b981}
|
|
200
|
+
.act-file{background:rgba(245,158,11,.12);color:#f59e0b;border-left:3px solid #f59e0b}
|
|
201
|
+
.act-err{background:rgba(239,68,68,.1);color:#ef4444;border-left:3px solid #ef4444}
|
|
202
|
+
.act-ok{background:rgba(16,185,129,.1);color:#10b981;border-left:3px solid #10b981}
|
|
203
|
+
.act::before{font-size:13px}
|
|
204
|
+
.act-cmd::before{content:'💻'}
|
|
205
|
+
.act-click::before{content:'🖱️'}
|
|
206
|
+
.act-app::before{content:'📂'}
|
|
207
|
+
.act-file::before{content:'📄'}
|
|
208
|
+
.act-err::before{content:'❌'}
|
|
209
|
+
.act-ok::before{content:'✅'}
|
|
210
|
+
|
|
195
211
|
/* typing */
|
|
196
212
|
.typing{display:flex;gap:4px;align-items:center;padding:14px 16px}
|
|
197
213
|
.typing span{width:6px;height:6px;border-radius:50%;background:var(--acc);animation:pulse 1.2s infinite}
|
|
@@ -556,7 +572,7 @@ body{font-family:'Syne',sans-serif;background:var(--bg);color:var(--txt);display
|
|
|
556
572
|
<h3>💬 Comportamento</h3>
|
|
557
573
|
<div class="field">
|
|
558
574
|
<label>System prompt</label>
|
|
559
|
-
<textarea id="cfg-sys" placeholder="Você é
|
|
575
|
+
<textarea id="cfg-sys" placeholder="Você é a PS Claw, assistente de IA com acesso a ferramentas e ações executáveis no computador do usuário. Você pode: executar comandos no terminal/shell do sistema, dar cliques na tela e controlar o mouse, abrir aplicativos e programas, manipular arquivos e pastas. Sempre informe o que está executando e o resultado obtido. Seja direta, útil e proativa." oninput="saveCfg()"></textarea>
|
|
560
576
|
</div>
|
|
561
577
|
<div class="row">
|
|
562
578
|
<div class="field">
|
|
@@ -683,6 +699,12 @@ function renderChatList(){
|
|
|
683
699
|
<button class="ci-del" onclick="deleteChat('${c.id}',event)">✕</button>
|
|
684
700
|
</div>`).join('');
|
|
685
701
|
}
|
|
702
|
+
function parseMsg(text){
|
|
703
|
+
var lines=text.split('\n');var parts=[];var buf=[];
|
|
704
|
+
var flush=function(){if(!buf.length)return;var raw=buf.join('\n').trim();buf.length=0;if(!raw)return;var cls='act-cmd';var lo=raw.toLowerCase();if(/\b(click|clique|mouse|botao|botão|right.?click|duplo|dblclick|scroll|arrastar|drag)\b/.test(lo))cls='act-click';else if(/\b(abrir|open|launch|start|iniciar|executar app|\.exe|notepad|calc|chrome|firefox|edge|explorer)\b/.test(lo))cls='act-app';else if(/\b(arquivo|file|criar|deletar|remover|delete|salvar|save|mover|move|copiar|copy|mkdir)\b/.test(lo))cls='act-file';else if(/^(erro|error|falha|failed|exception|traceback|fatal)/i.test(lo))cls='act-err';else if(/^(ok|sucesso|success|concluído|concluido|feito|done|pronto)/i.test(lo))cls='act-ok';parts.push({type:'action',text:raw,cls});};
|
|
705
|
+
for(var i=0;i<lines.length;i++){var trimmed=lines[i].trim();if(!trimmed||trimmed.charAt(0)=='-'||trimmed.charAt(0)=='*'||trimmed.charAt(0)=='#'||trimmed.indexOf('\`\`\`')===0){buf.push(lines[i]);continue;}var isAct=/^(> |\$ |❯|▶|\$|PS |C:|D:)/.test(trimmed)||/^(Executando|Running |Abrindo|Opening |Exec)/.test(trimmed)||/^(npm |pip |python |node |git |ls |cd |mkdir |rm |cat |open |start |launch |echo |mv |cp |touch |chmod |docker |kubectl |make )/i.test(trimmed);if(isAct){flush();buf.push(lines[i]);}else buf.push(lines[i]);}flush();if(!parts.length&&text.trim())parts.push({type:'text',text});return parts;
|
|
706
|
+
}
|
|
707
|
+
|
|
686
708
|
function renderMsgs(){
|
|
687
709
|
const box=document.getElementById('messages');
|
|
688
710
|
if(!curChat||!curChat.msgs.length){
|
|
@@ -699,13 +721,7 @@ function renderMsgs(){
|
|
|
699
721
|
</div>`;
|
|
700
722
|
return;
|
|
701
723
|
}
|
|
702
|
-
box.innerHTML=curChat.msgs.map(m
|
|
703
|
-
<div class="msg-row ${m.role==='user'?'user':''}">
|
|
704
|
-
<div class="av ${m.role==='user'?'user':'ai'}">${m.role==='user'?(S.cfg.name||'V')[0].toUpperCase():'🦞'}</div>
|
|
705
|
-
<div class="bbl ${m.role==='user'?'user':'ai'}">${fmt(m.content)}</div>
|
|
706
|
-
</div>`).join('');
|
|
707
|
-
box.scrollTop=box.scrollHeight;
|
|
708
|
-
}
|
|
724
|
+
box.innerHTML=curChat.msgs.map(function(m){var body="";if(m.role==="user"){body="<div class=\"bbl user\">"+fmt(m.content)+"</div>";}else{var parts=parseMsg(m.content||"");body=parts.map(function(p){if(p.type==="text")return fmt(p.text);return "<div class=\"act "+p.cls+"\">"+fmt(p.text)+"</div>";}).join("");body="<div class=\"bbl ai\">"+body+"</div>";}return "<div class=\"msg-row "+(m.role==="user"?"user":"")+"\">\n <div class=\\"av \"+(m.role==="user"?"user":"ai")+"\">"+(m.role==="user"?(S.cfg.name||"V")[0].toUpperCase():"🦞")+"</div>\n "+body+"</div>";}).join("");box.scrollTop=box.scrollHeight;}
|
|
709
725
|
function addTyping(){
|
|
710
726
|
const box=document.getElementById('messages');
|
|
711
727
|
document.getElementById('welcome')?.remove();
|
|
@@ -756,7 +772,7 @@ async function sendMsg(){
|
|
|
756
772
|
async function callApi(model, text, key){
|
|
757
773
|
const history = curChat.msgs.slice(0,-1).map(m=>({role:m.role,content:m.content}));
|
|
758
774
|
const messages = [...history, {role:'user',content:text}];
|
|
759
|
-
const sys = S.cfg.sys || 'Você é
|
|
775
|
+
const sys = S.cfg.sys || 'Você é a PS Claw, uma assistente de IA inteligente e prestativa. Você tem acesso a ferramentas poderosas e pode executar ações no computador do usuário, incluindo: executar comandos no terminal/shell do sistema, dar cliques na tela e controlar o mouse, abrir aplicativos e programas, e manipular arquivos. Sempre que executar uma dessas ações, explique o que está fazendo e informe o resultado. Seja direta, útil e proativa.';
|
|
760
776
|
const temp = parseFloat(S.cfg.temp)||0.7;
|
|
761
777
|
const maxTok = parseInt(S.cfg.tok)||4096;
|
|
762
778
|
|