@eduardo191labs/opencode-free-pi 0.0.0-stage → 0.2.0

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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 eduardo191-star
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.
package/README.md CHANGED
@@ -1,3 +1,165 @@
1
- # Temporary Holding Version
1
+ # @eduardo191labs/opencode-free-pi
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Proveedor **free-pi** para [OpenCode](https://opencode.ai): modelos gratuitos
4
+ financiados con anuncios, sin claves de API. Funciona en **Windows, Linux, macOS
5
+ y Termux**.
6
+
7
+ ## Instalación desde npm
8
+
9
+ ```bash
10
+ npm i -g @eduardo191labs/opencode-free-pi
11
+ opencode plugin add @eduardo191labs/opencode-free-pi
12
+ ```
13
+
14
+ El primer comando instala el paquete globalmente y el segundo lo registra en
15
+ OpenCode para que lo cargue como plugin.
16
+
17
+ ## Instalación rápida con script
18
+
19
+ > Pasa el cursor por el bloque de comandos y usa el icono de copiar de GitHub.
20
+ > No necesitas definir variables de entorno para instalar.
21
+
22
+ ### Windows (PowerShell + curl)
23
+
24
+ ```powershell
25
+ curl.exe -fsSL "https://raw.githubusercontent.com/eduardo191-star/opencode-free-pi/main/install.ps1" | powershell -NoProfile -ExecutionPolicy Bypass -Command -
26
+ ```
27
+
28
+ Si tu terminal no acepta la tubería, descarga y ejecuta el `.ps1`:
29
+
30
+ ```powershell
31
+ curl.exe -fsSL -o "$env:TEMP\install-free-pi.ps1" "https://raw.githubusercontent.com/eduardo191-star/opencode-free-pi/main/install.ps1"; powershell -NoProfile -ExecutionPolicy Bypass -File "$env:TEMP\install-free-pi.ps1"
32
+ ```
33
+
34
+ Alternativa si `curl.exe` no está disponible:
35
+
36
+ ```powershell
37
+ powershell -NoProfile -ExecutionPolicy Bypass -Command "irm 'https://raw.githubusercontent.com/eduardo191-star/opencode-free-pi/main/install.ps1' | iex"
38
+ ```
39
+
40
+ ### Linux, macOS y Termux
41
+
42
+ ```bash
43
+ curl -fsSL "https://raw.githubusercontent.com/eduardo191-star/opencode-free-pi/main/install.sh" | bash
44
+ ```
45
+
46
+ En Termux, si falta `curl`:
47
+
48
+ ```bash
49
+ pkg install curl
50
+ ```
51
+
52
+ ## Después de instalar
53
+
54
+ ```bash
55
+ opencode auth login -p free-pi
56
+ opencode
57
+ ```
58
+
59
+ El plugin se registra como proveedor `free-pi`, elige un modelo gratuito por
60
+ defecto y desactiva el agente `title` para no gastar una petición extra.
61
+
62
+ ## Qué hace
63
+
64
+ - Catálogo de modelos free-pi y free-pi-defense en vivo.
65
+ - Inicio de sesión con GitHub, dispositivo o JWT existente.
66
+ - Cuota diaria, créditos premium y límites con mensajes claros.
67
+ - Anuncios e impresiones asociados al turno correcto.
68
+ - Herramientas: `free_pi_usage`, `free_pi_buy_credits`, `free_pi_redeem`,
69
+ `free_pi_invite`, `free_pi_feedback`, `free_pi_dashboard`, `web_search`,
70
+ `docs_lookup`, `look_at_image`, `generate_image` y más.
71
+ - Recuperación automática del límite de sesiones concurrentes.
72
+ - Compatible con rutas, credenciales y navegador de cada sistema operativo.
73
+
74
+ ## Rutas por plataforma
75
+
76
+ | Elemento | Windows | Linux / macOS / Termux |
77
+ | --------------- | ------------------------------------------------------------ | ------------------------------------------------ |
78
+ | Plugin | `%USERPROFILE%\.config\opencode\plugins\opencode-free-pi.ts` | `~/.config/opencode/plugins/opencode-free-pi.ts` |
79
+ | Credenciales | `%USERPROFILE%\.free-pi\agent\credentials.json` | `~/.free-pi/agent/credentials.json` |
80
+ | Config OpenCode | `%USERPROFILE%\.config\opencode\opencode.json[c]` | `~/.config/opencode/opencode.json[c]` |
81
+
82
+ Si `XDG_CONFIG_HOME` o `OPENCODE_CONFIG_DIR` están definidos, el instalador los
83
+ respeta.
84
+
85
+ ## Variables de entorno (opcionales)
86
+
87
+ | Variable | Uso |
88
+ | ------------------------- | ---------------------------------------------------- |
89
+ | `FREEPI_JWT` | Token JWT directamente, sin archivo de credenciales. |
90
+ | `FREEPI_CREDENTIALS_PATH` | Ruta alternativa a `credentials.json`. |
91
+ | `FREEPI_BASE_URL` | Cambiar la URL base de la API. |
92
+ | `FREEPI_MODELS_URL` | Cambiar el registro de modelos. |
93
+ | `FREEPI_NO_BROWSER=1` | No abrir el navegador. |
94
+ | `FREEPI_DEVICE_LOGIN=1` | Forzar inicio de sesión por dispositivo. |
95
+ | `OPENCODE_CONFIG_DIR` | Directorio de configuración de OpenCode. |
96
+
97
+ No hay variables obligatorias. El plugin usa el entorno nativo de cada sistema
98
+ para `HOME`, `USERPROFILE`, `XDG_CONFIG_HOME`, `APPDATA` cuando aplica, Termux y
99
+ Windows.
100
+
101
+ ## Paquete npm
102
+
103
+ El paquete incluye `dist/index.js` ya compilado y tipos TypeScript:
104
+
105
+ ```bash
106
+ npm pack
107
+ npm install -g ./eduardo191labs-opencode-free-pi-0.2.0.tgz
108
+ ```
109
+
110
+ También puedes declararlo en OpenCode como plugin npm:
111
+
112
+ ```json
113
+ {
114
+ "plugins": ["@eduardo191labs/opencode-free-pi"]
115
+ }
116
+ ```
117
+
118
+ La instalación recomendada sigue siendo el script, porque coloca el archivo en
119
+ la carpeta de plugins y funciona sin publicación en npm.
120
+
121
+ ## Desarrollo
122
+
123
+ ```bash
124
+ npm install
125
+ npm run typecheck
126
+ npm run build
127
+ npm pack
128
+ ```
129
+
130
+ Estructura:
131
+
132
+ ```text
133
+ src/index.ts código fuente del plugin
134
+ dist/index.js build ESM listo para OpenCode
135
+ dist/index.d.ts tipos
136
+ install.sh instalador Linux/macOS/Termux
137
+ install.ps1 instalador Windows PowerShell
138
+ ```
139
+
140
+ ## Desinstalar
141
+
142
+ Windows:
143
+
144
+ ```powershell
145
+ powershell -NoProfile -ExecutionPolicy Bypass -Command "$p=Join-Path $env:TEMP 'install-free-pi.ps1'; irm 'https://raw.githubusercontent.com/eduardo191-star/opencode-free-pi/main/install.ps1' -OutFile $p; & $p -Uninstall"
146
+ ```
147
+
148
+ Linux/macOS/Termux:
149
+
150
+ ```bash
151
+ curl -fsSL "https://raw.githubusercontent.com/eduardo191-star/opencode-free-pi/main/install.sh" | bash -s -- --uninstall
152
+ ```
153
+
154
+ O borra manualmente `opencode-free-pi.ts` de la carpeta de plugins y reinicia
155
+ OpenCode.
156
+
157
+ ## Privacidad
158
+
159
+ El plugin se comunica con `https://api.freepi.ai` para autenticación, cuota,
160
+ anuncios y completions. El contexto de anuncios no se envía al modelo. No
161
+ incluye claves ni tokens en el repositorio.
162
+
163
+ ## Licencia
164
+
165
+ MIT
@@ -0,0 +1,7 @@
1
+ import { type Plugin } from "@opencode-ai/plugin";
2
+ export declare const FreePiPlugin: Plugin;
3
+ declare const _default: {
4
+ id: string;
5
+ server: Plugin;
6
+ };
7
+ export default _default;