-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
67 lines (62 loc) · 1.9 KB
/
Copy pathtypes.ts
File metadata and controls
67 lines (62 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* Shared types for the loop plugin
*/
export type TaskMode = "fixed" | "adaptive" | "maintenance"
export interface LoopTask {
/** Unique 8-char ID */
id: string
/** User-provided prompt to re-inject each cycle */
prompt: string
/** Scheduling mode */
mode: TaskMode
/** Interval in milliseconds (fixed mode only) */
intervalMs?: number
/** Adaptive bounds (adaptive mode only) */
adaptiveMinMs?: number
adaptiveMaxMs?: number
/** When this task was first created (epoch ms) */
createdAt: number
/** When this task last fired (epoch ms, 0 if never) */
lastFiredAt: number
/** Next scheduled fire time (epoch ms) */
nextDueAt: number
/** Source of the loop: user command, default, etc. */
source: "user" | "loop.md" | "default"
/** Project directory (for scoping) */
directory: string
/** Session that owns this task. REQUIRED. Tasks without sessionID are dropped on load. */
sessionID: string
/** Disabled? */
paused: boolean
}
export interface LoopConfig {
/** Override default storage directory */
storageDir?: string
/** Max concurrent tasks (default 50) */
maxTasks?: number
/** Auto-expire tasks after N days (default 7) */
taskTtlDays?: number
/** @deprecated kept for backwards compat; jitter is now hardcoded to match Claude Code */
jitterPercent?: number
/** Adaptive minimum interval in ms (default 60_000) */
defaultAdaptiveMinMs?: number
/** Adaptive maximum interval in ms (default 3_600_000) */
defaultAdaptiveMaxMs?: number
/** Internal ticker interval in ms (default 15_000) */
tickerIntervalMs?: number
}
export interface CreateTaskInput {
prompt: string
mode: TaskMode
intervalMs?: number
adaptiveMinMs?: number
adaptiveMaxMs?: number
source?: LoopTask["source"]
directory: string
/** Required: the session this task is bound to */
sessionID: string
}
export interface FireResult {
message: string
task: LoopTask
}