@auto-engineer/pipeline 0.14.0 → 0.15.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 (249) hide show
  1. package/.turbo/turbo-build.log +5 -6
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +279 -0
  4. package/dist/src/builder/define.d.ts +6 -2
  5. package/dist/src/builder/define.d.ts.map +1 -1
  6. package/dist/src/builder/define.js +17 -7
  7. package/dist/src/builder/define.js.map +1 -1
  8. package/dist/src/builder/define.specs.js +3 -3
  9. package/dist/src/builder/define.specs.js.map +1 -1
  10. package/dist/src/core/descriptors.d.ts +6 -2
  11. package/dist/src/core/descriptors.d.ts.map +1 -1
  12. package/dist/src/graph/filter-graph.d.ts +3 -0
  13. package/dist/src/graph/filter-graph.d.ts.map +1 -0
  14. package/dist/src/graph/filter-graph.js +80 -0
  15. package/dist/src/graph/filter-graph.js.map +1 -0
  16. package/dist/src/graph/filter-graph.specs.d.ts +2 -0
  17. package/dist/src/graph/filter-graph.specs.d.ts.map +1 -0
  18. package/dist/src/graph/filter-graph.specs.js +204 -0
  19. package/dist/src/graph/filter-graph.specs.js.map +1 -0
  20. package/dist/src/graph/types.d.ts +8 -0
  21. package/dist/src/graph/types.d.ts.map +1 -1
  22. package/dist/src/index.d.ts +1 -0
  23. package/dist/src/index.d.ts.map +1 -1
  24. package/dist/src/index.js.map +1 -1
  25. package/dist/src/projections/await-tracker-projection.d.ts +31 -0
  26. package/dist/src/projections/await-tracker-projection.d.ts.map +1 -0
  27. package/dist/src/projections/await-tracker-projection.js +35 -0
  28. package/dist/src/projections/await-tracker-projection.js.map +1 -0
  29. package/dist/src/projections/index.d.ts +4 -0
  30. package/dist/src/projections/index.d.ts.map +1 -0
  31. package/dist/src/projections/index.js +4 -0
  32. package/dist/src/projections/index.js.map +1 -0
  33. package/dist/src/projections/item-status-projection.d.ts +22 -0
  34. package/dist/src/projections/item-status-projection.d.ts.map +1 -0
  35. package/dist/src/projections/item-status-projection.js +11 -0
  36. package/dist/src/projections/item-status-projection.js.map +1 -0
  37. package/dist/src/projections/item-status-projection.specs.d.ts +2 -0
  38. package/dist/src/projections/item-status-projection.specs.d.ts.map +1 -0
  39. package/dist/src/projections/item-status-projection.specs.js +119 -0
  40. package/dist/src/projections/item-status-projection.specs.js.map +1 -0
  41. package/dist/src/projections/latest-run-projection.d.ts +15 -0
  42. package/dist/src/projections/latest-run-projection.d.ts.map +1 -0
  43. package/dist/src/projections/latest-run-projection.js +7 -0
  44. package/dist/src/projections/latest-run-projection.js.map +1 -0
  45. package/dist/src/projections/latest-run-projection.specs.d.ts +2 -0
  46. package/dist/src/projections/latest-run-projection.specs.d.ts.map +1 -0
  47. package/dist/src/projections/latest-run-projection.specs.js +33 -0
  48. package/dist/src/projections/latest-run-projection.specs.js.map +1 -0
  49. package/dist/src/projections/message-log-projection.d.ts +51 -0
  50. package/dist/src/projections/message-log-projection.d.ts.map +1 -0
  51. package/dist/src/projections/message-log-projection.js +51 -0
  52. package/dist/src/projections/message-log-projection.js.map +1 -0
  53. package/dist/src/projections/message-log-projection.specs.d.ts +2 -0
  54. package/dist/src/projections/message-log-projection.specs.d.ts.map +1 -0
  55. package/dist/src/projections/message-log-projection.specs.js +101 -0
  56. package/dist/src/projections/message-log-projection.specs.js.map +1 -0
  57. package/dist/src/projections/node-status-projection.d.ts +23 -0
  58. package/dist/src/projections/node-status-projection.d.ts.map +1 -0
  59. package/dist/src/projections/node-status-projection.js +10 -0
  60. package/dist/src/projections/node-status-projection.js.map +1 -0
  61. package/dist/src/projections/node-status-projection.specs.d.ts +2 -0
  62. package/dist/src/projections/node-status-projection.specs.d.ts.map +1 -0
  63. package/dist/src/projections/node-status-projection.specs.js +116 -0
  64. package/dist/src/projections/node-status-projection.specs.js.map +1 -0
  65. package/dist/src/projections/phased-execution-projection.d.ts +77 -0
  66. package/dist/src/projections/phased-execution-projection.d.ts.map +1 -0
  67. package/dist/src/projections/phased-execution-projection.js +54 -0
  68. package/dist/src/projections/phased-execution-projection.js.map +1 -0
  69. package/dist/src/projections/phased-execution-projection.specs.d.ts +2 -0
  70. package/dist/src/projections/phased-execution-projection.specs.d.ts.map +1 -0
  71. package/dist/src/projections/phased-execution-projection.specs.js +171 -0
  72. package/dist/src/projections/phased-execution-projection.specs.js.map +1 -0
  73. package/dist/src/projections/settled-instance-projection.d.ts +67 -0
  74. package/dist/src/projections/settled-instance-projection.d.ts.map +1 -0
  75. package/dist/src/projections/settled-instance-projection.js +66 -0
  76. package/dist/src/projections/settled-instance-projection.js.map +1 -0
  77. package/dist/src/projections/settled-instance-projection.specs.d.ts +2 -0
  78. package/dist/src/projections/settled-instance-projection.specs.d.ts.map +1 -0
  79. package/dist/src/projections/settled-instance-projection.specs.js +217 -0
  80. package/dist/src/projections/settled-instance-projection.specs.js.map +1 -0
  81. package/dist/src/projections/stats-projection.d.ts +9 -0
  82. package/dist/src/projections/stats-projection.d.ts.map +1 -0
  83. package/dist/src/projections/stats-projection.js +16 -0
  84. package/dist/src/projections/stats-projection.js.map +1 -0
  85. package/dist/src/projections/stats-projection.specs.d.ts +2 -0
  86. package/dist/src/projections/stats-projection.specs.d.ts.map +1 -0
  87. package/dist/src/projections/stats-projection.specs.js +91 -0
  88. package/dist/src/projections/stats-projection.specs.js.map +1 -0
  89. package/dist/src/runtime/await-tracker.d.ts +17 -7
  90. package/dist/src/runtime/await-tracker.d.ts.map +1 -1
  91. package/dist/src/runtime/await-tracker.js +32 -29
  92. package/dist/src/runtime/await-tracker.js.map +1 -1
  93. package/dist/src/runtime/await-tracker.specs.js +56 -38
  94. package/dist/src/runtime/await-tracker.specs.js.map +1 -1
  95. package/dist/src/runtime/context.d.ts +1 -1
  96. package/dist/src/runtime/context.d.ts.map +1 -1
  97. package/dist/src/runtime/event-command-map.d.ts +3 -3
  98. package/dist/src/runtime/event-command-map.d.ts.map +1 -1
  99. package/dist/src/runtime/event-command-map.js +6 -2
  100. package/dist/src/runtime/event-command-map.js.map +1 -1
  101. package/dist/src/runtime/phased-executor.d.ts +15 -9
  102. package/dist/src/runtime/phased-executor.d.ts.map +1 -1
  103. package/dist/src/runtime/phased-executor.js +126 -104
  104. package/dist/src/runtime/phased-executor.js.map +1 -1
  105. package/dist/src/runtime/phased-executor.specs.js +243 -81
  106. package/dist/src/runtime/phased-executor.specs.js.map +1 -1
  107. package/dist/src/runtime/pipeline-runtime.d.ts.map +1 -1
  108. package/dist/src/runtime/pipeline-runtime.js +2 -2
  109. package/dist/src/runtime/pipeline-runtime.js.map +1 -1
  110. package/dist/src/runtime/pipeline-runtime.specs.js +35 -0
  111. package/dist/src/runtime/pipeline-runtime.specs.js.map +1 -1
  112. package/dist/src/runtime/settled-tracker.d.ts +12 -9
  113. package/dist/src/runtime/settled-tracker.d.ts.map +1 -1
  114. package/dist/src/runtime/settled-tracker.js +92 -77
  115. package/dist/src/runtime/settled-tracker.js.map +1 -1
  116. package/dist/src/runtime/settled-tracker.specs.js +568 -118
  117. package/dist/src/runtime/settled-tracker.specs.js.map +1 -1
  118. package/dist/src/server/pipeline-server.d.ts +31 -9
  119. package/dist/src/server/pipeline-server.d.ts.map +1 -1
  120. package/dist/src/server/pipeline-server.e2e.specs.js +2 -10
  121. package/dist/src/server/pipeline-server.e2e.specs.js.map +1 -1
  122. package/dist/src/server/pipeline-server.js +408 -123
  123. package/dist/src/server/pipeline-server.js.map +1 -1
  124. package/dist/src/server/pipeline-server.specs.js +777 -32
  125. package/dist/src/server/pipeline-server.specs.js.map +1 -1
  126. package/dist/src/server/sse-manager.specs.js +55 -35
  127. package/dist/src/server/sse-manager.specs.js.map +1 -1
  128. package/dist/src/store/index.d.ts +3 -0
  129. package/dist/src/store/index.d.ts.map +1 -0
  130. package/dist/src/store/index.js +3 -0
  131. package/dist/src/store/index.js.map +1 -0
  132. package/dist/src/store/pipeline-event-store.d.ts +10 -0
  133. package/dist/src/store/pipeline-event-store.d.ts.map +1 -0
  134. package/dist/src/store/pipeline-event-store.js +112 -0
  135. package/dist/src/store/pipeline-event-store.js.map +1 -0
  136. package/dist/src/store/pipeline-event-store.specs.d.ts +2 -0
  137. package/dist/src/store/pipeline-event-store.specs.d.ts.map +1 -0
  138. package/dist/src/store/pipeline-event-store.specs.js +287 -0
  139. package/dist/src/store/pipeline-event-store.specs.js.map +1 -0
  140. package/dist/src/store/pipeline-read-model.d.ts +49 -0
  141. package/dist/src/store/pipeline-read-model.d.ts.map +1 -0
  142. package/dist/src/store/pipeline-read-model.js +157 -0
  143. package/dist/src/store/pipeline-read-model.js.map +1 -0
  144. package/dist/src/store/pipeline-read-model.specs.d.ts +2 -0
  145. package/dist/src/store/pipeline-read-model.specs.d.ts.map +1 -0
  146. package/dist/src/store/pipeline-read-model.specs.js +830 -0
  147. package/dist/src/store/pipeline-read-model.specs.js.map +1 -0
  148. package/dist/src/testing/fixtures/kanban-full.pipeline.js +2 -2
  149. package/dist/src/testing/fixtures/kanban-full.pipeline.js.map +1 -1
  150. package/dist/src/testing/fixtures/kanban.pipeline.js +2 -2
  151. package/dist/src/testing/fixtures/kanban.pipeline.js.map +1 -1
  152. package/dist/tsconfig.tsbuildinfo +1 -1
  153. package/ketchup-plan.md +960 -0
  154. package/package.json +5 -4
  155. package/src/builder/define.specs.ts +3 -3
  156. package/src/builder/define.ts +24 -11
  157. package/src/core/descriptors.ts +7 -2
  158. package/src/graph/filter-graph.specs.ts +241 -0
  159. package/src/graph/filter-graph.ts +111 -0
  160. package/src/graph/types.ts +10 -0
  161. package/src/index.ts +1 -0
  162. package/src/projections/await-tracker-projection.ts +68 -0
  163. package/src/projections/index.ts +11 -0
  164. package/src/projections/item-status-projection.specs.ts +130 -0
  165. package/src/projections/item-status-projection.ts +32 -0
  166. package/src/projections/latest-run-projection.specs.ts +38 -0
  167. package/src/projections/latest-run-projection.ts +20 -0
  168. package/src/projections/message-log-projection.specs.ts +118 -0
  169. package/src/projections/message-log-projection.ts +113 -0
  170. package/src/projections/node-status-projection.specs.ts +127 -0
  171. package/src/projections/node-status-projection.ts +33 -0
  172. package/src/projections/phased-execution-projection.specs.ts +202 -0
  173. package/src/projections/phased-execution-projection.ts +146 -0
  174. package/src/projections/settled-instance-projection.specs.ts +249 -0
  175. package/src/projections/settled-instance-projection.ts +160 -0
  176. package/src/projections/stats-projection.specs.ts +105 -0
  177. package/src/projections/stats-projection.ts +26 -0
  178. package/src/runtime/await-tracker.specs.ts +57 -34
  179. package/src/runtime/await-tracker.ts +43 -31
  180. package/src/runtime/context.ts +1 -1
  181. package/src/runtime/event-command-map.ts +11 -4
  182. package/src/runtime/phased-executor.specs.ts +357 -81
  183. package/src/runtime/phased-executor.ts +142 -126
  184. package/src/runtime/pipeline-runtime.specs.ts +42 -0
  185. package/src/runtime/pipeline-runtime.ts +6 -4
  186. package/src/runtime/settled-tracker.specs.ts +716 -120
  187. package/src/runtime/settled-tracker.ts +104 -98
  188. package/src/server/pipeline-server.e2e.specs.ts +10 -16
  189. package/src/server/pipeline-server.specs.ts +964 -49
  190. package/src/server/pipeline-server.ts +512 -144
  191. package/src/server/sse-manager.specs.ts +67 -36
  192. package/src/store/index.ts +2 -0
  193. package/src/store/pipeline-event-store.specs.ts +309 -0
  194. package/src/store/pipeline-event-store.ts +156 -0
  195. package/src/store/pipeline-read-model.specs.ts +967 -0
  196. package/src/store/pipeline-read-model.ts +223 -0
  197. package/src/testing/fixtures/kanban-full.pipeline.ts +2 -2
  198. package/src/testing/fixtures/kanban.pipeline.ts +2 -2
  199. package/claude.md +0 -160
  200. package/dist/src/__tests__/e2e/helpers.d.ts +0 -48
  201. package/dist/src/__tests__/e2e/helpers.d.ts.map +0 -1
  202. package/dist/src/__tests__/e2e/helpers.js +0 -253
  203. package/dist/src/__tests__/e2e/helpers.js.map +0 -1
  204. package/dist/src/__tests__/e2e/kanban-migration.e2e.specs.d.ts +0 -2
  205. package/dist/src/__tests__/e2e/kanban-migration.e2e.specs.d.ts.map +0 -1
  206. package/dist/src/__tests__/e2e/kanban-migration.e2e.specs.js +0 -195
  207. package/dist/src/__tests__/e2e/kanban-migration.e2e.specs.js.map +0 -1
  208. package/dist/src/__tests__/e2e/types.d.ts +0 -107
  209. package/dist/src/__tests__/e2e/types.d.ts.map +0 -1
  210. package/dist/src/__tests__/e2e/types.js +0 -2
  211. package/dist/src/__tests__/e2e/types.js.map +0 -1
  212. package/dist/src/file-syncer/crypto/jwe-encryptor.d.ts +0 -15
  213. package/dist/src/file-syncer/crypto/jwe-encryptor.d.ts.map +0 -1
  214. package/dist/src/file-syncer/crypto/jwe-encryptor.js +0 -64
  215. package/dist/src/file-syncer/crypto/jwe-encryptor.js.map +0 -1
  216. package/dist/src/file-syncer/crypto/provider-resolver.d.ts +0 -24
  217. package/dist/src/file-syncer/crypto/provider-resolver.d.ts.map +0 -1
  218. package/dist/src/file-syncer/crypto/provider-resolver.js +0 -71
  219. package/dist/src/file-syncer/crypto/provider-resolver.js.map +0 -1
  220. package/dist/src/file-syncer/discovery/bareImports.d.ts +0 -3
  221. package/dist/src/file-syncer/discovery/bareImports.d.ts.map +0 -1
  222. package/dist/src/file-syncer/discovery/bareImports.js +0 -36
  223. package/dist/src/file-syncer/discovery/bareImports.js.map +0 -1
  224. package/dist/src/file-syncer/discovery/dts.d.ts +0 -8
  225. package/dist/src/file-syncer/discovery/dts.d.ts.map +0 -1
  226. package/dist/src/file-syncer/discovery/dts.js +0 -99
  227. package/dist/src/file-syncer/discovery/dts.js.map +0 -1
  228. package/dist/src/file-syncer/index.d.ts +0 -46
  229. package/dist/src/file-syncer/index.d.ts.map +0 -1
  230. package/dist/src/file-syncer/index.js +0 -392
  231. package/dist/src/file-syncer/index.js.map +0 -1
  232. package/dist/src/file-syncer/sync/resolveSyncFileSet.d.ts +0 -7
  233. package/dist/src/file-syncer/sync/resolveSyncFileSet.d.ts.map +0 -1
  234. package/dist/src/file-syncer/sync/resolveSyncFileSet.js +0 -86
  235. package/dist/src/file-syncer/sync/resolveSyncFileSet.js.map +0 -1
  236. package/dist/src/file-syncer/types/wire.d.ts +0 -14
  237. package/dist/src/file-syncer/types/wire.d.ts.map +0 -1
  238. package/dist/src/file-syncer/types/wire.js +0 -2
  239. package/dist/src/file-syncer/types/wire.js.map +0 -1
  240. package/dist/src/file-syncer/utils/hash.d.ts +0 -5
  241. package/dist/src/file-syncer/utils/hash.d.ts.map +0 -1
  242. package/dist/src/file-syncer/utils/hash.js +0 -19
  243. package/dist/src/file-syncer/utils/hash.js.map +0 -1
  244. package/dist/src/file-syncer/utils/path.d.ts +0 -13
  245. package/dist/src/file-syncer/utils/path.d.ts.map +0 -1
  246. package/dist/src/file-syncer/utils/path.js +0 -74
  247. package/dist/src/file-syncer/utils/path.js.map +0 -1
  248. package/docs/testing-analysis.md +0 -395
  249. package/pomodoro-plan.md +0 -651
