@oracle-agent/oracle 0.9.0 → 0.9.1
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/package.json +1 -1
- package/src/cli/oracle-harness.py +56 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oracle-agent/oracle",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Oracle: prepare-only multichain agent control plane. Policy-bounded intents for a user-signed wallet. Self-custody by default — the public package never takes your key. Built for Hermes; no model key required.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -109,8 +109,10 @@ def patch_cli(module):
|
|
|
109
109
|
|
|
110
110
|
def show_banner(self):
|
|
111
111
|
from rich.align import Align
|
|
112
|
+
from rich.console import Group
|
|
112
113
|
from rich.panel import Panel
|
|
113
114
|
from rich.text import Text
|
|
115
|
+
from rich import box
|
|
114
116
|
|
|
115
117
|
self.console.clear()
|
|
116
118
|
width = shutil.get_terminal_size((100, 28)).columns
|
|
@@ -137,14 +139,16 @@ def patch_cli(module):
|
|
|
137
139
|
body.append(" / ", style="#52606D")
|
|
138
140
|
model = str(getattr(self, "model", "") or "choose model")
|
|
139
141
|
body.append(model, style="#91A2B1")
|
|
140
|
-
body.append("\n\n/model /chain /setup", style="#60717F")
|
|
141
142
|
|
|
142
|
-
panel_width =
|
|
143
|
+
panel_width = max(36, min(width - 4, 76))
|
|
143
144
|
panel = Panel(
|
|
144
|
-
Align.center(body),
|
|
145
|
+
Group(Align.center(body)),
|
|
145
146
|
width=panel_width,
|
|
146
|
-
padding=(
|
|
147
|
-
border_style="#
|
|
147
|
+
padding=(1, 2),
|
|
148
|
+
border_style="#3B4A56",
|
|
149
|
+
box=box.ROUNDED,
|
|
150
|
+
subtitle="[dim #6F7F8D]/model /chain /setup[/]",
|
|
151
|
+
subtitle_align="right",
|
|
148
152
|
)
|
|
149
153
|
self.console.print(Align.center(panel))
|
|
150
154
|
self.console.print()
|
|
@@ -166,7 +170,36 @@ def patch_cli(module):
|
|
|
166
170
|
return [("class:prompt-working", "working ")]
|
|
167
171
|
if getattr(self, "_agent_running", False):
|
|
168
172
|
return [("class:prompt-working", "thinking ")]
|
|
169
|
-
return [("class:prompt", "› ")]
|
|
173
|
+
return [("class:prompt", " Ask Oracle › ")]
|
|
174
|
+
|
|
175
|
+
def status_fragments(self):
|
|
176
|
+
if not getattr(self, "_status_bar_visible", True) or getattr(self, "_model_picker_state", None):
|
|
177
|
+
return []
|
|
178
|
+
try:
|
|
179
|
+
snapshot = self._get_status_bar_snapshot()
|
|
180
|
+
width = self._get_tui_terminal_width()
|
|
181
|
+
model = snapshot.get("model_short") or "model"
|
|
182
|
+
percent = snapshot.get("context_percent")
|
|
183
|
+
context = f"{percent}% context" if percent is not None else "context ready"
|
|
184
|
+
duration = snapshot.get("duration") or "0s"
|
|
185
|
+
if width < 58:
|
|
186
|
+
return [
|
|
187
|
+
("class:status-bar", " "),
|
|
188
|
+
("class:status-bar-strong", model),
|
|
189
|
+
("class:status-bar-dim", f" · {duration} "),
|
|
190
|
+
]
|
|
191
|
+
return [
|
|
192
|
+
("class:status-bar", " "),
|
|
193
|
+
("class:status-bar-brand", "oracle"),
|
|
194
|
+
("class:status-bar-dim", " / "),
|
|
195
|
+
("class:status-bar-strong", model),
|
|
196
|
+
("class:status-bar-dim", " / "),
|
|
197
|
+
("class:status-bar-context", context),
|
|
198
|
+
("class:status-bar-dim", " / "),
|
|
199
|
+
("class:status-bar-dim", f"{duration} "),
|
|
200
|
+
]
|
|
201
|
+
except Exception:
|
|
202
|
+
return [("class:status-bar-brand", " oracle ")]
|
|
170
203
|
|
|
171
204
|
def layout_children(
|
|
172
205
|
self,
|
|
@@ -187,7 +220,7 @@ def patch_cli(module):
|
|
|
187
220
|
voice_status_bar,
|
|
188
221
|
completions_menu,
|
|
189
222
|
):
|
|
190
|
-
from prompt_toolkit.layout.containers import HSplit, Window
|
|
223
|
+
from prompt_toolkit.layout.containers import HSplit, VSplit, Window
|
|
191
224
|
from prompt_toolkit.widgets import Frame
|
|
192
225
|
from prompt_toolkit.widgets.base import Border
|
|
193
226
|
|
|
@@ -196,9 +229,15 @@ def patch_cli(module):
|
|
|
196
229
|
Border.BOTTOM_LEFT = "╰"
|
|
197
230
|
Border.BOTTOM_RIGHT = "╯"
|
|
198
231
|
|
|
199
|
-
composer =
|
|
200
|
-
|
|
201
|
-
|
|
232
|
+
composer = VSplit(
|
|
233
|
+
[
|
|
234
|
+
Window(width=1),
|
|
235
|
+
Frame(
|
|
236
|
+
HSplit([item for item in (image_bar, input_area) if item is not None]),
|
|
237
|
+
style="class:oracle-composer",
|
|
238
|
+
),
|
|
239
|
+
Window(width=1),
|
|
240
|
+
]
|
|
202
241
|
)
|
|
203
242
|
return [
|
|
204
243
|
item
|
|
@@ -215,6 +254,7 @@ def patch_cli(module):
|
|
|
215
254
|
composer,
|
|
216
255
|
completions_menu,
|
|
217
256
|
voice_status_bar,
|
|
257
|
+
status_bar,
|
|
218
258
|
)
|
|
219
259
|
if item is not None
|
|
220
260
|
]
|
|
@@ -230,6 +270,11 @@ def patch_cli(module):
|
|
|
230
270
|
"input-area": "bg:#0B0E11 #EAF2F8",
|
|
231
271
|
"prompt": "bold #B8F0FF",
|
|
232
272
|
"prompt-working": "bold #91C2D7",
|
|
273
|
+
"status-bar": "bg:#11161B #91A2B1",
|
|
274
|
+
"status-bar-brand": "bg:#11161B bold #B8F0FF",
|
|
275
|
+
"status-bar-strong": "bg:#11161B #EAF2F8",
|
|
276
|
+
"status-bar-context": "bg:#11161B #A5D9EB",
|
|
277
|
+
"status-bar-dim": "bg:#11161B #60717F",
|
|
233
278
|
}
|
|
234
279
|
)
|
|
235
280
|
return style
|
|
@@ -247,6 +292,7 @@ def patch_cli(module):
|
|
|
247
292
|
|
|
248
293
|
setattr(cls, "show_banner", show_banner)
|
|
249
294
|
setattr(cls, "_get_tui_prompt_fragments", prompt_fragments)
|
|
295
|
+
setattr(cls, "_get_status_bar_fragments", status_fragments)
|
|
250
296
|
setattr(cls, "_build_tui_layout_children", layout_children)
|
|
251
297
|
setattr(cls, "_build_tui_style_dict", build_style)
|
|
252
298
|
setattr(cls, "process_command", process_command)
|