@agent-link/server 0.1.176 → 0.1.178

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": "@agent-link/server",
3
- "version": "0.1.176",
3
+ "version": "0.1.178",
4
4
  "description": "AgentLink relay server",
5
5
  "license": "MIT",
6
6
  "repository": {
package/web/app.js CHANGED
@@ -1170,10 +1170,14 @@ const App = {
1170
1170
  },
1171
1171
  formatDuration(ms) {
1172
1172
  if (!ms && ms !== 0) return '';
1173
- const secs = Math.floor(ms / 1000);
1174
- const m = Math.floor(secs / 60);
1175
- const s = secs % 60;
1176
- return m + 'm ' + String(s).padStart(2, '0') + 's';
1173
+ const totalSecs = Math.floor(ms / 1000);
1174
+ if (totalSecs < 60) return totalSecs + 's';
1175
+ const m = Math.floor(totalSecs / 60);
1176
+ const s = totalSecs % 60;
1177
+ if (m < 60) return m + 'm ' + String(s).padStart(2, '0') + 's';
1178
+ const h = Math.floor(m / 60);
1179
+ const rm = m % 60;
1180
+ return h + 'h ' + String(rm).padStart(2, '0') + 'm';
1177
1181
  },
1178
1182
  isLoopRunning(loopId) {
1179
1183
  return !!loop.runningLoops.value[loopId];
@@ -1947,7 +1951,7 @@ const App = {
1947
1951
  </div>
1948
1952
  <div v-if="displayTeam.durationMs" class="team-stat">
1949
1953
  <span class="team-stat-label">{{ t('team.duration') }}</span>
1950
- <span class="team-stat-value">{{ Math.round(displayTeam.durationMs / 1000) }}s</span>
1954
+ <span class="team-stat-value">{{ formatDuration(displayTeam.durationMs) }}</span>
1951
1955
  </div>
1952
1956
  <div v-if="displayTeam.totalCost" class="team-stat">
1953
1957
  <span class="team-stat-label">{{ t('team.cost') }}</span>
@@ -69,6 +69,18 @@ export function formatTokens(n) {
69
69
  return String(n);
70
70
  }
71
71
 
72
+ export function formatDurationShort(ms) {
73
+ if (!ms && ms !== 0) return '';
74
+ const totalSecs = Math.floor(ms / 1000);
75
+ if (totalSecs < 60) return (ms / 1000).toFixed(1) + 's';
76
+ const m = Math.floor(totalSecs / 60);
77
+ const s = totalSecs % 60;
78
+ if (m < 60) return m + 'm ' + String(s).padStart(2, '0') + 's';
79
+ const h = Math.floor(m / 60);
80
+ const rm = m % 60;
81
+ return h + 'h ' + String(rm).padStart(2, '0') + 'm';
82
+ }
83
+
72
84
  /**
73
85
  * Format a usage stats object into a human-readable summary string.
74
86
  * @param {object|null} u - Usage stats from turn_completed
@@ -80,7 +92,7 @@ export function formatUsage(u, t) {
80
92
  const ctx = formatTokens(u.inputTokens) + ' / ' + formatTokens(u.contextWindow) + ' (' + pct + '%)';
81
93
  const cost = '$' + u.totalCost.toFixed(2);
82
94
  const model = u.model.replace(/^claude-/, '').replace(/-\d{8}$/, '').replace(/-1m$/, '');
83
- const dur = (u.durationMs / 1000).toFixed(1) + 's';
95
+ const dur = formatDurationShort(u.durationMs);
84
96
  const contextLabel = t ? t('usage.context') : 'Context';
85
97
  const costLabel = t ? t('usage.cost') : 'Cost';
86
98
  return contextLabel + ' ' + ctx + ' \u00b7 ' + costLabel + ' ' + cost + ' \u00b7 ' + model + ' \u00b7 ' + dur;
@@ -1,7 +1,7 @@
1
1
  // ── Progressive text streaming / reveal animation ────────────────────────────
2
2
 
3
- const CHARS_PER_TICK = 5;
4
- const TICK_MS = 16;
3
+ const CHARS_PER_TICK = 20;
4
+ const TICK_MS = 50;
5
5
 
6
6
  /**
7
7
  * Creates a streaming text reveal controller.