aicodeman 0.2.9 → 0.3.0
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/README.md +91 -0
- package/dist/ai-idle-checker.d.ts.map +1 -1
- package/dist/ai-idle-checker.js +3 -2
- package/dist/ai-idle-checker.js.map +1 -1
- package/dist/ai-plan-checker.d.ts.map +1 -1
- package/dist/ai-plan-checker.js +3 -2
- package/dist/ai-plan-checker.js.map +1 -1
- package/dist/bash-tool-parser.d.ts +2 -3
- package/dist/bash-tool-parser.d.ts.map +1 -1
- package/dist/bash-tool-parser.js +14 -31
- package/dist/bash-tool-parser.js.map +1 -1
- package/dist/config/ai-defaults.d.ts +16 -0
- package/dist/config/ai-defaults.d.ts.map +1 -0
- package/dist/config/ai-defaults.js +16 -0
- package/dist/config/ai-defaults.js.map +1 -0
- package/dist/config/auth-config.d.ts +19 -0
- package/dist/config/auth-config.d.ts.map +1 -0
- package/dist/config/auth-config.js +28 -0
- package/dist/config/auth-config.js.map +1 -0
- package/dist/config/exec-timeout.d.ts +10 -0
- package/dist/config/exec-timeout.d.ts.map +1 -0
- package/dist/config/exec-timeout.js +10 -0
- package/dist/config/exec-timeout.js.map +1 -0
- package/dist/config/map-limits.d.ts +4 -0
- package/dist/config/map-limits.d.ts.map +1 -1
- package/dist/config/map-limits.js +7 -0
- package/dist/config/map-limits.js.map +1 -1
- package/dist/config/server-timing.d.ts +36 -0
- package/dist/config/server-timing.d.ts.map +1 -0
- package/dist/config/server-timing.js +51 -0
- package/dist/config/server-timing.js.map +1 -0
- package/dist/config/team-config.d.ts +16 -0
- package/dist/config/team-config.d.ts.map +1 -0
- package/dist/config/team-config.js +16 -0
- package/dist/config/team-config.js.map +1 -0
- package/dist/config/terminal-limits.d.ts +18 -0
- package/dist/config/terminal-limits.d.ts.map +1 -0
- package/dist/config/terminal-limits.js +18 -0
- package/dist/config/terminal-limits.js.map +1 -0
- package/dist/config/tunnel-config.d.ts +27 -0
- package/dist/config/tunnel-config.d.ts.map +1 -0
- package/dist/config/tunnel-config.js +36 -0
- package/dist/config/tunnel-config.js.map +1 -0
- package/dist/hooks-config.d.ts.map +1 -1
- package/dist/hooks-config.js +7 -6
- package/dist/hooks-config.js.map +1 -1
- package/dist/image-watcher.d.ts +4 -4
- package/dist/image-watcher.d.ts.map +1 -1
- package/dist/image-watcher.js +17 -30
- package/dist/image-watcher.js.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/plan-orchestrator.d.ts +2 -24
- package/dist/plan-orchestrator.d.ts.map +1 -1
- package/dist/plan-orchestrator.js.map +1 -1
- package/dist/push-store.d.ts +1 -1
- package/dist/push-store.d.ts.map +1 -1
- package/dist/push-store.js +4 -12
- package/dist/push-store.js.map +1 -1
- package/dist/ralph-fix-plan-watcher.d.ts +91 -0
- package/dist/ralph-fix-plan-watcher.d.ts.map +1 -0
- package/dist/ralph-fix-plan-watcher.js +326 -0
- package/dist/ralph-fix-plan-watcher.js.map +1 -0
- package/dist/ralph-plan-tracker.d.ts +201 -0
- package/dist/ralph-plan-tracker.d.ts.map +1 -0
- package/dist/ralph-plan-tracker.js +325 -0
- package/dist/ralph-plan-tracker.js.map +1 -0
- package/dist/ralph-stall-detector.d.ts +84 -0
- package/dist/ralph-stall-detector.d.ts.map +1 -0
- package/dist/ralph-stall-detector.js +139 -0
- package/dist/ralph-stall-detector.js.map +1 -0
- package/dist/ralph-status-parser.d.ts +141 -0
- package/dist/ralph-status-parser.d.ts.map +1 -0
- package/dist/ralph-status-parser.js +478 -0
- package/dist/ralph-status-parser.js.map +1 -0
- package/dist/ralph-tracker.d.ts +194 -685
- package/dist/ralph-tracker.d.ts.map +1 -1
- package/dist/ralph-tracker.js +349 -1713
- package/dist/ralph-tracker.js.map +1 -1
- package/dist/respawn-adaptive-timing.d.ts +61 -0
- package/dist/respawn-adaptive-timing.d.ts.map +1 -0
- package/dist/respawn-adaptive-timing.js +105 -0
- package/dist/respawn-adaptive-timing.js.map +1 -0
- package/dist/respawn-controller.d.ts +12 -101
- package/dist/respawn-controller.d.ts.map +1 -1
- package/dist/respawn-controller.js +144 -593
- package/dist/respawn-controller.js.map +1 -1
- package/dist/respawn-health.d.ts +54 -0
- package/dist/respawn-health.d.ts.map +1 -0
- package/dist/respawn-health.js +183 -0
- package/dist/respawn-health.js.map +1 -0
- package/dist/respawn-metrics.d.ts +81 -0
- package/dist/respawn-metrics.d.ts.map +1 -0
- package/dist/respawn-metrics.js +198 -0
- package/dist/respawn-metrics.js.map +1 -0
- package/dist/respawn-patterns.d.ts +45 -0
- package/dist/respawn-patterns.d.ts.map +1 -0
- package/dist/respawn-patterns.js +125 -0
- package/dist/respawn-patterns.js.map +1 -0
- package/dist/session-auto-ops.d.ts +89 -0
- package/dist/session-auto-ops.d.ts.map +1 -0
- package/dist/session-auto-ops.js +224 -0
- package/dist/session-auto-ops.js.map +1 -0
- package/dist/session-cli-builder.d.ts +62 -0
- package/dist/session-cli-builder.d.ts.map +1 -0
- package/dist/session-cli-builder.js +121 -0
- package/dist/session-cli-builder.js.map +1 -0
- package/dist/session-task-cache.d.ts +52 -0
- package/dist/session-task-cache.d.ts.map +1 -0
- package/dist/session-task-cache.js +90 -0
- package/dist/session-task-cache.js.map +1 -0
- package/dist/session.d.ts +2 -33
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +58 -309
- package/dist/session.js.map +1 -1
- package/dist/state-store.d.ts +2 -2
- package/dist/state-store.d.ts.map +1 -1
- package/dist/state-store.js +12 -23
- package/dist/state-store.js.map +1 -1
- package/dist/subagent-watcher.d.ts +3 -4
- package/dist/subagent-watcher.d.ts.map +1 -1
- package/dist/subagent-watcher.js +24 -61
- package/dist/subagent-watcher.js.map +1 -1
- package/dist/team-watcher.d.ts.map +1 -1
- package/dist/team-watcher.js +2 -5
- package/dist/team-watcher.js.map +1 -1
- package/dist/tmux-manager.d.ts.map +1 -1
- package/dist/tmux-manager.js +1 -2
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tunnel-manager.d.ts +26 -0
- package/dist/tunnel-manager.d.ts.map +1 -1
- package/dist/tunnel-manager.js +127 -7
- package/dist/tunnel-manager.js.map +1 -1
- package/dist/types/api.d.ts +93 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +83 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/app-state.d.ts +100 -0
- package/dist/types/app-state.d.ts.map +1 -0
- package/dist/types/app-state.js +59 -0
- package/dist/types/app-state.js.map +1 -0
- package/dist/types/common.d.ts +70 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +8 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/lifecycle.d.ts +17 -0
- package/dist/types/lifecycle.d.ts.map +1 -0
- package/dist/types/lifecycle.js +5 -0
- package/dist/types/lifecycle.js.map +1 -0
- package/dist/types/plan.d.ts +32 -0
- package/dist/types/plan.d.ts.map +1 -0
- package/dist/types/plan.js +5 -0
- package/dist/types/plan.js.map +1 -0
- package/dist/types/push.d.ts +23 -0
- package/dist/types/push.d.ts.map +1 -0
- package/dist/types/push.js +5 -0
- package/dist/types/push.js.map +1 -0
- package/dist/types/ralph.d.ts +241 -0
- package/dist/types/ralph.d.ts.map +1 -0
- package/dist/types/ralph.js +49 -0
- package/dist/types/ralph.js.map +1 -0
- package/dist/types/respawn.d.ts +250 -0
- package/dist/types/respawn.d.ts.map +1 -0
- package/dist/types/respawn.js +5 -0
- package/dist/types/respawn.js.map +1 -0
- package/dist/types/run-summary.d.ts +81 -0
- package/dist/types/run-summary.d.ts.map +1 -0
- package/dist/types/run-summary.js +22 -0
- package/dist/types/run-summary.js.map +1 -0
- package/dist/types/session.d.ts +130 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +5 -0
- package/dist/types/session.js.map +1 -0
- package/dist/types/task.d.ts +58 -0
- package/dist/types/task.d.ts.map +1 -0
- package/dist/types/task.js +5 -0
- package/dist/types/task.js.map +1 -0
- package/dist/types/teams.d.ts +55 -0
- package/dist/types/teams.d.ts.map +1 -0
- package/dist/types/teams.js +5 -0
- package/dist/types/teams.js.map +1 -0
- package/dist/types/tools.d.ts +46 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +5 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types.d.ts +1 -1138
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -214
- package/dist/types.js.map +1 -1
- package/dist/utils/claude-cli-resolver.d.ts.map +1 -1
- package/dist/utils/claude-cli-resolver.js +1 -2
- package/dist/utils/claude-cli-resolver.js.map +1 -1
- package/dist/utils/debouncer.d.ts +111 -0
- package/dist/utils/debouncer.d.ts.map +1 -0
- package/dist/utils/debouncer.js +162 -0
- package/dist/utils/debouncer.js.map +1 -0
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/opencode-cli-resolver.d.ts.map +1 -1
- package/dist/utils/opencode-cli-resolver.js +1 -2
- package/dist/utils/opencode-cli-resolver.js.map +1 -1
- package/dist/utils/string-similarity.d.ts +0 -57
- package/dist/utils/string-similarity.d.ts.map +1 -1
- package/dist/utils/string-similarity.js +3 -18
- package/dist/utils/string-similarity.js.map +1 -1
- package/dist/web/middleware/auth.d.ts +31 -0
- package/dist/web/middleware/auth.d.ts.map +1 -0
- package/dist/web/middleware/auth.js +154 -0
- package/dist/web/middleware/auth.js.map +1 -0
- package/dist/web/ports/auth-port.d.ts +18 -0
- package/dist/web/ports/auth-port.d.ts.map +1 -0
- package/dist/web/ports/auth-port.js +6 -0
- package/dist/web/ports/auth-port.js.map +1 -0
- package/dist/web/ports/config-port.d.ts +28 -0
- package/dist/web/ports/config-port.d.ts.map +1 -0
- package/dist/web/ports/config-port.js +6 -0
- package/dist/web/ports/config-port.js.map +1 -0
- package/dist/web/ports/event-port.d.ts +13 -0
- package/dist/web/ports/event-port.d.ts.map +1 -0
- package/dist/web/ports/event-port.js +6 -0
- package/dist/web/ports/event-port.js.map +1 -0
- package/dist/web/ports/index.d.ts +14 -0
- package/dist/web/ports/index.d.ts.map +1 -0
- package/dist/web/ports/index.js +9 -0
- package/dist/web/ports/index.js.map +1 -0
- package/dist/web/ports/infra-port.d.ts +36 -0
- package/dist/web/ports/infra-port.d.ts.map +1 -0
- package/dist/web/ports/infra-port.js +6 -0
- package/dist/web/ports/infra-port.js.map +1 -0
- package/dist/web/ports/respawn-port.d.ts +20 -0
- package/dist/web/ports/respawn-port.d.ts.map +1 -0
- package/dist/web/ports/respawn-port.js +6 -0
- package/dist/web/ports/respawn-port.js.map +1 -0
- package/dist/web/ports/session-port.d.ts +15 -0
- package/dist/web/ports/session-port.d.ts.map +1 -0
- package/dist/web/ports/session-port.js +6 -0
- package/dist/web/ports/session-port.js.map +1 -0
- package/dist/web/public/api-client.js +70 -0
- package/dist/web/public/api-client.js.br +0 -0
- package/dist/web/public/api-client.js.gz +0 -0
- package/dist/web/public/app.js +151 -235
- package/dist/web/public/app.js.br +0 -0
- package/dist/web/public/app.js.gz +0 -0
- package/dist/web/public/constants.js +238 -0
- package/dist/web/public/constants.js.br +0 -0
- package/dist/web/public/constants.js.gz +0 -0
- package/dist/web/public/index.html +11 -3
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/keyboard-accessory.js +279 -0
- package/dist/web/public/keyboard-accessory.js.br +0 -0
- package/dist/web/public/keyboard-accessory.js.gz +0 -0
- package/dist/web/public/mobile-handlers.js +467 -0
- package/dist/web/public/mobile-handlers.js.br +0 -0
- package/dist/web/public/mobile-handlers.js.gz +0 -0
- package/dist/web/public/mobile.css.gz +0 -0
- package/dist/web/public/notification-manager.js +445 -0
- package/dist/web/public/notification-manager.js.br +0 -0
- package/dist/web/public/notification-manager.js.gz +0 -0
- package/dist/web/public/ralph-wizard.js +3 -3
- package/dist/web/public/ralph-wizard.js.br +0 -0
- package/dist/web/public/ralph-wizard.js.gz +0 -0
- package/dist/web/public/styles.css.gz +0 -0
- package/dist/web/public/subagent-windows.js +1115 -0
- package/dist/web/public/subagent-windows.js.br +0 -0
- package/dist/web/public/subagent-windows.js.gz +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/voice-input.js +858 -0
- package/dist/web/public/voice-input.js.br +0 -0
- package/dist/web/public/voice-input.js.gz +0 -0
- package/dist/web/route-helpers.d.ts +38 -0
- package/dist/web/route-helpers.d.ts.map +1 -0
- package/dist/web/route-helpers.js +143 -0
- package/dist/web/route-helpers.js.map +1 -0
- package/dist/web/routes/case-routes.d.ts +9 -0
- package/dist/web/routes/case-routes.d.ts.map +1 -0
- package/dist/web/routes/case-routes.js +419 -0
- package/dist/web/routes/case-routes.js.map +1 -0
- package/dist/web/routes/file-routes.d.ts +8 -0
- package/dist/web/routes/file-routes.d.ts.map +1 -0
- package/dist/web/routes/file-routes.js +337 -0
- package/dist/web/routes/file-routes.js.map +1 -0
- package/dist/web/routes/hook-event-routes.d.ts +9 -0
- package/dist/web/routes/hook-event-routes.d.ts.map +1 -0
- package/dist/web/routes/hook-event-routes.js +57 -0
- package/dist/web/routes/hook-event-routes.js.map +1 -0
- package/dist/web/routes/index.d.ts +16 -0
- package/dist/web/routes/index.d.ts.map +1 -0
- package/dist/web/routes/index.js +16 -0
- package/dist/web/routes/index.js.map +1 -0
- package/dist/web/routes/mux-routes.d.ts +8 -0
- package/dist/web/routes/mux-routes.d.ts.map +1 -0
- package/dist/web/routes/mux-routes.js +32 -0
- package/dist/web/routes/mux-routes.js.map +1 -0
- package/dist/web/routes/plan-routes.d.ts +9 -0
- package/dist/web/routes/plan-routes.d.ts.map +1 -0
- package/dist/web/routes/plan-routes.js +381 -0
- package/dist/web/routes/plan-routes.js.map +1 -0
- package/dist/web/routes/push-routes.d.ts +8 -0
- package/dist/web/routes/push-routes.d.ts.map +1 -0
- package/dist/web/routes/push-routes.js +49 -0
- package/dist/web/routes/push-routes.js.map +1 -0
- package/dist/web/routes/ralph-routes.d.ts +9 -0
- package/dist/web/routes/ralph-routes.d.ts.map +1 -0
- package/dist/web/routes/ralph-routes.js +475 -0
- package/dist/web/routes/ralph-routes.js.map +1 -0
- package/dist/web/routes/respawn-routes.d.ts +8 -0
- package/dist/web/routes/respawn-routes.d.ts.map +1 -0
- package/dist/web/routes/respawn-routes.js +260 -0
- package/dist/web/routes/respawn-routes.js.map +1 -0
- package/dist/web/routes/scheduled-routes.d.ts +8 -0
- package/dist/web/routes/scheduled-routes.d.ts.map +1 -0
- package/dist/web/routes/scheduled-routes.js +51 -0
- package/dist/web/routes/scheduled-routes.js.map +1 -0
- package/dist/web/routes/session-routes.d.ts +9 -0
- package/dist/web/routes/session-routes.d.ts.map +1 -0
- package/dist/web/routes/session-routes.js +729 -0
- package/dist/web/routes/session-routes.js.map +1 -0
- package/dist/web/routes/system-routes.d.ts +9 -0
- package/dist/web/routes/system-routes.d.ts.map +1 -0
- package/dist/web/routes/system-routes.js +678 -0
- package/dist/web/routes/system-routes.js.map +1 -0
- package/dist/web/routes/team-routes.d.ts +8 -0
- package/dist/web/routes/team-routes.d.ts.map +1 -0
- package/dist/web/routes/team-routes.js +14 -0
- package/dist/web/routes/team-routes.js.map +1 -0
- package/dist/web/schemas.d.ts +43 -3
- package/dist/web/schemas.d.ts.map +1 -1
- package/dist/web/schemas.js +6 -2
- package/dist/web/schemas.js.map +1 -1
- package/dist/web/server.d.ts +10 -9
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +335 -3824
- package/dist/web/server.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Application state type definitions
|
|
3
|
+
*/
|
|
4
|
+
import type { SessionState } from './session.js';
|
|
5
|
+
import type { TaskState } from './task.js';
|
|
6
|
+
import type { RalphLoopState } from './ralph.js';
|
|
7
|
+
import type { RespawnConfig } from './respawn.js';
|
|
8
|
+
/**
|
|
9
|
+
* Global statistics across all sessions (including deleted ones).
|
|
10
|
+
* Persisted to track cumulative usage over time.
|
|
11
|
+
*/
|
|
12
|
+
export interface GlobalStats {
|
|
13
|
+
/** Total input tokens used across all sessions */
|
|
14
|
+
totalInputTokens: number;
|
|
15
|
+
/** Total output tokens used across all sessions */
|
|
16
|
+
totalOutputTokens: number;
|
|
17
|
+
/** Total cost in USD across all sessions */
|
|
18
|
+
totalCost: number;
|
|
19
|
+
/** Total number of sessions created (lifetime) */
|
|
20
|
+
totalSessionsCreated: number;
|
|
21
|
+
/** Timestamp when stats were first recorded */
|
|
22
|
+
firstRecordedAt: number;
|
|
23
|
+
/** Timestamp of last update */
|
|
24
|
+
lastUpdatedAt: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Daily token usage entry for historical tracking.
|
|
28
|
+
*/
|
|
29
|
+
export interface TokenUsageEntry {
|
|
30
|
+
/** Date in YYYY-MM-DD format */
|
|
31
|
+
date: string;
|
|
32
|
+
/** Input tokens used on this day */
|
|
33
|
+
inputTokens: number;
|
|
34
|
+
/** Output tokens used on this day */
|
|
35
|
+
outputTokens: number;
|
|
36
|
+
/** Estimated cost in USD */
|
|
37
|
+
estimatedCost: number;
|
|
38
|
+
/** Number of sessions that contributed to this day's usage */
|
|
39
|
+
sessions: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Token usage statistics with daily tracking.
|
|
43
|
+
*/
|
|
44
|
+
export interface TokenStats {
|
|
45
|
+
/** Daily usage entries (most recent first) */
|
|
46
|
+
daily: TokenUsageEntry[];
|
|
47
|
+
/** Timestamp of last update */
|
|
48
|
+
lastUpdated: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Application configuration
|
|
52
|
+
*/
|
|
53
|
+
export interface AppConfig {
|
|
54
|
+
/** Interval for polling session status (ms) */
|
|
55
|
+
pollIntervalMs: number;
|
|
56
|
+
/** Default timeout for tasks (ms) */
|
|
57
|
+
defaultTimeoutMs: number;
|
|
58
|
+
/** Maximum concurrent sessions allowed */
|
|
59
|
+
maxConcurrentSessions: number;
|
|
60
|
+
/** Path to state file */
|
|
61
|
+
stateFilePath: string;
|
|
62
|
+
/** Respawn controller configuration */
|
|
63
|
+
respawn: RespawnConfig;
|
|
64
|
+
/** Last used case name (for default selection) */
|
|
65
|
+
lastUsedCase: string | null;
|
|
66
|
+
/** Whether Ralph/Todo tracker is globally enabled for all new sessions */
|
|
67
|
+
ralphEnabled: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Complete application state
|
|
71
|
+
*/
|
|
72
|
+
export interface AppState {
|
|
73
|
+
/** Map of session ID to session state */
|
|
74
|
+
sessions: Record<string, SessionState>;
|
|
75
|
+
/** Map of task ID to task state */
|
|
76
|
+
tasks: Record<string, TaskState>;
|
|
77
|
+
/** Ralph Loop controller state */
|
|
78
|
+
ralphLoop: RalphLoopState;
|
|
79
|
+
/** Application configuration */
|
|
80
|
+
config: AppConfig;
|
|
81
|
+
/** Global statistics (cumulative across all sessions) */
|
|
82
|
+
globalStats?: GlobalStats;
|
|
83
|
+
/** Daily token usage statistics */
|
|
84
|
+
tokenStats?: TokenStats;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Default application configuration values
|
|
88
|
+
*/
|
|
89
|
+
export declare const DEFAULT_CONFIG: AppConfig;
|
|
90
|
+
/**
|
|
91
|
+
* Creates initial application state
|
|
92
|
+
* @returns Fresh application state with defaults
|
|
93
|
+
*/
|
|
94
|
+
export declare function createInitialState(): AppState;
|
|
95
|
+
/**
|
|
96
|
+
* Creates initial global stats object
|
|
97
|
+
* @returns Fresh global stats with zero values
|
|
98
|
+
*/
|
|
99
|
+
export declare function createInitialGlobalStats(): GlobalStats;
|
|
100
|
+
//# sourceMappingURL=app-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-state.d.ts","sourceRoot":"","sources":["../../src/types/app-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,kDAAkD;IAClD,gBAAgB,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,eAAe,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;CACvB;AAID;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,8CAA8C;IAC9C,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,+CAA+C;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yBAAyB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,OAAO,EAAE,aAAa,CAAC;IACvB,kDAAkD;IAClD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0EAA0E;IAC1E,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACvC,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACjC,kCAAkC;IAClC,SAAS,EAAE,cAAc,CAAC;IAC1B,gCAAgC;IAChC,MAAM,EAAE,SAAS,CAAC;IAClB,yDAAyD;IACzD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,mCAAmC;IACnC,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAID;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,SAe5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,QAAQ,CAe7C;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,WAAW,CAUtD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Application state type definitions
|
|
3
|
+
*/
|
|
4
|
+
// ========== Default Configuration ==========
|
|
5
|
+
/**
|
|
6
|
+
* Default application configuration values
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_CONFIG = {
|
|
9
|
+
pollIntervalMs: 1000,
|
|
10
|
+
defaultTimeoutMs: 300000, // 5 minutes
|
|
11
|
+
maxConcurrentSessions: 5,
|
|
12
|
+
stateFilePath: '',
|
|
13
|
+
respawn: {
|
|
14
|
+
idleTimeoutMs: 5000, // 5 seconds of no activity after prompt
|
|
15
|
+
updatePrompt: 'update all the docs and CLAUDE.md',
|
|
16
|
+
interStepDelayMs: 1000, // 1 second between steps
|
|
17
|
+
enabled: false, // disabled by default
|
|
18
|
+
sendClear: true, // send /clear after update prompt
|
|
19
|
+
sendInit: true, // send /init after /clear
|
|
20
|
+
},
|
|
21
|
+
lastUsedCase: null,
|
|
22
|
+
ralphEnabled: false,
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Creates initial application state
|
|
26
|
+
* @returns Fresh application state with defaults
|
|
27
|
+
*/
|
|
28
|
+
export function createInitialState() {
|
|
29
|
+
return {
|
|
30
|
+
sessions: {},
|
|
31
|
+
tasks: {},
|
|
32
|
+
ralphLoop: {
|
|
33
|
+
status: 'stopped',
|
|
34
|
+
startedAt: null,
|
|
35
|
+
minDurationMs: null,
|
|
36
|
+
tasksCompleted: 0,
|
|
37
|
+
tasksGenerated: 0,
|
|
38
|
+
lastCheckAt: null,
|
|
39
|
+
},
|
|
40
|
+
config: { ...DEFAULT_CONFIG },
|
|
41
|
+
globalStats: createInitialGlobalStats(),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates initial global stats object
|
|
46
|
+
* @returns Fresh global stats with zero values
|
|
47
|
+
*/
|
|
48
|
+
export function createInitialGlobalStats() {
|
|
49
|
+
const now = Date.now();
|
|
50
|
+
return {
|
|
51
|
+
totalInputTokens: 0,
|
|
52
|
+
totalOutputTokens: 0,
|
|
53
|
+
totalCost: 0,
|
|
54
|
+
totalSessionsCreated: 0,
|
|
55
|
+
firstRecordedAt: now,
|
|
56
|
+
lastUpdatedAt: now,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=app-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-state.js","sourceRoot":"","sources":["../../src/types/app-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8FH,8CAA8C;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC,cAAc,EAAE,IAAI;IACpB,gBAAgB,EAAE,MAAM,EAAE,YAAY;IACtC,qBAAqB,EAAE,CAAC;IACxB,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE;QACP,aAAa,EAAE,IAAI,EAAE,wCAAwC;QAC7D,YAAY,EAAE,mCAAmC;QACjD,gBAAgB,EAAE,IAAI,EAAE,yBAAyB;QACjD,OAAO,EAAE,KAAK,EAAE,sBAAsB;QACtC,SAAS,EAAE,IAAI,EAAE,kCAAkC;QACnD,QAAQ,EAAE,IAAI,EAAE,0BAA0B;KAC3C;IACD,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,KAAK;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,EAAE;QACT,SAAS,EAAE;YACT,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,IAAI;YACnB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,CAAC;YACjB,WAAW,EAAE,IAAI;SAClB;QACD,MAAM,EAAE,EAAE,GAAG,cAAc,EAAE;QAC7B,WAAW,EAAE,wBAAwB,EAAE;KACxC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,OAAO;QACL,gBAAgB,EAAE,CAAC;QACnB,iBAAiB,EAAE,CAAC;QACpB,SAAS,EAAE,CAAC;QACZ,oBAAoB,EAAE,CAAC;QACvB,eAAe,EAAE,GAAG;QACpB,aAAa,EAAE,GAAG;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Common/shared type definitions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Interface for objects that hold resources requiring explicit cleanup.
|
|
6
|
+
* Implementing classes should release timers, watchers, and other resources in dispose().
|
|
7
|
+
*/
|
|
8
|
+
export interface Disposable {
|
|
9
|
+
/** Release all held resources. Safe to call multiple times. */
|
|
10
|
+
dispose(): void;
|
|
11
|
+
/** Whether this object has been disposed */
|
|
12
|
+
readonly isDisposed: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Configuration for buffer accumulator instances.
|
|
16
|
+
* Used for terminal buffers, text output, and other size-limited string storage.
|
|
17
|
+
*/
|
|
18
|
+
export interface BufferConfig {
|
|
19
|
+
/** Maximum buffer size in bytes before trimming */
|
|
20
|
+
maxSize: number;
|
|
21
|
+
/** Size to trim to when maxSize is exceeded */
|
|
22
|
+
trimSize: number;
|
|
23
|
+
/** Optional callback invoked when buffer is trimmed */
|
|
24
|
+
onTrim?: (trimmedBytes: number) => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Resource types that can be registered for cleanup.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Configuration for process priority using `nice`.
|
|
31
|
+
* Lower priority reduces CPU contention with other processes.
|
|
32
|
+
*/
|
|
33
|
+
export interface NiceConfig {
|
|
34
|
+
/** Whether nice priority is enabled */
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
/** Nice value (-20 to 19, default: 10 = lower priority) */
|
|
37
|
+
niceValue: number;
|
|
38
|
+
}
|
|
39
|
+
export declare const DEFAULT_NICE_CONFIG: NiceConfig;
|
|
40
|
+
/**
|
|
41
|
+
* Process resource statistics
|
|
42
|
+
*/
|
|
43
|
+
export interface ProcessStats {
|
|
44
|
+
/** Memory usage in megabytes */
|
|
45
|
+
memoryMB: number;
|
|
46
|
+
/** CPU usage percentage */
|
|
47
|
+
cpuPercent: number;
|
|
48
|
+
/** Number of child processes */
|
|
49
|
+
childCount: number;
|
|
50
|
+
/** Timestamp of stats collection */
|
|
51
|
+
updatedAt: number;
|
|
52
|
+
}
|
|
53
|
+
export type CleanupResourceType = 'timer' | 'interval' | 'watcher' | 'listener' | 'stream';
|
|
54
|
+
/**
|
|
55
|
+
* Registration entry for a cleanup resource.
|
|
56
|
+
* Used by CleanupManager to track and dispose resources.
|
|
57
|
+
*/
|
|
58
|
+
export interface CleanupRegistration {
|
|
59
|
+
/** Unique identifier for this registration */
|
|
60
|
+
id: string;
|
|
61
|
+
/** Type of resource */
|
|
62
|
+
type: CleanupResourceType;
|
|
63
|
+
/** Human-readable description for debugging */
|
|
64
|
+
description: string;
|
|
65
|
+
/** Cleanup function to call on dispose */
|
|
66
|
+
cleanup: () => void;
|
|
67
|
+
/** Timestamp when registered */
|
|
68
|
+
registeredAt: number;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,+DAA+D;IAC/D,OAAO,IAAI,IAAI,CAAC;IAChB,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED;;GAEG;AACH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,mBAAmB,EAAE,UAGjC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE3F;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gCAAgC;IAChC,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwCH,MAAM,CAAC,MAAM,mBAAmB,GAAe;IAC7C,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,EAAE;CACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Barrel re-export for all type definitions.
|
|
3
|
+
* Split into domain modules for maintainability.
|
|
4
|
+
*/
|
|
5
|
+
export * from './common.js';
|
|
6
|
+
export * from './session.js';
|
|
7
|
+
export * from './task.js';
|
|
8
|
+
export * from './app-state.js';
|
|
9
|
+
export * from './respawn.js';
|
|
10
|
+
export * from './ralph.js';
|
|
11
|
+
export * from './api.js';
|
|
12
|
+
export * from './lifecycle.js';
|
|
13
|
+
export * from './run-summary.js';
|
|
14
|
+
export * from './tools.js';
|
|
15
|
+
export * from './teams.js';
|
|
16
|
+
export * from './push.js';
|
|
17
|
+
export * from './plan.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Barrel re-export for all type definitions.
|
|
3
|
+
* Split into domain modules for maintainability.
|
|
4
|
+
*/
|
|
5
|
+
export * from './common.js';
|
|
6
|
+
export * from './session.js';
|
|
7
|
+
export * from './task.js';
|
|
8
|
+
export * from './app-state.js';
|
|
9
|
+
export * from './respawn.js';
|
|
10
|
+
export * from './ralph.js';
|
|
11
|
+
export * from './api.js';
|
|
12
|
+
export * from './lifecycle.js';
|
|
13
|
+
export * from './run-summary.js';
|
|
14
|
+
export * from './tools.js';
|
|
15
|
+
export * from './teams.js';
|
|
16
|
+
export * from './push.js';
|
|
17
|
+
export * from './plan.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Session lifecycle audit types
|
|
3
|
+
*/
|
|
4
|
+
/** Types of session lifecycle events recorded to the audit log */
|
|
5
|
+
export type LifecycleEventType = 'created' | 'started' | 'exit' | 'deleted' | 'detached' | 'recovered' | 'stale_cleaned' | 'mux_died' | 'server_started' | 'server_stopped' | 'qr_auth';
|
|
6
|
+
/** A single entry in the session lifecycle audit log */
|
|
7
|
+
export interface LifecycleEntry {
|
|
8
|
+
ts: number;
|
|
9
|
+
event: LifecycleEventType;
|
|
10
|
+
sessionId: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
mode?: string;
|
|
13
|
+
reason?: string;
|
|
14
|
+
exitCode?: number | null;
|
|
15
|
+
extra?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/types/lifecycle.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,SAAS,GACT,MAAM,GACN,SAAS,GACT,UAAU,GACV,WAAW,GACX,eAAe,GACf,UAAU,GACV,gBAAgB,GAChB,gBAAgB,GAChB,SAAS,CAAC;AAEd,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,kBAAkB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../src/types/lifecycle.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Plan orchestrator type definitions
|
|
3
|
+
*/
|
|
4
|
+
/** Task execution status for plan tracking */
|
|
5
|
+
export type PlanTaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'blocked';
|
|
6
|
+
/** TDD phase categories */
|
|
7
|
+
export type TddPhase = 'setup' | 'test' | 'impl' | 'verify' | 'review';
|
|
8
|
+
/** Development phase in TDD cycle (alias for TddPhase) */
|
|
9
|
+
export type PlanPhase = TddPhase;
|
|
10
|
+
/**
|
|
11
|
+
* A single plan item for plan orchestration.
|
|
12
|
+
* Moved here from plan-orchestrator.ts to break circular dependency.
|
|
13
|
+
*/
|
|
14
|
+
export interface PlanItem {
|
|
15
|
+
id?: string;
|
|
16
|
+
content: string;
|
|
17
|
+
priority: 'P0' | 'P1' | 'P2' | null;
|
|
18
|
+
source?: string;
|
|
19
|
+
rationale?: string;
|
|
20
|
+
verificationCriteria?: string;
|
|
21
|
+
testCommand?: string;
|
|
22
|
+
dependencies?: string[];
|
|
23
|
+
status?: PlanTaskStatus;
|
|
24
|
+
attempts?: number;
|
|
25
|
+
lastError?: string;
|
|
26
|
+
completedAt?: number;
|
|
27
|
+
complexity?: 'low' | 'medium' | 'high';
|
|
28
|
+
tddPhase?: PlanPhase;
|
|
29
|
+
pairedWith?: string;
|
|
30
|
+
reviewChecklist?: string[];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/types/plan.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,8CAA8C;AAC9C,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5F,2BAA2B;AAC3B,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEvE,0DAA0D;AAC1D,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/types/plan.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Web Push notification type definitions
|
|
3
|
+
*/
|
|
4
|
+
/** A registered push subscription */
|
|
5
|
+
export interface PushSubscriptionRecord {
|
|
6
|
+
id: string;
|
|
7
|
+
endpoint: string;
|
|
8
|
+
keys: {
|
|
9
|
+
p256dh: string;
|
|
10
|
+
auth: string;
|
|
11
|
+
};
|
|
12
|
+
userAgent: string;
|
|
13
|
+
createdAt: number;
|
|
14
|
+
lastUsedAt: number;
|
|
15
|
+
pushPreferences: Record<string, boolean>;
|
|
16
|
+
}
|
|
17
|
+
/** VAPID key pair for Web Push */
|
|
18
|
+
export interface VapidKeys {
|
|
19
|
+
publicKey: string;
|
|
20
|
+
privateKey: string;
|
|
21
|
+
generatedAt: number;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=push.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/types/push.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qCAAqC;AACrC,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,kCAAkC;AAClC,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../src/types/push.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Ralph Loop / todo tracking type definitions
|
|
3
|
+
*/
|
|
4
|
+
/** Status of the Ralph Loop controller */
|
|
5
|
+
export type RalphLoopStatus = 'stopped' | 'running' | 'paused';
|
|
6
|
+
/**
|
|
7
|
+
* State of the Ralph Loop controller
|
|
8
|
+
*/
|
|
9
|
+
export interface RalphLoopState {
|
|
10
|
+
/** Current loop status */
|
|
11
|
+
status: RalphLoopStatus;
|
|
12
|
+
/** Timestamp when loop started */
|
|
13
|
+
startedAt: number | null;
|
|
14
|
+
/** Minimum duration to run in milliseconds */
|
|
15
|
+
minDurationMs: number | null;
|
|
16
|
+
/** Number of tasks completed in this run */
|
|
17
|
+
tasksCompleted: number;
|
|
18
|
+
/** Number of tasks auto-generated */
|
|
19
|
+
tasksGenerated: number;
|
|
20
|
+
/** Timestamp of last status check */
|
|
21
|
+
lastCheckAt: number | null;
|
|
22
|
+
}
|
|
23
|
+
/** Status of a detected todo item */
|
|
24
|
+
export type RalphTodoStatus = 'pending' | 'in_progress' | 'completed';
|
|
25
|
+
/**
|
|
26
|
+
* Confidence scoring for completion detection.
|
|
27
|
+
* Helps distinguish genuine completion signals from false positives.
|
|
28
|
+
*/
|
|
29
|
+
export interface CompletionConfidence {
|
|
30
|
+
/** Overall confidence level (0-100) */
|
|
31
|
+
score: number;
|
|
32
|
+
/** Whether score is above threshold for triggering completion */
|
|
33
|
+
isConfident: boolean;
|
|
34
|
+
/** Individual signal contributions */
|
|
35
|
+
signals: {
|
|
36
|
+
/** Promise tag detected with proper formatting */
|
|
37
|
+
hasPromiseTag: boolean;
|
|
38
|
+
/** Phrase matches expected completion phrase */
|
|
39
|
+
matchesExpected: boolean;
|
|
40
|
+
/** All todos are marked complete */
|
|
41
|
+
allTodosComplete: boolean;
|
|
42
|
+
/** EXIT_SIGNAL: true in RALPH_STATUS block */
|
|
43
|
+
hasExitSignal: boolean;
|
|
44
|
+
/** Multiple completion indicators present */
|
|
45
|
+
multipleIndicators: boolean;
|
|
46
|
+
/** Output context suggests completion (not in prompt/explanation) */
|
|
47
|
+
contextAppropriate: boolean;
|
|
48
|
+
};
|
|
49
|
+
/** Timestamp of last confidence calculation */
|
|
50
|
+
calculatedAt: number;
|
|
51
|
+
}
|
|
52
|
+
export interface RalphTrackerState {
|
|
53
|
+
/** Whether the tracker is actively monitoring (disabled by default) */
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
/** Whether a loop is currently active */
|
|
56
|
+
active: boolean;
|
|
57
|
+
/** Detected completion phrase (primary) */
|
|
58
|
+
completionPhrase: string | null;
|
|
59
|
+
/** Additional valid completion phrases (P1-003: multi-phrase support) */
|
|
60
|
+
alternateCompletionPhrases?: string[];
|
|
61
|
+
/** Timestamp when loop started */
|
|
62
|
+
startedAt: number | null;
|
|
63
|
+
/** Number of cycles/iterations detected */
|
|
64
|
+
cycleCount: number;
|
|
65
|
+
/** Maximum iterations if detected */
|
|
66
|
+
maxIterations: number | null;
|
|
67
|
+
/** Timestamp of last activity */
|
|
68
|
+
lastActivity: number;
|
|
69
|
+
/** Elapsed hours if detected */
|
|
70
|
+
elapsedHours: number | null;
|
|
71
|
+
/** Current plan version (for versioning UI) */
|
|
72
|
+
planVersion?: number;
|
|
73
|
+
/** Number of versions in history (for versioning UI) */
|
|
74
|
+
planHistoryLength?: number;
|
|
75
|
+
/** Last completion confidence assessment */
|
|
76
|
+
completionConfidence?: CompletionConfidence;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Priority levels for todo items.
|
|
80
|
+
* Matches @fix_plan.md format (P0=critical, P1=high, P2=normal).
|
|
81
|
+
*/
|
|
82
|
+
export type RalphTodoPriority = 'P0' | 'P1' | 'P2' | null;
|
|
83
|
+
/**
|
|
84
|
+
* A detected todo item from Claude Code output
|
|
85
|
+
*/
|
|
86
|
+
export interface RalphTodoItem {
|
|
87
|
+
/** Unique identifier based on content hash */
|
|
88
|
+
id: string;
|
|
89
|
+
/** Todo item text content */
|
|
90
|
+
content: string;
|
|
91
|
+
/** Current status */
|
|
92
|
+
status: RalphTodoStatus;
|
|
93
|
+
/** Timestamp when detected */
|
|
94
|
+
detectedAt: number;
|
|
95
|
+
/** Priority level (P0=critical, P1=high, P2=normal) */
|
|
96
|
+
priority: RalphTodoPriority;
|
|
97
|
+
/** P1-009: Estimated time to complete (ms), based on historical patterns */
|
|
98
|
+
estimatedDurationMs?: number;
|
|
99
|
+
/** P1-009: Complexity category for progress estimation */
|
|
100
|
+
estimatedComplexity?: 'trivial' | 'simple' | 'moderate' | 'complex';
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Progress estimation for the todo list
|
|
104
|
+
*/
|
|
105
|
+
export interface RalphTodoProgress {
|
|
106
|
+
/** Total number of todos */
|
|
107
|
+
total: number;
|
|
108
|
+
/** Number completed */
|
|
109
|
+
completed: number;
|
|
110
|
+
/** Number in progress */
|
|
111
|
+
inProgress: number;
|
|
112
|
+
/** Number pending */
|
|
113
|
+
pending: number;
|
|
114
|
+
/** Completion percentage (0-100) */
|
|
115
|
+
percentComplete: number;
|
|
116
|
+
/** Estimated remaining time (ms), based on historical completion rate */
|
|
117
|
+
estimatedRemainingMs: number | null;
|
|
118
|
+
/** Average time per todo completion (ms) */
|
|
119
|
+
avgCompletionTimeMs: number | null;
|
|
120
|
+
/** Projected completion timestamp (epoch ms) */
|
|
121
|
+
projectedCompletionAt: number | null;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Complete Ralph/todo state for a session
|
|
125
|
+
*/
|
|
126
|
+
export interface RalphSessionState {
|
|
127
|
+
/** Session this state belongs to */
|
|
128
|
+
sessionId: string;
|
|
129
|
+
/** Loop tracking state */
|
|
130
|
+
loop: RalphTrackerState;
|
|
131
|
+
/** Detected todo items */
|
|
132
|
+
todos: RalphTodoItem[];
|
|
133
|
+
/** Timestamp of last update */
|
|
134
|
+
lastUpdated: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Status values from RALPH_STATUS block.
|
|
138
|
+
* - IN_PROGRESS: Work is ongoing
|
|
139
|
+
* - COMPLETE: All tasks finished
|
|
140
|
+
* - BLOCKED: Needs human intervention
|
|
141
|
+
*/
|
|
142
|
+
export type RalphStatusValue = 'IN_PROGRESS' | 'COMPLETE' | 'BLOCKED';
|
|
143
|
+
/**
|
|
144
|
+
* Test status from RALPH_STATUS block.
|
|
145
|
+
*/
|
|
146
|
+
export type RalphTestsStatus = 'PASSING' | 'FAILING' | 'NOT_RUN';
|
|
147
|
+
/**
|
|
148
|
+
* Work type classification for current iteration.
|
|
149
|
+
*/
|
|
150
|
+
export type RalphWorkType = 'IMPLEMENTATION' | 'TESTING' | 'DOCUMENTATION' | 'REFACTORING';
|
|
151
|
+
/**
|
|
152
|
+
* Parsed RALPH_STATUS block from Claude output.
|
|
153
|
+
*
|
|
154
|
+
* Claude outputs this at the end of every response:
|
|
155
|
+
* ```
|
|
156
|
+
* ---RALPH_STATUS---
|
|
157
|
+
* STATUS: IN_PROGRESS
|
|
158
|
+
* TASKS_COMPLETED_THIS_LOOP: 3
|
|
159
|
+
* FILES_MODIFIED: 5
|
|
160
|
+
* TESTS_STATUS: PASSING
|
|
161
|
+
* WORK_TYPE: IMPLEMENTATION
|
|
162
|
+
* EXIT_SIGNAL: false
|
|
163
|
+
* RECOMMENDATION: Continue with database migration
|
|
164
|
+
* ---END_RALPH_STATUS---
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
export interface RalphStatusBlock {
|
|
168
|
+
/** Overall loop status */
|
|
169
|
+
status: RalphStatusValue;
|
|
170
|
+
/** Number of tasks completed in current iteration */
|
|
171
|
+
tasksCompletedThisLoop: number;
|
|
172
|
+
/** Number of files modified in current iteration */
|
|
173
|
+
filesModified: number;
|
|
174
|
+
/** Current state of tests */
|
|
175
|
+
testsStatus: RalphTestsStatus;
|
|
176
|
+
/** Type of work being performed */
|
|
177
|
+
workType: RalphWorkType;
|
|
178
|
+
/** Whether Claude is signaling completion */
|
|
179
|
+
exitSignal: boolean;
|
|
180
|
+
/** Claude's recommendation for next steps */
|
|
181
|
+
recommendation: string;
|
|
182
|
+
/** Timestamp when this block was parsed */
|
|
183
|
+
parsedAt: number;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Circuit breaker states for detecting stuck loops.
|
|
187
|
+
* - CLOSED: Normal operation, all checks passing
|
|
188
|
+
* - HALF_OPEN: Warning state, some checks failing
|
|
189
|
+
* - OPEN: Loop is stuck, requires intervention
|
|
190
|
+
*/
|
|
191
|
+
export type CircuitBreakerState = 'CLOSED' | 'HALF_OPEN' | 'OPEN';
|
|
192
|
+
/**
|
|
193
|
+
* Reason codes for circuit breaker state transitions.
|
|
194
|
+
*/
|
|
195
|
+
export type CircuitBreakerReason = 'normal_operation' | 'no_progress_warning' | 'no_progress_open' | 'same_error_repeated' | 'tests_failing_too_long' | 'progress_detected' | 'manual_reset';
|
|
196
|
+
/**
|
|
197
|
+
* Circuit breaker status for tracking loop health.
|
|
198
|
+
*
|
|
199
|
+
* Transitions:
|
|
200
|
+
* - CLOSED -> HALF_OPEN: consecutive_no_progress >= 2
|
|
201
|
+
* - CLOSED -> OPEN: consecutive_no_progress >= 3 OR consecutive_same_error >= 5
|
|
202
|
+
* - HALF_OPEN -> CLOSED: progress detected
|
|
203
|
+
* - HALF_OPEN -> OPEN: consecutive_no_progress >= 3
|
|
204
|
+
* - OPEN -> CLOSED: manual reset only
|
|
205
|
+
*/
|
|
206
|
+
export interface CircuitBreakerStatus {
|
|
207
|
+
/** Current state of the circuit breaker */
|
|
208
|
+
state: CircuitBreakerState;
|
|
209
|
+
/** Number of consecutive iterations with no progress */
|
|
210
|
+
consecutiveNoProgress: number;
|
|
211
|
+
/** Number of consecutive iterations with the same error */
|
|
212
|
+
consecutiveSameError: number;
|
|
213
|
+
/** Number of consecutive iterations with failing tests */
|
|
214
|
+
consecutiveTestsFailure: number;
|
|
215
|
+
/** Last iteration number that showed progress */
|
|
216
|
+
lastProgressIteration: number;
|
|
217
|
+
/** Human-readable reason for current state */
|
|
218
|
+
reason: string;
|
|
219
|
+
/** Reason code for programmatic handling */
|
|
220
|
+
reasonCode: CircuitBreakerReason;
|
|
221
|
+
/** Timestamp of last state transition */
|
|
222
|
+
lastTransitionAt: number;
|
|
223
|
+
/** Last error message seen (for same-error tracking) */
|
|
224
|
+
lastErrorMessage: string | null;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Creates initial circuit breaker status.
|
|
228
|
+
*/
|
|
229
|
+
export declare function createInitialCircuitBreakerStatus(): CircuitBreakerStatus;
|
|
230
|
+
/**
|
|
231
|
+
* Creates initial Ralph tracker state
|
|
232
|
+
* @returns Fresh Ralph tracker state with defaults
|
|
233
|
+
*/
|
|
234
|
+
export declare function createInitialRalphTrackerState(): RalphTrackerState;
|
|
235
|
+
/**
|
|
236
|
+
* Creates initial Ralph session state
|
|
237
|
+
* @param sessionId Session ID this state belongs to
|
|
238
|
+
* @returns Fresh Ralph session state
|
|
239
|
+
*/
|
|
240
|
+
export declare function createInitialRalphSessionState(sessionId: string): RalphSessionState;
|
|
241
|
+
//# sourceMappingURL=ralph.d.ts.map
|