omnius 1.0.214 → 1.0.215

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 CHANGED
@@ -578422,6 +578422,70 @@ var init_generative_progress = __esm({
578422
578422
  }
578423
578423
  });
578424
578424
 
578425
+ // packages/cli/src/tui/tool-adapter.ts
578426
+ function mapExecutionToolResult(result) {
578427
+ return {
578428
+ success: result.success,
578429
+ output: result.output,
578430
+ error: result.error,
578431
+ llmContent: result.llmContent,
578432
+ mutated: result.mutated,
578433
+ mutatedFiles: result.mutatedFiles,
578434
+ diff: result.diff,
578435
+ dryRun: result.dryRun,
578436
+ noop: result.noop,
578437
+ partial: result.partial,
578438
+ beforeHash: result.beforeHash,
578439
+ afterHash: result.afterHash
578440
+ };
578441
+ }
578442
+ function adaptExecutionTool(tool, options2 = {}) {
578443
+ const progressTool = tool;
578444
+ if (generationKindForToolName(tool.name) && typeof progressTool.setProgressCallback === "function") {
578445
+ progressTool.setProgressCallback((event) => {
578446
+ options2.onProgress?.(tool.name, event);
578447
+ });
578448
+ }
578449
+ const adapted = {
578450
+ name: tool.name,
578451
+ aliases: tool.aliases,
578452
+ description: tool.description,
578453
+ parameters: tool.parameters,
578454
+ inputSchema: tool.inputSchema,
578455
+ maxResultSizeChars: tool.maxResultSizeChars,
578456
+ async execute(args) {
578457
+ const invoke = () => tool.execute(args);
578458
+ const result = options2.execute ? await options2.execute(tool, args, invoke) : await invoke();
578459
+ return mapExecutionToolResult(result);
578460
+ }
578461
+ };
578462
+ if (typeof tool.prompt === "function") {
578463
+ adapted.prompt = (context2) => tool.prompt(context2);
578464
+ }
578465
+ if (typeof tool.executeStream === "function") {
578466
+ adapted.executeStream = async function* (args) {
578467
+ const result = yield* tool.executeStream(args);
578468
+ return mapExecutionToolResult(result);
578469
+ };
578470
+ }
578471
+ if (typeof tool.validateInput === "function") {
578472
+ adapted.validateInput = (args, context2) => tool.validateInput(args, context2);
578473
+ }
578474
+ if (typeof tool.isConcurrencySafe === "function") {
578475
+ adapted.isConcurrencySafe = (args) => tool.isConcurrencySafe(args);
578476
+ }
578477
+ if (typeof tool.isReadOnly === "function") {
578478
+ adapted.isReadOnly = (args) => tool.isReadOnly(args);
578479
+ }
578480
+ return adapted;
578481
+ }
578482
+ var init_tool_adapter = __esm({
578483
+ "packages/cli/src/tui/tool-adapter.ts"() {
578484
+ "use strict";
578485
+ init_generative_progress();
578486
+ }
578487
+ });
578488
+
578425
578489
  // packages/cli/src/tui/runtime-verification.ts
578426
578490
  import { execFileSync as execFileSync6 } from "node:child_process";
578427
578491
  import { existsSync as existsSync92, readFileSync as readFileSync74, readdirSync as readdirSync29 } from "node:fs";
