Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
366 changes: 366 additions & 0 deletions docs/design-docs/interactive-shell.md

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion interface/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ export interface AgentsResponse {
export interface CronJobInfo {
id: string;
prompt: string;
cron_expr: string | null;
interval_secs: number;
delivery_target: string;
enabled: boolean;
Expand Down Expand Up @@ -764,11 +765,13 @@ export interface AgentConfigUpdateRequest {
export interface CronJobWithStats {
id: string;
prompt: string;
cron_expr: string | null;
interval_secs: number;
delivery_target: string;
enabled: boolean;
run_once: boolean;
active_hours: [number, number] | null;
timeout_secs: number | null;
success_count: number;
failure_count: number;
last_executed_at: string | null;
Expand All @@ -783,6 +786,7 @@ export interface CronExecutionEntry {

export interface CronListResponse {
jobs: CronJobWithStats[];
timezone: string;
}

export interface CronExecutionsResponse {
Expand All @@ -797,12 +801,14 @@ export interface CronActionResponse {
export interface CreateCronRequest {
id: string;
prompt: string;
interval_secs: number;
cron_expr?: string;
interval_secs?: number;
delivery_target: string;
active_start_hour?: number;
active_end_hour?: number;
enabled: boolean;
run_once: boolean;
timeout_secs?: number;
}

export interface CronExecutionsParams {
Expand Down
11 changes: 11 additions & 0 deletions interface/src/lib/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,20 @@ export function formatTimestamp(ts: number): string {

export function formatDuration(seconds: number): string {
if (seconds < 60) return `${seconds}s`;
if (seconds % 86400 === 0) return `${seconds / 86400}d`;
if (seconds % 3600 === 0) return `${seconds / 3600}h`;
if (seconds % 60 === 0) return `${seconds / 60}m`;
return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
}

export function formatCronSchedule(cronExpr: string | null, intervalSecs: number): string {
if (cronExpr) return cronExpr;
if (intervalSecs % 86400 === 0) return `every ${intervalSecs / 86400}d`;
if (intervalSecs % 3600 === 0) return `every ${intervalSecs / 3600}h`;
if (intervalSecs % 60 === 0) return `every ${intervalSecs / 60}m`;
return `every ${intervalSecs}s`;
}

export function platformIcon(platform: string): string {
switch (platform) {
case "discord": return "Discord";
Expand Down
Loading
Loading