@shipfox/api-auth 18.0.0 → 20.0.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.
Files changed (151) hide show
  1. package/.turbo/turbo-build.log +17 -2
  2. package/CHANGELOG.md +47 -0
  3. package/README.md +24 -9
  4. package/dist/core/administration.d.ts +15 -0
  5. package/dist/core/administration.d.ts.map +1 -1
  6. package/dist/core/administration.js +44 -2
  7. package/dist/core/administration.js.map +1 -1
  8. package/dist/core/auth.d.ts.map +1 -1
  9. package/dist/core/auth.js +5 -3
  10. package/dist/core/auth.js.map +1 -1
  11. package/dist/core/cimd.d.ts +39 -0
  12. package/dist/core/cimd.d.ts.map +1 -0
  13. package/dist/core/cimd.js +392 -0
  14. package/dist/core/cimd.js.map +1 -0
  15. package/dist/core/entities/agent-access.d.ts +75 -0
  16. package/dist/core/entities/agent-access.d.ts.map +1 -0
  17. package/dist/core/entities/agent-access.js +3 -0
  18. package/dist/core/entities/agent-access.js.map +1 -0
  19. package/dist/core/errors.d.ts +17 -0
  20. package/dist/core/errors.d.ts.map +1 -1
  21. package/dist/core/errors.js +32 -0
  22. package/dist/core/errors.js.map +1 -1
  23. package/dist/core/oauth-client-resolver.d.ts +54 -0
  24. package/dist/core/oauth-client-resolver.d.ts.map +1 -0
  25. package/dist/core/oauth-client-resolver.js +154 -0
  26. package/dist/core/oauth-client-resolver.js.map +1 -0
  27. package/dist/core/oauth-client.d.ts +39 -0
  28. package/dist/core/oauth-client.d.ts.map +1 -0
  29. package/dist/core/oauth-client.js +236 -0
  30. package/dist/core/oauth-client.js.map +1 -0
  31. package/dist/db/admin-user-moderation.d.ts.map +1 -1
  32. package/dist/db/admin-user-moderation.js +30 -26
  33. package/dist/db/admin-user-moderation.js.map +1 -1
  34. package/dist/db/admin-user-summary.d.ts +22 -0
  35. package/dist/db/admin-user-summary.d.ts.map +1 -1
  36. package/dist/db/admin-user-summary.js +75 -1
  37. package/dist/db/admin-user-summary.js.map +1 -1
  38. package/dist/db/admin-users.d.ts +11 -0
  39. package/dist/db/admin-users.d.ts.map +1 -1
  40. package/dist/db/admin-users.js +4 -1
  41. package/dist/db/admin-users.js.map +1 -1
  42. package/dist/db/agent-access-retention.d.ts +10 -0
  43. package/dist/db/agent-access-retention.d.ts.map +1 -0
  44. package/dist/db/agent-access-retention.js +11 -0
  45. package/dist/db/agent-access-retention.js.map +1 -0
  46. package/dist/db/agent-access.d.ts +255 -0
  47. package/dist/db/agent-access.d.ts.map +1 -0
  48. package/dist/db/agent-access.js +705 -0
  49. package/dist/db/agent-access.js.map +1 -0
  50. package/dist/db/db.d.ts +2604 -238
  51. package/dist/db/db.d.ts.map +1 -1
  52. package/dist/db/db.js +7 -0
  53. package/dist/db/db.js.map +1 -1
  54. package/dist/db/schema/agent-access.d.ts +1204 -0
  55. package/dist/db/schema/agent-access.d.ts.map +1 -0
  56. package/dist/db/schema/agent-access.js +267 -0
  57. package/dist/db/schema/agent-access.js.map +1 -0
  58. package/dist/db/schema/users.d.ts.map +1 -1
  59. package/dist/db/schema/users.js +8 -3
  60. package/dist/db/schema/users.js.map +1 -1
  61. package/dist/index.d.ts +11 -2
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +26 -2
  64. package/dist/index.js.map +1 -1
  65. package/dist/metrics/instance.d.ts +1 -1
  66. package/dist/metrics/instance.d.ts.map +1 -1
  67. package/dist/metrics/instance.js.map +1 -1
  68. package/dist/presentation/routes/administration.d.ts.map +1 -1
  69. package/dist/presentation/routes/administration.js +123 -20
  70. package/dist/presentation/routes/administration.js.map +1 -1
  71. package/dist/presentation/routes/email-verification/verify-email-resend.d.ts.map +1 -1
  72. package/dist/presentation/routes/email-verification/verify-email-resend.js +6 -1
  73. package/dist/presentation/routes/email-verification/verify-email-resend.js.map +1 -1
  74. package/dist/presentation/routes/oauth.d.ts +9 -0
  75. package/dist/presentation/routes/oauth.d.ts.map +1 -0
  76. package/dist/presentation/routes/oauth.js +150 -0
  77. package/dist/presentation/routes/oauth.js.map +1 -0
  78. package/dist/presentation/routes/rate-limit.d.ts.map +1 -1
  79. package/dist/presentation/routes/rate-limit.js +34 -0
  80. package/dist/presentation/routes/rate-limit.js.map +1 -1
  81. package/dist/presentation/routes/registration/signup.d.ts.map +1 -1
  82. package/dist/presentation/routes/registration/signup.js +59 -50
  83. package/dist/presentation/routes/registration/signup.js.map +1 -1
  84. package/dist/temporal/activities/agent-access-retention.d.ts +13 -0
  85. package/dist/temporal/activities/agent-access-retention.d.ts.map +1 -0
  86. package/dist/temporal/activities/agent-access-retention.js +58 -0
  87. package/dist/temporal/activities/agent-access-retention.js.map +1 -0
  88. package/dist/temporal/activities/index.d.ts +5 -0
  89. package/dist/temporal/activities/index.d.ts.map +1 -0
  90. package/dist/temporal/activities/index.js +8 -0
  91. package/dist/temporal/activities/index.js.map +1 -0
  92. package/dist/temporal/constants.d.ts +2 -0
  93. package/dist/temporal/constants.d.ts.map +1 -0
  94. package/dist/temporal/constants.js +3 -0
  95. package/dist/temporal/constants.js.map +1 -0
  96. package/dist/temporal/workflows/agent-access-retention-cron.d.ts +2 -0
  97. package/dist/temporal/workflows/agent-access-retention-cron.d.ts.map +1 -0
  98. package/dist/temporal/workflows/agent-access-retention-cron.js +22 -0
  99. package/dist/temporal/workflows/agent-access-retention-cron.js.map +1 -0
  100. package/dist/temporal/workflows/index.bundle.js +25227 -0
  101. package/dist/temporal/workflows/index.bundle.meta.json +1 -0
  102. package/dist/temporal/workflows/index.d.ts +2 -0
  103. package/dist/temporal/workflows/index.d.ts.map +1 -0
  104. package/dist/temporal/workflows/index.js +3 -0
  105. package/dist/temporal/workflows/index.js.map +1 -0
  106. package/dist/tsconfig.test.tsbuildinfo +1 -1
  107. package/drizzle/0003_brainy_luckman.sql +6 -0
  108. package/drizzle/0004_yummy_runaways.sql +110 -0
  109. package/drizzle/meta/0003_snapshot.json +844 -0
  110. package/drizzle/meta/0004_snapshot.json +1751 -0
  111. package/drizzle/meta/_journal.json +14 -0
  112. package/package.json +11 -8
  113. package/src/core/admin-role.test.ts +70 -0
  114. package/src/core/administration.ts +78 -1
  115. package/src/core/auth.ts +3 -5
  116. package/src/core/cimd.test.ts +213 -0
  117. package/src/core/cimd.ts +532 -0
  118. package/src/core/entities/agent-access.ts +80 -0
  119. package/src/core/errors.ts +48 -0
  120. package/src/core/oauth-client-resolver.test.ts +198 -0
  121. package/src/core/oauth-client-resolver.ts +253 -0
  122. package/src/core/oauth-client.test.ts +157 -0
  123. package/src/core/oauth-client.ts +331 -0
  124. package/src/db/admin-user-moderation.ts +53 -45
  125. package/src/db/admin-user-summary.test.ts +228 -0
  126. package/src/db/admin-user-summary.ts +143 -1
  127. package/src/db/admin-users.ts +21 -1
  128. package/src/db/agent-access-retention.ts +10 -0
  129. package/src/db/agent-access.test.ts +1064 -0
  130. package/src/db/agent-access.ts +1491 -0
  131. package/src/db/db.ts +14 -0
  132. package/src/db/schema/agent-access.ts +273 -0
  133. package/src/db/schema/users.ts +9 -3
  134. package/src/index.test.ts +27 -0
  135. package/src/index.ts +82 -0
  136. package/src/metrics/instance.ts +6 -1
  137. package/src/presentation/routes/administration.test.ts +359 -2
  138. package/src/presentation/routes/administration.ts +142 -20
  139. package/src/presentation/routes/email-verification/verify-email-resend.ts +7 -1
  140. package/src/presentation/routes/oauth.test.ts +133 -0
  141. package/src/presentation/routes/oauth.ts +144 -0
  142. package/src/presentation/routes/rate-limit.ts +16 -0
  143. package/src/presentation/routes/registration/signup.ts +52 -41
  144. package/src/temporal/activities/agent-access-retention.ts +76 -0
  145. package/src/temporal/activities/index.ts +5 -0
  146. package/src/temporal/constants.ts +1 -0
  147. package/src/temporal/workflows/agent-access-retention-cron.ts +23 -0
  148. package/src/temporal/workflows/index.ts +1 -0
  149. package/test/globalSetup.ts +1 -1
  150. package/test/routes.ts +3 -1
  151. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,255 @@
