@eduardo191labs/opencode-free-pi 0.3.1 → 0.3.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/README.md +2 -0
- package/dist/session/hooks.js +4 -0
- package/package.json +2 -2
- package/src/session/hooks.ts +4 -0
package/README.md
CHANGED
|
@@ -214,6 +214,8 @@ dist/ build ESM y tipos
|
|
|
214
214
|
scripts/postinstall.mjs registro en opencode.json
|
|
215
215
|
test/smoke.mjs prueba de humo del build
|
|
216
216
|
test/registry.mjs caché y tolerancia a fallos de models.dev
|
|
217
|
+
test/models.mjs capacidades, variantes, límites y costos
|
|
218
|
+
test/hooks.mjs hooks de sesión, anuncios y cuota
|
|
217
219
|
```
|
|
218
220
|
|
|
219
221
|
## Desinstalar
|
package/dist/session/hooks.js
CHANGED
|
@@ -73,6 +73,10 @@ async function applyModelRequest(deps, event) {
|
|
|
73
73
|
if (deps.state.costExperimentArm) {
|
|
74
74
|
event.headers[COST_EXPERIMENT_HEADER] = deps.state.costExperimentArm;
|
|
75
75
|
}
|
|
76
|
+
// Title requests are suppressed by the title hook, so an ad for them would be
|
|
77
|
+
// an impression the user never sees.
|
|
78
|
+
if (event.kind === "title")
|
|
79
|
+
return;
|
|
76
80
|
const pending = deps.state.pendingAdTurns.get(pendingKeyOf(event.sessionID, agent, event.kind));
|
|
77
81
|
const turn = pending ??
|
|
78
82
|
(await resolveAdTurn(deps, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eduardo191labs/opencode-free-pi",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Ad-supported free-pi provider plugin for OpenCode on Windows, Linux, macOS and Termux",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsc -p tsconfig.json",
|
|
26
26
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
27
|
-
"test": "npm run build && node test/smoke.mjs && node test/registry.mjs",
|
|
27
|
+
"test": "npm run build && node test/smoke.mjs && node test/registry.mjs && node test/models.mjs && node test/hooks.mjs",
|
|
28
28
|
"prepublishOnly": "npm run build",
|
|
29
29
|
"postinstall": "node scripts/postinstall.mjs"
|
|
30
30
|
},
|
package/src/session/hooks.ts
CHANGED
|
@@ -115,6 +115,10 @@ async function applyModelRequest(deps: Deps, event: any): Promise<void> {
|
|
|
115
115
|
event.headers[COST_EXPERIMENT_HEADER] = deps.state.costExperimentArm;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
// Title requests are suppressed by the title hook, so an ad for them would be
|
|
119
|
+
// an impression the user never sees.
|
|
120
|
+
if (event.kind === "title") return;
|
|
121
|
+
|
|
118
122
|
const pending = deps.state.pendingAdTurns.get(
|
|
119
123
|
pendingKeyOf(event.sessionID, agent, event.kind),
|
|
120
124
|
);
|