@ouro.bot/cli 0.1.0-alpha.245 → 0.1.0-alpha.246

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/changelog.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.246",
6
+ "changes": [
7
+ "feat(tui): session resume display \u2014 shows summary line + last 3 exchanges dimmed when reconnecting to existing session."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.245",
6
12
  "changes": [
@@ -81,6 +81,16 @@ function MessageBlock({ msg }) {
81
81
  return (0, jsx_runtime_1.jsx)(ink_1.Text, { children: "" });
82
82
  return ((0, jsx_runtime_1.jsx)(ink_1.Box, { flexDirection: "column", children: visibleCalls.map((tc, i) => (0, jsx_runtime_1.jsx)(ToolResultLine, { tc: tc }, i)) }));
83
83
  }
84
+ // ── Session history (dimmed replay of last exchanges) ──
85
+ if (msg.role === "history-summary") {
86
+ return ((0, jsx_runtime_1.jsx)(ink_1.Box, { flexDirection: "column", marginTop: 1, children: (0, jsx_runtime_1.jsx)(ink_1.Text, { dimColor: true, children: msg.content }) }));
87
+ }
88
+ if (msg.role === "history-user") {
89
+ return ((0, jsx_runtime_1.jsx)(ink_1.Box, { flexDirection: "column", marginTop: 1, children: (0, jsx_runtime_1.jsx)(ink_1.Text, { dimColor: true, bold: true, children: msg.content }) }));
90
+ }
91
+ if (msg.role === "history-assistant") {
92
+ return ((0, jsx_runtime_1.jsx)(ink_1.Box, { flexDirection: "column", marginBottom: 1, children: msg.content ? (0, jsx_runtime_1.jsx)(ink_1.Text, { dimColor: true, children: msg.content }) : null }));
93
+ }
84
94
  if (msg.role === "user") {
85
95
  return ((0, jsx_runtime_1.jsxs)(ink_1.Box, { flexDirection: "column", marginTop: 1, children: [msg.content ? (0, jsx_runtime_1.jsx)(ink_1.Text, { color: OURO.bone, bold: true, children: msg.content }) : null, (0, jsx_runtime_1.jsx)(ink_1.Box, { marginBottom: 1, children: (0, jsx_runtime_1.jsx)(ink_1.Text, { children: "" }) })] }));
86
96
  }
@@ -173,6 +173,19 @@ class TuiStore {
173
173
  seedHistory(texts) {
174
174
  this._inputHistory.push(...texts);
175
175
  }
176
+ /** Show session resume context: summary line + last N exchanges, all dimmed */
177
+ addSessionHistory(summary, exchanges) {
178
+ const msgs = [
179
+ { id: "history-summary", role: "history-summary", content: summary },
180
+ ...exchanges.map((ex, i) => ({
181
+ id: `history-${i}`,
182
+ role: (ex.role === "user" ? "history-user" : "history-assistant"),
183
+ content: ex.content,
184
+ })),
185
+ ];
186
+ this._completed = [...msgs, ...this._completed];
187
+ this.notify();
188
+ }
176
189
  // ─── Queued input display ────────────────────────────────────────
177
190
  enqueueInput(text) {
178
191
  this._queuedInputs.push(text);
@@ -98,6 +98,20 @@ function getCliContinuityIngressTexts(input) {
98
98
  const trimmed = input.trim();
99
99
  return trimmed ? [trimmed] : [];
100
100
  }
101
+ /* v8 ignore start -- cosmetic time formatting @preserve */
102
+ function formatTimeAgo(date) {
103
+ const seconds = Math.floor((Date.now() - date.getTime()) / 1000);
104
+ if (seconds < 60)
105
+ return "just now";
106
+ const minutes = Math.floor(seconds / 60);
107
+ if (minutes < 60)
108
+ return `${minutes}m ago`;
109
+ const hours = Math.floor(minutes / 60);
110
+ if (hours < 24)
111
+ return `${hours}h ago`;
112
+ const days = Math.floor(hours / 24);
113
+ return `${days}d ago`;
114
+ }
101
115
  const CLI_PROMPT = "\x1b[36m) \x1b[0m";
102
116
  function writeCliAsyncAssistantMessage(rl, message, stdout = process.stdout) {
103
117
  const rlInt = rl;
@@ -521,6 +535,21 @@ async function runCliSession(options) {
521
535
  .filter((msg) => msg.role === "user" && typeof msg.content === "string")
522
536
  .map(msg => msg.content);
523
537
  tuiStore.seedHistory(prevUserMsgs);
538
+ // Show session resume context: summary + last few exchanges (dimmed)
539
+ /* v8 ignore start -- session resume display: integration-only, tested visually @preserve */
540
+ if (messages.length > 1) {
541
+ const userAssistantMsgs = messages.filter((m) => (m.role === "user" || m.role === "assistant") && typeof m.content === "string" && m.content.trim().length > 0);
542
+ // Extract last 3 exchanges (pairs of user+assistant)
543
+ const lastExchanges = [];
544
+ for (let i = userAssistantMsgs.length - 1; i >= 0 && lastExchanges.length < 6; i--) {
545
+ lastExchanges.unshift({ role: userAssistantMsgs[i].role, content: userAssistantMsgs[i].content });
546
+ }
547
+ const msgCount = messages.filter(m => m.role === "user" || m.role === "assistant").length;
548
+ const timeAgo = options.lastActivityAt ? formatTimeAgo(new Date(options.lastActivityAt)) : null;
549
+ const summary = ` resuming session (${msgCount} messages${timeAgo ? ` · last active ${timeAgo}` : ""})`;
550
+ tuiStore.addSessionHistory(summary, lastExchanges);
551
+ }
552
+ /* v8 ignore stop */
524
553
  // Ctrl-C state machine (Claude Code behavior):
525
554
  // During generation: abort current request
526
555
  // Idle with text: clear input
@@ -939,6 +968,7 @@ async function main(agentName, options) {
939
968
  agentName: currentAgentName,
940
969
  pasteDebounceMs,
941
970
  messages: sessionMessages,
971
+ lastActivityAt: sessionState?.lastFriendActivityAt,
942
972
  _testInputSource: options?._testInputSource,
943
973
  onAsyncAssistantMessage: async (messages, _assistantMessage) => {
944
974
  (0, context_1.postTurn)(messages, sessPath, undefined, undefined, sessionState);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.245",
3
+ "version": "0.1.0-alpha.246",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",