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 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
+ }