omnius 1.0.188 → 1.0.189
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/dist/index.js +237 -62
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -569367,6 +569367,78 @@ var init_spinner = __esm({
|
|
|
569367
569367
|
}
|
|
569368
569368
|
});
|
|
569369
569369
|
|
|
569370
|
+
// packages/cli/src/tui/generative-progress.ts
|
|
569371
|
+
function generationKindForToolName(toolName) {
|
|
569372
|
+
if (toolName === "generate_image") return "image";
|
|
569373
|
+
if (toolName === "generate_audio") return "audio";
|
|
569374
|
+
if (toolName === "generate_video") return "video";
|
|
569375
|
+
if (toolName === "generate_tts" || toolName === "create_audio_file") return "tts";
|
|
569376
|
+
return null;
|
|
569377
|
+
}
|
|
569378
|
+
function formatGenerativeProgress(kind, event, options2 = {}) {
|
|
569379
|
+
const width = Math.max(8, Math.min(32, options2.width ?? (options2.surface === "telegram" ? 12 : 20)));
|
|
569380
|
+
const label = kindLabel(kind);
|
|
569381
|
+
const stage = stageLabel(event.stage);
|
|
569382
|
+
const pct = finitePercent(event.percent);
|
|
569383
|
+
const bytes = formatProgressBytes(event);
|
|
569384
|
+
const elapsed = formatElapsed(event.elapsedMs);
|
|
569385
|
+
const message2 = compactProgressMessage(event.message);
|
|
569386
|
+
if (typeof pct === "number") {
|
|
569387
|
+
const filled = Math.max(0, Math.min(width, Math.round(pct / 100 * width)));
|
|
569388
|
+
const bar = `${"#".repeat(filled)}${"-".repeat(width - filled)}`;
|
|
569389
|
+
return `${label} ${stage}: [${bar}] ${pct}% ${message2}${bytes}${elapsed}`;
|
|
569390
|
+
}
|
|
569391
|
+
return `${label} ${stage}: ${message2}${bytes}${elapsed}`;
|
|
569392
|
+
}
|
|
569393
|
+
function kindLabel(kind) {
|
|
569394
|
+
if (kind === "tts") return "TTS";
|
|
569395
|
+
return kind.slice(0, 1).toUpperCase() + kind.slice(1);
|
|
569396
|
+
}
|
|
569397
|
+
function stageLabel(stage) {
|
|
569398
|
+
const normalized = String(stage || "process").trim().toLowerCase();
|
|
569399
|
+
if (normalized === "setup") return "setup";
|
|
569400
|
+
if (normalized === "download") return "download";
|
|
569401
|
+
if (normalized === "load") return "load";
|
|
569402
|
+
if (normalized === "generate") return "infer";
|
|
569403
|
+
if (normalized === "save") return "save";
|
|
569404
|
+
if (normalized === "thumbnail") return "thumbnail";
|
|
569405
|
+
if (normalized === "hf_token_required") return "auth";
|
|
569406
|
+
return "process";
|
|
569407
|
+
}
|
|
569408
|
+
function finitePercent(value2) {
|
|
569409
|
+
if (typeof value2 !== "number" || !Number.isFinite(value2)) return void 0;
|
|
569410
|
+
return Math.max(0, Math.min(100, Math.round(value2)));
|
|
569411
|
+
}
|
|
569412
|
+
function formatProgressBytes(event) {
|
|
569413
|
+
if (typeof event.totalBytes !== "number" || !Number.isFinite(event.totalBytes) || event.totalBytes <= 0) {
|
|
569414
|
+
return "";
|
|
569415
|
+
}
|
|
569416
|
+
const downloaded = typeof event.downloadedBytes === "number" && Number.isFinite(event.downloadedBytes) ? Math.max(0, event.downloadedBytes) : 0;
|
|
569417
|
+
return ` (${formatBytes3(downloaded)} / ${formatBytes3(event.totalBytes)})`;
|
|
569418
|
+
}
|
|
569419
|
+
function formatElapsed(elapsedMs2) {
|
|
569420
|
+
if (typeof elapsedMs2 !== "number" || !Number.isFinite(elapsedMs2) || elapsedMs2 <= 1500) return "";
|
|
569421
|
+
return ` ${Math.round(elapsedMs2 / 1e3)}s`;
|
|
569422
|
+
}
|
|
569423
|
+
function compactProgressMessage(message2) {
|
|
569424
|
+
return String(message2 || "working").replace(/\s+/g, " ").trim().slice(0, 220);
|
|
569425
|
+
}
|
|
569426
|
+
function formatBytes3(value2) {
|
|
569427
|
+
const units = ["B", "KB", "MB", "GB", "TB"];
|
|
569428
|
+
let amount = Math.max(0, value2);
|
|
569429
|
+
let idx = 0;
|
|
569430
|
+
while (amount >= 1024 && idx < units.length - 1) {
|
|
569431
|
+
amount /= 1024;
|
|
569432
|
+
idx++;
|
|
569433
|
+
}
|
|
569434
|
+
return idx === 0 ? `${Math.round(amount)}B` : `${amount.toFixed(1)}${units[idx]}`;
|
|
569435
|
+
}
|
|
569436
|
+
var init_generative_progress = __esm({
|
|
569437
|
+
"packages/cli/src/tui/generative-progress.ts"() {
|
|
569438
|
+
"use strict";
|
|
569439
|
+
}
|
|
569440
|
+
});
|
|
569441
|
+
|
|
569370
569442
|
// packages/cli/src/api/py-embed.ts
|
|
569371
569443
|
var py_embed_exports = {};
|
|
569372
569444
|
__export(py_embed_exports, {
|
|
@@ -575958,7 +576030,7 @@ async function fetchOllamaModels(baseUrl) {
|
|
|
575958
576030
|
const family = m2.details?.family;
|
|
575959
576031
|
return {
|
|
575960
576032
|
name: m2.name,
|
|
575961
|
-
size:
|
|
576033
|
+
size: formatBytes4(m2.size),
|
|
575962
576034
|
sizeBytes: m2.size,
|
|
575963
576035
|
modified: formatRelativeTime(m2.modified_at),
|
|
575964
576036
|
parameterSize: m2.details?.parameter_size,
|
|
@@ -576404,7 +576476,7 @@ async function queryModelCapabilities(baseUrl, modelName) {
|
|
|
576404
576476
|
return caps;
|
|
576405
576477
|
}
|
|
576406
576478
|
}
|
|
576407
|
-
function
|
|
576479
|
+
function formatBytes4(bytes) {
|
|
576408
576480
|
if (bytes < 1024) return `${bytes} B`;
|
|
576409
576481
|
const units = ["KB", "MB", "GB", "TB"];
|
|
576410
576482
|
let size = bytes;
|
|
@@ -595609,7 +595681,7 @@ function formatWorkspaceExplorer(result) {
|
|
|
595609
595681
|
const width = Math.max(12, ...result.entries.map((entry) => entry.path.length));
|
|
595610
595682
|
for (const entry of result.entries) {
|
|
595611
595683
|
lines.push(
|
|
595612
|
-
` ${entry.path.padEnd(Math.min(width, 70)).slice(0, 70)} ${entry.kind.padEnd(6)} ${
|
|
595684
|
+
` ${entry.path.padEnd(Math.min(width, 70)).slice(0, 70)} ${entry.kind.padEnd(6)} ${formatBytes5(entry.sizeBytes).padStart(8)}`
|
|
595613
595685
|
);
|
|
595614
595686
|
}
|
|
595615
595687
|
lines.push("");
|
|
@@ -595631,7 +595703,7 @@ function previewWorkspaceFile(root, relPath, options2 = {}) {
|
|
|
595631
595703
|
return [
|
|
595632
595704
|
"",
|
|
595633
595705
|
` File Preview: ${relPath}`,
|
|
595634
|
-
` Size: ${
|
|
595706
|
+
` Size: ${formatBytes5(st.size)} (too large for inline preview)`,
|
|
595635
595707
|
""
|
|
595636
595708
|
].join("\n");
|
|
595637
595709
|
}
|
|
@@ -595642,7 +595714,7 @@ function previewWorkspaceFile(root, relPath, options2 = {}) {
|
|
|
595642
595714
|
return [
|
|
595643
595715
|
"",
|
|
595644
595716
|
` File Preview: ${relPath}`,
|
|
595645
|
-
` Size: ${
|
|
595717
|
+
` Size: ${formatBytes5(st.size)} Lines: ${rawLines.length}${rawLines.length > maxLines ? " (truncated)" : ""}`,
|
|
595646
595718
|
"",
|
|
595647
595719
|
...visible.map((line, idx) => ` ${String(idx + 1).padStart(gutter)} | ${line}`),
|
|
595648
595720
|
""
|
|
@@ -595673,7 +595745,7 @@ function scoreWorkspaceFile(entry, query) {
|
|
|
595673
595745
|
}
|
|
595674
595746
|
return score;
|
|
595675
595747
|
}
|
|
595676
|
-
function
|
|
595748
|
+
function formatBytes5(bytes) {
|
|
595677
595749
|
if (bytes < 1024) return `${bytes} B`;
|
|
595678
595750
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
595679
595751
|
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
@@ -601338,7 +601410,7 @@ function describeTaskComplete(summary, completed, personality = 2, _stark = fals
|
|
|
601338
601410
|
}
|
|
601339
601411
|
return `Task completed, but no summary was generated to describe the outcome`;
|
|
601340
601412
|
}
|
|
601341
|
-
function
|
|
601413
|
+
function formatBytes6(bytes) {
|
|
601342
601414
|
if (bytes < 1024) return `${bytes}B`;
|
|
601343
601415
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)}KB`;
|
|
601344
601416
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
@@ -604048,7 +604120,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
|
|
|
604048
604120
|
const pct = Math.round(received / contentLength * 100);
|
|
604049
604121
|
if (pct === 25 || pct === 50 || pct === 75 || pct === 100) {
|
|
604050
604122
|
renderInfo(
|
|
604051
|
-
` ${pct}% (${
|
|
604123
|
+
` ${pct}% (${formatBytes6(received)} / ${formatBytes6(contentLength)})`
|
|
604052
604124
|
);
|
|
604053
604125
|
}
|
|
604054
604126
|
}
|
|
@@ -604056,7 +604128,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
|
|
|
604056
604128
|
const fullBuffer = Buffer.concat(chunks);
|
|
604057
604129
|
writeFileSync54(onnxPath, fullBuffer);
|
|
604058
604130
|
renderInfo(
|
|
604059
|
-
`${model.label} model downloaded (${
|
|
604131
|
+
`${model.label} model downloaded (${formatBytes6(fullBuffer.length)}).`
|
|
604060
604132
|
);
|
|
604061
604133
|
}
|
|
604062
604134
|
}
|
|
@@ -612185,15 +612257,7 @@ async function handleImageCommand(ctx3, arg, hasLocal) {
|
|
|
612185
612257
|
return "handled";
|
|
612186
612258
|
}
|
|
612187
612259
|
function formatImageGenerationProgress(event) {
|
|
612188
|
-
|
|
612189
|
-
const elapsed = event.elapsedMs && event.elapsedMs > 1500 ? ` ${Math.round(event.elapsedMs / 1e3)}s` : "";
|
|
612190
|
-
if (typeof pct === "number") {
|
|
612191
|
-
const width = 20;
|
|
612192
|
-
const filled = Math.max(0, Math.min(width, Math.round(pct / 100 * width)));
|
|
612193
|
-
const bar = `${"#".repeat(filled)}${"-".repeat(width - filled)}`;
|
|
612194
|
-
return `Image ${event.stage}: [${bar}] ${pct}% ${event.message}${elapsed}`;
|
|
612195
|
-
}
|
|
612196
|
-
return `Image ${event.stage}: ${event.message}${elapsed}`;
|
|
612260
|
+
return formatGenerativeProgress("image", event);
|
|
612197
612261
|
}
|
|
612198
612262
|
function rateVideoPresetForHardware(preset, specs) {
|
|
612199
612263
|
const min = preset.minVramGB;
|
|
@@ -612473,15 +612537,7 @@ async function handleVideoCommand(ctx3, arg, hasLocal) {
|
|
|
612473
612537
|
return "handled";
|
|
612474
612538
|
}
|
|
612475
612539
|
function formatVideoGenerationProgress(event) {
|
|
612476
|
-
|
|
612477
|
-
const elapsed = event.elapsedMs && event.elapsedMs > 1500 ? ` ${Math.round(event.elapsedMs / 1e3)}s` : "";
|
|
612478
|
-
if (typeof pct === "number") {
|
|
612479
|
-
const width = 20;
|
|
612480
|
-
const filled = Math.max(0, Math.min(width, Math.round(pct / 100 * width)));
|
|
612481
|
-
const bar = `${"#".repeat(filled)}${"-".repeat(width - filled)}`;
|
|
612482
|
-
return `Video ${event.stage}: [${bar}] ${pct}% ${event.message}${elapsed}`;
|
|
612483
|
-
}
|
|
612484
|
-
return `Video ${event.stage}: ${event.message}${elapsed}`;
|
|
612540
|
+
return formatGenerativeProgress("video", event);
|
|
612485
612541
|
}
|
|
612486
612542
|
function activeAudioModel(settings, kind) {
|
|
612487
612543
|
return kind === "music" ? settings.musicModel : settings.soundModel;
|
|
@@ -612789,16 +612845,7 @@ async function handleAudioGenerationCommand(ctx3, arg, hasLocal, kind) {
|
|
|
612789
612845
|
return "handled";
|
|
612790
612846
|
}
|
|
612791
612847
|
function formatAudioGenerationProgress(event) {
|
|
612792
|
-
|
|
612793
|
-
const elapsed = event.elapsedMs && event.elapsedMs > 1500 ? ` ${Math.round(event.elapsedMs / 1e3)}s` : "";
|
|
612794
|
-
const bytes = typeof event.totalBytes === "number" && event.totalBytes > 0 ? ` (${formatFileSize(event.downloadedBytes ?? 0)} / ${formatFileSize(event.totalBytes)})` : "";
|
|
612795
|
-
if (typeof pct === "number") {
|
|
612796
|
-
const width = 20;
|
|
612797
|
-
const filled = Math.max(0, Math.min(width, Math.round(pct / 100 * width)));
|
|
612798
|
-
const bar = `${"#".repeat(filled)}${"-".repeat(width - filled)}`;
|
|
612799
|
-
return `Audio ${event.stage}: [${bar}] ${pct}% ${event.message}${bytes}${elapsed}`;
|
|
612800
|
-
}
|
|
612801
|
-
return `Audio ${event.stage}: ${event.message}${bytes}${elapsed}`;
|
|
612848
|
+
return formatGenerativeProgress("audio", event);
|
|
612802
612849
|
}
|
|
612803
612850
|
async function showHelpMenu(ctx3) {
|
|
612804
612851
|
const slashCommands = getSlashHelpEntries();
|
|
@@ -617947,6 +617994,7 @@ var init_commands = __esm({
|
|
|
617947
617994
|
"use strict";
|
|
617948
617995
|
init_model_picker();
|
|
617949
617996
|
init_render();
|
|
617997
|
+
init_generative_progress();
|
|
617950
617998
|
init_command_registry();
|
|
617951
617999
|
init_hf_token_prompt();
|
|
617952
618000
|
init_dist5();
|
|
@@ -626692,6 +626740,10 @@ function scopedTool(base3, root, mode) {
|
|
|
626692
626740
|
if (typeof baseSetExpander === "function") {
|
|
626693
626741
|
wrapper.setPromptExpander = (expander) => baseSetExpander.call(base3, expander);
|
|
626694
626742
|
}
|
|
626743
|
+
const baseSetProgress = base3.setProgressCallback;
|
|
626744
|
+
if (typeof baseSetProgress === "function") {
|
|
626745
|
+
wrapper.setProgressCallback = (handler) => baseSetProgress.call(base3, handler);
|
|
626746
|
+
}
|
|
626695
626747
|
return wrapper;
|
|
626696
626748
|
}
|
|
626697
626749
|
function withTelegramAutoAttachmentNotice(result, artifactCount) {
|
|
@@ -627000,6 +627052,16 @@ var init_telegram_creative_tools = __esm({
|
|
|
627000
627052
|
},
|
|
627001
627053
|
required: []
|
|
627002
627054
|
};
|
|
627055
|
+
progressHandler = null;
|
|
627056
|
+
setProgressCallback(handler) {
|
|
627057
|
+
this.progressHandler = handler;
|
|
627058
|
+
}
|
|
627059
|
+
emitProgress(start2, event) {
|
|
627060
|
+
try {
|
|
627061
|
+
this.progressHandler?.({ ...event, elapsedMs: performance.now() - start2 });
|
|
627062
|
+
} catch {
|
|
627063
|
+
}
|
|
627064
|
+
}
|
|
627003
627065
|
async execute(args) {
|
|
627004
627066
|
const start2 = performance.now();
|
|
627005
627067
|
const text = typeof args["text"] === "string" && args["text"].trim() ? args["text"].trim() : typeof args["input"] === "string" && args["input"].trim() ? args["input"].trim() : typeof args["prompt"] === "string" && args["prompt"].trim() ? args["prompt"].trim() : "";
|
|
@@ -627033,8 +627095,10 @@ var init_telegram_creative_tools = __esm({
|
|
|
627033
627095
|
}
|
|
627034
627096
|
let result;
|
|
627035
627097
|
try {
|
|
627098
|
+
this.emitProgress(start2, { stage: "setup", message: "Preparing scoped TTS audio file" });
|
|
627036
627099
|
await mkdir19(dirname37(guarded.path.abs), { recursive: true });
|
|
627037
627100
|
const tts = new TtsGenerateTool();
|
|
627101
|
+
this.emitProgress(start2, { stage: "load", message: "Starting TTS backend" });
|
|
627038
627102
|
result = await tts.execute({
|
|
627039
627103
|
text,
|
|
627040
627104
|
output: guarded.path.abs,
|
|
@@ -627067,6 +627131,7 @@ ${(result.error || result.output || "").slice(0, 1200)}`,
|
|
|
627067
627131
|
}
|
|
627068
627132
|
rememberCreated(this.root, guarded.path.abs);
|
|
627069
627133
|
const sizeKB = Math.round(statSync43(guarded.path.abs).size / 1024);
|
|
627134
|
+
this.emitProgress(start2, { stage: "save", message: `Saved scoped audio file (${sizeKB}KB)` });
|
|
627070
627135
|
return withTelegramAutoAttachmentNotice({
|
|
627071
627136
|
success: true,
|
|
627072
627137
|
output: `Created audio file: ${guarded.path.abs} (${sizeKB}KB WAV)
|
|
@@ -631689,7 +631754,13 @@ function normalizeTelegramCallbackQuery(update2) {
|
|
|
631689
631754
|
data
|
|
631690
631755
|
};
|
|
631691
631756
|
}
|
|
631692
|
-
function adaptTool5(tool, todoSessionId) {
|
|
631757
|
+
function adaptTool5(tool, todoSessionId, progress) {
|
|
631758
|
+
const progressTool = tool;
|
|
631759
|
+
if (generationKindForToolName(tool.name) && typeof progressTool.setProgressCallback === "function") {
|
|
631760
|
+
progressTool.setProgressCallback((event) => {
|
|
631761
|
+
progress?.onProgress(tool.name, event);
|
|
631762
|
+
});
|
|
631763
|
+
}
|
|
631693
631764
|
return {
|
|
631694
631765
|
name: tool.name,
|
|
631695
631766
|
description: tool.description,
|
|
@@ -631701,7 +631772,15 @@ function adaptTool5(tool, todoSessionId) {
|
|
|
631701
631772
|
}
|
|
631702
631773
|
try {
|
|
631703
631774
|
const result = await tool.execute(args);
|
|
631775
|
+
progress?.complete(tool.name, result);
|
|
631704
631776
|
return { success: result.success, output: result.output, error: result.error, llmContent: result.llmContent };
|
|
631777
|
+
} catch (err) {
|
|
631778
|
+
progress?.complete(tool.name, {
|
|
631779
|
+
success: false,
|
|
631780
|
+
output: "",
|
|
631781
|
+
error: err instanceof Error ? err.message : String(err)
|
|
631782
|
+
});
|
|
631783
|
+
throw err;
|
|
631705
631784
|
} finally {
|
|
631706
631785
|
if (todoSessionId && (tool.name === "todo_write" || tool.name === "todo_read")) {
|
|
631707
631786
|
setTodoSessionId(previousTodoSession);
|
|
@@ -631872,6 +631951,7 @@ var init_telegram_bridge = __esm({
|
|
|
631872
631951
|
init_scoped_personality();
|
|
631873
631952
|
init_voice_soul();
|
|
631874
631953
|
init_telegram_creative_tools();
|
|
631954
|
+
init_generative_progress();
|
|
631875
631955
|
init_omnius_directory();
|
|
631876
631956
|
init_stimulation();
|
|
631877
631957
|
init_pid_controller();
|
|
@@ -638353,6 +638433,91 @@ ${TELEGRAM_PUBLIC_ORCHESTRATOR_CONTRACT}`);
|
|
|
638353
638433
|
async sendChatAction(chatId, action) {
|
|
638354
638434
|
await this.apiCall("sendChatAction", { chat_id: chatId, action });
|
|
638355
638435
|
}
|
|
638436
|
+
createTelegramGenerativeProgressBridge(chatId, msg) {
|
|
638437
|
+
if (chatId === void 0) return void 0;
|
|
638438
|
+
const states = /* @__PURE__ */ new Map();
|
|
638439
|
+
const stateFor = (toolName) => {
|
|
638440
|
+
let state = states.get(toolName);
|
|
638441
|
+
if (!state) {
|
|
638442
|
+
state = {
|
|
638443
|
+
messageId: null,
|
|
638444
|
+
pump: null,
|
|
638445
|
+
queuedHtml: null,
|
|
638446
|
+
lastRenderedAt: 0
|
|
638447
|
+
};
|
|
638448
|
+
states.set(toolName, state);
|
|
638449
|
+
}
|
|
638450
|
+
return state;
|
|
638451
|
+
};
|
|
638452
|
+
const kindTitle = (toolName) => {
|
|
638453
|
+
const kind = generationKindForToolName(toolName);
|
|
638454
|
+
if (!kind) return "Generation";
|
|
638455
|
+
if (kind === "tts") return "TTS audio";
|
|
638456
|
+
return `${kind.slice(0, 1).toUpperCase()}${kind.slice(1)}`;
|
|
638457
|
+
};
|
|
638458
|
+
const enqueue = (state, html) => {
|
|
638459
|
+
state.queuedHtml = html;
|
|
638460
|
+
if (state.pump) return;
|
|
638461
|
+
state.pump = (async () => {
|
|
638462
|
+
while (state.queuedHtml) {
|
|
638463
|
+
const nextHtml = state.queuedHtml;
|
|
638464
|
+
state.queuedHtml = null;
|
|
638465
|
+
if (state.messageId === null) {
|
|
638466
|
+
const messageId = await this.sendLiveMessage(chatId, nextHtml, msg?.messageId);
|
|
638467
|
+
if (!messageId) return;
|
|
638468
|
+
state.messageId = messageId;
|
|
638469
|
+
} else {
|
|
638470
|
+
await this.editLiveMessage(chatId, state.messageId, nextHtml);
|
|
638471
|
+
}
|
|
638472
|
+
}
|
|
638473
|
+
})().catch(() => {
|
|
638474
|
+
}).finally(() => {
|
|
638475
|
+
state.pump = null;
|
|
638476
|
+
if (state.queuedHtml) enqueue(state, state.queuedHtml);
|
|
638477
|
+
});
|
|
638478
|
+
};
|
|
638479
|
+
const progressHtml = (toolName, event) => {
|
|
638480
|
+
const kind = generationKindForToolName(toolName);
|
|
638481
|
+
if (!kind) return null;
|
|
638482
|
+
const rendered = redactTelegramLocalPaths(formatGenerativeProgress(kind, event, { surface: "telegram" }));
|
|
638483
|
+
return `<b>${escapeTelegramHTML(kindTitle(toolName))} generation</b>
|
|
638484
|
+
<code>${escapeTelegramHTML(rendered)}</code>`;
|
|
638485
|
+
};
|
|
638486
|
+
const completeHtml = (toolName, result) => {
|
|
638487
|
+
if (!generationKindForToolName(toolName)) return null;
|
|
638488
|
+
if (result.success) {
|
|
638489
|
+
return `<b>${escapeTelegramHTML(kindTitle(toolName))} generation complete</b>`;
|
|
638490
|
+
}
|
|
638491
|
+
const reason = redactTelegramLocalPaths((result.error || result.output || "Generation failed").slice(0, 900));
|
|
638492
|
+
return `<b>${escapeTelegramHTML(kindTitle(toolName))} generation failed</b>
|
|
638493
|
+
<code>${escapeTelegramHTML(reason)}</code>`;
|
|
638494
|
+
};
|
|
638495
|
+
return {
|
|
638496
|
+
onProgress: (toolName, event) => {
|
|
638497
|
+
const html = progressHtml(toolName, event);
|
|
638498
|
+
if (!html) return;
|
|
638499
|
+
const state = stateFor(toolName);
|
|
638500
|
+
const now = Date.now();
|
|
638501
|
+
const stage = String(event.stage || "process");
|
|
638502
|
+
const percent = typeof event.percent === "number" && Number.isFinite(event.percent) ? Math.round(event.percent) : void 0;
|
|
638503
|
+
const terminalStage = stage === "save" || stage === "thumbnail" || stage === "hf_token_required";
|
|
638504
|
+
const shouldRender = state.lastRenderedAt === 0 || stage !== state.lastStage || typeof percent === "number" && (state.lastPercent === void 0 || Math.abs(percent - state.lastPercent) >= 5) || now - state.lastRenderedAt >= 3500 || terminalStage;
|
|
638505
|
+
if (!shouldRender) return;
|
|
638506
|
+
state.lastRenderedAt = now;
|
|
638507
|
+
state.lastStage = stage;
|
|
638508
|
+
state.lastPercent = percent;
|
|
638509
|
+
enqueue(state, html);
|
|
638510
|
+
},
|
|
638511
|
+
complete: (toolName, result) => {
|
|
638512
|
+
if (!generationKindForToolName(toolName)) return;
|
|
638513
|
+
const state = states.get(toolName);
|
|
638514
|
+
if (!state && result.success) return;
|
|
638515
|
+
const html = completeHtml(toolName, result);
|
|
638516
|
+
if (!html) return;
|
|
638517
|
+
enqueue(state ?? stateFor(toolName), html);
|
|
638518
|
+
}
|
|
638519
|
+
};
|
|
638520
|
+
}
|
|
638356
638521
|
// ── Live message streaming (editMessageText pattern) ─────────────────
|
|
638357
638522
|
/**
|
|
638358
638523
|
* Send a placeholder message that will be progressively edited with
|
|
@@ -640385,6 +640550,7 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
640385
640550
|
const imageDefaults = this.imageGenerationDefaultsForRepo(repoRoot);
|
|
640386
640551
|
const audioDefaults = this.audioGenerationDefaultsForRepo(repoRoot);
|
|
640387
640552
|
const videoDefaults = this.videoGenerationDefaultsForRepo(repoRoot);
|
|
640553
|
+
const generativeProgress = this.createTelegramGenerativeProgressBridge(chatId, msg);
|
|
640388
640554
|
const taskComplete = {
|
|
640389
640555
|
name: "task_complete",
|
|
640390
640556
|
description: "Internal completion signal for Telegram runs. Put the actual user-facing reply in assistant text before calling this. Use summary 'no_reply' only to silently skip responding; never write that sentinel as assistant text.",
|
|
@@ -640531,7 +640697,7 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
640531
640697
|
}
|
|
640532
640698
|
}
|
|
640533
640699
|
}
|
|
640534
|
-
const unfilteredAdaptedTools = allTools.map((tool) => adaptTool5(tool, todoSessionId));
|
|
640700
|
+
const unfilteredAdaptedTools = allTools.map((tool) => adaptTool5(tool, todoSessionId, generativeProgress));
|
|
640535
640701
|
let adaptedTools = unfilteredAdaptedTools;
|
|
640536
640702
|
adaptedTools = applyToolPolicy(adaptedTools, context2, this.toolPolicyConfig);
|
|
640537
640703
|
if (context2 === "telegram-admin-dm") {
|
|
@@ -640546,9 +640712,9 @@ Scoped workspace: ${scopedRoot}`,
|
|
|
640546
640712
|
imageDefaults,
|
|
640547
640713
|
audioDefaults,
|
|
640548
640714
|
videoDefaults
|
|
640549
|
-
).map((tool) => adaptTool5(tool, todoSessionId));
|
|
640715
|
+
).map((tool) => adaptTool5(tool, todoSessionId, generativeProgress));
|
|
640550
640716
|
adaptedTools.push(...creativeTools);
|
|
640551
|
-
adaptedTools.push(adaptTool5(this.buildTelegramSendFileTool(context2, repoRoot, chatId, msg), todoSessionId));
|
|
640717
|
+
adaptedTools.push(adaptTool5(this.buildTelegramSendFileTool(context2, repoRoot, chatId, msg), todoSessionId, generativeProgress));
|
|
640552
640718
|
adaptedTools = this.filterNonAdminTelegramTools(adaptedTools);
|
|
640553
640719
|
adaptedTools = adaptedTools.map((tool) => this.applyTelegramPublicQuota(tool, context2, chatId, msg));
|
|
640554
640720
|
}
|
|
@@ -643293,7 +643459,7 @@ function buildShellLiveBlockLines(state, width) {
|
|
|
643293
643459
|
const w = Math.max(36, width);
|
|
643294
643460
|
const inner = Math.max(1, w - 4);
|
|
643295
643461
|
const elapsed = Math.max(0, Date.now() - state.startedAt);
|
|
643296
|
-
const status = state.status === "running" ? `live ${
|
|
643462
|
+
const status = state.status === "running" ? `live ${formatElapsed2(elapsed)}` : state.status;
|
|
643297
643463
|
const title = ` Shell ${status} `;
|
|
643298
643464
|
const top = `╭${fitWithFill(`─${title}`, w - 2, "─")}╮`;
|
|
643299
643465
|
const bottom = `╰${"─".repeat(w - 2)}╯`;
|
|
@@ -643338,7 +643504,7 @@ function fitWithFill(value2, width, fill) {
|
|
|
643338
643504
|
if (chars.length > width) return chars.slice(0, width).join("");
|
|
643339
643505
|
return value2 + fill.repeat(width - chars.length);
|
|
643340
643506
|
}
|
|
643341
|
-
function
|
|
643507
|
+
function formatElapsed2(ms) {
|
|
643342
643508
|
const seconds = Math.floor(ms / 1e3);
|
|
643343
643509
|
if (seconds < 60) return `${seconds}s`;
|
|
643344
643510
|
const minutes = Math.floor(seconds / 60);
|
|
@@ -668837,6 +669003,12 @@ function getVersion4() {
|
|
|
668837
669003
|
return "0.0.0";
|
|
668838
669004
|
}
|
|
668839
669005
|
function adaptTool6(tool) {
|
|
669006
|
+
const progressTool = tool;
|
|
669007
|
+
if (generationKindForToolName(tool.name) && typeof progressTool.setProgressCallback === "function") {
|
|
669008
|
+
progressTool.setProgressCallback((event) => {
|
|
669009
|
+
_generativeProgressSink?.(tool.name, event);
|
|
669010
|
+
});
|
|
669011
|
+
}
|
|
668840
669012
|
return {
|
|
668841
669013
|
name: tool.name,
|
|
668842
669014
|
description: tool.description,
|
|
@@ -669147,6 +669319,17 @@ function audioGenerationDefaultsForRepo(repoRoot) {
|
|
|
669147
669319
|
function createConfiguredAudioGenerateTool(repoRoot) {
|
|
669148
669320
|
return new AudioGenerateTool(repoRoot, audioGenerationDefaultsForRepo(repoRoot));
|
|
669149
669321
|
}
|
|
669322
|
+
function videoGenerationDefaultsForRepo(repoRoot) {
|
|
669323
|
+
const settings = resolveSettings(repoRoot);
|
|
669324
|
+
return {
|
|
669325
|
+
model: typeof settings.videoModel === "string" && settings.videoModel.trim() ? settings.videoModel : void 0,
|
|
669326
|
+
backend: settings.videoBackend,
|
|
669327
|
+
defaultKind: settings.videoKind
|
|
669328
|
+
};
|
|
669329
|
+
}
|
|
669330
|
+
function createConfiguredVideoGenerateTool(repoRoot) {
|
|
669331
|
+
return new VideoGenerateTool(repoRoot, videoGenerationDefaultsForRepo(repoRoot));
|
|
669332
|
+
}
|
|
669150
669333
|
function buildSubAgentTools(repoRoot, config) {
|
|
669151
669334
|
return [
|
|
669152
669335
|
// File + search
|
|
@@ -669245,6 +669428,7 @@ function buildSubAgentTools(repoRoot, config) {
|
|
|
669245
669428
|
new CameraCaptureTool(),
|
|
669246
669429
|
createConfiguredImageGenerateTool(repoRoot, config.backendUrl),
|
|
669247
669430
|
createConfiguredAudioGenerateTool(repoRoot),
|
|
669431
|
+
createConfiguredVideoGenerateTool(repoRoot),
|
|
669248
669432
|
// Hardware sensors + radios (read-only scans)
|
|
669249
669433
|
new GpsLocationTool(),
|
|
669250
669434
|
new WifiControlTool(),
|
|
@@ -669332,6 +669516,8 @@ function buildTools(repoRoot, config, contextWindowSize, modelTier) {
|
|
|
669332
669516
|
createConfiguredImageGenerateTool(repoRoot, config.backendUrl),
|
|
669333
669517
|
// Sound/music Generation — local Diffusers/AudioCraft/Stable Audio paths
|
|
669334
669518
|
createConfiguredAudioGenerateTool(repoRoot),
|
|
669519
|
+
// Video Generation — local Diffusers/ComfyUI video pipelines
|
|
669520
|
+
createConfiguredVideoGenerateTool(repoRoot),
|
|
669335
669521
|
// Structured file reading (CSV, JSON, Markdown, binary detection)
|
|
669336
669522
|
new StructuredReadTool(repoRoot),
|
|
669337
669523
|
// Vision tools (Moondream — desktop awareness + point-and-click)
|
|
@@ -669994,16 +670180,6 @@ async function renderAsciiPreviewForImage(imagePath, displayPath, title, writer)
|
|
|
669994
670180
|
return "";
|
|
669995
670181
|
}
|
|
669996
670182
|
}
|
|
669997
|
-
function formatImageGenerationProgress2(event) {
|
|
669998
|
-
const elapsed = event.elapsedMs && event.elapsedMs > 1500 ? ` ${Math.round(event.elapsedMs / 1e3)}s` : "";
|
|
669999
|
-
if (typeof event.percent === "number") {
|
|
670000
|
-
const width = 20;
|
|
670001
|
-
const filled = Math.max(0, Math.min(width, Math.round(event.percent / 100 * width)));
|
|
670002
|
-
const bar = `${"#".repeat(filled)}${"-".repeat(width - filled)}`;
|
|
670003
|
-
return `Image ${event.stage}: [${bar}] ${event.percent}% ${event.message}${elapsed}`;
|
|
670004
|
-
}
|
|
670005
|
-
return `Image ${event.stage}: ${event.message}${elapsed}`;
|
|
670006
|
-
}
|
|
670007
670183
|
async function renderAsciiPreviewForToolResult(toolName, output, repoRoot, writer) {
|
|
670008
670184
|
if (!output) return;
|
|
670009
670185
|
try {
|
|
@@ -671144,14 +671320,11 @@ ${entry.fullContent}`
|
|
|
671144
671320
|
fn();
|
|
671145
671321
|
}
|
|
671146
671322
|
};
|
|
671147
|
-
|
|
671148
|
-
const
|
|
671149
|
-
if (
|
|
671150
|
-
|
|
671151
|
-
|
|
671152
|
-
});
|
|
671153
|
-
}
|
|
671154
|
-
}
|
|
671323
|
+
_generativeProgressSink = (toolName, event) => {
|
|
671324
|
+
const kind = generationKindForToolName(toolName);
|
|
671325
|
+
if (!kind) return;
|
|
671326
|
+
contentWrite(() => renderInfo(formatGenerativeProgress(kind, event, { surface: "tui" })));
|
|
671327
|
+
};
|
|
671155
671328
|
let liveShellBlock = null;
|
|
671156
671329
|
const scheduleLiveShellRepaint = () => {
|
|
671157
671330
|
if (!liveShellBlock || liveShellBlock.repaintTimer || !statusBar?.isActive)
|
|
@@ -677927,7 +678100,7 @@ Rules:
|
|
|
677927
678100
|
process.exit(1);
|
|
677928
678101
|
}
|
|
677929
678102
|
}
|
|
677930
|
-
var NEXUS_DIRECTORY_ORIGIN3, NEXUS_AGENT_DIRECTORY_URL, NEXUS_SPONSORS_URL3, _interactiveSessionActive, _interactiveSessionReason, _voiceChatSession2, taskManager, _apiCallbacks, _shellToolRef, _replToolRef, _fullSubAgentToolRef, _agentToolRef, _sendMessageToolRef, _agentLifecycleMgr, _activeRunnerRef, _parentRunnerForArchive, _wireSubAgentCallbacks, _wireAgentToolCallbacks, _wireSubAgentToolCallbacks, _autoUpdatedThisSession, _mcpManager, _pluginManager, _mcpTools, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
|
|
678103
|
+
var NEXUS_DIRECTORY_ORIGIN3, NEXUS_AGENT_DIRECTORY_URL, NEXUS_SPONSORS_URL3, _generativeProgressSink, _interactiveSessionActive, _interactiveSessionReason, _voiceChatSession2, taskManager, _apiCallbacks, _shellToolRef, _replToolRef, _fullSubAgentToolRef, _agentToolRef, _sendMessageToolRef, _agentLifecycleMgr, _activeRunnerRef, _parentRunnerForArchive, _wireSubAgentCallbacks, _wireAgentToolCallbacks, _wireSubAgentToolCallbacks, _autoUpdatedThisSession, _mcpManager, _pluginManager, _mcpTools, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
|
|
677931
678104
|
var init_interactive = __esm({
|
|
677932
678105
|
"packages/cli/src/tui/interactive.ts"() {
|
|
677933
678106
|
"use strict";
|
|
@@ -677936,6 +678109,7 @@ var init_interactive = __esm({
|
|
|
677936
678109
|
init_dist8();
|
|
677937
678110
|
init_dist8();
|
|
677938
678111
|
init_dist5();
|
|
678112
|
+
init_generative_progress();
|
|
677939
678113
|
init_dist();
|
|
677940
678114
|
init_listen();
|
|
677941
678115
|
init_voice_session();
|
|
@@ -677986,6 +678160,7 @@ var init_interactive = __esm({
|
|
|
677986
678160
|
NEXUS_DIRECTORY_ORIGIN3 = (process.env["OMNIUS_NEXUS_DIRECTORY_ORIGIN"] || process.env["OMNIUS_NEXUS_SIGNALING_SERVER"] || "https://openagents.nexus").replace(/\/+$/, "");
|
|
677987
678161
|
NEXUS_AGENT_DIRECTORY_URL = `${NEXUS_DIRECTORY_ORIGIN3}/api/v1/directory`;
|
|
677988
678162
|
NEXUS_SPONSORS_URL3 = `${NEXUS_DIRECTORY_ORIGIN3}/api/v1/sponsors`;
|
|
678163
|
+
_generativeProgressSink = null;
|
|
677989
678164
|
_interactiveSessionActive = false;
|
|
677990
678165
|
_interactiveSessionReason = "";
|
|
677991
678166
|
_voiceChatSession2 = null;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.189",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.189",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED