agent-relay 1.3.0 → 1.3.2
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/.trajectories/active/traj_3yx9dy148mge.json +42 -0
- package/.trajectories/completed/2026-01/traj_1g7yx6qtg4ai.json +49 -0
- package/.trajectories/completed/2026-01/traj_1g7yx6qtg4ai.md +31 -0
- package/.trajectories/completed/2026-01/traj_4qwd4zmhfwp4.json +49 -0
- package/.trajectories/completed/2026-01/traj_4qwd4zmhfwp4.md +31 -0
- package/.trajectories/completed/2026-01/traj_6unwwmgyj5sq.json +109 -0
- package/.trajectories/completed/2026-01/traj_a0tqx8biw9c4.json +49 -0
- package/.trajectories/completed/2026-01/traj_a0tqx8biw9c4.md +31 -0
- package/.trajectories/completed/2026-01/traj_ax8uungxz2qh.json +66 -0
- package/.trajectories/completed/2026-01/traj_ax8uungxz2qh.md +36 -0
- package/.trajectories/completed/2026-01/traj_c9izbh2snpzf.json +49 -0
- package/.trajectories/completed/2026-01/traj_c9izbh2snpzf.md +31 -0
- package/.trajectories/completed/2026-01/traj_cpn70dw066nt.json +65 -0
- package/.trajectories/completed/2026-01/traj_cpn70dw066nt.md +37 -0
- package/.trajectories/completed/2026-01/traj_erglv2f8t9eh.json +36 -0
- package/.trajectories/completed/2026-01/traj_erglv2f8t9eh.md +21 -0
- package/.trajectories/completed/2026-01/traj_he75f24d1xfm.json +101 -0
- package/.trajectories/completed/2026-01/traj_he75f24d1xfm.md +52 -0
- package/.trajectories/completed/2026-01/traj_lgtodco7dp1n.json +61 -0
- package/.trajectories/completed/2026-01/traj_lgtodco7dp1n.md +36 -0
- package/.trajectories/completed/2026-01/traj_oszg9flv74pk.json +73 -0
- package/.trajectories/completed/2026-01/traj_oszg9flv74pk.md +41 -0
- package/.trajectories/completed/2026-01/traj_pulomd3y8cvj.json +77 -0
- package/.trajectories/completed/2026-01/traj_pulomd3y8cvj.md +42 -0
- package/.trajectories/completed/2026-01/traj_rsavt0jipi3c.json +109 -0
- package/.trajectories/completed/2026-01/traj_rsavt0jipi3c.md +56 -0
- package/.trajectories/completed/2026-01/traj_x721m1j9rzup.json +113 -0
- package/.trajectories/completed/2026-01/traj_x721m1j9rzup.md +57 -0
- package/.trajectories/completed/2026-01/traj_xjqvmep5ed3h.json +61 -0
- package/.trajectories/completed/2026-01/traj_xjqvmep5ed3h.md +36 -0
- package/.trajectories/completed/2026-01/traj_y7n6hfbf7dmg.json +49 -0
- package/.trajectories/completed/2026-01/traj_y7n6hfbf7dmg.md +31 -0
- package/.trajectories/completed/2026-01/traj_yvfkwnkdiso2.json +49 -0
- package/.trajectories/completed/2026-01/traj_yvfkwnkdiso2.md +31 -0
- package/.trajectories/index.json +140 -1
- package/TRAIL_GIT_AUTH_FIX.md +113 -0
- package/deploy/workspace/codex.config.toml +1 -1
- package/deploy/workspace/entrypoint.sh +20 -79
- package/deploy/workspace/gh-relay +156 -0
- package/deploy/workspace/git-credential-relay +5 -1
- package/dist/bridge/multi-project-client.js +13 -10
- package/dist/bridge/spawner.d.ts +2 -0
- package/dist/bridge/spawner.js +19 -1
- package/dist/bridge/types.d.ts +2 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +115 -69
- package/dist/cloud/api/admin.js +16 -3
- package/dist/cloud/api/codex-auth-helper.js +28 -8
- package/dist/cloud/api/consensus.d.ts +13 -0
- package/dist/cloud/api/consensus.js +259 -0
- package/dist/cloud/api/daemons.js +205 -1
- package/dist/cloud/api/git.js +37 -7
- package/dist/cloud/api/onboarding.js +4 -1
- package/dist/cloud/api/provider-env.d.ts +5 -0
- package/dist/cloud/api/provider-env.js +27 -0
- package/dist/cloud/api/providers.js +2 -0
- package/dist/cloud/api/test-helpers.js +130 -0
- package/dist/cloud/api/workspaces.js +38 -3
- package/dist/cloud/db/bulk-ingest.d.ts +88 -0
- package/dist/cloud/db/bulk-ingest.js +268 -0
- package/dist/cloud/db/drizzle.d.ts +33 -0
- package/dist/cloud/db/drizzle.js +174 -2
- package/dist/cloud/db/index.d.ts +24 -5
- package/dist/cloud/db/index.js +19 -4
- package/dist/cloud/db/schema.d.ts +397 -3
- package/dist/cloud/db/schema.js +75 -1
- package/dist/cloud/provisioner/index.d.ts +8 -0
- package/dist/cloud/provisioner/index.js +256 -50
- package/dist/cloud/server.js +47 -3
- package/dist/cloud/services/index.d.ts +1 -0
- package/dist/cloud/services/index.js +2 -0
- package/dist/cloud/services/nango.d.ts +3 -4
- package/dist/cloud/services/nango.js +11 -33
- package/dist/cloud/services/workspace-keepalive.d.ts +76 -0
- package/dist/cloud/services/workspace-keepalive.js +234 -0
- package/dist/config/relay-config.d.ts +23 -0
- package/dist/config/relay-config.js +23 -0
- package/dist/daemon/agent-manager.d.ts +20 -1
- package/dist/daemon/agent-manager.js +47 -0
- package/dist/daemon/agent-registry.js +4 -4
- package/dist/daemon/agent-signing.d.ts +158 -0
- package/dist/daemon/agent-signing.js +523 -0
- package/dist/daemon/api.js +18 -1
- package/dist/daemon/cli-auth.d.ts +4 -1
- package/dist/daemon/cli-auth.js +55 -11
- package/dist/daemon/cloud-sync.d.ts +47 -1
- package/dist/daemon/cloud-sync.js +152 -3
- package/dist/daemon/connection.d.ts +28 -0
- package/dist/daemon/connection.js +98 -15
- package/dist/daemon/consensus-integration.d.ts +167 -0
- package/dist/daemon/consensus-integration.js +371 -0
- package/dist/daemon/consensus.d.ts +271 -0
- package/dist/daemon/consensus.js +632 -0
- package/dist/daemon/delivery-tracker.d.ts +34 -0
- package/dist/daemon/delivery-tracker.js +104 -0
- package/dist/daemon/enhanced-features.d.ts +118 -0
- package/dist/daemon/enhanced-features.js +178 -0
- package/dist/daemon/index.d.ts +4 -0
- package/dist/daemon/index.js +5 -0
- package/dist/daemon/rate-limiter.d.ts +68 -0
- package/dist/daemon/rate-limiter.js +130 -0
- package/dist/daemon/router.d.ts +18 -11
- package/dist/daemon/router.js +55 -111
- package/dist/daemon/server.d.ts +13 -1
- package/dist/daemon/server.js +71 -9
- package/dist/daemon/sync-queue.d.ts +116 -0
- package/dist/daemon/sync-queue.js +361 -0
- package/dist/health-worker-manager.d.ts +62 -0
- package/dist/health-worker-manager.js +144 -0
- package/dist/health-worker.d.ts +9 -0
- package/dist/health-worker.js +79 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -1
- package/dist/memory/context-compaction.d.ts +156 -0
- package/dist/memory/context-compaction.js +453 -0
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.js +1 -0
- package/dist/protocol/channels.js +4 -4
- package/dist/protocol/framing.d.ts +72 -10
- package/dist/protocol/framing.js +194 -25
- package/dist/storage/adapter.d.ts +8 -1
- package/dist/storage/adapter.js +11 -0
- package/dist/storage/batched-sqlite-adapter.d.ts +71 -0
- package/dist/storage/batched-sqlite-adapter.js +183 -0
- package/dist/storage/dead-letter-queue.d.ts +196 -0
- package/dist/storage/dead-letter-queue.js +427 -0
- package/dist/storage/dlq-adapter.d.ts +195 -0
- package/dist/storage/dlq-adapter.js +664 -0
- package/dist/trajectory/config.d.ts +32 -14
- package/dist/trajectory/config.js +38 -16
- package/dist/trajectory/integration.js +217 -64
- package/dist/utils/git-remote.d.ts +47 -0
- package/dist/utils/git-remote.js +125 -0
- package/dist/utils/id-generator.d.ts +35 -0
- package/dist/utils/id-generator.js +60 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/precompiled-patterns.d.ts +110 -0
- package/dist/utils/precompiled-patterns.js +322 -0
- package/dist/wrapper/auth-detection.js +1 -1
- package/dist/wrapper/base-wrapper.d.ts +36 -0
- package/dist/wrapper/base-wrapper.js +48 -2
- package/dist/wrapper/client.d.ts +14 -4
- package/dist/wrapper/client.js +84 -31
- package/dist/wrapper/idle-detector.d.ts +102 -0
- package/dist/wrapper/idle-detector.js +279 -0
- package/dist/wrapper/parser.d.ts +4 -0
- package/dist/wrapper/parser.js +19 -1
- package/dist/wrapper/pty-wrapper.d.ts +7 -1
- package/dist/wrapper/pty-wrapper.js +51 -27
- package/dist/wrapper/tmux-wrapper.d.ts +12 -1
- package/dist/wrapper/tmux-wrapper.js +65 -17
- package/package.json +5 -5
- package/scripts/run-migrations.js +43 -0
- package/scripts/verify-schema.js +134 -0
- package/tests/benchmarks/protocol.bench.ts +310 -0
- package/dist/dashboard/out/404.html +0 -1
- package/dist/dashboard/out/_next/static/T1tgCqVWHFIkV7ClEtzD7/_buildManifest.js +0 -1
- package/dist/dashboard/out/_next/static/T1tgCqVWHFIkV7ClEtzD7/_ssgManifest.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/116-2502180def231162.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/117-f7b8ab0809342e77.js +0 -2
- package/dist/dashboard/out/_next/static/chunks/282-980c2eb8fff20123.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/532-bace199897eeab37.js +0 -9
- package/dist/dashboard/out/_next/static/chunks/648-5cc6e1921389a58a.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/766-b54f0853794b78c3.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/83-b51836037078006c.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/891-6cd50de1224f70bb.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/899-bb19a9b3d9b39ea6.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/_not-found/page-53b8a69f76db17d0.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/onboarding/page-8939b0fc700f7eca.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/page-5af1b6b439858aa6.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-f45ecbc3e06134fc.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/history/page-8c8bed33beb2bf1c.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/layout-2433bb48965f4333.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/login/page-16f3b49e55b1e0ed.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-ac39dc0cc3c26fa7.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/page-4a5938c18a11a654.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-982a7000fee44014.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-ac3a6ac433fd6001.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/providers/setup/[provider]/page-09f9caae98a18c09.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/signup/page-547dd0ca55ecd0ba.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +0 -18
- package/dist/dashboard/out/_next/static/chunks/fd9d1056-609918ca7b6280bb.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/framework-f66176bb897dc684.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/main-2ee6beb2ae96d210.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/main-app-5d692157a8eb1fd9.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +0 -1
- package/dist/dashboard/out/_next/static/css/85d2af9c7ac74d62.css +0 -1
- package/dist/dashboard/out/_next/static/css/fe4b28883eeff359.css +0 -1
- package/dist/dashboard/out/alt-logos/agent-relay-logo-128.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-256.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-32.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-512.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-64.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo.svg +0 -45
- package/dist/dashboard/out/alt-logos/logo.svg +0 -38
- package/dist/dashboard/out/alt-logos/monogram-logo-128.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-256.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-32.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-512.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-64.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo.svg +0 -38
- package/dist/dashboard/out/app/onboarding.html +0 -1
- package/dist/dashboard/out/app/onboarding.txt +0 -7
- package/dist/dashboard/out/app.html +0 -1
- package/dist/dashboard/out/app.txt +0 -7
- package/dist/dashboard/out/apple-icon.png +0 -0
- package/dist/dashboard/out/connect-repos.html +0 -1
- package/dist/dashboard/out/connect-repos.txt +0 -7
- package/dist/dashboard/out/history.html +0 -1
- package/dist/dashboard/out/history.txt +0 -7
- package/dist/dashboard/out/index.html +0 -1
- package/dist/dashboard/out/index.txt +0 -7
- package/dist/dashboard/out/login.html +0 -6
- package/dist/dashboard/out/login.txt +0 -7
- package/dist/dashboard/out/metrics.html +0 -1
- package/dist/dashboard/out/metrics.txt +0 -7
- package/dist/dashboard/out/pricing.html +0 -13
- package/dist/dashboard/out/pricing.txt +0 -7
- package/dist/dashboard/out/providers/setup/claude.html +0 -1
- package/dist/dashboard/out/providers/setup/claude.txt +0 -8
- package/dist/dashboard/out/providers/setup/codex.html +0 -1
- package/dist/dashboard/out/providers/setup/codex.txt +0 -8
- package/dist/dashboard/out/providers.html +0 -1
- package/dist/dashboard/out/providers.txt +0 -7
- package/dist/dashboard/out/signup.html +0 -6
- package/dist/dashboard/out/signup.txt +0 -7
- package/dist/dashboard-server/metrics.d.ts +0 -105
- package/dist/dashboard-server/metrics.js +0 -193
- package/dist/dashboard-server/needs-attention.d.ts +0 -24
- package/dist/dashboard-server/needs-attention.js +0 -78
- package/dist/dashboard-server/server.d.ts +0 -15
- package/dist/dashboard-server/server.js +0 -3776
- package/dist/dashboard-server/start.d.ts +0 -6
- package/dist/dashboard-server/start.js +0 -13
- package/dist/dashboard-server/user-bridge.d.ts +0 -103
- package/dist/dashboard-server/user-bridge.js +0 -189
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dead Letter Queue Storage Adapter
|
|
3
|
+
*
|
|
4
|
+
* Abstract interface for DLQ storage with implementations for:
|
|
5
|
+
* - SQLite (local daemon)
|
|
6
|
+
* - PostgreSQL (cloud deployment)
|
|
7
|
+
* - In-memory (testing)
|
|
8
|
+
*
|
|
9
|
+
* Follows the adapter pattern used by the main storage layer.
|
|
10
|
+
*/
|
|
11
|
+
export type DLQFailureReason = 'max_retries_exceeded' | 'ttl_expired' | 'connection_lost' | 'target_not_found' | 'signature_invalid' | 'payload_too_large' | 'rate_limited' | 'unknown';
|
|
12
|
+
export interface DeadLetter {
|
|
13
|
+
id: string;
|
|
14
|
+
messageId: string;
|
|
15
|
+
from: string;
|
|
16
|
+
to: string;
|
|
17
|
+
topic?: string;
|
|
18
|
+
kind: string;
|
|
19
|
+
body: string;
|
|
20
|
+
data?: Record<string, unknown>;
|
|
21
|
+
thread?: string;
|
|
22
|
+
originalTs: number;
|
|
23
|
+
dlqTs: number;
|
|
24
|
+
reason: DLQFailureReason;
|
|
25
|
+
errorMessage?: string;
|
|
26
|
+
attemptCount: number;
|
|
27
|
+
lastAttemptTs?: number;
|
|
28
|
+
dlqRetryCount: number;
|
|
29
|
+
acknowledged: boolean;
|
|
30
|
+
acknowledgedTs?: number;
|
|
31
|
+
acknowledgedBy?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface DLQQuery {
|
|
34
|
+
to?: string;
|
|
35
|
+
from?: string;
|
|
36
|
+
reason?: DLQFailureReason;
|
|
37
|
+
acknowledged?: boolean;
|
|
38
|
+
afterTs?: number;
|
|
39
|
+
beforeTs?: number;
|
|
40
|
+
limit?: number;
|
|
41
|
+
offset?: number;
|
|
42
|
+
orderBy?: 'dlqTs' | 'originalTs' | 'attemptCount';
|
|
43
|
+
orderDir?: 'ASC' | 'DESC';
|
|
44
|
+
}
|
|
45
|
+
export interface DLQStats {
|
|
46
|
+
totalEntries: number;
|
|
47
|
+
unacknowledged: number;
|
|
48
|
+
byReason: Record<DLQFailureReason, number>;
|
|
49
|
+
byTarget: Record<string, number>;
|
|
50
|
+
oldestEntryTs: number | null;
|
|
51
|
+
newestEntryTs: number | null;
|
|
52
|
+
avgRetryCount: number;
|
|
53
|
+
}
|
|
54
|
+
export interface DLQConfig {
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
retentionHours: number;
|
|
57
|
+
maxEntries: number;
|
|
58
|
+
autoCleanup: boolean;
|
|
59
|
+
cleanupIntervalMinutes: number;
|
|
60
|
+
alertThreshold: number;
|
|
61
|
+
}
|
|
62
|
+
export interface MessageEnvelope {
|
|
63
|
+
from: string;
|
|
64
|
+
to: string;
|
|
65
|
+
topic?: string;
|
|
66
|
+
kind: string;
|
|
67
|
+
body: string;
|
|
68
|
+
data?: Record<string, unknown>;
|
|
69
|
+
thread?: string;
|
|
70
|
+
ts: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Abstract interface for DLQ storage backends.
|
|
74
|
+
*/
|
|
75
|
+
export interface DLQStorageAdapter {
|
|
76
|
+
/**
|
|
77
|
+
* Initialize the adapter (create tables, etc.)
|
|
78
|
+
*/
|
|
79
|
+
init(): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Add a dead letter to the queue.
|
|
82
|
+
*/
|
|
83
|
+
add(messageId: string, envelope: MessageEnvelope, reason: DLQFailureReason, attemptCount: number, errorMessage?: string): Promise<DeadLetter>;
|
|
84
|
+
/**
|
|
85
|
+
* Get a dead letter by ID.
|
|
86
|
+
*/
|
|
87
|
+
get(id: string): Promise<DeadLetter | null>;
|
|
88
|
+
/**
|
|
89
|
+
* Query dead letters with filters.
|
|
90
|
+
*/
|
|
91
|
+
query(query?: DLQQuery): Promise<DeadLetter[]>;
|
|
92
|
+
/**
|
|
93
|
+
* Acknowledge a dead letter.
|
|
94
|
+
*/
|
|
95
|
+
acknowledge(id: string, acknowledgedBy?: string): Promise<boolean>;
|
|
96
|
+
/**
|
|
97
|
+
* Acknowledge multiple dead letters.
|
|
98
|
+
*/
|
|
99
|
+
acknowledgeMany(ids: string[], acknowledgedBy?: string): Promise<number>;
|
|
100
|
+
/**
|
|
101
|
+
* Increment retry count for a dead letter.
|
|
102
|
+
*/
|
|
103
|
+
incrementRetry(id: string): Promise<boolean>;
|
|
104
|
+
/**
|
|
105
|
+
* Remove a dead letter.
|
|
106
|
+
*/
|
|
107
|
+
remove(id: string): Promise<boolean>;
|
|
108
|
+
/**
|
|
109
|
+
* Get DLQ statistics.
|
|
110
|
+
*/
|
|
111
|
+
getStats(): Promise<DLQStats>;
|
|
112
|
+
/**
|
|
113
|
+
* Cleanup old entries.
|
|
114
|
+
*/
|
|
115
|
+
cleanup(retentionHours: number, maxEntries: number): Promise<{
|
|
116
|
+
removed: number;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Get messages ready for retry.
|
|
120
|
+
*/
|
|
121
|
+
getRetryable(maxRetries?: number, limit?: number): Promise<DeadLetter[]>;
|
|
122
|
+
/**
|
|
123
|
+
* Close the adapter (cleanup resources).
|
|
124
|
+
*/
|
|
125
|
+
close(): Promise<void>;
|
|
126
|
+
}
|
|
127
|
+
export declare const DEFAULT_DLQ_CONFIG: DLQConfig;
|
|
128
|
+
import type { Database as BetterSqlite3Database } from 'better-sqlite3';
|
|
129
|
+
export declare class SQLiteDLQAdapter implements DLQStorageAdapter {
|
|
130
|
+
private db;
|
|
131
|
+
constructor(db: BetterSqlite3Database);
|
|
132
|
+
init(): Promise<void>;
|
|
133
|
+
add(messageId: string, envelope: MessageEnvelope, reason: DLQFailureReason, attemptCount: number, errorMessage?: string): Promise<DeadLetter>;
|
|
134
|
+
get(id: string): Promise<DeadLetter | null>;
|
|
135
|
+
query(query?: DLQQuery): Promise<DeadLetter[]>;
|
|
136
|
+
acknowledge(id: string, acknowledgedBy?: string): Promise<boolean>;
|
|
137
|
+
acknowledgeMany(ids: string[], acknowledgedBy?: string): Promise<number>;
|
|
138
|
+
incrementRetry(id: string): Promise<boolean>;
|
|
139
|
+
remove(id: string): Promise<boolean>;
|
|
140
|
+
getStats(): Promise<DLQStats>;
|
|
141
|
+
cleanup(retentionHours: number, maxEntries: number): Promise<{
|
|
142
|
+
removed: number;
|
|
143
|
+
}>;
|
|
144
|
+
getRetryable(maxRetries?: number, limit?: number): Promise<DeadLetter[]>;
|
|
145
|
+
close(): Promise<void>;
|
|
146
|
+
private rowToDeadLetter;
|
|
147
|
+
}
|
|
148
|
+
import type { Pool as PgPool } from 'pg';
|
|
149
|
+
export declare class PostgresDLQAdapter implements DLQStorageAdapter {
|
|
150
|
+
private pool;
|
|
151
|
+
constructor(pool: PgPool);
|
|
152
|
+
init(): Promise<void>;
|
|
153
|
+
add(messageId: string, envelope: MessageEnvelope, reason: DLQFailureReason, attemptCount: number, errorMessage?: string): Promise<DeadLetter>;
|
|
154
|
+
get(id: string): Promise<DeadLetter | null>;
|
|
155
|
+
query(query?: DLQQuery): Promise<DeadLetter[]>;
|
|
156
|
+
acknowledge(id: string, acknowledgedBy?: string): Promise<boolean>;
|
|
157
|
+
acknowledgeMany(ids: string[], acknowledgedBy?: string): Promise<number>;
|
|
158
|
+
incrementRetry(id: string): Promise<boolean>;
|
|
159
|
+
remove(id: string): Promise<boolean>;
|
|
160
|
+
getStats(): Promise<DLQStats>;
|
|
161
|
+
cleanup(retentionHours: number, maxEntries: number): Promise<{
|
|
162
|
+
removed: number;
|
|
163
|
+
}>;
|
|
164
|
+
getRetryable(maxRetries?: number, limit?: number): Promise<DeadLetter[]>;
|
|
165
|
+
close(): Promise<void>;
|
|
166
|
+
private rowToDeadLetter;
|
|
167
|
+
}
|
|
168
|
+
export declare class InMemoryDLQAdapter implements DLQStorageAdapter {
|
|
169
|
+
private letters;
|
|
170
|
+
init(): Promise<void>;
|
|
171
|
+
add(messageId: string, envelope: MessageEnvelope, reason: DLQFailureReason, attemptCount: number, errorMessage?: string): Promise<DeadLetter>;
|
|
172
|
+
get(id: string): Promise<DeadLetter | null>;
|
|
173
|
+
query(query?: DLQQuery): Promise<DeadLetter[]>;
|
|
174
|
+
acknowledge(id: string, acknowledgedBy?: string): Promise<boolean>;
|
|
175
|
+
acknowledgeMany(ids: string[], acknowledgedBy?: string): Promise<number>;
|
|
176
|
+
incrementRetry(id: string): Promise<boolean>;
|
|
177
|
+
remove(id: string): Promise<boolean>;
|
|
178
|
+
getStats(): Promise<DLQStats>;
|
|
179
|
+
cleanup(retentionHours: number, maxEntries: number): Promise<{
|
|
180
|
+
removed: number;
|
|
181
|
+
}>;
|
|
182
|
+
getRetryable(maxRetries?: number, limit?: number): Promise<DeadLetter[]>;
|
|
183
|
+
close(): Promise<void>;
|
|
184
|
+
}
|
|
185
|
+
export type DLQAdapterType = 'sqlite' | 'postgres' | 'memory';
|
|
186
|
+
export interface DLQAdapterOptions {
|
|
187
|
+
type: DLQAdapterType;
|
|
188
|
+
sqlite?: BetterSqlite3Database;
|
|
189
|
+
postgres?: PgPool;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Create a DLQ adapter based on configuration.
|
|
193
|
+
*/
|
|
194
|
+
export declare function createDLQAdapter(options: DLQAdapterOptions): DLQStorageAdapter;
|
|
195
|
+
//# sourceMappingURL=dlq-adapter.d.ts.map
|