@@ -592024,15 +592088,7 @@ var init_p2p = __esm({
592024
592088
  import { EventEmitter as EventEmitter11 } from "node:events";
592025
592089
  import crypto13 from "node:crypto";
592026
592090
  function adaptTool(tool) {
592027
- return {
592028
- name: tool.name,
592029
- description: tool.description,
592030
- parameters: tool.parameters,
592031
- async execute(args) {
592032
- const result = await tool.execute(args);
592033
- return { success: result.success, output: result.output, error: result.error };
592034
- }
592035
- };
592091
+ return adaptExecutionTool(tool);
592036
592092
  }
592037
592093
  function getActivityFeed() {
592038
592094
  if (!_globalFeed) _globalFeed = new ActivityFeed();
@@ -592047,6 +592103,7 @@ var init_call_agent = __esm({
592047
592103
  "use strict";
592048
592104
  init_dist8();
592049
592105
  init_dist6();
592106
+ init_tool_adapter();
592050
592107
  ActivityFeed = class {
592051
592108
  entries = [];
592052
592109
  maxEntries = 100;
@@ -632130,15 +632187,7 @@ function computeSparsity(entries) {
632130
632187
  return Math.max(0, Math.min(1, 1 - avgOverlap));
632131
632188
  }
632132
632189
  function adaptTool2(tool) {
632133
- return {
632134
- name: tool.name,
632135
- description: tool.description,
632136
- parameters: tool.parameters,
632137
- async execute(args) {
632138
- const result = await tool.execute(args);
632139
- return { success: result.success, output: result.output, error: result.error };
632140
- }
632141
- };
632190
+ return adaptExecutionTool(tool);
632142
632191
  }
632143
632192
  var SNREngine;
632144
632193
  var init_snr_engine = __esm({
@@ -632148,6 +632197,7 @@ var init_snr_engine = __esm({
632148
632197
  init_dist6();
632149
632198
  init_project_context();
632150
632199
  init_render();
632200
+ init_tool_adapter();
632151
632201
  SNREngine = class {
632152
632202
  constructor(config, repoRoot) {
632153
632203
  this.config = config;
@@ -632608,15 +632658,7 @@ ${sections.join("\n\n")}`;
632608
632658
  }
632609
632659
  }
632610
632660
  function adaptTool3(tool) {
632611
- return {
632612
- name: tool.name,
632613
- description: tool.description,
632614
- parameters: tool.parameters,
632615
- async execute(args) {
632616
- const result = await tool.execute(args);
632617
- return { success: result.success, output: result.output, error: result.error };
632618
- }
632619
- };
632661
+ return adaptExecutionTool(tool);
632620
632662
  }
632621
632663
  function buildDreamPrompt(mode, stage, cycleNum, totalCycles, previousFindings, dreamsDir) {
632622
632664
  const modeDesc = mode === "lucid" ? "LUCID DREAM MODE: You have full implementation capability. After ideation, you will implement, test, and evaluate changes." : mode === "deep" ? "DEEP DREAM MODE: Explore deeply with multiple expansion/contraction cycles. All proposals go in .omnius/dreams/." : "DREAM MODE: Creative exploration only. All output must be written to .omnius/dreams/ directory using file_write.";
@@ -632758,6 +632800,7 @@ var init_dream_engine = __esm({
632758
632800
  init_setup();
632759
632801
  init_render();
632760
632802
  init_promptLoader3();
632803
+ init_tool_adapter();
632761
632804
  _dreamWriteContent = null;
632762
632805
  SWARM_ROLE_CONFIG = {
632763
632806
  researcher: { maxTurns: 25, temperature: 0.4 },
@@ -634546,15 +634589,7 @@ Reflect on what went well and what could improve.`;
634546
634589
  }
634547
634590
  }
634548
634591
  function adaptTool4(tool) {
634549
- return {
634550
- name: tool.name,
634551
- description: tool.description,
634552
- parameters: tool.parameters,
634553
- async execute(args) {
634554
- const result = await tool.execute(args);
634555
- return { success: result.success, output: result.output, error: result.error };
634556
- }
634557
- };
634592
+ return adaptExecutionTool(tool);
634558
634593
  }
634559
634594
  function renderDMNCycleStart(cycleNum, deliberation = false) {
634560
634595
  process.stdout.write(`
@@ -634622,6 +634657,7 @@ var init_dmn_engine = __esm({
634622
634657
  init_project_context();
634623
634658
  init_render();
634624
634659
  init_promptLoader3();
634660
+ init_tool_adapter();
634625
634661
  DMNEngine = class {
634626
634662
  constructor(config, repoRoot) {
634627
634663
  this.config = config;
@@ -642252,25 +642288,17 @@ function normalizeTelegramCallbackQuery(update2) {
642252
642288
  };
642253
642289
  }
642254
642290
  function adaptTool5(tool, todoSessionId, progress) {
642255
- const progressTool = tool;
642256
- if (generationKindForToolName(tool.name) && typeof progressTool.setProgressCallback === "function") {
642257
- progressTool.setProgressCallback((event) => {
642258
- progress?.onProgress(tool.name, event);
642259
- });
642260
- }
642261
- return {
642262
- name: tool.name,
642263
- description: tool.description,
642264
- parameters: tool.parameters,
642265
- async execute(args) {
642291
+ return adaptExecutionTool(tool, {
642292
+ onProgress: (toolName, event) => progress?.onProgress(toolName, event),
642293
+ execute: async (_tool, args, invoke) => {
642266
642294
  const previousTodoSession = todoSessionId ? getTodoSessionId() : "";
642267
642295
  if (todoSessionId && (tool.name === "todo_write" || tool.name === "todo_read")) {
642268
642296
  setTodoSessionId(todoSessionId);
642269
642297
  }
642270
642298
  try {
642271
- const result = await tool.execute(args);
642299
+ const result = await invoke();
642272
642300
  progress?.complete(tool.name, result);
642273
- return { success: result.success, output: result.output, error: result.error, llmContent: result.llmContent };
642301
+ return result;
642274
642302
  } catch (err) {
642275
642303
  progress?.complete(tool.name, {
642276
642304
  success: false,
@@ -642284,7 +642312,7 @@ function adaptTool5(tool, todoSessionId, progress) {
642284
642312
  }
642285
642313
  }
642286
642314
  }
642287
- };
642315
+ });
642288
642316
  }
642289
642317
  function telegramBotAccessSettingsFromApi(settings) {
642290
642318
  return {
@@ -642449,6 +642477,7 @@ var init_telegram_bridge = __esm({
642449
642477
  init_voice_soul();
642450
642478
  init_telegram_creative_tools();
642451
642479
  init_generative_progress();
642480
+ init_tool_adapter();
642452
642481
  init_omnius_directory();
642453
642482
  init_stimulation();
642454
642483
  init_pid_controller();
@@ -681209,42 +681238,9 @@ function getVersion4() {
681209
681238
  return "0.0.0";
681210
681239
  }
681211
681240
  function adaptTool6(tool) {
681212
- const progressTool = tool;
681213
- if (generationKindForToolName(tool.name) && typeof progressTool.setProgressCallback === "function") {
681214
- progressTool.setProgressCallback((event) => {
681215
- _generativeProgressSink?.(tool.name, event);
681216
- });
681217
- }
681218
- return {
681219
- name: tool.name,
681220
- aliases: tool.aliases,
681221
- description: tool.description,
681222
- parameters: tool.parameters,
681223
- inputSchema: tool.inputSchema,
681224
- prompt: tool.prompt,
681225
- executeStream: tool.executeStream,
681226
- validateInput: tool.validateInput,
681227
- isConcurrencySafe: tool.isConcurrencySafe,
681228
- isReadOnly: tool.isReadOnly,
681229
- maxResultSizeChars: tool.maxResultSizeChars,
681230
- async execute(args) {
681231
- const result = await tool.execute(args);
681232
- return {
681233
- success: result.success,
681234
- output: result.output,
681235
- error: result.error,
681236
- llmContent: result.llmContent,
681237
- mutated: result.mutated,
681238
- mutatedFiles: result.mutatedFiles,
681239
- diff: result.diff,
681240
- dryRun: result.dryRun,
681241
- noop: result.noop,
681242
- partial: result.partial,
681243
- beforeHash: result.beforeHash,
681244
- afterHash: result.afterHash
681245
- };
681246
- }
681247
- };
681241
+ return adaptExecutionTool(tool, {
681242
+ onProgress: (toolName, event) => _generativeProgressSink?.(toolName, event)
681243
+ });
681248
681244
  }
681249
681245
  function createTuiReminderOptions(allowActionDelivery = true) {
681250
681246
  const sessionId = process.env["OMNIUS_SESSION_ID"] || "terminal";
@@ -690440,6 +690436,7 @@ var init_interactive = __esm({
690440
690436
  init_dist8();
690441
690437
  init_dist6();
690442
690438
  init_generative_progress();
690439
+ init_tool_adapter();
690443
690440
  init_runtime_verification();
690444
690441
  init_dist();
690445
690442
  init_listen();
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.214",
3
+ "version": "1.0.215",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.214",
9
+ "version": "1.0.215",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.214",
3
+ "version": "1.0.215",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",