@rubytech/create-maxy 1.0.2 → 1.0.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/create-maxy",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Install Maxy — your personal AI assistant",
5
5
  "bin": {
6
6
  "create-maxy": "./dist/index.js"
@@ -233,10 +233,10 @@ export function ActivityTimeline({ events, isStreaming, elapsedSeconds }: Activi
233
233
  <div className="tl-body">
234
234
  <div className="tl-row tl-row-top" onClick={() => toggleExpand(i)} style={{ cursor: 'pointer' }}>
235
235
  <div className="tl-thinking-col">
236
- <span className="tl-summary tl-thinking-label">Thinking</span>
237
- {isExpanded && (
238
- <div className="tl-thinking-body">{e.content}</div>
239
- )}
236
+ {isExpanded
237
+ ? <div className="tl-thinking-body">{e.content}</div>
238
+ : <span className="tl-summary tl-thinking-label">{e.content.slice(0, 80)}{e.content.length > 80 ? '…' : ''}</span>
239
+ }
240
240
  </div>
241
241
  <span className="tl-step-elapsed">{formatElapsed(stepElapsed(i, nextIdx))}</span>
242
242
  <span className="tl-chevron">
@@ -367,7 +367,7 @@ async function* invokeAdminAgent(
367
367
  }
368
368
 
369
369
  if (msg.type === "user") {
370
- const content = (msg as Record<string, unknown>).content as
370
+ const content = (msg.message as Record<string, unknown> | undefined)?.content as
371
371
  Array<{ type: string; tool_use_id?: string; content?: string; is_error?: boolean }> | undefined;
372
372
 
373
373
  if (Array.isArray(content)) {
@@ -27,27 +27,31 @@ export default function AdminPage() {
27
27
  const [elapsedSeconds, setElapsedSeconds] = useState(0)
28
28
  const elapsedRef = useRef<ReturnType<typeof setInterval> | null>(null)
29
29
  const [sessionElapsed, setSessionElapsed] = useState(0)
30
- const sessionStartRef = useRef<number | null>(null)
31
- const sessionIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null)
30
+ const sessionAccumMs = useRef(0) // total active ms across all turns
31
+ const sessionTickRef = useRef<ReturnType<typeof setInterval> | null>(null)
32
32
  const messagesEndRef = useRef<HTMLDivElement>(null)
33
33
  const inputRef = useRef<HTMLInputElement>(null)
34
34
  const pinInputRef = useRef<HTMLInputElement>(null)
35
35
 
36
+ const sessionTurnStart = useRef<number | null>(null)
37
+
36
38
  function startElapsedTimer() {
37
- if (!sessionStartRef.current) {
38
- sessionStartRef.current = Date.now()
39
- sessionIntervalRef.current = setInterval(() => {
40
- setSessionElapsed(Math.floor((Date.now() - sessionStartRef.current!) / 1000))
41
- }, 1000)
42
- }
39
+ sessionTurnStart.current = Date.now()
40
+ sessionTickRef.current = setInterval(() => {
41
+ const active = sessionAccumMs.current + (Date.now() - (sessionTurnStart.current ?? Date.now()))
42
+ setSessionElapsed(Math.floor(active / 1000))
43
+ }, 1000)
43
44
  setElapsedSeconds(0)
44
45
  elapsedRef.current = setInterval(() => setElapsedSeconds(s => s + 1), 1000)
45
46
  }
46
47
 
47
48
  function stopElapsedTimer() {
48
- if (elapsedRef.current) {
49
- clearInterval(elapsedRef.current)
50
- elapsedRef.current = null
49
+ if (elapsedRef.current) { clearInterval(elapsedRef.current); elapsedRef.current = null }
50
+ if (sessionTickRef.current) { clearInterval(sessionTickRef.current); sessionTickRef.current = null }
51
+ if (sessionTurnStart.current) {
52
+ sessionAccumMs.current += Date.now() - sessionTurnStart.current
53
+ sessionTurnStart.current = null
54
+ setSessionElapsed(Math.floor(sessionAccumMs.current / 1000))
51
55
  }
52
56
  }
53
57
 
@@ -538,8 +542,6 @@ export default function AdminPage() {
538
542
  const contextPct = latestInputTokens > 0 ? Math.round(latestInputTokens / 200000 * 100) : 0
539
543
  return messages.some(m => m.role === 'maxy') ? (
540
544
  <div className="session-stats">
541
- <span className="session-stat">Effort <b>Standard</b></span>
542
- <span className="session-stat">Style <b>Standard</b></span>
543
545
  <span className="session-stat">Context <b>{contextPct > 0 ? `${contextPct}%` : '—'}</b></span>
544
546
  <span className="session-stat">Tokens <b>{fmtTokens(sessionTokens)}</b></span>
545
547
  <span className="session-stat">Session <b>{formatSessionTime(sessionElapsed)}</b></span>