omnius 1.0.932 → 1.0.933
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 +2 -2
- package/dist/tui/native/worker.js +166 -0
- package/docs/guides/telegram.md +11 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/index.js
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 41404006 bytes
|
|
4
|
+
sha256: be58a5d5d2b8a9eef20e5f59cd795bec65dd19e397280be9577570655f952bd0
|
|
@@ -73,6 +73,7 @@ function sanitizeNativeInterfaceState(value) {
|
|
|
73
73
|
scrollTop: offset(instruments.scrollTop),
|
|
74
74
|
deviceScrollTop: offset(instruments.deviceScrollTop),
|
|
75
75
|
...typeof instruments.routeAttempts === "boolean" ? { routeAttempts: instruments.routeAttempts } : {},
|
|
76
|
+
...typeof instruments.telegram === "boolean" ? { telegram: instruments.telegram } : {},
|
|
76
77
|
...taskNotes ? { taskNotes: { open: taskNotes.open !== false, tasks: taskNotes.tasks !== false, notes: taskNotes.notes !== false, layers: taskNotes.layers !== false, disclosures: taskDisclosures } } : {},
|
|
77
78
|
...workQueue ? { workQueue: { open: workQueue.open !== false, history: workQueue.history === true, disclosures: workDisclosures } } : {},
|
|
78
79
|
...workspaceFiles ? { workspaceFiles: {
|
|
@@ -5745,10 +5746,166 @@ var ChannelMap = class extends BoxRenderable9 {
|
|
|
5745
5746
|
}
|
|
5746
5747
|
}
|
|
5747
5748
|
};
|
|
5749
|
+
var NativeTelegramView = class extends BoxRenderable9 {
|
|
5750
|
+
constructor(renderer2, colors, onAction, reveal) {
|
|
5751
|
+
super(renderer2, { id: "omnius-telegram", width: "100%", minWidth: 0, flexDirection: "column", flexShrink: 0, visible: false });
|
|
5752
|
+
this.renderer = renderer2;
|
|
5753
|
+
this.colors = colors;
|
|
5754
|
+
this.onAction = onAction;
|
|
5755
|
+
this.reveal = reveal;
|
|
5756
|
+
this.header = new SectionBanner(renderer2, "TELEGRAM", "omnius-telegram:heading", () => this.setExpanded(!this.expanded));
|
|
5757
|
+
this.header.update("TELEGRAM", false);
|
|
5758
|
+
this.header.on(RenderableEvents6.FOCUSED, () => this.reveal?.(this.header));
|
|
5759
|
+
this.add(this.header);
|
|
5760
|
+
this.body = new BoxRenderable9(renderer2, { id: "omnius-telegram:body", width: "100%", minWidth: 0, flexDirection: "column", flexShrink: 0, visible: false });
|
|
5761
|
+
this.add(this.body);
|
|
5762
|
+
const text = (id) => new TextRenderable8(renderer2, {
|
|
5763
|
+
id,
|
|
5764
|
+
content: "",
|
|
5765
|
+
width: "100%",
|
|
5766
|
+
minWidth: 0,
|
|
5767
|
+
flexShrink: 0,
|
|
5768
|
+
wrapMode: "word",
|
|
5769
|
+
fg: colors.foreground,
|
|
5770
|
+
bg: colors.background
|
|
5771
|
+
});
|
|
5772
|
+
this.details = text("omnius-telegram:details");
|
|
5773
|
+
this.body.add(this.details);
|
|
5774
|
+
this.error = text("omnius-telegram:error");
|
|
5775
|
+
this.body.add(this.error);
|
|
5776
|
+
this.applyTheme(colors);
|
|
5777
|
+
}
|
|
5778
|
+
renderer;
|
|
5779
|
+
colors;
|
|
5780
|
+
onAction;
|
|
5781
|
+
reveal;
|
|
5782
|
+
header;
|
|
5783
|
+
body;
|
|
5784
|
+
details;
|
|
5785
|
+
error;
|
|
5786
|
+
actions = /* @__PURE__ */ new Map();
|
|
5787
|
+
expanded = false;
|
|
5788
|
+
busy = false;
|
|
5789
|
+
ownsFocus() {
|
|
5790
|
+
for (let node = this.renderer.currentFocusedRenderable; node; node = node.parent) {
|
|
5791
|
+
if (node === this) return true;
|
|
5792
|
+
}
|
|
5793
|
+
return false;
|
|
5794
|
+
}
|
|
5795
|
+
update(state) {
|
|
5796
|
+
this.visible = state?.configured === true;
|
|
5797
|
+
this.body.visible = this.visible && this.expanded;
|
|
5798
|
+
if (!this.visible || !state) return;
|
|
5799
|
+
this.busy = state.busy === true;
|
|
5800
|
+
const safe3 = (value) => plainText(value).replace(/[\r\n\t]+/g, " ");
|
|
5801
|
+
const details = [
|
|
5802
|
+
`STATUS ${state.status.toUpperCase()} · ${state.owner.toUpperCase()}${state.busy ? " · UPDATING" : ""}`,
|
|
5803
|
+
...state.botUsername ? [`BOT @${safe3(state.botUsername).replace(/^@/, "")}`] : [],
|
|
5804
|
+
`MODE ${state.mode.toUpperCase()} · SLOTS ${instrumentNumber(state.slots)}`,
|
|
5805
|
+
`POLLING ${state.enabled ? "ENABLED" : "DISABLED"}${state.pollPhase ? ` · ${safe3(state.pollPhase)}` : ""}`,
|
|
5806
|
+
...state.activeTasks !== void 0 || state.queuedTasks !== void 0 ? [`TASKS ${instrumentNumber(state.activeTasks)} ACTIVE · ${instrumentNumber(state.queuedTasks)} QUEUED`] : [],
|
|
5807
|
+
...state.privacyLimited ? ["Group visibility is limited by bot privacy."] : [],
|
|
5808
|
+
...state.restartRequired ? ["Restart required to apply settings."] : [],
|
|
5809
|
+
...state.detail ? [safe3(state.detail)] : []
|
|
5810
|
+
].join("\n");
|
|
5811
|
+
if (this.details.plainText !== details) this.details.content = details;
|
|
5812
|
+
this.error.content = safe3(state.error);
|
|
5813
|
+
this.error.visible = Boolean(state.error);
|
|
5814
|
+
const current = new Set(state.actions.map((action) => action.id));
|
|
5815
|
+
for (const [id, row] of this.actions) if (!current.has(id)) {
|
|
5816
|
+
if (row.control.focused) this.header.focus();
|
|
5817
|
+
row.control.destroy();
|
|
5818
|
+
this.actions.delete(id);
|
|
5819
|
+
}
|
|
5820
|
+
for (const [index, action] of state.actions.entries()) {
|
|
5821
|
+
let row = this.actions.get(action.id);
|
|
5822
|
+
if (!row) {
|
|
5823
|
+
const activate = () => {
|
|
5824
|
+
const latest = this.actions.get(action.id);
|
|
5825
|
+
if (this.visible && this.expanded && !this.busy && latest && !latest.action.disabled) {
|
|
5826
|
+
this.onAction?.(latest.action.command ?? latest.action.id);
|
|
5827
|
+
}
|
|
5828
|
+
};
|
|
5829
|
+
const control = new TextRenderable8(this.renderer, {
|
|
5830
|
+
id: `omnius-telegram:action:${action.id}`,
|
|
5831
|
+
content: "",
|
|
5832
|
+
width: "100%",
|
|
5833
|
+
minWidth: 0,
|
|
5834
|
+
height: 1,
|
|
5835
|
+
flexShrink: 0,
|
|
5836
|
+
wrapMode: "none",
|
|
5837
|
+
truncate: true,
|
|
5838
|
+
selectable: false,
|
|
5839
|
+
fg: this.colors.foreground,
|
|
5840
|
+
bg: this.colors.background,
|
|
5841
|
+
onMouseDown: (event) => {
|
|
5842
|
+
if (event.button === 0) {
|
|
5843
|
+
if (control.focusable) control.focus();
|
|
5844
|
+
activate();
|
|
5845
|
+
event.preventDefault();
|
|
5846
|
+
event.stopPropagation();
|
|
5847
|
+
}
|
|
5848
|
+
},
|
|
5849
|
+
onKeyDown: (key) => {
|
|
5850
|
+
if (key.eventType !== "release" && (key.name === "return" || key.sequence === " ")) {
|
|
5851
|
+
activate();
|
|
5852
|
+
key.preventDefault();
|
|
5853
|
+
key.stopPropagation();
|
|
5854
|
+
}
|
|
5855
|
+
}
|
|
5856
|
+
});
|
|
5857
|
+
const style = () => {
|
|
5858
|
+
control.attributes = (control.focusable ? 0 : TextAttributes8.DIM) | (this.actions.get(action.id)?.action.active ? TextAttributes8.BOLD : 0) | (control.focused ? TextAttributes8.INVERSE : 0);
|
|
5859
|
+
};
|
|
5860
|
+
control.on(RenderableEvents6.FOCUSED, () => {
|
|
5861
|
+
style();
|
|
5862
|
+
this.reveal?.(control);
|
|
5863
|
+
});
|
|
5864
|
+
control.on(RenderableEvents6.BLURRED, style);
|
|
5865
|
+
row = { control, action };
|
|
5866
|
+
this.actions.set(action.id, row);
|
|
5867
|
+
this.body.add(control);
|
|
5868
|
+
}
|
|
5869
|
+
row.action = action;
|
|
5870
|
+
row.control.content = safe3(action.label);
|
|
5871
|
+
row.control.focusable = !this.busy && !action.disabled;
|
|
5872
|
+
row.control.attributes = (row.control.focusable ? 0 : TextAttributes8.DIM) | (action.active ? TextAttributes8.BOLD : 0) | (row.control.focused ? TextAttributes8.INVERSE : 0);
|
|
5873
|
+
if (this.body.getChildren()[index + 2] !== row.control) this.body.add(row.control, index + 2);
|
|
5874
|
+
if (!row.control.focusable && row.control.focused) this.header.focus();
|
|
5875
|
+
}
|
|
5876
|
+
}
|
|
5877
|
+
setExpanded(expanded) {
|
|
5878
|
+
if (!expanded && this.ownsFocus()) this.header.focus();
|
|
5879
|
+
this.expanded = expanded;
|
|
5880
|
+
this.header.update("TELEGRAM", expanded);
|
|
5881
|
+
this.body.visible = this.visible && expanded;
|
|
5882
|
+
}
|
|
5883
|
+
get isExpanded() {
|
|
5884
|
+
return this.expanded;
|
|
5885
|
+
}
|
|
5886
|
+
focusTargets() {
|
|
5887
|
+
return this.visible ? [this.header, ...this.expanded ? this.body.getChildren().filter((node) => node instanceof TextRenderable8 && node.focusable) : []] : [];
|
|
5888
|
+
}
|
|
5889
|
+
applyTheme(colors) {
|
|
5890
|
+
this.colors = colors;
|
|
5891
|
+
this.backgroundColor = colors.background;
|
|
5892
|
+
this.header.fg = colors.foreground;
|
|
5893
|
+
this.header.bg = colors.background;
|
|
5894
|
+
this.details.fg = colors.foreground;
|
|
5895
|
+
this.details.bg = colors.background;
|
|
5896
|
+
this.error.fg = colors.error;
|
|
5897
|
+
this.error.bg = colors.background;
|
|
5898
|
+
for (const row of this.actions.values()) {
|
|
5899
|
+
row.control.fg = colors.foreground;
|
|
5900
|
+
row.control.bg = colors.background;
|
|
5901
|
+
}
|
|
5902
|
+
}
|
|
5903
|
+
};
|
|
5748
5904
|
var InstrumentRail = class extends BoxRenderable9 {
|
|
5749
5905
|
workQueue;
|
|
5750
5906
|
workspaceFiles;
|
|
5751
5907
|
taskNotes;
|
|
5908
|
+
telegram;
|
|
5752
5909
|
scroll;
|
|
5753
5910
|
inferenceHeader;
|
|
5754
5911
|
sessionHeader;
|
|
@@ -5821,6 +5978,8 @@ var InstrumentRail = class extends BoxRenderable9 {
|
|
|
5821
5978
|
selection: background
|
|
5822
5979
|
}, (target) => this.reveal(target));
|
|
5823
5980
|
this.scroll.add(this.taskNotes);
|
|
5981
|
+
this.telegram = new NativeTelegramView(renderer2, colors, options.onAction, (target) => this.reveal(target));
|
|
5982
|
+
this.scroll.add(this.telegram);
|
|
5824
5983
|
this.inferenceHeader = new SectionBanner(
|
|
5825
5984
|
renderer2,
|
|
5826
5985
|
"INFERENCE",
|
|
@@ -5935,6 +6094,9 @@ var InstrumentRail = class extends BoxRenderable9 {
|
|
|
5935
6094
|
if (options.colors) this.applyTheme(options.colors);
|
|
5936
6095
|
}
|
|
5937
6096
|
update(state) {
|
|
6097
|
+
const telegramFocused = this.telegram.focusTargets().some((target) => target.focused);
|
|
6098
|
+
this.telegram.update(state.instruments?.telegram);
|
|
6099
|
+
if (telegramFocused && !this.telegram.visible) this.inferenceHeader.focus();
|
|
5938
6100
|
this.workQueue.update(state.workQueue);
|
|
5939
6101
|
this.workspaceFiles.update(state.workspaceFiles);
|
|
5940
6102
|
this.taskNotes.update(state.taskNotes);
|
|
@@ -6038,6 +6200,7 @@ var InstrumentRail = class extends BoxRenderable9 {
|
|
|
6038
6200
|
this.workQueue.applyTheme(colors);
|
|
6039
6201
|
this.workspaceFiles.applyTheme(colors);
|
|
6040
6202
|
this.taskNotes.applyTheme(colors);
|
|
6203
|
+
this.telegram.applyTheme(colors);
|
|
6041
6204
|
styleNativeScrollbars(this.scroll, colors);
|
|
6042
6205
|
styleNativeScrollbars(this.devices.scroll, colors);
|
|
6043
6206
|
}
|
|
@@ -6056,6 +6219,7 @@ var InstrumentRail = class extends BoxRenderable9 {
|
|
|
6056
6219
|
session: this.session.visible,
|
|
6057
6220
|
context: this.contextHeader.expanded,
|
|
6058
6221
|
devices: this.devices.isExpanded,
|
|
6222
|
+
telegram: this.telegram.isExpanded,
|
|
6059
6223
|
deviceSections: this.devices.captureDeviceSections(),
|
|
6060
6224
|
routeAttempts: this.routeAttemptsHeader.expanded,
|
|
6061
6225
|
scrollTop: this.scroll.scrollTop,
|
|
@@ -6069,6 +6233,7 @@ var InstrumentRail = class extends BoxRenderable9 {
|
|
|
6069
6233
|
this.workQueue.restorePresentation(state.workQueue);
|
|
6070
6234
|
this.workspaceFiles.restorePresentation(state.workspaceFiles);
|
|
6071
6235
|
this.taskNotes.restorePresentation(state.taskNotes);
|
|
6236
|
+
this.telegram.setExpanded(state.telegram === true);
|
|
6072
6237
|
if (this.inference.visible !== state.inference) this.toggleSection("inference");
|
|
6073
6238
|
if (this.session.visible !== state.session) this.toggleSection("session");
|
|
6074
6239
|
this.contextHeader.update("CONTEXT DETAILS", state.context);
|
|
@@ -6085,6 +6250,7 @@ var InstrumentRail = class extends BoxRenderable9 {
|
|
|
6085
6250
|
return [
|
|
6086
6251
|
...this.workQueue.focusTargets(),
|
|
6087
6252
|
...this.taskNotes.focusTargets(),
|
|
6253
|
+
...this.telegram.focusTargets(),
|
|
6088
6254
|
this.inferenceHeader,
|
|
6089
6255
|
...this.inference.visible && this.contextHeader.visible ? [this.contextHeader] : [],
|
|
6090
6256
|
...this.inference.visible && this.routeAttemptsHeader.visible ? [this.routeAttemptsHeader] : [],
|
package/docs/guides/telegram.md
CHANGED
|
@@ -12,6 +12,17 @@ The Telegram bridge is a scoped public ingress and egress layer. It supports adm
|
|
|
12
12
|
/telegram stop
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
The TUI's right details sidebar includes a **TELEGRAM** dropdown after a bot is
|
|
16
|
+
configured. It shows bridge state, polling, interaction mode and work slots,
|
|
17
|
+
with controls for managing the bot and opening its settings. Click the heading
|
|
18
|
+
or focus it with Tab and press Enter or Space to expand it. On narrow terminals,
|
|
19
|
+
open **DETAILS** first. The dropdown remains available while the bot is stopped
|
|
20
|
+
or polling is disabled.
|
|
21
|
+
|
|
22
|
+
Workspace-owned bots use the daemon's existing controls. Settings that require
|
|
23
|
+
a worker restart are labeled as applying on the next start. A bot owned by
|
|
24
|
+
another terminal remains under that terminal's control.
|
|
25
|
+
|
|
15
26
|
## Workspace Services
|
|
16
27
|
|
|
17
28
|
The Omnius daemon supervises Telegram agents for registered workspaces, so a terminal does not need to stay open. A workspace must have its own saved `telegramKey`; global bot tokens are never copied across projects. Existing Telegram enablement, endpoint, credentials, and GPU selections still apply.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.933",
|
|
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.933",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED