busybits 2.2.0 → 2.3.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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/build.json +2 -2
- package/dist/cli/busybits.js +39 -3
- package/dist/client/bundle/{app-Y2N0l58V.css → app-Cn3BvqjA.css} +1 -1
- package/dist/client/bundle/{app-BqhKcvbt.js → app-DatmLMV4.js} +5 -5
- package/dist/client/bundle/{city-DMPsypEv.js → city-Obp81Tgi.js} +1 -1
- package/dist/client/bundle/{daystats-BJLg6u8w.js → daystats-Da82sNh9.js} +1 -1
- package/dist/client/bundle/{dom-Co5ozWIR.js → dom-DPKsIT1T.js} +1 -1
- package/dist/client/bundle/{en-DRc2Oulk.js → en-D6p_-oC0.js} +1 -1
- package/dist/client/bundle/{es-DslAKAxR.js → es-aBALBWWq.js} +1 -1
- package/dist/client/bundle/{format-k7wUh6fM.js → format-DS9qjIGc.js} +1 -1
- package/dist/client/bundle/{fr-Chqn4K83.js → fr-BE8l2fLL.js} +1 -1
- package/dist/client/bundle/{main-DBC-FPBX.js → main-Bv-qstsh.js} +2 -2
- package/dist/client/bundle/{ptypane-UBqz8-gA.js → ptypane-C7Nw8-Dx.js} +1 -1
- package/dist/client/bundle/{room-name-B0XrI0hp.js → room-name-Bf-U1Fyo.js} +1 -1
- package/dist/client/bundle/{simulator-B0dhttuF.js → simulator-B4Usk2yH.js} +1 -1
- package/dist/client/bundle/{world-model-DZTQjqjZ.js → world-model-CkevAUmh.js} +1 -1
- package/dist/client/bundle/{world-stream-EkZAApmC.js → world-stream-CuZouXr_.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/index.js +158 -21
- package/mod/habblaud/.claude-plugin/plugin.json +1 -1
- package/mod/habblaud-mensagens/.claude-plugin/plugin.json +1 -1
- package/mod/habblaud-permissoes/.claude-plugin/plugin.json +1 -1
- package/mod/habblaud-pi/package.json +1 -1
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -3726,7 +3726,19 @@ var EN = {
|
|
|
3726
3726
|
"Itens deixados na sua mesa. Clique para abrir.": "Items left on your desk. Click to open.",
|
|
3727
3727
|
"na mesa": "on desk",
|
|
3728
3728
|
"Na sua mesa": "On your desk",
|
|
3729
|
-
"Mensageiro": "Courier"
|
|
3729
|
+
"Mensageiro": "Courier",
|
|
3730
|
+
"Padr\xE3o": "Default",
|
|
3731
|
+
"Padr\xE3o (ou escreva o modelo, ex.: gpt-5.5)": "Default (or type the model, e.g. gpt-5.5)",
|
|
3732
|
+
"Outro modelo": "Other model",
|
|
3733
|
+
"Carregando a lista de modelos\u2026": "Loading the model list\u2026",
|
|
3734
|
+
"Lista de modelos indispon\xEDvel: usa o padr\xE3o": "Model list unavailable: using the default",
|
|
3735
|
+
"Modelo inv\xE1lido: use letras, d\xEDgitos e . - _ / :": "Invalid model: use letters, digits and . - _ / :",
|
|
3736
|
+
"modelo inv\xE1lido": "invalid model",
|
|
3737
|
+
"modelo inv\xE1lido (use letras, d\xEDgitos e . - _ / :, at\xE9 {0} caracteres)": "invalid model (use letters, digits and . - _ / :, up to {0} characters)",
|
|
3738
|
+
"modelo desconhecido para o Claude Code": "unknown model for Claude Code",
|
|
3739
|
+
"a lista de modelos do Gentle Shell ainda n\xE3o carregou: abra o di\xE1logo de novo": "the Gentle Shell model list has not loaded yet: open the dialog again",
|
|
3740
|
+
"modelo desconhecido para o Gentle Shell": "unknown model for Gentle Shell",
|
|
3741
|
+
"no Docker o agente novo n\xE3o aceita escolher o modelo": "in Docker, a new agent cannot choose the model"
|
|
3730
3742
|
};
|
|
3731
3743
|
|
|
3732
3744
|
// shared/locales/es.ts
|
|
@@ -7429,7 +7441,19 @@ var ES = {
|
|
|
7429
7441
|
"Itens deixados na sua mesa. Clique para abrir.": "Elementos dejados en tu escritorio. Haz clic para abrir.",
|
|
7430
7442
|
"na mesa": "en el escritorio",
|
|
7431
7443
|
"Na sua mesa": "En tu escritorio",
|
|
7432
|
-
"Mensageiro": "Mensajero"
|
|
7444
|
+
"Mensageiro": "Mensajero",
|
|
7445
|
+
"Padr\xE3o": "Predeterminado",
|
|
7446
|
+
"Padr\xE3o (ou escreva o modelo, ex.: gpt-5.5)": "Predeterminado (o escribe el modelo, p. ej. gpt-5.5)",
|
|
7447
|
+
"Outro modelo": "Otro modelo",
|
|
7448
|
+
"Carregando a lista de modelos\u2026": "Cargando la lista de modelos\u2026",
|
|
7449
|
+
"Lista de modelos indispon\xEDvel: usa o padr\xE3o": "Lista de modelos no disponible: se usa el predeterminado",
|
|
7450
|
+
"Modelo inv\xE1lido: use letras, d\xEDgitos e . - _ / :": "Modelo no v\xE1lido: usa letras, d\xEDgitos y . - _ / :",
|
|
7451
|
+
"modelo inv\xE1lido": "modelo no v\xE1lido",
|
|
7452
|
+
"modelo inv\xE1lido (use letras, d\xEDgitos e . - _ / :, at\xE9 {0} caracteres)": "modelo no v\xE1lido (usa letras, d\xEDgitos y . - _ / :, hasta {0} caracteres)",
|
|
7453
|
+
"modelo desconhecido para o Claude Code": "modelo desconocido para Claude Code",
|
|
7454
|
+
"a lista de modelos do Gentle Shell ainda n\xE3o carregou: abra o di\xE1logo de novo": "la lista de modelos de Gentle Shell a\xFAn no se carg\xF3: abre el di\xE1logo de nuevo",
|
|
7455
|
+
"modelo desconhecido para o Gentle Shell": "modelo desconocido para Gentle Shell",
|
|
7456
|
+
"no Docker o agente novo n\xE3o aceita escolher o modelo": "en Docker, un agente nuevo no puede elegir el modelo"
|
|
7433
7457
|
};
|
|
7434
7458
|
|
|
7435
7459
|
// shared/locales/fr.ts
|
|
@@ -11159,7 +11183,19 @@ Exemple :
|
|
|
11159
11183
|
"Itens deixados na sua mesa. Clique para abrir.": "\xC9l\xE9ments laiss\xE9s sur votre bureau. Cliquez pour ouvrir.",
|
|
11160
11184
|
"na mesa": "sur le bureau",
|
|
11161
11185
|
"Na sua mesa": "Sur votre bureau",
|
|
11162
|
-
"Mensageiro": "Coursier"
|
|
11186
|
+
"Mensageiro": "Coursier",
|
|
11187
|
+
"Padr\xE3o": "Par d\xE9faut",
|
|
11188
|
+
"Padr\xE3o (ou escreva o modelo, ex.: gpt-5.5)": "Par d\xE9faut (ou saisissez le mod\xE8le, ex. gpt-5.5)",
|
|
11189
|
+
"Outro modelo": "Autre mod\xE8le",
|
|
11190
|
+
"Carregando a lista de modelos\u2026": "Chargement de la liste des mod\xE8les\u2026",
|
|
11191
|
+
"Lista de modelos indispon\xEDvel: usa o padr\xE3o": "Liste des mod\xE8les indisponible : le mod\xE8le par d\xE9faut est utilis\xE9",
|
|
11192
|
+
"Modelo inv\xE1lido: use letras, d\xEDgitos e . - _ / :": "Mod\xE8le invalide : utilisez des lettres, des chiffres et . - _ / :",
|
|
11193
|
+
"modelo inv\xE1lido": "mod\xE8le invalide",
|
|
11194
|
+
"modelo inv\xE1lido (use letras, d\xEDgitos e . - _ / :, at\xE9 {0} caracteres)": "mod\xE8le invalide (utilisez des lettres, des chiffres et . - _ / :, jusqu'\xE0 {0} caract\xE8res)",
|
|
11195
|
+
"modelo desconhecido para o Claude Code": "mod\xE8le inconnu pour Claude Code",
|
|
11196
|
+
"a lista de modelos do Gentle Shell ainda n\xE3o carregou: abra o di\xE1logo de novo": "la liste des mod\xE8les de Gentle Shell n'est pas encore charg\xE9e : rouvrez la bo\xEEte de dialogue",
|
|
11197
|
+
"modelo desconhecido para o Gentle Shell": "mod\xE8le inconnu pour Gentle Shell",
|
|
11198
|
+
"no Docker o agente novo n\xE3o aceita escolher o modelo": "dans Docker, un nouvel agent ne peut pas choisir le mod\xE8le"
|
|
11163
11199
|
};
|
|
11164
11200
|
|
|
11165
11201
|
// shared/locales/all.ts
|
|
@@ -20176,6 +20212,11 @@ function createApiHandler(deps) {
|
|
|
20176
20212
|
if (r) sendJson2(res, 200, r);
|
|
20177
20213
|
else sendJson2(res, 404, { error: tr("Esta sess\xE3o n\xE3o foi aberta pelo herdr.") });
|
|
20178
20214
|
}).catch((err) => fail3(res, err));
|
|
20215
|
+
} else if (path === "/api/spawn/models") {
|
|
20216
|
+
const provider = ["claude", "gentle-shell", "codex"].find((p) => p === url.searchParams.get("provider"));
|
|
20217
|
+
if (!isRead) methodNotAllowed4(res, "GET");
|
|
20218
|
+
else if (!provider) sendJson2(res, 400, { error: tr("provedor desconhecido") });
|
|
20219
|
+
else sendJson2(res, 200, deps.spawnModels?.(provider) ?? { free: false, state: "unavailable", models: [] });
|
|
20179
20220
|
} else if (path === "/api/spawn/folders") {
|
|
20180
20221
|
if (!isRead) methodNotAllowed4(res, "GET");
|
|
20181
20222
|
else (deps.spawnFolders ?? (async () => []))().then((folders) => sendJson2(res, 200, { folders }), (err) => fail3(res, err));
|
|
@@ -35267,7 +35308,7 @@ async function startUpdate(o) {
|
|
|
35267
35308
|
import { spawn as spawnProcess } from "node:child_process";
|
|
35268
35309
|
|
|
35269
35310
|
// server/spawn/spawn.ts
|
|
35270
|
-
import { execFile as
|
|
35311
|
+
import { execFile as execFile5 } from "node:child_process";
|
|
35271
35312
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
35272
35313
|
import { statSync as statSync23 } from "node:fs";
|
|
35273
35314
|
import { isAbsolute as isAbsolute7 } from "node:path";
|
|
@@ -35283,6 +35324,87 @@ function isHerdrPaneId(s2) {
|
|
|
35283
35324
|
return typeof s2 === "string" && PANE_ID.test(s2);
|
|
35284
35325
|
}
|
|
35285
35326
|
|
|
35327
|
+
// server/spawn/models.ts
|
|
35328
|
+
import { execFile as execFile4 } from "node:child_process";
|
|
35329
|
+
var MODEL_MAX = 100;
|
|
35330
|
+
var MODEL_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._/:-]*$/;
|
|
35331
|
+
var CLAUDE_MODELS = ["opus", "sonnet", "haiku", "fable"];
|
|
35332
|
+
var LIST_TTL_MS = 10 * 6e4;
|
|
35333
|
+
var LIST_TIMEOUT_MS = 15e3;
|
|
35334
|
+
var LIST_FAIL_TTL_MS = 3e4;
|
|
35335
|
+
function parseListModels(text3) {
|
|
35336
|
+
const out = [];
|
|
35337
|
+
for (const line2 of text3.split("\n").slice(1)) {
|
|
35338
|
+
const [provider, model, ...rest] = line2.trim().split(/\s+/);
|
|
35339
|
+
if (!provider || !model || !rest.length) continue;
|
|
35340
|
+
const value = `${provider}/${model}`;
|
|
35341
|
+
if (value.length <= MODEL_MAX && MODEL_PATTERN.test(value) && !out.includes(value)) out.push(value);
|
|
35342
|
+
}
|
|
35343
|
+
return out;
|
|
35344
|
+
}
|
|
35345
|
+
function modelProblem(provider, model, offered) {
|
|
35346
|
+
if (!model || model.length > MODEL_MAX || !MODEL_PATTERN.test(model)) {
|
|
35347
|
+
return tr("modelo inv\xE1lido (use letras, d\xEDgitos e . - _ / :, at\xE9 {0} caracteres)", [MODEL_MAX]);
|
|
35348
|
+
}
|
|
35349
|
+
if (provider === "claude" && !CLAUDE_MODELS.includes(model)) return tr("modelo desconhecido para o Claude Code");
|
|
35350
|
+
if (provider === "gentle-shell") {
|
|
35351
|
+
if (!offered) return tr("a lista de modelos do Gentle Shell ainda n\xE3o carregou: abra o di\xE1logo de novo");
|
|
35352
|
+
if (!offered.includes(model)) return tr("modelo desconhecido para o Gentle Shell");
|
|
35353
|
+
}
|
|
35354
|
+
return void 0;
|
|
35355
|
+
}
|
|
35356
|
+
function createGentleModelLister(opts) {
|
|
35357
|
+
const now = opts.now ?? Date.now;
|
|
35358
|
+
const ttl = opts.ttlMs ?? LIST_TTL_MS;
|
|
35359
|
+
const failTtl = opts.failTtlMs ?? LIST_FAIL_TTL_MS;
|
|
35360
|
+
const timeoutMs = opts.timeoutMs ?? LIST_TIMEOUT_MS;
|
|
35361
|
+
let cache2;
|
|
35362
|
+
let failedAt;
|
|
35363
|
+
let inflight = false;
|
|
35364
|
+
const refresh = () => {
|
|
35365
|
+
inflight = true;
|
|
35366
|
+
let timer;
|
|
35367
|
+
const deadline = new Promise((_ok, no) => {
|
|
35368
|
+
timer = setTimeout(() => no(new Error("timeout")), timeoutMs);
|
|
35369
|
+
});
|
|
35370
|
+
Promise.race([opts.run(), deadline]).then((text3) => {
|
|
35371
|
+
const models = parseListModels(text3);
|
|
35372
|
+
if (!models.length) throw new Error("empty");
|
|
35373
|
+
cache2 = { models, at: now() };
|
|
35374
|
+
failedAt = void 0;
|
|
35375
|
+
}).catch(() => {
|
|
35376
|
+
failedAt = now();
|
|
35377
|
+
}).finally(() => {
|
|
35378
|
+
clearTimeout(timer);
|
|
35379
|
+
inflight = false;
|
|
35380
|
+
});
|
|
35381
|
+
};
|
|
35382
|
+
const failedRecently = () => failedAt !== void 0 && now() - failedAt <= failTtl;
|
|
35383
|
+
return {
|
|
35384
|
+
lookup() {
|
|
35385
|
+
const stale = !cache2 || now() - cache2.at > ttl;
|
|
35386
|
+
if (stale && !inflight && !failedRecently()) refresh();
|
|
35387
|
+
if (cache2) return { state: "ready", models: [...cache2.models] };
|
|
35388
|
+
return inflight ? { state: "loading" } : { state: "unavailable" };
|
|
35389
|
+
},
|
|
35390
|
+
peek: () => cache2 ? [...cache2.models] : void 0
|
|
35391
|
+
};
|
|
35392
|
+
}
|
|
35393
|
+
function createListModelsRunner(bin, timeoutMs = LIST_TIMEOUT_MS) {
|
|
35394
|
+
return () => new Promise((ok, no) => {
|
|
35395
|
+
const path = bin();
|
|
35396
|
+
if (!path) return no(new Error("gentle-shell not found"));
|
|
35397
|
+
const child = execFile4(path, ["--", "--list-models"], { timeout: timeoutMs, windowsHide: true, encoding: "utf8", maxBuffer: 1 << 20 }, (err, out) => err ? no(err) : ok(out));
|
|
35398
|
+
child.stdin?.end();
|
|
35399
|
+
});
|
|
35400
|
+
}
|
|
35401
|
+
function modelOptions(provider, gentle) {
|
|
35402
|
+
if (provider === "claude") return { free: false, state: "ready", models: [...CLAUDE_MODELS] };
|
|
35403
|
+
if (provider === "codex") return { free: true, state: "ready", models: [] };
|
|
35404
|
+
const l = gentle.lookup();
|
|
35405
|
+
return { free: false, state: l.state, models: l.state === "ready" ? l.models : [] };
|
|
35406
|
+
}
|
|
35407
|
+
|
|
35286
35408
|
// server/spawn/spawn.ts
|
|
35287
35409
|
var PROMPT_MAX = 8e3;
|
|
35288
35410
|
var FOLDER_MAX = 1024;
|
|
@@ -35297,7 +35419,7 @@ var MAX_OPEN3 = 5;
|
|
|
35297
35419
|
var ERROR_MAX4 = 300;
|
|
35298
35420
|
var PROVIDERS = ["claude", "gentle-shell", "codex"];
|
|
35299
35421
|
var PROVIDER_NAMES = { claude: "Claude Code", "gentle-shell": "Gentle Shell", codex: "Codex" };
|
|
35300
|
-
function parseSpawn(raw) {
|
|
35422
|
+
function parseSpawn(raw, offered = () => void 0) {
|
|
35301
35423
|
const r = raw && typeof raw === "object" ? raw : {};
|
|
35302
35424
|
const folder = typeof r.folder === "string" ? r.folder.trim() : "";
|
|
35303
35425
|
const prompt = typeof r.prompt === "string" ? r.prompt.replace(/\s+$/, "") : "";
|
|
@@ -35312,7 +35434,12 @@ function parseSpawn(raw) {
|
|
|
35312
35434
|
if (destination.kind === "background" && provider !== "claude") {
|
|
35313
35435
|
return { error: tr("{0} s\xF3 abre no herdr (n\xE3o tem modo em segundo plano)", [PROVIDER_NAMES[provider]]) };
|
|
35314
35436
|
}
|
|
35315
|
-
|
|
35437
|
+
const model = r.model === void 0 || r.model === null || r.model === "" ? void 0 : r.model;
|
|
35438
|
+
if (model !== void 0) {
|
|
35439
|
+
const problem = typeof model === "string" ? modelProblem(provider, model, offered(provider)) : tr("modelo inv\xE1lido");
|
|
35440
|
+
if (problem) return { error: problem };
|
|
35441
|
+
}
|
|
35442
|
+
return { folder, prompt, provider, destination, ...typeof model === "string" ? { model } : {} };
|
|
35316
35443
|
}
|
|
35317
35444
|
function parseDestination(raw) {
|
|
35318
35445
|
if (raw === void 0) return { kind: "background" };
|
|
@@ -35337,12 +35464,12 @@ function sessionName(prompt) {
|
|
|
35337
35464
|
return cut3 ? `Busybits: ${cut3}` : "Busybits";
|
|
35338
35465
|
}
|
|
35339
35466
|
function cliArgs(req) {
|
|
35340
|
-
const args = ["--bg", "-n", sessionName(req.prompt)];
|
|
35467
|
+
const args = ["--bg", "-n", sessionName(req.prompt), ...req.model ? ["--model", req.model] : []];
|
|
35341
35468
|
return req.prompt.trim() ? [...args, "--", req.prompt] : args;
|
|
35342
35469
|
}
|
|
35343
35470
|
function createCliRunner(bin, timeoutMs = CLI_TIMEOUT_MS) {
|
|
35344
35471
|
return (req) => new Promise((ok) => {
|
|
35345
|
-
const child =
|
|
35472
|
+
const child = execFile5(bin, cliArgs(req), { cwd: req.folder, timeout: timeoutMs, windowsHide: true, encoding: "utf8" }, (err, out, stderr) => {
|
|
35346
35473
|
const id = /backgrounded\s*·\s*([\w-]+)/.exec(out ?? "")?.[1];
|
|
35347
35474
|
if (!err && id) return ok({ ok: true, id });
|
|
35348
35475
|
const line2 = [stderr, out, err?.message].map((t) => (t ?? "").split("\n").map((l) => l.trim()).find(Boolean)).find(Boolean);
|
|
@@ -35375,7 +35502,7 @@ function folderProblem(folder, stat3 = statSync23) {
|
|
|
35375
35502
|
function createOpener(platform = process.platform, timeoutMs = OPEN_TIMEOUT_MS) {
|
|
35376
35503
|
const [bin, pre2] = platform === "darwin" ? ["open", []] : platform === "win32" ? ["cmd", ["/c", "start", '""']] : ["xdg-open", []];
|
|
35377
35504
|
return (url) => new Promise((ok) => {
|
|
35378
|
-
|
|
35505
|
+
execFile5(bin, [...pre2, url], { timeout: timeoutMs, windowsHide: true, encoding: "utf8" }, (err, _out, stderr) => {
|
|
35379
35506
|
if (!err) return ok({ ok: true });
|
|
35380
35507
|
const line2 = (stderr || err.message || "").split("\n").find((l) => l.trim()) ?? tr("falhou");
|
|
35381
35508
|
ok({ ok: false, error: `${bin}: ${line2.trim()}`.slice(0, ERROR_MAX4) });
|
|
@@ -35400,11 +35527,12 @@ var SpawnService = class {
|
|
|
35400
35527
|
}
|
|
35401
35528
|
submit(raw) {
|
|
35402
35529
|
this.prune();
|
|
35403
|
-
const req = parseSpawn(raw);
|
|
35530
|
+
const req = parseSpawn(raw, (p) => p === "gentle-shell" ? this.opts.gentleModels?.() : void 0);
|
|
35404
35531
|
if ("error" in req) return { error: "invalid", reason: req.error };
|
|
35405
35532
|
if (!this.opts.opener && (req.destination.kind !== "background" || req.provider !== "claude")) {
|
|
35406
35533
|
return { error: "invalid", reason: tr("no Docker o agente novo s\xF3 abre em segundo plano, com o Claude Code") };
|
|
35407
35534
|
}
|
|
35535
|
+
if (!this.opts.opener && req.model) return { error: "invalid", reason: tr("no Docker o agente novo n\xE3o aceita escolher o modelo") };
|
|
35408
35536
|
if (req.destination.kind !== "background" && !this.opts.herdr) return { error: "unavailable", reason: tr("o herdr n\xE3o est\xE1 dispon\xEDvel") };
|
|
35409
35537
|
if (!this.available()) {
|
|
35410
35538
|
return { error: "unavailable", reason: tr("o auxiliar do computador n\xE3o est\xE1 rodando: deixe npm run codex:bridge no ar (o Habblaud est\xE1 no Docker)") };
|
|
@@ -35475,13 +35603,13 @@ var SpawnService = class {
|
|
|
35475
35603
|
}
|
|
35476
35604
|
const prompt = promptWithAttachments(e.req.prompt, paths);
|
|
35477
35605
|
const dest = e.req.destination;
|
|
35478
|
-
if (dest.kind === "background") return this.resolve(e, await launch({ folder: e.req.folder, prompt }, opener, this.opts.cli));
|
|
35606
|
+
if (dest.kind === "background") return this.resolve(e, await launch({ folder: e.req.folder, prompt, ...e.req.model ? { model: e.req.model } : {} }, opener, this.opts.cli));
|
|
35479
35607
|
return this.resolveHerdr(e, dest, prompt);
|
|
35480
35608
|
}
|
|
35481
35609
|
async resolveHerdr(e, destination, prompt) {
|
|
35482
35610
|
const herdr2 = this.opts.herdr;
|
|
35483
35611
|
if (!herdr2) return this.resolve(e, { ok: false, error: tr("o herdr n\xE3o est\xE1 dispon\xEDvel") });
|
|
35484
|
-
const { provider, folder } = e.req;
|
|
35612
|
+
const { provider, folder, model } = e.req;
|
|
35485
35613
|
const recorded = /* @__PURE__ */ new Set();
|
|
35486
35614
|
const onPane = (paneId) => {
|
|
35487
35615
|
if (recorded.has(paneId)) return;
|
|
@@ -35495,7 +35623,7 @@ var SpawnService = class {
|
|
|
35495
35623
|
e.info.error = tr("o painel {0} do herdr foi criado, mas o agente n\xE3o come\xE7ou: {1}", [paneId, e.info.error ?? ""]).slice(0, ERROR_MAX4);
|
|
35496
35624
|
}
|
|
35497
35625
|
};
|
|
35498
|
-
const r = await herdr2({ provider, folder, prompt, destination }, onPane).catch((err) => ({
|
|
35626
|
+
const r = await herdr2({ provider, folder, prompt, destination, ...model ? { model } : {} }, onPane).catch((err) => ({
|
|
35499
35627
|
ok: false,
|
|
35500
35628
|
error: String(err?.message ?? err).slice(0, ERROR_MAX4)
|
|
35501
35629
|
}));
|
|
@@ -35536,7 +35664,7 @@ var SpawnService = class {
|
|
|
35536
35664
|
};
|
|
35537
35665
|
|
|
35538
35666
|
// server/herdr/cli.ts
|
|
35539
|
-
import { execFile as
|
|
35667
|
+
import { execFile as execFile6 } from "node:child_process";
|
|
35540
35668
|
import { join as join30 } from "node:path";
|
|
35541
35669
|
var HERDR_TIMEOUT_MS = 5e3;
|
|
35542
35670
|
var TIMEOUT_SLACK_MS = 5e3;
|
|
@@ -35591,7 +35719,7 @@ function errorOf(json) {
|
|
|
35591
35719
|
function createHerdrExec(bin, env, timeoutMs = HERDR_TIMEOUT_MS) {
|
|
35592
35720
|
return (args, callTimeout) => new Promise((ok) => {
|
|
35593
35721
|
try {
|
|
35594
|
-
const child =
|
|
35722
|
+
const child = execFile6(
|
|
35595
35723
|
bin,
|
|
35596
35724
|
[...args],
|
|
35597
35725
|
{ env, timeout: callTimeout ?? timeoutMs, windowsHide: true, encoding: "utf8", maxBuffer: 4 * 1024 * 1024 },
|
|
@@ -35814,8 +35942,13 @@ var BACKOFF_MAX_MS = 2e3;
|
|
|
35814
35942
|
var INBOX_WAIT_MS = 25e3;
|
|
35815
35943
|
var EARLY_MS2 = 5e3;
|
|
35816
35944
|
var GENTLE_SHELL_COMMAND = "gentle-shell";
|
|
35817
|
-
function providerArgs(provider, name) {
|
|
35818
|
-
|
|
35945
|
+
function providerArgs(provider, name, model) {
|
|
35946
|
+
if (provider === "claude") return model ? ["-n", name, "--model", model] : ["-n", name];
|
|
35947
|
+
return model ? ["-m", model] : [];
|
|
35948
|
+
}
|
|
35949
|
+
function gentleShellCommand(model, piArgs = []) {
|
|
35950
|
+
const args = [...piArgs, ...model ? ["--model", model] : []];
|
|
35951
|
+
return args.length ? `${GENTLE_SHELL_COMMAND} -- ${args.join(" ")}` : GENTLE_SHELL_COMMAND;
|
|
35819
35952
|
}
|
|
35820
35953
|
function agentName(provider, taken, tag) {
|
|
35821
35954
|
const prefix = provider === "gentle-shell" ? "gentle" : provider;
|
|
@@ -35852,6 +35985,7 @@ function matchGentle(agents2, known, folder, at) {
|
|
|
35852
35985
|
var message = (err) => err instanceof Error ? err.message : String(err);
|
|
35853
35986
|
var sleep = (ms) => new Promise((ok) => setTimeout(ok, ms));
|
|
35854
35987
|
async function launchInHerdr(client, req, opts = {}) {
|
|
35988
|
+
if (req.model !== void 0 && (req.model.length > MODEL_MAX || !MODEL_PATTERN.test(req.model))) return { ok: false, error: tr("modelo inv\xE1lido") };
|
|
35855
35989
|
const now = opts.now ?? Date.now;
|
|
35856
35990
|
const maxMs = opts.maxMs ?? HERDR_LAUNCH_MAX_MS;
|
|
35857
35991
|
const pollMs = opts.pollMs ?? POLL_MS2;
|
|
@@ -35955,10 +36089,10 @@ async function launchInHerdr(client, req, opts = {}) {
|
|
|
35955
36089
|
try {
|
|
35956
36090
|
if (state.over) return partial(late2);
|
|
35957
36091
|
if (req.provider === "gentle-shell") {
|
|
35958
|
-
await client.run(paneId,
|
|
36092
|
+
await client.run(paneId, gentleShellCommand(req.model));
|
|
35959
36093
|
} else {
|
|
35960
36094
|
const name = agentName(req.provider, names2, launchTag(now()));
|
|
35961
|
-
await client.startAgent(name, req.provider, paneId, providerArgs(req.provider, name), Math.min(START_MAX_MS, left()));
|
|
36095
|
+
await client.startAgent(name, req.provider, paneId, providerArgs(req.provider, name, req.model), Math.min(START_MAX_MS, left()));
|
|
35962
36096
|
}
|
|
35963
36097
|
if (req.prompt.trim() || req.provider === "gentle-shell") {
|
|
35964
36098
|
await retrying(() => client.waitIdle(paneId, Math.min(START_MAX_MS, left())), noAgentYet);
|
|
@@ -36153,7 +36287,7 @@ function recentFolders(sessions, rooms, limit = FOLDERS_LIMIT) {
|
|
|
36153
36287
|
}
|
|
36154
36288
|
|
|
36155
36289
|
// server/dictation/whisper.ts
|
|
36156
|
-
import { execFile as
|
|
36290
|
+
import { execFile as execFile7 } from "node:child_process";
|
|
36157
36291
|
import { existsSync as existsSync12, mkdtempSync as mkdtempSync2, readFileSync as readFileSync26, rmSync as rmSync8, writeFileSync as writeFileSync16 } from "node:fs";
|
|
36158
36292
|
import { homedir as homedir7, tmpdir } from "node:os";
|
|
36159
36293
|
import { delimiter as delimiter2, join as join32 } from "node:path";
|
|
@@ -36182,7 +36316,7 @@ function findWhisper(env = process.env, exists = existsSync12) {
|
|
|
36182
36316
|
}
|
|
36183
36317
|
function run2(bin, args, timeoutMs) {
|
|
36184
36318
|
return new Promise((ok) => {
|
|
36185
|
-
|
|
36319
|
+
execFile7(bin, args, { timeout: timeoutMs, encoding: "utf8", maxBuffer: 8 * 1024 * 1024 }, (err, _out, stderr) => {
|
|
36186
36320
|
if (!err) return ok({ ok: true });
|
|
36187
36321
|
const line2 = (stderr || err.message || "").split("\n").filter((l) => l.trim()).pop() ?? tr("falhou");
|
|
36188
36322
|
ok({ ok: false, error: line2.trim().slice(0, 300) });
|
|
@@ -40598,11 +40732,13 @@ var gentleInbox = () => messages && {
|
|
|
40598
40732
|
return { ok: false, retry: false, reason: "reason" in r ? r.reason : tr("o agente n\xE3o foi achado") };
|
|
40599
40733
|
}
|
|
40600
40734
|
};
|
|
40735
|
+
var gentleModels = createGentleModelLister({ run: createListModelsRunner(() => config.inDocker ? void 0 : findExecutable("gentle-shell", process.env)) });
|
|
40601
40736
|
var spawn = spawnOn ? new SpawnService(
|
|
40602
40737
|
config.inDocker ? { attachments } : {
|
|
40603
40738
|
opener: createOpener(),
|
|
40604
40739
|
cli: spawnBin ? createCliRunner(spawnBin) : void 0,
|
|
40605
40740
|
attachments,
|
|
40741
|
+
gentleModels: () => gentleModels.peek(),
|
|
40606
40742
|
herdr: herdrClient ? (r, onPane) => launchInHerdr(herdrClient, r, { onPane, inbox: gentleInbox() }) : void 0,
|
|
40607
40743
|
onHerdrLaunch: herdrLinks ? (r) => herdrLinks.record(r) : void 0
|
|
40608
40744
|
}
|
|
@@ -40745,6 +40881,7 @@ var api = createApiHandler({
|
|
|
40745
40881
|
dictation,
|
|
40746
40882
|
deliveries,
|
|
40747
40883
|
files: deliveryFiles,
|
|
40884
|
+
spawnModels: (provider) => modelOptions(provider, gentleModels),
|
|
40748
40885
|
spawnFolders: async () => {
|
|
40749
40886
|
const snap = hub.current();
|
|
40750
40887
|
const last = /* @__PURE__ */ new Map();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busybits",
|
|
3
3
|
"displayName": "Busybits",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"description": "Connects the session to Busybits: records plan usage (5h and weekly) for the office, shows a line under the prompt when another session needs you, and adds the /busybits command.",
|
|
6
6
|
"author": { "name": "Márcio Junior", "url": "https://github.com/marmottajr" },
|
|
7
7
|
"homepage": "https://github.com/marmottajr/habblaud#readme",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busybits-messages",
|
|
3
3
|
"displayName": "Busybits: messages from the office",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"description": "Delivers to the Claude Code session the messages you type in Busybits (agent panel or terminal), as if you had typed them in the terminal.",
|
|
6
6
|
"author": { "name": "Márcio Junior", "url": "https://github.com/marmottajr" },
|
|
7
7
|
"homepage": "https://github.com/marmottajr/habblaud#readme",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busybits-permissions",
|
|
3
3
|
"displayName": "Busybits: permissions from the office",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"description": "PermissionRequest hook that lets you approve or deny Claude Code permission requests and answer AskUserQuestion prompts from Busybits; the dialog stays in the terminal and whichever answer comes first wins.",
|
|
6
6
|
"author": { "name": "Márcio Junior", "url": "https://github.com/marmottajr" },
|
|
7
7
|
"homepage": "https://github.com/marmottajr/habblaud#readme",
|