@@ -1,64 +0,0 @@
1
- import { EncryptJWT, importJWK } from 'jose';
2
- const PUBLIC_JWKS_URL = 'https://sync-sandbox.rami-632.workers.dev/.well-known/jwks.json';
3
- const PUBLIC_KEY_CACHE_TTL_MS = 60 * 60 * 300;
4
- const JWE_TTL_SECONDS = 1800;
5
- const AUDIENCE = 'cf-worker-ai';
6
- let cached = null;
7
- async function fetchJWKS() {
8
- const res = await fetch(PUBLIC_JWKS_URL, { headers: { accept: 'application/json' } });
9
- if (!res.ok)
10
- throw new Error(`Failed JWKS fetch: ${res.status} ${res.statusText}`);
11
- return (await res.json());
12
- }
13
- function pickEncryptionKey(jwks) {
14
- const candidate = jwks.keys.find((k) => k.kty === 'RSA' &&
15
- (k.use === 'enc' || k.use === undefined) &&
16
- (k.alg === undefined || k.alg === 'RSA-OAEP' || k.alg === 'RSA-OAEP-256') &&
17
- k.n !== undefined &&
18
- k.e !== undefined &&
19
- k.kid !== undefined);
20
- if (candidate === undefined)
21
- throw new Error('No suitable RSA encryption key in JWKS');
22
- return candidate;
23
- }
24
- async function getCachedPublicKey() {
25
- const now = Date.now();
26
- if (cached !== null && now - cached.fetchedAt < PUBLIC_KEY_CACHE_TTL_MS) {
27
- return cached;
28
- }
29
- const jwks = await fetchJWKS();
30
- const jwk = pickEncryptionKey(jwks);
31
- const alg = jwk.alg ?? 'RSA-OAEP-256';
32
- const imported = await importJWK(jwk, alg);
33
- const keyLike = imported instanceof Uint8Array ? imported : imported;
34
- if (!keyLike.type) {
35
- throw new Error('importJWK did not return a valid KeyLike');
36
- }
37
- const newCached = { keyLike: keyLike, jwk, fetchedAt: now };
38
- cached = newCached;
39
- return newCached;
40
- }
41
- export async function createJWE(payload) {
42
- const { keyLike, jwk } = await getCachedPublicKey();
43
- const now = Math.floor(Date.now() / 1000);
44
- const jwt = new EncryptJWT({
45
- apiKey: payload.apiKey,
46
- provider: payload.provider,
47
- roomId: payload.roomId,
48
- model: payload.model,
49
- custom: payload.custom,
50
- })
51
- .setProtectedHeader({
52
- alg: jwk.alg ?? 'RSA-OAEP-256',
53
- enc: 'A256GCM',
54
- kid: jwk.kid,
55
- })
56
- .setIssuedAt(now)
57
- .setExpirationTime(now + JWE_TTL_SECONDS)
58
- .setAudience(AUDIENCE);
59
- return jwt.encrypt(keyLike);
60
- }
61
- export function clearPublicKeyCache() {
62
- cached = null;
63
- }
64
- //# sourceMappingURL=jwe-encryptor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jwe-encryptor.js","sourceRoot":"","sources":["../../../../src/file-syncer/crypto/jwe-encryptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAA0B,MAAM,MAAM,CAAC;AAErE,MAAM,eAAe,GAAG,iEAAiE,CAAC;AAC1F,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;AAC9C,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,QAAQ,GAAG,cAAc,CAAC;AAKhC,IAAI,MAAM,GAAqB,IAAI,CAAC;AAEpC,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAA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,IAAI,CAAC;AAChB,CAAC"}
@@ -1,24 +0,0 @@
1
- export declare enum AIProvider {
2
- OpenAI = "openai",
3
- Anthropic = "anthropic",
4
- Google = "google",
5
- XAI = "xai",
6
- Custom = "custom"
7
- }
8
- export type ActiveProvider = {
9
- provider: Exclude<AIProvider, AIProvider.Custom>;
10
- apiKey: string;
11
- model?: string;
12
- } | {
13
- provider: AIProvider.Custom;
14
- apiKey: string;
15
- model?: string;
16
- custom: {
17
- name: string;
18
- baseUrl: string;
19
- defaultModel: string;
20
- };
21
- };
22
- export declare function getActiveProvider(): ActiveProvider | null;
23
- export declare function getProviderEnvHash(): string;
24
- //# sourceMappingURL=provider-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider-resolver.d.ts","sourceRoot":"","sources":["../../../../src/file-syncer/crypto/provider-resolver.ts"],"names":[],"mappings":"AAIA,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,EAAE,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACpF;IACE,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE,CAAC;AA6BN,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,IAAI,CAoBzD;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAe3C"}
@@ -1,71 +0,0 @@
1
- import crypto from 'node:crypto';
2
- import { resolve } from 'node:path';
3
- import dotenv from 'dotenv';
4
- export var AIProvider;
5
- (function (AIProvider) {
6
- AIProvider["OpenAI"] = "openai";
7
- AIProvider["Anthropic"] = "anthropic";
8
- AIProvider["Google"] = "google";
9
- AIProvider["XAI"] = "xai";
10
- AIProvider["Custom"] = "custom";
11
- })(AIProvider || (AIProvider = {}));
12
- let envLoaded = false;
13
- function ensureEnv() {
14
- if (envLoaded)
15
- return;
16
- dotenv.config({ path: resolve(process.cwd(), '.env') });
17
- envLoaded = true;
18
- }
19
- function resolveCustom() {
20
- const name = process.env.CUSTOM_PROVIDER_NAME;
21
- const baseUrl = process.env.CUSTOM_PROVIDER_BASE_URL;
22
- const apiKey = process.env.CUSTOM_PROVIDER_API_KEY;
23
- const defaultModel = process.env.CUSTOM_PROVIDER_DEFAULT_MODEL;
24
- if (name !== undefined &&
25
- name.length > 0 &&
26
- baseUrl !== undefined &&
27
- baseUrl.length > 0 &&
28
- apiKey !== undefined &&
29
- apiKey.length > 0 &&
30
- defaultModel !== undefined &&
31
- defaultModel.length > 0) {
32
- return { provider: AIProvider.Custom, apiKey, custom: { name, baseUrl, defaultModel } };
33
- }
34
- return null;
35
- }
36
- export function getActiveProvider() {
37
- ensureEnv();
38
- const model = process.env.DEFAULT_AI_MODEL ?? undefined;
39
- const probes = [
40
- [AIProvider.Anthropic, 'ANTHROPIC_API_KEY'],
41
- [AIProvider.OpenAI, 'OPENAI_API_KEY'],
42
- [AIProvider.Google, 'GEMINI_API_KEY'],
43
- [AIProvider.XAI, 'XAI_API_KEY'],
44
- ];
45
- for (const [provider, envVar] of probes) {
46
- const apiKey = process.env[envVar];
47
- if (apiKey !== undefined)
48
- return { provider, apiKey, model };
49
- }
50
- const custom = resolveCustom();
51
- if (custom !== null)
52
- return { ...custom, model };
53
- return null;
54
- }
55
- export function getProviderEnvHash() {
56
- ensureEnv();
57
- const keys = [
58
- 'ANTHROPIC_API_KEY',
59
- 'OPENAI_API_KEY',
60
- 'GEMINI_API_KEY',
61
- 'XAI_API_KEY',
62
- 'CUSTOM_PROVIDER_NAME',
63
- 'CUSTOM_PROVIDER_BASE_URL',
64
- 'CUSTOM_PROVIDER_API_KEY',
65
- 'CUSTOM_PROVIDER_DEFAULT_MODEL',
66
- 'DEFAULT_AI_MODEL',
67
- ];
68
- const joined = keys.map((k) => process.env[k] ?? '').join('|');
69
- return crypto.createHash('md5').update(joined).digest('hex');
70
- }
71
- //# sourceMappingURL=provider-resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider-resolver.js","sourceRoot":"","sources":["../../../../src/file-syncer/crypto/provider-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,+BAAiB,CAAA;AACnB,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB;AAWD,IAAI,SAAS,GAAG,KAAK,CAAC;AACtB,SAAS,SAAS;IAChB,IAAI,SAAS;QAAE,OAAO;IACtB,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACxD,SAAS,GAAG,IAAI,CAAC;AACnB,CAAC;AAED,SAAS,aAAa;IACpB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;IAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;IACrD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IACnD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC;IAC/D,IACE,IAAI,KAAK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C;IACZ,MAAM,IAAI,GAAG;QACX,mBAAmB;QACnB,gBAAgB;QAChB,gBAAgB;QAChB,aAAa;QACb,sBAAsB;QACtB,0BAA0B;QAC1B,yBAAyB;QACzB,+BAA+B;QAC/B,kBAAkB;KACnB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/D,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { NodeFileStore } from '@auto-engineer/file-store/node';
2
- export declare function collectBareImportsFromFiles(files: string[], vfs: NodeFileStore): Promise<string[]>;
3
- //# sourceMappingURL=bareImports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bareImports.d.ts","sourceRoot":"","sources":["../../../../src/file-syncer/discovery/bareImports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAkBpE,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAkBxG"}
@@ -1,36 +0,0 @@
1
- const BARE_IMPORT_RE = /\bfrom\s+['"]([^'"]+)['"]|require\(\s*['"]([^'"]+)['"]\s*\)|\bimport\(\s*['"]([^'"]+)['"]\s*\)/g;
2
- function isBare(spec) {
3
- return !!spec && !spec.startsWith('.') && !spec.startsWith('/') && !spec.startsWith('node:');
4
- }
5
- function basePackageOf(spec) {
6
- if (spec.startsWith('@')) {
7
- const parts = spec.split('/');
8
- return parts.length >= 2 ? `${parts[0]}/${parts[1]}` : spec;
9
- }
10
- const i = spec.indexOf('/');
11
- return i === -1 ? spec : spec.slice(0, i);
12
- }
13
- export async function collectBareImportsFromFiles(files, vfs) {
14
- const pkgs = new Set();
15
- for (const abs of files) {
16
- if (!/\.(m?ts|m?js|tsx|jsx)$/i.test(abs))
17
- continue;
18
- try {
19
- const buf = await vfs.read(abs);
20
- if (!buf)
21
- continue;
22
- const src = new TextDecoder().decode(buf);
23
- for (const m of src.matchAll(BARE_IMPORT_RE)) {
24
- const raw = (m[1] ?? m[2] ?? m[3] ?? '').trim();
25
- if (!isBare(raw))
26
- continue;
27
- pkgs.add(basePackageOf(raw));
28
- }
29
- }
30
- catch {
31
- // ignore per-file errors
32
- }
33
- }
34
- return [...pkgs];
35
- }
36
- //# sourceMappingURL=bareImports.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bareImports.js","sourceRoot":"","sources":["../../../../src/file-syncer/discovery/bareImports.ts"],"names":[],"mappings":"AAEA,MAAM,cAAc,GAClB,iGAAiG,CAAC;AAEpG,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC/F,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,CAAC;IACD,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,KAAe,EAAE,GAAkB;IACnF,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,GAAG,CAAC;YAAE,SAAS;QACnD,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAChC,IAAI,CAAC,GAAG;gBAAE,SAAS;YACnB,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC1C,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;gBAC7C,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBAChD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;oBAAE,SAAS;gBAC3B,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,yBAAyB;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;AACnB,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { NodeFileStore } from '@auto-engineer/file-store/node';
2
- export declare function readJsonIfExists(vfs: NodeFileStore, p: string): Promise<Record<string, unknown> | null>;
3
- export declare function exists(vfs: NodeFileStore, p: string): Promise<boolean>;
4
- export declare function typesAlias(pkg: string): string;
5
- export declare function nmRootsForBases(bases: string[], maxUp?: number): string[];
6
- export declare function probeEntryDtsInRoot(vfs: NodeFileStore, nmRoot: string, pkg: string): Promise<string | null>;
7
- export declare function probeEntryDtsForPackagesFromRoots(vfs: NodeFileStore, nmRoots: string[], pkgs: string[]): Promise<string[]>;
8
- //# sourceMappingURL=dts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dts.d.ts","sourceRoot":"","sources":["../../../../src/file-syncer/discovery/dts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAGpE,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAQ7G;AAED,wBAAsB,MAAM,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5E;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM9C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,SAAI,GAAG,MAAM,EAAE,CAYpE;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiBjH;AA6BD,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,MAAM,EAAE,CAAC,CAYnB"}
@@ -1,99 +0,0 @@
1
- import { posix } from '../utils/path.js';
2
- export async function readJsonIfExists(vfs, p) {
3
- try {
4
- const buf = await vfs.read(p);
5
- if (!buf)
6
- return null;
7
- return JSON.parse(new TextDecoder().decode(buf));
8
- }
9
- catch {
10
- return null;
11
- }
12
- }
13
- export async function exists(vfs, p) {
14
- try {
15
- const buf = await vfs.read(p);
16
- return !!buf;
17
- }
18
- catch {
19
- return false;
20
- }
21
- }
22
- export function typesAlias(pkg) {
23
- if (pkg.startsWith('@')) {
24
- const [scope, name] = pkg.split('/');
25
- return `@types/${scope.slice(1)}__${name}`;
26
- }
27
- return `@types/${pkg}`;
28
- }
29
- export function nmRootsForBases(bases, maxUp = 8) {
30
- const roots = new Set();
31
- for (const base of bases) {
32
- let cur = base.replace(/\\/g, '/');
33
- for (let i = 0; i < maxUp; i++) {
34
- roots.add(`${cur}/node_modules`);
35
- const parent = cur.replace(/\/+$/, '').split('/').slice(0, -1).join('/') || '/';
36
- if (parent === cur)
37
- break;
38
- cur = parent;
39
- }
40
- }
41
- return [...roots].map((p) => p.replace(/\/+/g, '/'));
42
- }
43
- export async function probeEntryDtsInRoot(vfs, nmRoot, pkg) {
44
- const pkgDir = `${nmRoot}/${pkg}`.replace(/\/+/g, '/');
45
- const pj = await readJsonIfExists(vfs, `${pkgDir}/package.json`);
46
- if (pj && (typeof pj.types === 'string' || typeof pj.typings === 'string')) {
47
- const rel = String(pj.types ?? pj.typings);
48
- const abs = posix(`${pkgDir}/${rel}`.replace(/\/+/g, '/'));
49
- if (await exists(vfs, abs))
50
- return abs;
51
- }
52
- const idx = posix(`${pkgDir}/index.d.ts`);
53
- if (await exists(vfs, idx))
54
- return idx;
55
- const distIdx = posix(`${pkgDir}/dist/index.d.ts`);
56
- if (await exists(vfs, distIdx))
57
- return distIdx;
58
- return null;
59
- }
60
- function scorePath(p) {
61
- let s = 0;
62
- const pathPosix = p.replace(/\\/g, '/');
63
- if (pathPosix.includes('/server/node_modules/'))
64
- s -= 10;
65
- if (!pathPosix.includes('/.pnpm/'))
66
- s -= 3;
67
- if (pathPosix.includes('/node_modules/'))
68
- s -= 1;
69
- s += pathPosix.length / 1000;
70
- return s;
71
- }
72
- async function findCandidatesForPackage(vfs, nmRoots, pkg) {
73
- const candidates = [];
74
- for (const nm of nmRoots) {
75
- const hit = await probeEntryDtsInRoot(vfs, nm, pkg);
76
- if (hit !== null)
77
- candidates.push(hit);
78
- }
79
- return candidates;
80
- }
81
- async function findCandidatesWithFallback(vfs, nmRoots, pkg) {
82
- const candidates = await findCandidatesForPackage(vfs, nmRoots, pkg);
83
- if (candidates.length > 0)
84
- return candidates;
85
- const alias = typesAlias(pkg);
86
- return findCandidatesForPackage(vfs, nmRoots, alias);
87
- }
88
- export async function probeEntryDtsForPackagesFromRoots(vfs, nmRoots, pkgs) {
89
- const out = new Set();
90
- for (const pkg of pkgs) {
91
- const candidates = await findCandidatesWithFallback(vfs, nmRoots, pkg);
92
- if (candidates.length > 0) {
93
- candidates.sort((a, b) => scorePath(a) - scorePath(b));
94
- out.add(candidates[0]);
95
- }
96
- }
97
- return [...out];
98
- }
99
- //# sourceMappingURL=dts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dts.js","sourceRoot":"","sources":["../../../../src/file-syncer/discovery/dts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAkB,EAAE,CAAS;IAClE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAA4B,CAAC;IAC9E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,GAAkB,EAAE,CAAS;IACxD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,C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UAAU,GAAG,MAAM,0BAA0B,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACvE,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YACvD,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;AAClB,CAAC"}
@@ -1,46 +0,0 @@
1
- import type { Response } from 'express';
2
- import type { WireInitial } from './types/wire';
3
- export interface FileSyncerConfig {
4
- watchDir: string;
5
- projectRoot?: string;
6
- loadAutoConfig?: (configPath: string) => Promise<unknown>;
7
- }
8
- export declare class FileSyncer {
9
- private watchDir;
10
- private projectRoot;
11
- private vfs;
12
- private active;
13
- private watcher?;
14
- private debounce;
15
- private autoConfigDebounce;
16
- private lastComputeTime;
17
- private cachedDesiredSet;
18
- private autoConfigHash;
19
- private autoConfigContent;
20
- private providerEnvHash;
21
- private clients;
22
- private loadAutoConfig?;
23
- constructor(config: FileSyncerConfig);
24
- private broadcast;
25
- addClient(id: string, response: Response): void;
26
- removeClient(id: string): void;
27
- private sendInitialSync;
28
- getInitialFiles(): Promise<WireInitial>;
29
- start(): void;
30
- private handleAutoConfigRemoval;
31
- private shouldUpdateAutoConfig;
32
- private updateAndBroadcastAutoConfig;
33
- handleClientFileChange(msg: {
34
- event: 'write' | 'delete';
35
- path: string;
36
- content?: string;
37
- }): Promise<void>;
38
- stop(): void;
39
- private findAutoConfigFile;
40
- private serializeConfig;
41
- private computeInitialFiles;
42
- }
43
- export { createJWE, type TokenPayload } from './crypto/jwe-encryptor';
44
- export { type ActiveProvider, AIProvider, getActiveProvider, getProviderEnvHash } from './crypto/provider-resolver';
45
- export type { WireChange, WireInitial } from './types/wire';
46
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/file-syncer/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,cAAc,CAAC;AAW5D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3D;AA0BD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,GAAG,CAAgB;IAC3B,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,OAAO,CAAC,CAAqB;IACrC,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,kBAAkB,CAA+B;IACzD,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,gBAAgB,CAA4B;IACpD,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,OAAO,CAA6C;IAC5D,OAAO,CAAC,cAAc,CAAC,CAA2C;gBAEtD,MAAM,EAAE,gBAAgB;IAQpC,OAAO,CAAC,SAAS;IAiBjB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAmB/C,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;YAQhB,eAAe;IAYvB,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC;IAI7C,KAAK,IAAI,IAAI;IAyJb,OAAO,CAAC,uBAAuB;YAWjB,sBAAsB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