aicodeman 0.2.8 → 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 +14 -101
- package/dist/respawn-controller.d.ts.map +1 -1
- package/dist/respawn-controller.js +155 -594
- 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 +9 -2
- package/dist/state-store.d.ts.map +1 -1
- package/dist/state-store.js +112 -39
- package/dist/state-store.js.map +1 -1
- package/dist/subagent-watcher.d.ts +16 -9
- package/dist/subagent-watcher.d.ts.map +1 -1
- package/dist/subagent-watcher.js +126 -147
- package/dist/subagent-watcher.js.map +1 -1
- package/dist/team-watcher.d.ts +3 -0
- package/dist/team-watcher.d.ts.map +1 -1
- package/dist/team-watcher.js +54 -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 +152 -236
- 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 +342 -3829
- package/dist/web/server.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ralph.d.ts","sourceRoot":"","sources":["../../src/types/ralph.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,0BAA0B;IAC1B,MAAM,EAAE,eAAe,CAAC;IACxB,kCAAkC;IAClC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC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B,EAAE,MAAM,CAAC;IAC9B,2DAA2D;IAC3D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,0DAA0D;IAC1D,uBAAuB,EAAE,MAAM,CAAC;IAChC,iDAAiD;IACjD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,UAAU,EAAE,oBAAoB,CAAC;IACjC,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;GAEG;AACH,wBAAgB,iCAAiC,IAAI,oBAAoB,CAYxE;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,IAAI,iBAAiB,CAWlE;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,iBAAiB,CAOnF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Ralph Loop / todo tracking type definitions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Creates initial circuit breaker status.
|
|
6
|
+
*/
|
|
7
|
+
export function createInitialCircuitBreakerStatus() {
|
|
8
|
+
return {
|
|
9
|
+
state: 'CLOSED',
|
|
10
|
+
consecutiveNoProgress: 0,
|
|
11
|
+
consecutiveSameError: 0,
|
|
12
|
+
consecutiveTestsFailure: 0,
|
|
13
|
+
lastProgressIteration: 0,
|
|
14
|
+
reason: 'Initial state',
|
|
15
|
+
reasonCode: 'normal_operation',
|
|
16
|
+
lastTransitionAt: Date.now(),
|
|
17
|
+
lastErrorMessage: null,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates initial Ralph tracker state
|
|
22
|
+
* @returns Fresh Ralph tracker state with defaults
|
|
23
|
+
*/
|
|
24
|
+
export function createInitialRalphTrackerState() {
|
|
25
|
+
return {
|
|
26
|
+
enabled: false, // Disabled by default, auto-enables when Ralph patterns detected
|
|
27
|
+
active: false,
|
|
28
|
+
completionPhrase: null,
|
|
29
|
+
startedAt: null,
|
|
30
|
+
cycleCount: 0,
|
|
31
|
+
maxIterations: null,
|
|
32
|
+
lastActivity: Date.now(),
|
|
33
|
+
elapsedHours: null,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates initial Ralph session state
|
|
38
|
+
* @param sessionId Session ID this state belongs to
|
|
39
|
+
* @returns Fresh Ralph session state
|
|
40
|
+
*/
|
|
41
|
+
export function createInitialRalphSessionState(sessionId) {
|
|
42
|
+
return {
|
|
43
|
+
sessionId,
|
|
44
|
+
loop: createInitialRalphTrackerState(),
|
|
45
|
+
todos: [],
|
|
46
|
+
lastUpdated: Date.now(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=ralph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ralph.js","sourceRoot":"","sources":["../../src/types/ralph.ts"],"names":[],"mappings":"AAAA;;GAEG;AA2PH;;GAEG;AACH,MAAM,UAAU,iCAAiC;IAC/C,OAAO;QACL,KAAK,EAAE,QAAQ;QACf,qBAAqB,EAAE,CAAC;QACxB,oBAAoB,EAAE,CAAC;QACvB,uBAAuB,EAAE,CAAC;QAC1B,qBAAqB,EAAE,CAAC;QACxB,MAAM,EAAE,eAAe;QACvB,UAAU,EAAE,kBAAkB;QAC9B,gBAAgB,EAAE,IAAI,CAAC,GAAG,EAAE;QAC5B,gBAAgB,EAAE,IAAI;KACvB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO;QACL,OAAO,EAAE,KAAK,EAAE,iEAAiE;QACjF,MAAM,EAAE,KAAK;QACb,gBAAgB,EAAE,IAAI;QACtB,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,CAAC;QACb,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE;QACxB,YAAY,EAAE,IAAI;KACnB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAAC,SAAiB;IAC9D,OAAO;QACL,SAAS;QACT,IAAI,EAAE,8BAA8B,EAAE;QACtC,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE;KACxB,CAAC;AACJ,CAAC"}
|