Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

feat(ui): heartbeat row + last/next-fired in SCHEDULES; reconcile config types (#2)

Chaitanya Giri8cf34c6fffa1
diff --git a/src/preload/index.ts b/src/preload/index.ts
index 0323c403..55508c3b 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -83,6 +83,19 @@ export interface ScheduledMission {
enabled: boolean;
autoCompact?: boolean;
lastFiredAt?: number;
+ /** Mission flavor; 'heartbeat' (Lane A #1) is a context-aware adaptive beat. */
+ kind?: 'dispatch' | 'heartbeat';
+ /** Heartbeat only: floor-quiet threshold in ms. */
+ quietThresholdMs?: number;
+}
+
+/** Circuit-breaker thresholds (Lane A #6.6b). Mirrors src/main/config.ts. */
+export interface CircuitBreakerConfig {
+ enabled?: boolean;
+ hardStop?: boolean;
+ repeatedToolLimit?: number;
+ errorStormLimit?: number;
+ tokenVelocityPerMin?: number;
}
export interface HarnessConfig {
@@ -95,7 +108,17 @@ export interface HarnessConfig {
semanticMemory: boolean;
embeddingModel: 'minilm' | 'embeddinggemma';
missions?: ScheduledMission[];
+ opsStandupSeeded?: boolean;
+ heartbeatSeeded?: boolean;
notifications?: boolean;
+ slackEnabled?: boolean;
+ slackSigningSecret?: string;
+ slackBotToken?: string;
+ slackChannelId?: string;
+ slackPort?: number;
+ costCapUsd?: number;
+ maxTurns?: number;
+ circuitBreaker?: CircuitBreakerConfig;
}
export interface MemoryStatus {
@@ -292,6 +315,13 @@ const api = {
listMissions: (): Promise<ScheduledMission[]> => ipcRenderer.invoke('missions:list'),
saveMissions: (missions: ScheduledMission[]): Promise<{ ok: boolean }> =>
ipcRenderer.invoke('missions:save', missions),
+ /** Fires when the scheduler stamps a mission's lastFiredAt (a beat/dispatch),
+ * so the SCHEDULES panel can refresh "last fired" without a reload. */
+ onMissionsUpdated: (cb: () => void): (() => void) => {
+ const listener = (): void => cb();
+ ipcRenderer.on('missions:updated', listener);
+ return () => ipcRenderer.removeListener('missions:updated', listener);
+ },
// ─── Full-text search across hive files (board, tasks, memory) ─────────────
textSearch: (q: string): Promise<{ ok: boolean; results: Array<{ source: string; excerpt: string }> }> =>
diff --git a/src/renderer/src/components/CommandCenterPanel.tsx b/src/renderer/src/components/CommandCenterPanel.tsx
index b73d115f..2957677a 100644
--- a/src/renderer/src/components/CommandCenterPanel.tsx
+++ b/src/renderer/src/components/CommandCenterPanel.tsx
@@ -30,6 +30,20 @@ interface ScheduledMission {
enabled: boolean;
autoCompact?: boolean;
lastFiredAt?: number;
+ /** 'heartbeat' (Lane A #1) is a context-aware adaptive beat, not a plain dispatch. */
+ kind?: 'dispatch' | 'heartbeat';
+ quietThresholdMs?: number;
+}
+
+/** Compact relative time, e.g. "4m ago" / "in 2m" / "just now". A positive ms is
+ * in the past, negative in the future. */
+function relTime(ms: number): string {
+ const past = ms >= 0;
+ const a = Math.abs(ms);
+ if (a < 45_000) return 'just now';
+ const mins = Math.round(a / 60_000);
+ const unit = mins < 60 ? `${mins}m` : mins < 1440 ? `${Math.round(mins / 60)}h` : `${Math.round(mins / 1440)}d`;
+ return past ? `${unit} ago` : `in ${unit}`;
}
/** Interval presets offered in the SCHEDULES form / shown as badges. */
@@ -216,6 +230,11 @@ function FloorTab({ seed }: { seed: { text: string; seq: number } }) {
useEffect(() => {
window.cth.getConfig().then((c) => setRepos(c.registeredRepos ?? [])).catch(() => { /* noop */ });
window.cth.listMissions().then(setMissions).catch(() => { /* noop */ });
+ // Refresh "last fired" when the scheduler stamps a beat/dispatch (#2.3).
+ const off = window.cth.onMissionsUpdated(() => {
+ window.cth.listMissions().then(setMissions).catch(() => { /* noop */ });
+ });
+ return off;
}, []);
// Seed the dispatch box from a task-card "assign" (keyed on seq so repeat
@@ -400,19 +419,28 @@ function FloorTab({ seed }: { seed: { text: string; seq: number } }) {
<Section title="SCHEDULES">
{missions.length === 0 && <Muted>No scheduled missions.</Muted>}
- {missions.map((m) => (
+ {missions.map((m) => {
+ const hb = m.kind === 'heartbeat';
+ const fired = m.lastFiredAt ? `fired ${relTime(Date.now() - m.lastFiredAt)}` : 'not yet fired';
+ const next = m.enabled && m.lastFiredAt
+ ? ` · next ${relTime(Date.now() - (m.lastFiredAt + m.intervalMs))}` : '';
+ return (
<div key={m.id} style={{
display: 'flex', alignItems: 'center', gap: 6, padding: 6, marginBottom: 6,
background: 'var(--cth-paper-100)', boxShadow: 'inset 0 0 0 1px var(--cth-ink-300)'
}}>
<span style={{
fontFamily: 'var(--cth-font-display)', fontSize: 9, padding: '2px 5px 1px',
- background: 'var(--cth-cream-200)', boxShadow: 'inset 0 0 0 1px var(--cth-ink-700)',
+ background: hb ? 'var(--cth-lemon)' : 'var(--cth-cream-200)',
+ boxShadow: `inset 0 0 0 1px ${hb ? 'var(--cth-ink-900)' : 'var(--cth-ink-700)'}`,
color: 'var(--cth-ink-900)', flexShrink: 0
- }}>{intervalLabel(m.intervalMs)}</span>
+ }}>{hb ? '♥ beat' : intervalLabel(m.intervalMs)}</span>
<div style={{ flex: 1, minWidth: 0 }}>
<div style={{ fontSize: 13, color: 'var(--cth-ink-900)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{m.label}</div>
- <div style={{ fontSize: 11, color: 'var(--cth-ink-500)' }}>→ {targetName(m.to)}</div>
+ <div style={{ fontSize: 11, color: 'var(--cth-ink-500)' }}>
+ → {targetName(m.to)}{hb ? ` · adaptive ~${intervalLabel(m.intervalMs)} · auto digest` : ''}
+ </div>
+ <div style={{ fontSize: 10, color: 'var(--cth-ink-500)' }}>{fired}{next}</div>
</div>
<button
onClick={() => toggleMission(m.id)}
@@ -424,7 +452,8 @@ function FloorTab({ seed }: { seed: { text: string; seq: number } }) {
}}
>{m.enabled ? 'on' : 'off'}</button>
</div>
- ))}
+ );
+ })}
<div style={{ display: 'flex', gap: 6, marginTop: 6, marginBottom: 6 }}>
<input
value={mLabel}
diff --git a/src/renderer/src/store/config.ts b/src/renderer/src/store/config.ts
index 5383c647..6c9b892d 100644
--- a/src/renderer/src/store/config.ts
+++ b/src/renderer/src/store/config.ts
@@ -1,6 +1,29 @@
// Mirrors src/main/config.ts. Kept as a renderer-side type-only module
// so we don't have to reach into the preload package to type-check.
+/** A recurring auto-dispatched mission (mirrors src/main/config.ts). */
+export interface ScheduledMission {
+ id: string;
+ label: string;
+ intervalMs: number;
+ to: string;
+ body: string;
+ enabled: boolean;
+ autoCompact?: boolean;
+ lastFiredAt?: number;
+ kind?: 'dispatch' | 'heartbeat';
+ quietThresholdMs?: number;
+}
+
+/** Circuit-breaker thresholds (mirrors src/main/config.ts CircuitBreakerConfig). */
+export interface CircuitBreakerConfig {
+ enabled?: boolean;
+ hardStop?: boolean;
+ repeatedToolLimit?: number;
+ errorStormLimit?: number;
+ tokenVelocityPerMin?: number;
+}
+
export interface HarnessConfig {
onboardingComplete: boolean;
harnessHome: string | null;
@@ -11,6 +34,18 @@ export interface HarnessConfig {
defaultModel?: string;
semanticMemory: boolean;
embeddingModel: 'minilm' | 'embeddinggemma';
+ missions?: ScheduledMission[];
+ opsStandupSeeded?: boolean;
+ heartbeatSeeded?: boolean;
+ notifications?: boolean;
+ slackEnabled?: boolean;
+ slackSigningSecret?: string;
+ slackBotToken?: string;
+ slackChannelId?: string;
+ slackPort?: number;
+ costCapUsd?: number;
+ maxTurns?: number;
+ circuitBreaker?: CircuitBreakerConfig;
}
/** The Sonnet model with the 1M-token context window — used for Michael's prep