@hasna/loops 0.4.13 → 0.4.14

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +74 -3
  2. package/README.md +54 -12
  3. package/dist/api/index.d.ts +35 -0
  4. package/dist/api/index.js +695 -10
  5. package/dist/cli/index.js +1633 -366
  6. package/dist/cli/ui.d.ts +44 -0
  7. package/dist/daemon/index.js +948 -212
  8. package/dist/generated/storage-kit/health.d.ts +19 -0
  9. package/dist/generated/storage-kit/index.d.ts +7 -0
  10. package/dist/generated/storage-kit/migrations.d.ts +47 -0
  11. package/dist/generated/storage-kit/mode.d.ts +47 -0
  12. package/dist/generated/storage-kit/pool.d.ts +33 -0
  13. package/dist/generated/storage-kit/query.d.ts +35 -0
  14. package/dist/generated/storage-kit/tls.d.ts +25 -0
  15. package/dist/index.d.ts +2 -2
  16. package/dist/index.js +3567 -2010
  17. package/dist/lib/health.d.ts +83 -3
  18. package/dist/lib/mode.js +14 -2
  19. package/dist/lib/scheduler.d.ts +5 -2
  20. package/dist/lib/storage/index.d.ts +1 -0
  21. package/dist/lib/storage/index.js +1329 -211
  22. package/dist/lib/storage/pg-executor.d.ts +27 -0
  23. package/dist/lib/storage/pg-runner-claim.d.ts +40 -0
  24. package/dist/lib/storage/postgres-loop-storage.d.ts +114 -0
  25. package/dist/lib/storage/sqlite.js +336 -8
  26. package/dist/lib/store.d.ts +234 -0
  27. package/dist/lib/store.js +350 -8
  28. package/dist/mcp/index.js +1067 -306
  29. package/dist/runner/index.js +124 -25
  30. package/dist/sdk/http.d.ts +115 -0
  31. package/dist/sdk/http.js +145 -0
  32. package/dist/sdk/index.d.ts +5 -1
  33. package/dist/sdk/index.js +1052 -312
  34. package/dist/serve/index.d.ts +4 -0
  35. package/dist/serve/index.js +7619 -0
  36. package/dist/types.d.ts +3 -0
  37. package/docs/CUTOVER-RUNBOOK.md +61 -0
  38. package/docs/USAGE.md +50 -11
  39. package/package.json +14 -2
@@ -0,0 +1,44 @@
1
+ import type { Loop } from "../types.js";
2
+ import { Store } from "../lib/store.js";
3
+ export interface LoopUiRow {
4
+ id: string;
5
+ name: string;
6
+ status: Loop["status"];
7
+ cadence: string;
8
+ nextRun: string;
9
+ lastRunOutcome: string;
10
+ provider: string;
11
+ activeRuns: number;
12
+ }
13
+ export interface LoopUiStats {
14
+ activeLoops: number;
15
+ pausedLoops: number;
16
+ stoppedLoops: number;
17
+ runningRuns: number;
18
+ failedRuns: number;
19
+ updatedAt: string;
20
+ }
21
+ export interface LoopUiSnapshot {
22
+ rows: LoopUiRow[];
23
+ stats: LoopUiStats;
24
+ }
25
+ export interface BuildLoopUiSnapshotOptions {
26
+ now?: Date;
27
+ limit?: number;
28
+ }
29
+ export interface RenderLoopUiFrameOptions {
30
+ columns?: number;
31
+ rows?: number;
32
+ now?: Date;
33
+ refreshMs?: number;
34
+ color?: boolean;
35
+ }
36
+ export interface RunLoopsUiAppOptions {
37
+ refreshMs?: number;
38
+ input?: NodeJS.ReadStream;
39
+ output?: NodeJS.WriteStream;
40
+ storeFactory?: () => Store;
41
+ }
42
+ export declare function buildLoopUiSnapshot(store: Store, opts?: BuildLoopUiSnapshotOptions): LoopUiSnapshot;
43
+ export declare function renderLoopUiFrame(snapshot: LoopUiSnapshot, opts?: RenderLoopUiFrameOptions): string;
44
+ export declare function runLoopsUiApp(opts?: RunLoopsUiAppOptions): Promise<void>;