newmark-agent 0.3.12 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/cli-commands.d.ts +1 -0
  2. package/dist/cli-commands.js +11 -2
  3. package/dist/context/domain/types.d.ts +37 -0
  4. package/dist/context/services/context-orchestrator.js +2 -0
  5. package/dist/conversation-utility-host.bundle.cjs +1259 -132
  6. package/dist/conversation-utility-host.js +3 -0
  7. package/dist/core/agent.d.ts +139 -5
  8. package/dist/core/agent.js +964 -82
  9. package/dist/core/agentKernel/agent-loop.js +29 -3
  10. package/dist/core/agentKernel/types.d.ts +7 -0
  11. package/dist/core/agentKernelRunner.d.ts +2 -0
  12. package/dist/core/agentKernelRunner.js +121 -19
  13. package/dist/core/conversationKernel.d.ts +5 -0
  14. package/dist/core/conversationKernel.js +29 -0
  15. package/dist/core/dshCompatibility.d.ts +198 -0
  16. package/dist/core/dshCompatibility.js +600 -0
  17. package/dist/core/electronUtilityAgentClient.d.ts +4 -0
  18. package/dist/core/electronUtilityAgentClient.js +4 -0
  19. package/dist/core/electronUtilityRuntimePool.d.ts +8 -0
  20. package/dist/core/electronUtilityRuntimePool.js +14 -0
  21. package/dist/core/mcpManager.d.ts +1 -0
  22. package/dist/core/mcpManager.js +100 -10
  23. package/dist/core/subagent.d.ts +6 -0
  24. package/dist/core/subagent.js +22 -1
  25. package/dist/core/toolPolicy.d.ts +15 -0
  26. package/dist/core/toolPolicy.js +174 -1
  27. package/dist/core/types.d.ts +1 -1
  28. package/dist/core/utilityAgentProtocol.d.ts +8 -1
  29. package/dist/core/workspace.d.ts +9 -0
  30. package/dist/core/workspace.js +48 -1
  31. package/dist/core/wslAgentClient.d.ts +4 -0
  32. package/dist/core/wslAgentClient.js +4 -0
  33. package/dist/core/wslAgentProtocol.d.ts +8 -1
  34. package/dist/core/wslAgentRuntimePool.d.ts +8 -0
  35. package/dist/core/wslAgentRuntimePool.js +15 -0
  36. package/dist/launcher.js +8 -0
  37. package/dist/llm/provider.d.ts +1 -1
  38. package/dist/llm/provider.js +4 -3
  39. package/dist/main.js +163 -11
  40. package/dist/preload.js +11 -0
  41. package/dist/providers/chat-completions.adapter.js +41 -15
  42. package/dist/providers/provider-adapter.d.ts +3 -0
  43. package/dist/toolchain/registry/tool-registry.d.ts +13 -1
  44. package/dist/toolchain/registry/tool-registry.js +8 -0
  45. package/dist/toolchain/registry-seeder.js +52 -6
  46. package/dist/tools/index.d.ts +1 -0
  47. package/dist/tools/index.js +39 -2
  48. package/dist/tools/nativeTools.js +6 -1
  49. package/dist/tui/src/app.js +24 -0
  50. package/dist/tui/src/i18n.js +151 -0
  51. package/dist/tui/src/render.js +152 -61
  52. package/dist/tui/src/state.js +83 -0
  53. package/dist/ui/index.html +2669 -234
  54. package/dist/ui/lucide-sprite.svg +31 -0
  55. package/dist/wsl-agent-host.bundle.cjs +1259 -132
  56. package/dist/wsl-agent-host.js +3 -0
  57. package/package.json +6 -10
  58. package/Flow/Electron-Debug-Release.Flow.json +0 -43
  59. package/Flow/Flow.md +0 -9
  60. package/Flow/UI-Feature-Integration.Flow.json +0 -96
