omnius 1.0.873 → 1.0.874

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.
@@ -66,6 +66,7 @@ function sanitizeNativeInterfaceState(value) {
66
66
  devices: instruments.devices === true,
67
67
  scrollTop: offset(instruments.scrollTop),
68
68
  deviceScrollTop: offset(instruments.deviceScrollTop),
69
+ ...typeof instruments.routeAttempts === "boolean" ? { routeAttempts: instruments.routeAttempts } : {},
69
70
  ...taskNotes ? { taskNotes: { open: taskNotes.open !== false, tasks: taskNotes.tasks !== false, notes: taskNotes.notes !== false, layers: taskNotes.layers !== false, disclosures: taskDisclosures } } : {},
70
71
  ...workQueue ? { workQueue: { open: workQueue.open !== false, history: workQueue.history === true, disclosures: workDisclosures } } : {}
71
72
  },
@@ -1187,6 +1188,8 @@ var NativeBlockView = class {
1187
1188
  this.spec = spec;
1188
1189
  if (rebuild) this.reset();
1189
1190
  this.signature = signature;
1191
+ const finalAnswer = spec.kind === "markdown" && spec.presentation === "final-answer";
1192
+ this.root.marginTop = this.root.marginBottom = finalAnswer ? 1 : 0;
1190
1193
  if (spec.collapsed !== this.previousModelCollapsed) {
1191
1194
  this.collapsed = spec.collapsed ?? false;
1192
1195
  this.previousModelCollapsed = spec.collapsed;
@@ -4032,6 +4035,9 @@ var InstrumentRail = class extends BoxRenderable7 {
4032
4035
  contextMeter;
4033
4036
  contextHeader;
4034
4037
  contextDetails;
4038
+ routeAttemptsHeader;
4039
+ routeAttempts;
4040
+ routeAttemptRows = [];
4035
4041
  onResize(width, height) {
4036
4042
  super.onResize(width, height);
4037
4043
  this.devices?.fitHeight(height);
@@ -4150,6 +4156,16 @@ var InstrumentRail = class extends BoxRenderable7 {
4150
4156
  addRow(this.contextDetails, "context-tools", "TOOL CALLS");
4151
4157
  addRow(this.contextDetails, "adversary", "ADVERSARY");
4152
4158
  addRow(this.contextDetails, "duration", "LAST GEN");
4159
+ this.routeAttemptsHeader = new SectionBanner(renderer2, "ROUTE ATTEMPTS", `${id}:route-attempts`, () => {
4160
+ this.routeAttempts.visible = !this.routeAttempts.visible;
4161
+ this.routeAttemptsHeader.update(this.routeAttemptsHeading, this.routeAttempts.visible);
4162
+ });
4163
+ this.routeAttemptsHeader.update("ROUTE ATTEMPTS", false);
4164
+ this.routeAttemptsHeader.visible = false;
4165
+ this.routeAttemptsHeader.on(RenderableEvents5.FOCUSED, () => this.reveal(this.routeAttemptsHeader));
4166
+ this.inference.add(this.routeAttemptsHeader);
4167
+ this.routeAttempts = new BoxRenderable7(renderer2, { id: `${id}:route-attempt-body`, width: "100%", flexDirection: "column", flexShrink: 0, visible: false });
4168
+ this.inference.add(this.routeAttempts);
4153
4169
  this.sessionHeader = new SectionBanner(
4154
4170
  renderer2,
4155
4171
  "SESSION / AGENTS",
@@ -4193,6 +4209,7 @@ var InstrumentRail = class extends BoxRenderable7 {
4193
4209
  const data = state.instruments;
4194
4210
  const inference = data?.inference;
4195
4211
  const session = data?.session;
4212
+ this.updateRouteAttempts(inference?.routeAttempts ?? []);
4196
4213
  const set = (id, value) => this.rows.get(id).update(value);
4197
4214
  set("messages", instrumentNumber(inference?.contextMessages));
4198
4215
  set("headroom", inference?.contextHeadroom !== void 0 && Number.isFinite(inference.contextHeadroom) ? String(Math.round(inference.contextHeadroom)) : "--");
@@ -4243,6 +4260,39 @@ var InstrumentRail = class extends BoxRenderable7 {
4243
4260
  }))
4244
4261
  );
4245
4262
  }
4263
+ routeAttemptsHeading = "ROUTE ATTEMPTS";
4264
+ updateRouteAttempts(attempts) {
4265
+ const bounded = attempts.slice(-24);
4266
+ this.routeAttemptsHeading = `ROUTE ATTEMPTS (${bounded.length})`;
4267
+ this.routeAttemptsHeader.visible = bounded.length > 0;
4268
+ this.routeAttemptsHeader.update(this.routeAttemptsHeading);
4269
+ this.routeAttempts.visible = this.routeAttemptsHeader.visible && this.routeAttemptsHeader.expanded;
4270
+ for (let index = 0; index < bounded.length; index++) {
4271
+ let row = this.routeAttemptRows[index];
4272
+ if (!row) {
4273
+ const id = `${this.routeAttempts.id}:${index}`;
4274
+ const box = new BoxRenderable7(this.ctx, { id, width: "100%", flexDirection: "column", flexShrink: 0 });
4275
+ const title2 = new TextRenderable6(this.ctx, { id: `${id}:title`, width: "100%", height: 1, content: "", fg: foreground, bg: background, wrapMode: "none", truncate: true, flexShrink: 0 });
4276
+ const detail2 = new TextRenderable6(this.ctx, { id: `${id}:detail`, width: "100%", content: "", fg: foreground, bg: background, attributes: TextAttributes7.DIM, wrapMode: "word", flexShrink: 0 });
4277
+ box.add(title2);
4278
+ box.add(detail2);
4279
+ this.routeAttempts.add(box);
4280
+ row = { box, title: title2, detail: detail2 };
4281
+ this.routeAttemptRows.push(row);
4282
+ }
4283
+ const attempt = bounded[index];
4284
+ const title = `${attempt.phase.toUpperCase()} ${attempt.model}`;
4285
+ const detail = [
4286
+ [attempt.category?.replace(/_/g, " ").toUpperCase(), attempt.status === void 0 ? void 0 : `HTTP ${attempt.status}`].filter(Boolean).join(" · "),
4287
+ [attempt.disposition?.replace(/_/g, " ").toUpperCase(), attempt.retryDelayMs === void 0 ? void 0 : `WAIT ${instrumentNumber(attempt.retryDelayMs / 1e3, 1, "s")}`].filter(Boolean).join(" · ")
4288
+ ].filter(Boolean).join("\n");
4289
+ if (row.title.plainText !== title) row.title.content = title;
4290
+ if (row.detail.plainText !== detail) row.detail.content = detail;
4291
+ row.detail.visible = detail.length > 0;
4292
+ row.box.visible = true;
4293
+ }
4294
+ for (let index = bounded.length; index < this.routeAttemptRows.length; index++) this.routeAttemptRows[index].box.visible = false;
4295
+ }
4246
4296
  applyTheme(colors) {
4247
4297
  this.backgroundColor = colors.background;
4248
4298
  const visit = (node) => {
@@ -4273,6 +4323,7 @@ var InstrumentRail = class extends BoxRenderable7 {
4273
4323
  session: this.session.visible,
4274
4324
  context: this.contextHeader.expanded,
4275
4325
  devices: this.devices.isExpanded,
4326
+ routeAttempts: this.routeAttemptsHeader.expanded,
4276
4327
  scrollTop: this.scroll.scrollTop,
4277
4328
  deviceScrollTop: this.devices.scroll.scrollTop,
4278
4329
  taskNotes: this.taskNotes.capturePresentation(),
@@ -4286,6 +4337,8 @@ var InstrumentRail = class extends BoxRenderable7 {
4286
4337
  if (this.session.visible !== state.session) this.toggleSection("session");
4287
4338
  this.contextHeader.update("CONTEXT DETAILS", state.context);
4288
4339
  this.contextDetails.visible = this.contextHeader.visible && state.context;
4340
+ this.routeAttemptsHeader.update(this.routeAttemptsHeading, state.routeAttempts === true);
4341
+ this.routeAttempts.visible = this.routeAttemptsHeader.visible && state.routeAttempts === true;
4289
4342
  this.devices.setExpanded(state.devices);
4290
4343
  this.scroll.scrollTo(state.scrollTop);
4291
4344
  this.devices.scroll.scrollTo(state.deviceScrollTop);
@@ -4297,6 +4350,7 @@ var InstrumentRail = class extends BoxRenderable7 {
4297
4350
  ...this.taskNotes.focusTargets(),
4298
4351
  this.inferenceHeader,
4299
4352
  ...this.inference.visible && this.contextHeader.visible ? [this.contextHeader] : [],
4353
+ ...this.inference.visible && this.routeAttemptsHeader.visible ? [this.routeAttemptsHeader] : [],
4300
4354
  this.sessionHeader,
4301
4355
  ...this.session.visible ? this.channels.focusTargets() : [],
4302
4356
  ...this.devices.focusTargets()
@@ -6154,9 +6208,19 @@ var NativeFrontend = class {
6154
6208
  };
6155
6209
  const headerRow = new BoxRenderable10(renderer2, { id: "omnius-header-row", width: "100%", minWidth: 0, minHeight: 1, flexDirection: "row", gap: 1 });
6156
6210
  this.header.add(headerRow);
6211
+ this.identityMarker = new TextRenderable9(renderer2, {
6212
+ id: "omnius-marker",
6213
+ content: "■",
6214
+ width: 1,
6215
+ height: 1,
6216
+ flexShrink: 0,
6217
+ fg: colors.foreground,
6218
+ selectable: false
6219
+ });
6220
+ headerRow.add(this.identityMarker);
6157
6221
  this.identity = new TextRenderable9(renderer2, {
6158
6222
  id: "omnius-identity",
6159
- content: "Omnius",
6223
+ content: "OMNIUS",
6160
6224
  fg: colors.foreground,
6161
6225
  flexShrink: 0,
6162
6226
  flexGrow: 0,
@@ -6217,7 +6281,7 @@ var NativeFrontend = class {
6217
6281
  }
6218
6282
  });
6219
6283
  this.detailButton.focusable = true;
6220
- headerRow.add(this.detailButton, 1);
6284
+ headerRow.add(this.detailButton, 2);
6221
6285
  for (const control of [this.identity, this.detailButton]) {
6222
6286
  const attributes = control.attributes;
6223
6287
  control.on("focused", () => {
@@ -6227,6 +6291,14 @@ var NativeFrontend = class {
6227
6291
  control.attributes = attributes;
6228
6292
  });
6229
6293
  }
6294
+ if (process.env["OMNIUS_TUI_REDUCE_MOTION"] !== "1" && process.env["REDUCE_MOTION"] !== "1") {
6295
+ this.identityMarkerTimer = setInterval(() => {
6296
+ if (this.destroyed) return;
6297
+ this.identityMarker.content = this.identityMarker.plainText === "■" ? " " : "■";
6298
+ this.renderer.requestRender();
6299
+ }, 600);
6300
+ this.identityMarkerTimer.unref?.();
6301
+ }
6230
6302
  this.sessionRow = new BoxRenderable10(renderer2, {
6231
6303
  id: "omnius-sessions-row",
6232
6304
  width: "100%",
@@ -6587,6 +6659,7 @@ var NativeFrontend = class {
6587
6659
  context;
6588
6660
  selectionMenu;
6589
6661
  header;
6662
+ identityMarker;
6590
6663
  identity;
6591
6664
  headerActions;
6592
6665
  headerPanel;
@@ -6626,6 +6699,7 @@ var NativeFrontend = class {
6626
6699
  clipboard;
6627
6700
  copyFeedback;
6628
6701
  copyFeedbackTimer;
6702
+ identityMarkerTimer;
6629
6703
  state;
6630
6704
  themeSignature = "";
6631
6705
  headerSignature = "";
@@ -6678,7 +6752,7 @@ var NativeFrontend = class {
6678
6752
  if (headerSignature !== this.headerSignature) {
6679
6753
  this.headerSignature = headerSignature;
6680
6754
  this.identity.content = styledText([
6681
- { text: `${plainText(state.header.panel) ? this.headerPanelCollapsed ? "▸" : "▾" : "·"} ${state.header.title}` },
6755
+ { text: `${plainText(state.header.panel) ? this.headerPanelCollapsed ? "▸ " : "▾ " : ""}${state.header.title}` },
6682
6756
  ...state.header.detail ? [{ text: " " }, ...textSpans(state.header.detail)] : []
6683
6757
  ]);
6684
6758
  this.headerPanel.content = styledText(state.header.panel);
@@ -6846,6 +6920,7 @@ var NativeFrontend = class {
6846
6920
  this.header.backgroundColor = this.footer.backgroundColor = colors.background;
6847
6921
  this.header.borderColor = this.footer.borderColor = this.embeddedPane.borderColor = colors.border;
6848
6922
  this.identity.fg = colors.foreground;
6923
+ this.identityMarker.fg = colors.foreground;
6849
6924
  this.headerPanel.fg = colors.foreground;
6850
6925
  this.routeWarning.fg = colors.warning;
6851
6926
  this.prompt.fg = this.activity.fg = this.liveButton.fg = colors.accent;
@@ -6937,11 +7012,11 @@ var NativeFrontend = class {
6937
7012
  const actions = this.state?.header.actions ?? [];
6938
7013
  const naturalWidth = actions.reduce((size, action) => size + terminalCellWidth(plainText(action.label)), 0) + Math.max(0, actions.length - 1);
6939
7014
  const detailWidth = width < 40 ? 1 : 9;
6940
- const gapCount = this.headerActions.visible ? 2 : 1;
6941
- const controlWidth = Math.min(naturalWidth, Math.max(1, width - 18 - detailWidth - gapCount));
7015
+ const gapCount = this.headerActions.visible ? 3 : 2;
7016
+ const controlWidth = Math.min(naturalWidth, Math.max(1, width - 1 - 18 - detailWidth - gapCount));
6942
7017
  this.headerActions.width = controlWidth;
6943
- this.identity.minWidth = Math.max(0, Math.min(18, width - detailWidth - gapCount));
6944
- this.identity.width = Math.max(0, width - (this.headerActions.visible ? controlWidth : 0) - detailWidth - gapCount);
7018
+ this.identity.minWidth = Math.max(0, Math.min(18, width - 1 - detailWidth - gapCount));
7019
+ this.identity.width = Math.max(0, width - 1 - (this.headerActions.visible ? controlWidth : 0) - detailWidth - gapCount);
6945
7020
  this.detailButton.width = detailWidth;
6946
7021
  this.keyHints.content = width < 60 ? "F1 HELP" : "F1 HELP TAB FOCUS";
6947
7022
  this.detailButton.content = `${shown ? "-" : "+"}${detailWidth > 1 ? " DETAILS" : ""}`;
@@ -7487,6 +7562,10 @@ var NativeFrontend = class {
7487
7562
  if (this.destroyed) return;
7488
7563
  this.destroyed = true;
7489
7564
  if (this.copyFeedbackTimer) clearTimeout(this.copyFeedbackTimer);
7565
+ if (this.identityMarkerTimer) {
7566
+ clearInterval(this.identityMarkerTimer);
7567
+ this.identityMarkerTimer = void 0;
7568
+ }
7490
7569
  this.selectionMenu.destroy();
7491
7570
  this.disposeSelectionContrast();
7492
7571
  this.renderer.keyInput.off("keypress", this.onKey);