ps-claw 1.0.6
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/LICENSE +24 -0
- package/README.md +169 -0
- package/cli.mjs +125 -0
- package/package.json +1979 -0
- package/patches/.gitkeep +1 -0
- package/pnpm-workspace.yaml +121 -0
- package/ps-claw.mjs +661 -0
- package/src/agents/templates/HEARTBEAT.md +3 -0
- package/update.sh +79 -0
- package/web-ui/public/index.html +1179 -0
- package/web-ui/server.mjs +192 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenClaw Foundation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Third-party notices for incorporated or adapted code are recorded in
|
|
24
|
+
THIRD_PARTY_NOTICES.md.
|
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# PS Claw π¦
|
|
2
|
+
|
|
3
|
+
**PS Claw** Γ© uma versΓ£o leve do [OpenClaw](https://github.com/openclaw/openclaw) β agente de IA autΓ΄nomo multi-canal com interface web estilo ChatGPT.
|
|
4
|
+
|
|
5
|
+
Fork enxuto com foco em leveza e facilidade de uso, sem apps mobile, geraΓ§Γ£o de mΓdia pesada ou componentes desnecessΓ‘rios.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## β‘ InstalaΓ§Γ£o rΓ‘pida
|
|
10
|
+
|
|
11
|
+
### Requisitos
|
|
12
|
+
- [Node.js](https://nodejs.org/) v22.19 ou superior
|
|
13
|
+
|
|
14
|
+
### Instalar via npm (recomendado)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm i ps-claw
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Pronto! O comando `ps-claw` fica disponΓvel globalmente se instalado com `-g`:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm i -g ps-claw
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Instalar via npx (sem instalar)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx ps-claw --help
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Instalar a partir do cΓ³digo-fonte
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
git clone https://github.com/Pedro21062014/Ps-Claw.git
|
|
36
|
+
cd Ps-Claw
|
|
37
|
+
pnpm install
|
|
38
|
+
pnpm build
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## π Usando o PS Claw
|
|
44
|
+
|
|
45
|
+
### CLI β Linha de comando
|
|
46
|
+
|
|
47
|
+
ApΓ³s instalar com `npm i -g ps-claw`:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
ps-claw --help # Mostra todos os comandos
|
|
51
|
+
ps-claw --version # VersΓ£o instalada
|
|
52
|
+
ps-claw web # Inicia a interface web
|
|
53
|
+
ps-claw gateway run # Inicia o gateway
|
|
54
|
+
ps-claw gateway status # Verifica status do gateway
|
|
55
|
+
ps-claw doctor # DiagnΓ³stico do sistema
|
|
56
|
+
ps-claw models list # Lista modelos disponΓveis
|
|
57
|
+
ps-claw secrets set openai # Configura chave OpenAI
|
|
58
|
+
ps-claw secrets set anthropic # Configura chave Anthropic
|
|
59
|
+
ps-claw configure # ConfiguraΓ§Γ£o interativa
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Interface Web
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
ps-claw web
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Acesse **http://localhost:3000** no navegador.
|
|
69
|
+
|
|
70
|
+
A interface web tem 4 abas:
|
|
71
|
+
- π¬ **Chat** β conversas com histΓ³rico salvo localmente
|
|
72
|
+
- π **Gateways** β conectar e gerenciar APIs (OpenAI, Anthropic, Ollama, LM Studio, etc.)
|
|
73
|
+
- π§ **Modelos** β selecionar modelos por provedor (GPT-4o, Claude Opus 4.5, Gemini 2.5 Pro, DeepSeek...)
|
|
74
|
+
- βοΈ **Config** β temperatura, max tokens, system prompt, chaves de API, export/import de configuraΓ§Γ΅es
|
|
75
|
+
|
|
76
|
+
### VariΓ‘veis de ambiente
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
PS_CLAW_WEB_PORT=3000 # Porta da interface web (padrΓ£o: 3000)
|
|
80
|
+
PS_CLAW_GATEWAY_PORT=18789 # Porta do gateway (padrΓ£o: 18789)
|
|
81
|
+
OPENCLAW_GATEWAY_TOKEN= # Token de autenticaΓ§Γ£o do gateway
|
|
82
|
+
OPENAI_API_KEY=sk-... # Chave OpenAI
|
|
83
|
+
ANTHROPIC_API_KEY=sk-ant-... # Chave Anthropic
|
|
84
|
+
GEMINI_API_KEY=... # Chave Google/Gemini
|
|
85
|
+
DEEPSEEK_API_KEY=sk-... # Chave DeepSeek
|
|
86
|
+
OPENROUTER_API_KEY=sk-or-... # Chave OpenRouter
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Ou configure as chaves na aba **Config** da interface web.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## π Atualizar o PS Claw
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm update -g ps-claw
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Ou se instalou via cΓ³digo-fonte:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
cd Ps-Claw
|
|
103
|
+
git pull
|
|
104
|
+
pnpm install
|
|
105
|
+
pnpm build
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## β
O que estΓ‘ incluΓdo
|
|
111
|
+
|
|
112
|
+
| Recurso | Status |
|
|
113
|
+
|---|---|
|
|
114
|
+
| Core do agente autΓ΄nomo | β
|
|
|
115
|
+
| Provedores: OpenAI, Anthropic, Google, DeepSeek, OpenRouter | β
|
|
|
116
|
+
| Interface web com gateways, modelos e configuraΓ§Γ΅es | β
|
|
|
117
|
+
| CLI com comandos completos | β
|
|
|
118
|
+
| Pacote npm publicado | β
|
|
|
119
|
+
| Busca na web (DuckDuckGo, Brave) | β
|
|
|
120
|
+
| Suporte a MCP / Skills | β
|
|
|
121
|
+
| MemΓ³ria persistente | β
|
|
|
122
|
+
| Docker | β
|
|
|
123
|
+
| Apps iOS / Android / macOS | β removido |
|
|
124
|
+
| GeraΓ§Γ£o de vΓdeo / mΓΊsica / imagem | β removido |
|
|
125
|
+
| TranscriΓ§Γ£o em tempo real / TTS | β removido |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## π³ Docker
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
docker-compose up
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## π Estrutura
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
Ps-Claw/
|
|
141
|
+
βββ ps-claw.mjs β BinΓ‘rio CLI principal
|
|
142
|
+
βββ scripts/
|
|
143
|
+
β βββ build-all.mjs β Script de build
|
|
144
|
+
βββ web-ui/
|
|
145
|
+
β βββ server.mjs β Servidor da interface web
|
|
146
|
+
β βββ public/
|
|
147
|
+
β βββ index.html β Interface web (Chat, Gateways, Modelos, Config)
|
|
148
|
+
βββ src/ β CΓ³digo-fonte TypeScript
|
|
149
|
+
βββ extensions/ β Provedores (OpenAI, Anthropic, DeepSeek...)
|
|
150
|
+
βββ packages/ β Bibliotecas internas
|
|
151
|
+
βββ .env.example β Exemplo de configuraΓ§Γ£o
|
|
152
|
+
βββ package.json
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## π¦ npm
|
|
158
|
+
|
|
159
|
+
DisponΓvel em: [https://www.npmjs.com/package/ps-claw](https://www.npmjs.com/package/ps-claw)
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
npm i ps-claw
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## π LicenΓ§a
|
|
168
|
+
|
|
169
|
+
MIT β baseado no [OpenClaw](https://github.com/openclaw/openclaw) por Peter Steinberger e contribuidores.
|
package/cli.mjs
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PS Claw CLI β ponto de entrada global
|
|
5
|
+
* Uso: ps-claw [comando]
|
|
6
|
+
* Comandos: start | web | all | update | help
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { spawn } from "node:child_process";
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
|
|
14
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
const cmd = args[0] || "help";
|
|
17
|
+
|
|
18
|
+
const C = {
|
|
19
|
+
reset: "\x1b[0m",
|
|
20
|
+
green: "\x1b[32m",
|
|
21
|
+
cyan: "\x1b[36m",
|
|
22
|
+
yellow: "\x1b[33m",
|
|
23
|
+
red: "\x1b[31m",
|
|
24
|
+
bold: "\x1b[1m",
|
|
25
|
+
dim: "\x1b[2m",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function banner() {
|
|
29
|
+
console.log(`
|
|
30
|
+
${C.cyan}${C.bold} βββββββ ββββββββ ββββββββββ ββββββ βββ βββ${C.reset}
|
|
31
|
+
${C.cyan}${C.bold} ββββββββββββββββ βββββββββββ βββββββββββ βββ${C.reset}
|
|
32
|
+
${C.cyan}${C.bold} ββββββββββββββββ βββ βββ βββββββββββ ββ βββ${C.reset}
|
|
33
|
+
${C.cyan}${C.bold} βββββββ ββββββββ βββ βββ ββββββββββββββββββ${C.reset}
|
|
34
|
+
${C.cyan}${C.bold} βββ ββββββββ βββββββββββββββββββ βββββββββββββ${C.reset}
|
|
35
|
+
${C.cyan}${C.bold} βββ ββββββββ ββββββββββββββββββ βββ ββββββββ${C.reset}
|
|
36
|
+
${C.dim}v1.0.0 β Lightweight AI Agent Gateway${C.reset}
|
|
37
|
+
`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function help() {
|
|
41
|
+
banner();
|
|
42
|
+
console.log(` ${C.bold}Comandos:${C.reset}
|
|
43
|
+
|
|
44
|
+
${C.green}ps-claw start${C.reset} Inicia o agente PS Claw
|
|
45
|
+
${C.green}ps-claw web${C.reset} Inicia a interface web em http://localhost:3000
|
|
46
|
+
${C.green}ps-claw all${C.reset} Inicia o agente + interface web juntos
|
|
47
|
+
${C.green}ps-claw update${C.reset} Atualiza o PS Claw
|
|
48
|
+
${C.green}ps-claw help${C.reset} Esta mensagem
|
|
49
|
+
|
|
50
|
+
${C.bold}InΓcio rΓ‘pido:${C.reset}
|
|
51
|
+
|
|
52
|
+
${C.dim}# Via npm (global)${C.reset}
|
|
53
|
+
npm install -g ps-claw
|
|
54
|
+
ps-claw all
|
|
55
|
+
|
|
56
|
+
${C.dim}# Via git clone${C.reset}
|
|
57
|
+
git clone https://github.com/Pedro21062014/ps-claw-v2.git
|
|
58
|
+
cd ps-claw-v2 && npm install
|
|
59
|
+
ps-claw all
|
|
60
|
+
|
|
61
|
+
${C.bold}Interface web:${C.reset} http://localhost:3000
|
|
62
|
+
`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function run(file, extraArgs = []) {
|
|
66
|
+
if (!existsSync(file)) {
|
|
67
|
+
console.error(`${C.red}β Arquivo nΓ£o encontrado: ${file}${C.reset}`);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
const proc = spawn(process.execPath, [file, ...extraArgs], { stdio: "inherit" });
|
|
71
|
+
proc.on("exit", code => process.exit(code ?? 0));
|
|
72
|
+
return proc;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function startAgent() {
|
|
76
|
+
console.log(`${C.green}π¦ Iniciando PS Claw Agent...${C.reset}`);
|
|
77
|
+
run(path.join(__dirname, "ps-claw.mjs"), args.slice(1));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function startWeb() {
|
|
81
|
+
const srv = path.join(__dirname, "web-ui", "server.mjs");
|
|
82
|
+
console.log(`${C.green}π Interface Web β http://localhost:3000${C.reset}`);
|
|
83
|
+
run(srv);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function startAll() {
|
|
87
|
+
banner();
|
|
88
|
+
const agentFile = path.join(__dirname, "ps-claw.mjs");
|
|
89
|
+
const webFile = path.join(__dirname, "web-ui", "server.mjs");
|
|
90
|
+
|
|
91
|
+
console.log(`${C.green}π¦ Iniciando PS Claw Agent...${C.reset}`);
|
|
92
|
+
const agent = spawn(process.execPath, [agentFile], { stdio: "inherit" });
|
|
93
|
+
|
|
94
|
+
setTimeout(() => {
|
|
95
|
+
if (existsSync(webFile)) {
|
|
96
|
+
console.log(`\n${C.cyan}π Iniciando Interface Web β http://localhost:3000${C.reset}\n`);
|
|
97
|
+
const web = spawn(process.execPath, [webFile], { stdio: "inherit" });
|
|
98
|
+
web.on("exit", code => process.exit(code ?? 0));
|
|
99
|
+
}
|
|
100
|
+
}, 1500);
|
|
101
|
+
|
|
102
|
+
agent.on("exit", code => process.exit(code ?? 0));
|
|
103
|
+
process.on("SIGINT", () => { agent.kill(); process.exit(0); });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function update() {
|
|
107
|
+
banner();
|
|
108
|
+
const script = path.join(__dirname, "update.sh");
|
|
109
|
+
console.log(`${C.yellow}π Verificando atualizaΓ§Γ΅es...${C.reset}\n`);
|
|
110
|
+
if (!existsSync(script)) {
|
|
111
|
+
console.log(`${C.yellow}Baixando versΓ£o mais recente...${C.reset}`);
|
|
112
|
+
run("git", ["pull"]);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const proc = spawn("bash", [script], { stdio: "inherit" });
|
|
116
|
+
proc.on("exit", code => process.exit(code ?? 0));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
switch (cmd) {
|
|
120
|
+
case "start": startAgent(); break;
|
|
121
|
+
case "web": startWeb(); break;
|
|
122
|
+
case "all": startAll(); break;
|
|
123
|
+
case "update": update(); break;
|
|
124
|
+
default: help(); break;
|
|
125
|
+
}
|