@@ -197,9 +197,14 @@ function createState(options = {}) {
197
197
  inputCursor: 0,
198
198
  conversationScroll: 0,
199
199
  conversationMaxScroll: 0,
200
+ contentScroll: 0,
201
+ contentFocusLine: -1,
200
202
  conversationHistoryFocus: false,
201
203
  historySelectedIndex: -1,
202
204
  historySelectedImageIndex: -1,
205
+ historyEventFocus: false,
206
+ historyEventIndex: -1,
207
+ collapsedBuildEvents: new Set(),
203
208
  historyVisibleRunIds: [],
204
209
  historyCursorDirection: 0,
205
210
  expandedBuildRuns: new Set(
@@ -549,6 +554,8 @@ function switchView(state, id) {
549
554
  state.input = "";
550
555
  state.inputCursor = 0;
551
556
  if (id === "chat") state.conversationScroll = 0;
557
+ state.contentScroll = 0;
558
+ state.contentFocusLine = -1;
552
559
  }
553
560
 
554
561
  function normalizedAutomation(item) {
@@ -1330,6 +1337,76 @@ function filteredCommands(state) {
1330
1337
  return data.commands.filter((command) => command.label.toLowerCase().includes(query));
1331
1338
  }
1332
1339
 
1340
+ function focusableEventsForRun(run) {
1341
+ return (run?.events || [])
1342
+ .filter((event) => {
1343
+ const type = String(event?.type || "").toLowerCase();
1344
+ return type && type !== "final_response" && !type.startsWith("guide");
1345
+ })
1346
+ .sort((left, right) => {
1347
+ const leftSeq = Number(left?.sequence);
1348
+ const rightSeq = Number(right?.sequence);
1349
+ if (Number.isFinite(leftSeq) && Number.isFinite(rightSeq) && leftSeq !== rightSeq) return leftSeq - rightSeq;
1350
+ const leftTime = new Date(left?.timestamp || left?.createdAt || "").getTime();
1351
+ const rightTime = new Date(right?.timestamp || right?.createdAt || "").getTime();
1352
+ return (Number.isFinite(leftTime) ? leftTime : 0) - (Number.isFinite(rightTime) ? rightTime : 0);
1353
+ });
1354
+ }
1355
+
1356
+ function buildEventKey(event, index) {
1357
+ return String(event?.id || event?.toolCallId || `${event?.type || "event"}:${event?.toolName || ""}:${index}`);
1358
+ }
1359
+
1360
+ function selectedHistoryRun(state) {
1361
+ const runs = [...(state.snapshot.workRuns || [])].sort((left, right) => Number(left.sequence || 0) - Number(right.sequence || 0));
1362
+ return runs[Number(state.historySelectedIndex) || 0];
1363
+ }
1364
+
1365
+ function enterHistoryEventFocus(state) {
1366
+ const run = selectedHistoryRun(state);
1367
+ const events = focusableEventsForRun(run);
1368
+ if (!run || !state.expandedBuildRuns?.has(run.runId) || !events.length) return false;
1369
+ state.historyEventFocus = true;
1370
+ state.historyEventIndex = 0;
1371
+ state.historySelectedImageIndex = -1;
1372
+ state.notice = `History focus · ${events.length} item(s) · Enter expand · ← back`;
1373
+ return true;
1374
+ }
1375
+
1376
+ function exitHistoryEventFocus(state) {
1377
+ state.historyEventFocus = false;
1378
+ state.historyEventIndex = -1;
1379
+ state.notice = "History focus · Build Block · Enter expands";
1380
+ return true;
1381
+ }
1382
+
1383
+ function moveHistoryEventCursor(state, direction) {
1384
+ const run = selectedHistoryRun(state);
1385
+ const events = focusableEventsForRun(run);
1386
+ if (!events.length) return false;
1387
+ const count = events.length;
1388
+ state.historyEventIndex = ((Number(state.historyEventIndex) || 0) + direction + count) % count;
1389
+ state.notice = `History focus · item ${state.historyEventIndex + 1}/${count} · Enter expand`;
1390
+ return true;
1391
+ }
1392
+
1393
+ function toggleSelectedBuildEvent(state) {
1394
+ const run = selectedHistoryRun(state);
1395
+ const events = focusableEventsForRun(run);
1396
+ const index = Number(state.historyEventIndex) || 0;
1397
+ const event = events[index];
1398
+ if (!event) return false;
1399
+ const key = buildEventKey(event, index);
1400
+ if (state.collapsedBuildEvents.has(key)) {
1401
+ state.collapsedBuildEvents.delete(key);
1402
+ state.notice = "Event expanded";
1403
+ } else {
1404
+ state.collapsedBuildEvents.add(key);
1405
+ state.notice = "Event collapsed";
1406
+ }
1407
+ return true;
1408
+ }
1409
+
1333
1410
  module.exports = {
1334
1411
  activeConversationModelLabel,
1335
1412
  INTELLIGENCE_TIERS,
@@ -1341,6 +1418,7 @@ module.exports = {
1341
1418
  applyConversationResult,
1342
1419
  beginAutomationCreate,
1343
1420
  beginWorkflowCreate,
1421
+ buildEventKey,
1344
1422
  conversationModelOptions,
1345
1423
  createAutomationFromDraft,
1346
1424
  createState,
@@ -1349,7 +1427,10 @@ module.exports = {
1349
1427
  cycleMemoryComponent,
1350
1428
  cycleSettingsTab,
1351
1429
  enterConversation,
1430
+ enterHistoryEventFocus,
1431
+ exitHistoryEventFocus,
1352
1432
  filteredCommands,
1433
+ focusableEventsForRun,
1353
1434
  itemCount,
1354
1435
  memoryColumnItems,
1355
1436
  memoryTagOptions,
@@ -1358,6 +1439,7 @@ module.exports = {
1358
1439
  moveMenuSelection,
1359
1440
  moveFocusHorizontal,
1360
1441
  moveConversationHistoryCursor,
1442
+ moveHistoryEventCursor,
1361
1443
  moveInputCursorVertical,
1362
1444
  moveSettingChoiceSelection,
1363
1445
  moveSelection,
@@ -1378,6 +1460,7 @@ module.exports = {
1378
1460
  toggleSelected,
1379
1461
  toggleConversationPinned,
1380
1462
  toggleSelectedBuildBlock,
1463
+ toggleSelectedBuildEvent,
1381
1464
  validateSelectedModel,
1382
1465
  workspaceMenuChildren
1383
1466
  };