1
+ import type { AgentAuthorizationCode, AgentAuthorizationRequest, AgentClient, AgentGrant, AgentPersonalAccessToken, AgentRefreshToken } from '#core/entities/agent-access.js';
2
+ import { db } from './db.js';
3
+ export type AgentAccessTx = Parameters<Parameters<ReturnType<typeof db>['transaction']>[0]>[0];
4
+ type AgentAccessExecutor = ReturnType<typeof db> | AgentAccessTx;
5
+ /** Returns the default sliding lifetime for a newly issued agent refresh token. */
6
+ export declare function agentRefreshTokenExpiresAt(now?: Date): Date;
7
+ /**
8
+ * A rotated token remains usable for an access-token-only grace response. The
9
+ * row must still exist; pruning deliberately turns later replays into plain
10
+ * unknown-token responses.
11
+ */
12
+ export declare function isWithinAgentRefreshRotationGrace(params: {
13
+ rotatedAt: Date | null;
14
+ now?: Date;
15
+ graceSeconds?: number | undefined;
16
+ }): boolean;
17
+ export interface CreateAgentClientParams {
18
+ clientId: string;
19
+ name: string;
20
+ redirectUris: string[];
21
+ kind: 'registered' | 'cimd';
22
+ }
23
+ export declare function createAgentClient(params: CreateAgentClientParams): Promise<AgentClient>;
24
+ export declare function createAgentClientTx(tx: AgentAccessTx, params: CreateAgentClientParams): Promise<AgentClient>;
25
+ export interface UpsertCimdAgentClientParams {
26
+ clientId: string;
27
+ name: string;
28
+ redirectUris: string[];
29
+ }
30
+ /**
31
+ * Stores the latest validated CIMD identity. The generic client upsert above
32
+ * intentionally preserves registration metadata; CIMD documents are the
33
+ * source of truth and therefore use this explicit update path.
34
+ */
35
+ export declare function upsertCimdAgentClient(params: UpsertCimdAgentClientParams): Promise<AgentClient>;
36
+ export declare function findAgentClientByClientId(params: {
37
+ clientId: string;
38
+ executor?: AgentAccessExecutor;
39
+ }): Promise<AgentClient | undefined>;
40
+ export declare function markAgentClientReferenced(tx: AgentAccessTx, params: {
41
+ clientUuid: string;
42
+ }): Promise<void>;
43
+ export declare function markAgentClientUnreferenced(tx: AgentAccessTx, params: {
44
+ clientUuid: string;
45
+ }): Promise<void>;
46
+ export interface CreateAgentAuthorizationRequestParams {
47
+ /** Internal `auth_agent_clients.id`, not the public OAuth `client_id`. */
48
+ clientId: string;
49
+ redirectUri: string;
50
+ resource: string;
51
+ scopes: string[];
52
+ codeChallenge: string;
53
+ state: string | null;
54
+ expiresAt: Date;
55
+ }
56
+ export declare function createAgentAuthorizationRequest(params: CreateAgentAuthorizationRequestParams): Promise<AgentAuthorizationRequest>;
57
+ export declare function createAgentAuthorizationRequestTx(tx: AgentAccessTx, params: CreateAgentAuthorizationRequestParams): Promise<AgentAuthorizationRequest>;
58
+ export declare function findPendingAgentAuthorizationRequest(params: {
59
+ id: string;
60
+ executor?: AgentAccessExecutor;
61
+ }): Promise<AgentAuthorizationRequest | undefined>;
62
+ export declare function consumeAgentAuthorizationRequest(params: {
63
+ id: string;
64
+ }): Promise<AgentAuthorizationRequest | undefined>;
65
+ /**
66
+ * Claims a pending request in the caller's transaction. The expiry and
67
+ * consumed-at predicates are part of the update so concurrent approval and
68
+ * denial can have only one winner.
69
+ */
70
+ export declare function consumeAgentAuthorizationRequestTx(tx: AgentAccessTx, params: {
71
+ id: string;
72
+ }): Promise<AgentAuthorizationRequest | undefined>;
73
+ export interface CreateAgentGrantParams {
74
+ userId: string;
75
+ workspaceId: string;
76
+ /** Internal `auth_agent_clients.id`, not the public OAuth `client_id`. */
77
+ clientId: string;
78
+ scopes: string[];
79
+ }
80
+ export declare function createAgentGrant(params: CreateAgentGrantParams): Promise<AgentGrant>;
81
+ /**
82
+ * Creates or reauthorizes a grant while holding its client row lock. A newly
83
+ * created grant has no live child until its first authorization code or refresh
84
+ * token is issued, so approval callers must compose that first child creation
85
+ * with this Tx helper in one database transaction.
86
+ */
87
+ export declare function createAgentGrantTx(tx: AgentAccessTx, params: CreateAgentGrantParams): Promise<AgentGrant>;
88
+ export declare function findAgentGrant(params: {
89
+ id: string;
90
+ executor?: AgentAccessExecutor;
91
+ }): Promise<AgentGrant | undefined>;
92
+ /**
93
+ * Locks one grant row until the surrounding transaction ends. Code exchange
94
+ * and lifecycle transitions must use this same primitive before inspecting or
95
+ * changing grant state. Callers must keep the transaction database-only while
96
+ * this lock is held; external I/O must happen after commit.
97
+ */
98
+ export declare function lockAgentGrant(tx: AgentAccessTx, params: {
99
+ grantId: string;
100
+ }): Promise<AgentGrant | undefined>;
101
+ export interface CreateAgentAuthorizationCodeParams {
102
+ grantId: string;
103
+ hashedCode: string;
104
+ codeChallenge: string;
105
+ redirectUri: string;
106
+ resource: string;
107
+ expiresAt: Date;
108
+ }
109
+ export declare function createAgentAuthorizationCode(params: CreateAgentAuthorizationCodeParams): Promise<AgentAuthorizationCode>;
110
+ export declare function createAgentAuthorizationCodeTx(tx: AgentAccessTx, params: CreateAgentAuthorizationCodeParams): Promise<AgentAuthorizationCode>;
111
+ export declare function findAgentAuthorizationCodeByHash(params: {
112
+ hashedCode: string;
113
+ executor?: AgentAccessExecutor;
114
+ }): Promise<AgentAuthorizationCode | undefined>;
115
+ export declare function findActiveAgentAuthorizationCodeByHash(params: {
116
+ hashedCode: string;
117
+ executor?: AgentAccessExecutor;
118
+ }): Promise<AgentAuthorizationCode | undefined>;
119
+ export declare function consumeAgentAuthorizationCode(params: {
120
+ hashedCode: string;
121
+ }): Promise<AgentAuthorizationCode | undefined>;
122
+ /** Claims an authorization code exactly once, including its 60-second TTL. */
123
+ export declare function consumeAgentAuthorizationCodeTx(tx: AgentAccessTx, params: {
124
+ hashedCode: string;
125
+ }): Promise<AgentAuthorizationCode | undefined>;
126
+ export interface CreateAgentRefreshTokenParams {
127
+ grantId: string;
128
+ hashedToken: string;
129
+ /** Defaults to the configured 14-day lifetime. */
130
+ expiresAt?: Date;
131
+ }
132
+ export declare function createAgentRefreshToken(params: CreateAgentRefreshTokenParams): Promise<AgentRefreshToken>;
133
+ export declare function createAgentRefreshTokenTx(tx: AgentAccessTx, params: CreateAgentRefreshTokenParams): Promise<AgentRefreshToken>;
134
+ export declare function findAgentRefreshTokenByHash(params: {
135
+ hashedToken: string;
136
+ executor?: AgentAccessExecutor;
137
+ }): Promise<AgentRefreshToken | undefined>;
138
+ export declare function findActiveAgentRefreshTokenByHash(params: {
139
+ hashedToken: string;
140
+ executor?: AgentAccessExecutor;
141
+ }): Promise<AgentRefreshToken | undefined>;
142
+ /** Finds the one live refresh token currently attached to a grant. */
143
+ export declare function findActiveAgentRefreshTokenByGrantId(params: {
144
+ grantId: string;
145
+ executor?: AgentAccessExecutor;
146
+ }): Promise<AgentRefreshToken | undefined>;
147
+ export type AgentRefreshTokenReplayResult = {
148
+ kind: 'grace';
149
+ grant: AgentGrant;
150
+ predecessor: AgentRefreshToken;
151
+ successor: AgentRefreshToken;
152
+ } | {
153
+ kind: 'reused';
154
+ grant: AgentGrant;
155
+ predecessor: AgentRefreshToken;
156
+ };
157
+ /**
158
+ * Resolves a replay of a retained, rotated token. A grace hit returns the one
159
+ * live successor so the caller can mint an access token without issuing a new
160
+ * refresh cookie. A replay after grace revokes the complete grant family.
161
+ * Missing or pruned rows return undefined and therefore remain plain 401s.
162
+ */
163
+ export declare function resolveAgentRefreshTokenReplay(params: {
164
+ hashedToken: string;
165
+ now?: Date;
166
+ graceSeconds?: number;
167
+ }): Promise<AgentRefreshTokenReplayResult | undefined>;
168
+ export declare function resolveAgentRefreshTokenReplayTx(tx: AgentAccessTx, params: {
169
+ hashedToken: string;
170
+ now?: Date;
171
+ graceSeconds?: number;
172
+ }): Promise<AgentRefreshTokenReplayResult | undefined>;
173
+ /** Rotates a refresh token atomically; a concurrent rotation cannot win twice. */
174
+ export declare function rotateAgentRefreshToken(params: {
175
+ hashedToken: string;
176
+ replacementHashedToken: string;
177
+ /** Defaults to the configured 14-day sliding lifetime. */
178
+ replacementExpiresAt?: Date;
179
+ }): Promise<AgentRefreshToken | undefined>;
180
+ export declare function rotateAgentRefreshTokenTx(tx: AgentAccessTx, params: {
181
+ hashedToken: string;
182
+ replacementHashedToken: string;
183
+ replacementExpiresAt?: Date;
184
+ }): Promise<AgentRefreshToken | undefined>;
185
+ export declare function revokeAgentRefreshToken(params: {
186
+ id: string;
187
+ }): Promise<AgentRefreshToken | undefined>;
188
+ /** Revokes a grant and every refresh-token generation in its family. */
189
+ export declare function revokeAgentGrant(params: {
190
+ grantId: string;
191
+ }): Promise<AgentGrant | undefined>;
192
+ export declare function revokeAgentGrantTx(tx: AgentAccessTx, params: {
193
+ grantId: string;
194
+ }): Promise<AgentGrant | undefined>;
195
+ export interface TransitionAgentGrantsToTerminalParams {
196
+ limit?: number;
197
+ now?: Date;
198
+ deadlineMs?: number | undefined;
199
+ }
200
+ /**
201
+ * Marks grants terminal once they have no usable refresh token or authorization
202
+ * code left. Each candidate is locked before its children are inspected so a
203
+ * concurrent code exchange or token rotation cannot create a live child after
204
+ * the decision.
205
+ */
206
+ export declare function transitionAgentGrantsToTerminal(params?: TransitionAgentGrantsToTerminalParams): Promise<number>;
207
+ export declare function transitionAgentGrantsToTerminalTx(tx: AgentAccessTx, params?: TransitionAgentGrantsToTerminalParams): Promise<number>;
208
+ export interface CreateAgentPersonalAccessTokenParams {
209
+ userId: string;
210
+ workspaceId: string;
211
+ hashedToken: string;
212
+ prefix: string;
213
+ name: string;
214
+ scopes: string[];
215
+ expiresAt: Date;
216
+ }
217
+ export declare function createAgentPersonalAccessToken(params: CreateAgentPersonalAccessTokenParams): Promise<AgentPersonalAccessToken>;
218
+ export declare function createAgentPersonalAccessTokenTx(tx: AgentAccessTx, params: CreateAgentPersonalAccessTokenParams): Promise<AgentPersonalAccessToken>;
219
+ export declare function findAgentPersonalAccessTokenByHash(params: {
220
+ hashedToken: string;
221
+ executor?: AgentAccessExecutor;
222
+ }): Promise<AgentPersonalAccessToken | undefined>;
223
+ export declare function findActiveAgentPersonalAccessTokenByHash(params: {
224
+ hashedToken: string;
225
+ executor?: AgentAccessExecutor;
226
+ }): Promise<AgentPersonalAccessToken | undefined>;
227
+ export declare function markAgentPersonalAccessTokenUsed(params: {
228
+ id: string;
229
+ throttleSeconds?: number;
230
+ }): Promise<AgentPersonalAccessToken | undefined>;
231
+ export declare function revokeAgentPersonalAccessToken(params: {
232
+ id: string;
233
+ }): Promise<AgentPersonalAccessToken | undefined>;
234
+ export interface PruneAgentAccessParams {
235
+ /** Overrides every retention horizon for deterministic maintenance tests. */
236
+ retentionDays?: number;
237
+ limit?: number;
238
+ now?: Date;
239
+ /** Absolute epoch deadline used to bound every PostgreSQL statement. */
240
+ deadlineMs?: number;
241
+ }
242
+ export interface PruneAgentAccessResult {
243
+ deleted: number;
244
+ transitioned: number;
245
+ }
246
+ /**
247
+ * Transitions inactive grants and deletes retained agent-access rows in bounded
248
+ * batches. The caller can override the common horizon in tests; production uses
249
+ * the per-row windows from the agent-access retention policy.
250
+ */
251
+ export declare function pruneAgentAccess(params?: PruneAgentAccessParams): Promise<number>;
252
+ /** Runs one bounded retention transaction and reports terminal transitions separately. */
253
+ export declare function pruneAgentAccessBatch(params?: PruneAgentAccessParams): Promise<PruneAgentAccessResult>;
254
+ export {};
255
+ //# sourceMappingURL=agent-access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-access.d.ts","sourceRoot":"","sources":["../../src/db/agent-access.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,UAAU,EACV,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,gCAAgC,CAAC;AASxC,OAAO,EAAC,EAAE,EAAC,MAAM,SAAS,CAAC;AAiB3B,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/F,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;AA0FjE,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,GAAG,GAAE,IAAiB,GAAG,IAAI,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE;IACxD,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,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