@jmanuelcorral/openteam 0.1.35 → 0.1.36
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 +14 -0
- package/dist/cli.js +86 -3
- package/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/commands/local.d.ts +6 -0
- package/dist/commands/local.d.ts.map +1 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/config/schema.d.ts +2 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/index.js +87 -2
- package/dist/router/chooseModel.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -375,6 +375,8 @@ openteam console
|
|
|
375
375
|
openteam report --telemetry .opencode/openteam-telemetry.jsonl
|
|
376
376
|
openteam yolo status
|
|
377
377
|
openteam yolo on
|
|
378
|
+
openteam local status
|
|
379
|
+
openteam local off
|
|
378
380
|
```
|
|
379
381
|
|
|
380
382
|
Flags: `--config <path>` y `--telemetry <path>` sobrescriben las rutas por defecto; `--opencode <path>` apunta el comando `yolo` a un `opencode.json` concreto.
|
|
@@ -417,6 +419,18 @@ También puedes activarlo durante `openteam setup` (te lo pregunta), o al vuelo
|
|
|
417
419
|
|
|
418
420
|
> **YOLO no desactiva la privacidad de openteam.** Solo afecta a las aprobaciones de permisos de opencode; con `privacyMode: "forceLocalOnSensitive"`, los prompts sensibles siguen sin salir a frontier. Úsalo solo en entornos de confianza: auto-aprueba también `bash`, escrituras y accesos fuera del workspace (salvo reglas `deny` explícitas).
|
|
419
421
|
|
|
422
|
+
### Solo frontier (sin runtime local): `openteam local`
|
|
423
|
+
|
|
424
|
+
Si **no tienes ningún runtime local** (Ollama/LM Studio/Foundry Local) o prefieres no usarlo, puedes forzar que openteam enrute **siempre a modelos frontier**. `openteam setup` ya activa este modo automáticamente cuando no habilitas ningún runtime, pero puedes alternarlo en cualquier momento sin repetir el setup:
|
|
425
|
+
|
|
426
|
+
```powershell
|
|
427
|
+
openteam local status # ¿local-first o solo frontier? + runtimes configurados
|
|
428
|
+
openteam local off # solo frontier (desactiva el routing local-first)
|
|
429
|
+
openteam local on # vuelve al routing local-first
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Esto persiste el flag `router.frontierOnly` en `.opencode/openteam.json`. Con `frontierOnly` activo, el router escoge el **frontier cheapest-capable** en lugar de la heurística local-first, pero **respeta la privacidad, los presupuestos y los overrides explícitos por tarea**: los prompts sensibles con `forceLocalOnSensitive` no salen a frontier, y `local off` degrada esa política a `consentBeforeFrontier` (imposible forzar local sin runtime) informándote del cambio.
|
|
433
|
+
|
|
420
434
|
### Modo desatendido: `openteam loop` (patrón Ralph) 🎯 *(diseño)*
|
|
421
435
|
|
|
422
436
|
Segundo modo de operación: un **bucle externo** que invoca `opencode run` contra un backlog persistente hasta vaciarlo, con contexto fresco por iteración y topes de seguridad (presupuesto, máx. iteraciones, sin-progreso). Complementa al orquestador interactivo, no lo sustituye. Consulta el diseño y los ejemplos en **[docs/loop.md](docs/loop.md)**.
|
package/dist/cli.js
CHANGED
|
@@ -688,12 +688,14 @@ var OpenTeamConfigObjectSchema = z3.object({
|
|
|
688
688
|
mode: RouterModeSchema.default("balanced"),
|
|
689
689
|
localDefault: ModelRefSchema.default(defaultLocalModel),
|
|
690
690
|
trivialPromptMaxChars: z3.number().int().positive().default(280),
|
|
691
|
-
frontierPromptMinChars: z3.number().int().positive().default(2000)
|
|
691
|
+
frontierPromptMinChars: z3.number().int().positive().default(2000),
|
|
692
|
+
frontierOnly: z3.boolean().default(false)
|
|
692
693
|
}).default({
|
|
693
694
|
mode: "balanced",
|
|
694
695
|
localDefault: defaultLocalModel,
|
|
695
696
|
trivialPromptMaxChars: 280,
|
|
696
|
-
frontierPromptMinChars: 2000
|
|
697
|
+
frontierPromptMinChars: 2000,
|
|
698
|
+
frontierOnly: false
|
|
697
699
|
}),
|
|
698
700
|
local: z3.object({
|
|
699
701
|
runtimes: z3.array(LocalRuntimeSchema).min(1).default([
|
|
@@ -3945,6 +3947,60 @@ function renderDoctor(input) {
|
|
|
3945
3947
|
`);
|
|
3946
3948
|
}
|
|
3947
3949
|
|
|
3950
|
+
// src/commands/local.ts
|
|
3951
|
+
function enabledRuntimesSummary(config) {
|
|
3952
|
+
const enabled = config.local.runtimes.filter((runtime) => runtime.enabled);
|
|
3953
|
+
if (enabled.length === 0) {
|
|
3954
|
+
return "ninguno";
|
|
3955
|
+
}
|
|
3956
|
+
return enabled.map((runtime) => {
|
|
3957
|
+
const model = `${runtime.defaultModel.providerID}/${runtime.defaultModel.modelID}`;
|
|
3958
|
+
const remote = runtime.baseURL !== undefined && !runtime.baseURL.includes("localhost") && !runtime.baseURL.includes("127.0.0.1") ? ` @ ${runtime.baseURL}` : "";
|
|
3959
|
+
return `${runtime.id} (${model})${remote}`;
|
|
3960
|
+
}).join(", ");
|
|
3961
|
+
}
|
|
3962
|
+
function showLocal(config) {
|
|
3963
|
+
const mode = config.router.frontierOnly ? "solo frontier (frontierOnly)" : "local-first";
|
|
3964
|
+
const lines = [
|
|
3965
|
+
"openteam local:",
|
|
3966
|
+
` modo: ${mode}`,
|
|
3967
|
+
` frontierOnly: ${config.router.frontierOnly}`,
|
|
3968
|
+
` privacidad: ${config.privacyMode}`,
|
|
3969
|
+
` runtimes: ${enabledRuntimesSummary(config)}`
|
|
3970
|
+
];
|
|
3971
|
+
return { message: lines.join(`
|
|
3972
|
+
`) };
|
|
3973
|
+
}
|
|
3974
|
+
function setFrontierOnly(config) {
|
|
3975
|
+
if (config.router.frontierOnly) {
|
|
3976
|
+
return { message: "Sin cambios: ya estás en modo solo frontier." };
|
|
3977
|
+
}
|
|
3978
|
+
const flipsPrivacy = config.privacyMode === "forceLocalOnSensitive";
|
|
3979
|
+
const next = {
|
|
3980
|
+
...config,
|
|
3981
|
+
router: { ...config.router, frontierOnly: true },
|
|
3982
|
+
privacyMode: flipsPrivacy ? "consentBeforeFrontier" : config.privacyMode
|
|
3983
|
+
};
|
|
3984
|
+
const privacyNote = flipsPrivacy ? " Privacidad ajustada a 'consentBeforeFrontier' (forceLocalOnSensitive requiere un runtime local)." : "";
|
|
3985
|
+
return {
|
|
3986
|
+
config: next,
|
|
3987
|
+
message: `Modo solo frontier activado (frontierOnly=true).${privacyNote}`
|
|
3988
|
+
};
|
|
3989
|
+
}
|
|
3990
|
+
function setLocalFirst(config) {
|
|
3991
|
+
if (!config.router.frontierOnly) {
|
|
3992
|
+
return { message: "Sin cambios: el routing local-first ya está activo." };
|
|
3993
|
+
}
|
|
3994
|
+
const next = {
|
|
3995
|
+
...config,
|
|
3996
|
+
router: { ...config.router, frontierOnly: false }
|
|
3997
|
+
};
|
|
3998
|
+
return {
|
|
3999
|
+
config: next,
|
|
4000
|
+
message: "Routing local-first reactivado (frontierOnly=false). Asegúrate de tener un runtime local accesible."
|
|
4001
|
+
};
|
|
4002
|
+
}
|
|
4003
|
+
|
|
3948
4004
|
// src/commands/orchestratorAgent.ts
|
|
3949
4005
|
var ORCHESTRATOR_AGENT_PATH = ".opencode/agent/openteam.md";
|
|
3950
4006
|
function buildOrchestratorAgent(frontier, options = {}) {
|
|
@@ -4180,6 +4236,9 @@ var HELP = [
|
|
|
4180
4236
|
" openteam baseline show Muestra el baseline efectivo",
|
|
4181
4237
|
" openteam baseline set <p/model> Fija el baseline (modo pinned)",
|
|
4182
4238
|
" openteam baseline auto Baseline cheapest-capable (modo auto)",
|
|
4239
|
+
" openteam local status Muestra el modo de routing (local-first / solo frontier)",
|
|
4240
|
+
" openteam local off Usa solo modelos frontier (sin runtime local)",
|
|
4241
|
+
" openteam local on Reactiva el routing local-first",
|
|
4183
4242
|
" openteam doctor Diagnóstico de runtimes y config",
|
|
4184
4243
|
" openteam agents Lista los agentes y el LLM (local/frontier) de cada uno",
|
|
4185
4244
|
" openteam console Lanza la Console web multi-sesión (Ctrl+C para parar; --open abre el navegador)",
|
|
@@ -4262,6 +4321,26 @@ async function runBaseline(positionals, deps, configPath) {
|
|
|
4262
4321
|
${HELP}`
|
|
4263
4322
|
};
|
|
4264
4323
|
}
|
|
4324
|
+
async function runLocal(positionals, deps, configPath) {
|
|
4325
|
+
const sub = positionals[1] ?? "status";
|
|
4326
|
+
if (sub !== "status" && sub !== "off" && sub !== "on") {
|
|
4327
|
+
return {
|
|
4328
|
+
exitCode: 1,
|
|
4329
|
+
stdout: `Subcomando de local desconocido: ${sub}
|
|
4330
|
+
|
|
4331
|
+
${HELP}`
|
|
4332
|
+
};
|
|
4333
|
+
}
|
|
4334
|
+
const config = await deps.loadConfig(configPath);
|
|
4335
|
+
if (sub === "status") {
|
|
4336
|
+
return { exitCode: 0, stdout: showLocal(config).message };
|
|
4337
|
+
}
|
|
4338
|
+
const outcome = sub === "off" ? setFrontierOnly(config) : setLocalFirst(config);
|
|
4339
|
+
if (outcome.config !== undefined) {
|
|
4340
|
+
await deps.saveConfig(outcome.config, configPath);
|
|
4341
|
+
}
|
|
4342
|
+
return { exitCode: 0, stdout: outcome.message };
|
|
4343
|
+
}
|
|
4265
4344
|
async function runYolo(positionals, deps, opencodeConfigPath) {
|
|
4266
4345
|
const sub = positionals[1] ?? "status";
|
|
4267
4346
|
if (sub !== "status" && sub !== "on" && sub !== "off") {
|
|
@@ -4346,6 +4425,9 @@ async function runCli(argv, deps) {
|
|
|
4346
4425
|
if (command === "baseline") {
|
|
4347
4426
|
return await runBaseline(parsed.positionals, deps, configPath);
|
|
4348
4427
|
}
|
|
4428
|
+
if (command === "local") {
|
|
4429
|
+
return await runLocal(parsed.positionals, deps, configPath);
|
|
4430
|
+
}
|
|
4349
4431
|
if (command === "yolo") {
|
|
4350
4432
|
return await runYolo(parsed.positionals, deps, opencodeConfigPath);
|
|
4351
4433
|
}
|
|
@@ -4552,7 +4634,8 @@ function buildOpenTeamConfig(answers) {
|
|
|
4552
4634
|
},
|
|
4553
4635
|
router: {
|
|
4554
4636
|
mode: answers.routerMode,
|
|
4555
|
-
localDefault
|
|
4637
|
+
localDefault,
|
|
4638
|
+
frontierOnly: primaryLocal === undefined
|
|
4556
4639
|
},
|
|
4557
4640
|
local: { runtimes },
|
|
4558
4641
|
privacyMode: answers.privacyMode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,UAAU,CAAC;AAclB,MAAM,MAAM,OAAO,GAAG;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACtD,UAAU,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,KAAK,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACnE,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IACvD,kBAAkB,EAAE,CAClB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IAClD,mBAAmB,EAAE,CACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,sBAAsB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA0PF,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,SAAS,CAAC,CAmEpB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OpenTeamConfig } from "../config/schema";
|
|
2
|
+
import type { CommandOutcome } from "./types";
|
|
3
|
+
export declare function showLocal(config: OpenTeamConfig): CommandOutcome;
|
|
4
|
+
export declare function setFrontierOnly(config: OpenTeamConfig): CommandOutcome;
|
|
5
|
+
export declare function setLocalFirst(config: OpenTeamConfig): CommandOutcome;
|
|
6
|
+
//# sourceMappingURL=local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/commands/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAkC9C,wBAAgB,SAA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,MAAM,uBAAuB,eAAe,CAAC;AAiJpD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAsB1D;AA2FD,wBAAsB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CA+MlE"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
|
|
|
96
96
|
}, z.core.$strip>>;
|
|
97
97
|
trivialPromptMaxChars: z.ZodDefault<z.ZodNumber>;
|
|
98
98
|
frontierPromptMinChars: z.ZodDefault<z.ZodNumber>;
|
|
99
|
+
frontierOnly: z.ZodDefault<z.ZodBoolean>;
|
|
99
100
|
}, z.core.$strip>>;
|
|
100
101
|
local: z.ZodDefault<z.ZodObject<{
|
|
101
102
|
runtimes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -179,6 +180,7 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
|
179
180
|
}, z.core.$strip>>;
|
|
180
181
|
trivialPromptMaxChars: z.ZodDefault<z.ZodNumber>;
|
|
181
182
|
frontierPromptMinChars: z.ZodDefault<z.ZodNumber>;
|
|
183
|
+
frontierOnly: z.ZodDefault<z.ZodBoolean>;
|
|
182
184
|
}, z.core.$strip>>;
|
|
183
185
|
local: z.ZodDefault<z.ZodObject<{
|
|
184
186
|
runtimes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;EAA6C,CAAC;AAC3E,eAAO,MAAM,iBAAiB;;;;EAI5B,CAAC;AACH,eAAO,MAAM,kBAAkB;;;EAA6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OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -393,12 +393,14 @@ var OpenTeamConfigObjectSchema = z.object({
|
|
|
393
393
|
mode: RouterModeSchema.default("balanced"),
|
|
394
394
|
localDefault: ModelRefSchema.default(defaultLocalModel),
|
|
395
395
|
trivialPromptMaxChars: z.number().int().positive().default(280),
|
|
396
|
-
frontierPromptMinChars: z.number().int().positive().default(2000)
|
|
396
|
+
frontierPromptMinChars: z.number().int().positive().default(2000),
|
|
397
|
+
frontierOnly: z.boolean().default(false)
|
|
397
398
|
}).default({
|
|
398
399
|
mode: "balanced",
|
|
399
400
|
localDefault: defaultLocalModel,
|
|
400
401
|
trivialPromptMaxChars: 280,
|
|
401
|
-
frontierPromptMinChars: 2000
|
|
402
|
+
frontierPromptMinChars: 2000,
|
|
403
|
+
frontierOnly: false
|
|
402
404
|
}),
|
|
403
405
|
local: z.object({
|
|
404
406
|
runtimes: z.array(LocalRuntimeSchema).min(1).default([
|
|
@@ -1384,6 +1386,60 @@ function renderDoctor(input) {
|
|
|
1384
1386
|
`);
|
|
1385
1387
|
}
|
|
1386
1388
|
|
|
1389
|
+
// src/commands/local.ts
|
|
1390
|
+
function enabledRuntimesSummary(config) {
|
|
1391
|
+
const enabled = config.local.runtimes.filter((runtime) => runtime.enabled);
|
|
1392
|
+
if (enabled.length === 0) {
|
|
1393
|
+
return "ninguno";
|
|
1394
|
+
}
|
|
1395
|
+
return enabled.map((runtime) => {
|
|
1396
|
+
const model = `${runtime.defaultModel.providerID}/${runtime.defaultModel.modelID}`;
|
|
1397
|
+
const remote = runtime.baseURL !== undefined && !runtime.baseURL.includes("localhost") && !runtime.baseURL.includes("127.0.0.1") ? ` @ ${runtime.baseURL}` : "";
|
|
1398
|
+
return `${runtime.id} (${model})${remote}`;
|
|
1399
|
+
}).join(", ");
|
|
1400
|
+
}
|
|
1401
|
+
function showLocal(config) {
|
|
1402
|
+
const mode = config.router.frontierOnly ? "solo frontier (frontierOnly)" : "local-first";
|
|
1403
|
+
const lines = [
|
|
1404
|
+
"openteam local:",
|
|
1405
|
+
` modo: ${mode}`,
|
|
1406
|
+
` frontierOnly: ${config.router.frontierOnly}`,
|
|
1407
|
+
` privacidad: ${config.privacyMode}`,
|
|
1408
|
+
` runtimes: ${enabledRuntimesSummary(config)}`
|
|
1409
|
+
];
|
|
1410
|
+
return { message: lines.join(`
|
|
1411
|
+
`) };
|
|
1412
|
+
}
|
|
1413
|
+
function setFrontierOnly(config) {
|
|
1414
|
+
if (config.router.frontierOnly) {
|
|
1415
|
+
return { message: "Sin cambios: ya estás en modo solo frontier." };
|
|
1416
|
+
}
|
|
1417
|
+
const flipsPrivacy = config.privacyMode === "forceLocalOnSensitive";
|
|
1418
|
+
const next = {
|
|
1419
|
+
...config,
|
|
1420
|
+
router: { ...config.router, frontierOnly: true },
|
|
1421
|
+
privacyMode: flipsPrivacy ? "consentBeforeFrontier" : config.privacyMode
|
|
1422
|
+
};
|
|
1423
|
+
const privacyNote = flipsPrivacy ? " Privacidad ajustada a 'consentBeforeFrontier' (forceLocalOnSensitive requiere un runtime local)." : "";
|
|
1424
|
+
return {
|
|
1425
|
+
config: next,
|
|
1426
|
+
message: `Modo solo frontier activado (frontierOnly=true).${privacyNote}`
|
|
1427
|
+
};
|
|
1428
|
+
}
|
|
1429
|
+
function setLocalFirst(config) {
|
|
1430
|
+
if (!config.router.frontierOnly) {
|
|
1431
|
+
return { message: "Sin cambios: el routing local-first ya está activo." };
|
|
1432
|
+
}
|
|
1433
|
+
const next = {
|
|
1434
|
+
...config,
|
|
1435
|
+
router: { ...config.router, frontierOnly: false }
|
|
1436
|
+
};
|
|
1437
|
+
return {
|
|
1438
|
+
config: next,
|
|
1439
|
+
message: "Routing local-first reactivado (frontierOnly=false). Asegúrate de tener un runtime local accesible."
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1387
1443
|
// src/commands/report.ts
|
|
1388
1444
|
var TIERS = [
|
|
1389
1445
|
"trivial",
|
|
@@ -1501,6 +1557,9 @@ var HELP = [
|
|
|
1501
1557
|
" openteam baseline show Muestra el baseline efectivo",
|
|
1502
1558
|
" openteam baseline set <p/model> Fija el baseline (modo pinned)",
|
|
1503
1559
|
" openteam baseline auto Baseline cheapest-capable (modo auto)",
|
|
1560
|
+
" openteam local status Muestra el modo de routing (local-first / solo frontier)",
|
|
1561
|
+
" openteam local off Usa solo modelos frontier (sin runtime local)",
|
|
1562
|
+
" openteam local on Reactiva el routing local-first",
|
|
1504
1563
|
" openteam doctor Diagnóstico de runtimes y config",
|
|
1505
1564
|
" openteam agents Lista los agentes y el LLM (local/frontier) de cada uno",
|
|
1506
1565
|
" openteam console Lanza la Console web multi-sesión (Ctrl+C para parar; --open abre el navegador)",
|
|
@@ -1583,6 +1642,26 @@ async function runBaseline(positionals, deps, configPath) {
|
|
|
1583
1642
|
${HELP}`
|
|
1584
1643
|
};
|
|
1585
1644
|
}
|
|
1645
|
+
async function runLocal(positionals, deps, configPath) {
|
|
1646
|
+
const sub = positionals[1] ?? "status";
|
|
1647
|
+
if (sub !== "status" && sub !== "off" && sub !== "on") {
|
|
1648
|
+
return {
|
|
1649
|
+
exitCode: 1,
|
|
1650
|
+
stdout: `Subcomando de local desconocido: ${sub}
|
|
1651
|
+
|
|
1652
|
+
${HELP}`
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
const config = await deps.loadConfig(configPath);
|
|
1656
|
+
if (sub === "status") {
|
|
1657
|
+
return { exitCode: 0, stdout: showLocal(config).message };
|
|
1658
|
+
}
|
|
1659
|
+
const outcome = sub === "off" ? setFrontierOnly(config) : setLocalFirst(config);
|
|
1660
|
+
if (outcome.config !== undefined) {
|
|
1661
|
+
await deps.saveConfig(outcome.config, configPath);
|
|
1662
|
+
}
|
|
1663
|
+
return { exitCode: 0, stdout: outcome.message };
|
|
1664
|
+
}
|
|
1586
1665
|
async function runYolo(positionals, deps, opencodeConfigPath) {
|
|
1587
1666
|
const sub = positionals[1] ?? "status";
|
|
1588
1667
|
if (sub !== "status" && sub !== "on" && sub !== "off") {
|
|
@@ -1667,6 +1746,9 @@ async function runCli(argv, deps) {
|
|
|
1667
1746
|
if (command === "baseline") {
|
|
1668
1747
|
return await runBaseline(parsed.positionals, deps, configPath);
|
|
1669
1748
|
}
|
|
1749
|
+
if (command === "local") {
|
|
1750
|
+
return await runLocal(parsed.positionals, deps, configPath);
|
|
1751
|
+
}
|
|
1670
1752
|
if (command === "yolo") {
|
|
1671
1753
|
return await runYolo(parsed.positionals, deps, opencodeConfigPath);
|
|
1672
1754
|
}
|
|
@@ -2122,6 +2204,9 @@ function chooseModel(input) {
|
|
|
2122
2204
|
if (override === "alwaysFrontier") {
|
|
2123
2205
|
return finalizeDecision(input, tier, frontier, budgetAction, decision(frontier.model, "frontier", ["explicit-always-frontier"], []));
|
|
2124
2206
|
}
|
|
2207
|
+
if (input.config.router.frontierOnly) {
|
|
2208
|
+
return finalizeDecision(input, tier, frontier, budgetAction, decision(frontier.model, "frontier", ["router-frontier-only"], []));
|
|
2209
|
+
}
|
|
2125
2210
|
const shortEnoughForLocal = input.task.promptChars <= input.config.router.trivialPromptMaxChars;
|
|
2126
2211
|
const largeEnoughForFrontier = input.task.promptChars >= input.config.router.frontierPromptMinChars;
|
|
2127
2212
|
if (!input.task.hasCode && shortEnoughForLocal && !largeEnoughForFrontier) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chooseModel.d.ts","sourceRoot":"","sources":["../../src/router/chooseModel.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAIV,eAAe,EACf,YAAY,EACb,MAAM,SAAS,CAAC;AAoXjB,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"chooseModel.d.ts","sourceRoot":"","sources":["../../src/router/chooseModel.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAIV,eAAe,EACf,YAAY,EACb,MAAM,SAAS,CAAC;AAoXjB,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CA8HhE"}
|