@datasynx/agentic-crm 0.1.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 (251) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +767 -0
  3. package/dist/agent-config-zPvcqu07.js +14 -0
  4. package/dist/agent-config-zPvcqu07.js.map +1 -0
  5. package/dist/approvals-DpjxGHFp.js +67 -0
  6. package/dist/approvals-DpjxGHFp.js.map +1 -0
  7. package/dist/ask-CID3jnuL.js +52 -0
  8. package/dist/ask-CID3jnuL.js.map +1 -0
  9. package/dist/audit-log-DNMY9mUZ.js +49 -0
  10. package/dist/audit-log-DNMY9mUZ.js.map +1 -0
  11. package/dist/auth-CyFuu9X_.js +2 -0
  12. package/dist/auth-DFWwWcYD.js +93 -0
  13. package/dist/auth-DFWwWcYD.js.map +1 -0
  14. package/dist/autofill-Di_-SP7t.js +51 -0
  15. package/dist/autofill-Di_-SP7t.js.map +1 -0
  16. package/dist/backup-CeMk9z86.js +417 -0
  17. package/dist/backup-CeMk9z86.js.map +1 -0
  18. package/dist/backup-f_hC7rBV.js +2 -0
  19. package/dist/calendly-Bft_wwji.js +52 -0
  20. package/dist/calendly-Bft_wwji.js.map +1 -0
  21. package/dist/calendly-D3coO92o.cjs +53 -0
  22. package/dist/calendly-D3coO92o.cjs.map +1 -0
  23. package/dist/chunk-DakpK96I.cjs +43 -0
  24. package/dist/churn-C28IgnAj.js +54 -0
  25. package/dist/churn-C28IgnAj.js.map +1 -0
  26. package/dist/cli.js +4396 -0
  27. package/dist/cli.js.map +1 -0
  28. package/dist/colors-BG07TZQz.js +11 -0
  29. package/dist/colors-BG07TZQz.js.map +1 -0
  30. package/dist/compliance-B1kk5-YS.js +115 -0
  31. package/dist/compliance-B1kk5-YS.js.map +1 -0
  32. package/dist/compliance-B91zNvCR.cjs +156 -0
  33. package/dist/compliance-B91zNvCR.cjs.map +1 -0
  34. package/dist/compliance-CKSBoQUe.js +118 -0
  35. package/dist/compliance-CKSBoQUe.js.map +1 -0
  36. package/dist/compliance-CujOqAKk.js +2 -0
  37. package/dist/context-builder-BzWAp3Zs.js +96 -0
  38. package/dist/context-builder-BzWAp3Zs.js.map +1 -0
  39. package/dist/context-builder-DlrRcqmJ.js +2 -0
  40. package/dist/conversation-intel-mm7Lhemh.js +72 -0
  41. package/dist/conversation-intel-mm7Lhemh.js.map +1 -0
  42. package/dist/custom-fields-CzNeD3_v.js +2 -0
  43. package/dist/custom-fields-Pl2t9xzp.js +73 -0
  44. package/dist/custom-fields-Pl2t9xzp.js.map +1 -0
  45. package/dist/custom-objects-BHgn1GEX.js +78 -0
  46. package/dist/custom-objects-BHgn1GEX.js.map +1 -0
  47. package/dist/custom-objects-CIFrmQ2V.js +2 -0
  48. package/dist/customer-dir-DIylZ8Q6.js +75 -0
  49. package/dist/customer-dir-DIylZ8Q6.js.map +1 -0
  50. package/dist/daemon/worker.js +207 -0
  51. package/dist/daemon/worker.js.map +1 -0
  52. package/dist/enrichment-3XvgGDfB.js +103 -0
  53. package/dist/enrichment-3XvgGDfB.js.map +1 -0
  54. package/dist/file-lock-B_zi7NQl.js +22 -0
  55. package/dist/file-lock-B_zi7NQl.js.map +1 -0
  56. package/dist/gmail-auth-BP6cJwfw.js +40 -0
  57. package/dist/gmail-auth-BP6cJwfw.js.map +1 -0
  58. package/dist/gmail-auth-DxakCtGm.cjs +44 -0
  59. package/dist/gmail-auth-DxakCtGm.cjs.map +1 -0
  60. package/dist/gmail-auth-OComS92L.js +40 -0
  61. package/dist/gmail-auth-OComS92L.js.map +1 -0
  62. package/dist/gmail-push-watch-DELQFMPk.js +20 -0
  63. package/dist/gmail-push-watch-DELQFMPk.js.map +1 -0
  64. package/dist/gmail-sender-StTpJ9Ub.js +32 -0
  65. package/dist/gmail-sender-StTpJ9Ub.js.map +1 -0
  66. package/dist/gmail-sync-DIaxInDT.js +204 -0
  67. package/dist/gmail-sync-DIaxInDT.js.map +1 -0
  68. package/dist/gmail-sync-hHm9gaWd.cjs +218 -0
  69. package/dist/gmail-sync-hHm9gaWd.cjs.map +1 -0
  70. package/dist/gmail-sync-rQaVqKWd.js +214 -0
  71. package/dist/gmail-sync-rQaVqKWd.js.map +1 -0
  72. package/dist/gmail-webhook-handler-DS7OlRPX.js +3 -0
  73. package/dist/gmail-webhook-handler-e5Od25FX.js +97 -0
  74. package/dist/gmail-webhook-handler-e5Od25FX.js.map +1 -0
  75. package/dist/goal-engine-CUZSpERI.js +2 -0
  76. package/dist/goal-engine-KpBftn4V.js +295 -0
  77. package/dist/goal-engine-KpBftn4V.js.map +1 -0
  78. package/dist/google-drive-sync-DEPcqFca.js +105 -0
  79. package/dist/google-drive-sync-DEPcqFca.js.map +1 -0
  80. package/dist/hybrid-search-BmHttLrR.js +40 -0
  81. package/dist/hybrid-search-BmHttLrR.js.map +1 -0
  82. package/dist/hygiene-DZqfYpFf.js +38 -0
  83. package/dist/hygiene-DZqfYpFf.js.map +1 -0
  84. package/dist/identity-CI6olMNm.js +41 -0
  85. package/dist/identity-CI6olMNm.js.map +1 -0
  86. package/dist/identity-gyfWdrcX.js +2 -0
  87. package/dist/import-hubspot-BaK71U_K.js +588 -0
  88. package/dist/import-hubspot-BaK71U_K.js.map +1 -0
  89. package/dist/index-V8BFaH-b.d.ts +539 -0
  90. package/dist/index-V8BFaH-b.d.ts.map +1 -0
  91. package/dist/index-YqwMd6aQ.d.cts +538 -0
  92. package/dist/index-YqwMd6aQ.d.cts.map +1 -0
  93. package/dist/index.cjs +185 -0
  94. package/dist/index.cjs.map +1 -0
  95. package/dist/index.d.cts +538 -0
  96. package/dist/index.d.cts.map +1 -0
  97. package/dist/index.d.ts +539 -0
  98. package/dist/index.d.ts.map +1 -0
  99. package/dist/index.js +165 -0
  100. package/dist/index.js.map +1 -0
  101. package/dist/interactions-writer-CrPStUll.cjs +77 -0
  102. package/dist/interactions-writer-CrPStUll.cjs.map +1 -0
  103. package/dist/interactions-writer-DO3KcSR3.js +52 -0
  104. package/dist/interactions-writer-DO3KcSR3.js.map +1 -0
  105. package/dist/interactions-writer-SLHnoEeE.js +46 -0
  106. package/dist/interactions-writer-SLHnoEeE.js.map +1 -0
  107. package/dist/interactions-writer-dSPy1XfO.js +2 -0
  108. package/dist/knowledge-base-D0Fh40kc.js +1013 -0
  109. package/dist/knowledge-base-D0Fh40kc.js.map +1 -0
  110. package/dist/lancedb-CCBbpulq.js +2 -0
  111. package/dist/lancedb-rlvWoPwl.js +98 -0
  112. package/dist/lancedb-rlvWoPwl.js.map +1 -0
  113. package/dist/lead-model-BCFzyktm.js +109 -0
  114. package/dist/lead-model-BCFzyktm.js.map +1 -0
  115. package/dist/llm-DEjWcqmW.js +2 -0
  116. package/dist/llm-DvzZqva0.js +372 -0
  117. package/dist/llm-DvzZqva0.js.map +1 -0
  118. package/dist/llm-Z8RIYkpF.js +174 -0
  119. package/dist/llm-Z8RIYkpF.js.map +1 -0
  120. package/dist/llm-iijeXmgq.cjs +198 -0
  121. package/dist/llm-iijeXmgq.cjs.map +1 -0
  122. package/dist/mcp-CdTJWTJf.d.cts +12 -0
  123. package/dist/mcp-CdTJWTJf.d.cts.map +1 -0
  124. package/dist/mcp-CdTJWTJf.d.ts +12 -0
  125. package/dist/mcp-CdTJWTJf.d.ts.map +1 -0
  126. package/dist/mcp.cjs +7464 -0
  127. package/dist/mcp.cjs.map +1 -0
  128. package/dist/mcp.d.cts +12 -0
  129. package/dist/mcp.d.cts.map +1 -0
  130. package/dist/mcp.d.ts +12 -0
  131. package/dist/mcp.d.ts.map +1 -0
  132. package/dist/mcp.js +7448 -0
  133. package/dist/mcp.js.map +1 -0
  134. package/dist/memory-Bb6ky3kb.js +58 -0
  135. package/dist/memory-Bb6ky3kb.js.map +1 -0
  136. package/dist/memory-Cy6-Tbyl.js +2 -0
  137. package/dist/metrics-DH8wHvya.js +26 -0
  138. package/dist/metrics-DH8wHvya.js.map +1 -0
  139. package/dist/microsoft-auth-B8_S45gh.js +17 -0
  140. package/dist/microsoft-auth-B8_S45gh.js.map +1 -0
  141. package/dist/microsoft-calendar-B6MMtUQK.js +67 -0
  142. package/dist/microsoft-calendar-B6MMtUQK.js.map +1 -0
  143. package/dist/microsoft-sync-CpZVoSuq.js +68 -0
  144. package/dist/microsoft-sync-CpZVoSuq.js.map +1 -0
  145. package/dist/nba-3wanmJ0U.js +48 -0
  146. package/dist/nba-3wanmJ0U.js.map +1 -0
  147. package/dist/notification-dispatcher-0vYNngWe.js +97 -0
  148. package/dist/notification-dispatcher-0vYNngWe.js.map +1 -0
  149. package/dist/opportunity-score-BTMOQSTV.js +47 -0
  150. package/dist/opportunity-score-BTMOQSTV.js.map +1 -0
  151. package/dist/pipedrive-client-CdGKpH9b.js +17 -0
  152. package/dist/pipedrive-client-CdGKpH9b.js.map +1 -0
  153. package/dist/pipeline-writer-BqBrYrQc.js +2 -0
  154. package/dist/pipeline-writer-BvVquKIe.js +96 -0
  155. package/dist/pipeline-writer-BvVquKIe.js.map +1 -0
  156. package/dist/pipeline-writer-N2omexxp.cjs +121 -0
  157. package/dist/pipeline-writer-N2omexxp.cjs.map +1 -0
  158. package/dist/pipeline-writer-eufx_0o1.js +102 -0
  159. package/dist/pipeline-writer-eufx_0o1.js.map +1 -0
  160. package/dist/proactive-agent-BgQXw3ac.js +96 -0
  161. package/dist/proactive-agent-BgQXw3ac.js.map +1 -0
  162. package/dist/proactive-worker-BrLHNhjH.js +229 -0
  163. package/dist/proactive-worker-BrLHNhjH.js.map +1 -0
  164. package/dist/push-manager-CdqIIkuh.js +108 -0
  165. package/dist/push-manager-CdqIIkuh.js.map +1 -0
  166. package/dist/push-manager-CowY-0IK.js +2 -0
  167. package/dist/quote-generator-BfwENXzg.js +133 -0
  168. package/dist/quote-generator-BfwENXzg.js.map +1 -0
  169. package/dist/quote-generator-OhSFsi3x.js +2 -0
  170. package/dist/rbac-C7c8tcES.js +2 -0
  171. package/dist/rbac-CTIktZaC.js +91 -0
  172. package/dist/rbac-CTIktZaC.js.map +1 -0
  173. package/dist/relationship-health-odxEoQdJ.js +454 -0
  174. package/dist/relationship-health-odxEoQdJ.js.map +1 -0
  175. package/dist/revenue-simulation-BJdRTEHc.js +2 -0
  176. package/dist/revenue-simulation-Bqf2DLVB.js +251 -0
  177. package/dist/revenue-simulation-Bqf2DLVB.js.map +1 -0
  178. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  179. package/dist/salesforce-client-rhZFa_p5.js +51 -0
  180. package/dist/salesforce-client-rhZFa_p5.js.map +1 -0
  181. package/dist/segments-BqcD5HIl.js +61 -0
  182. package/dist/segments-BqcD5HIl.js.map +1 -0
  183. package/dist/sequence-engine-CCTHEBgi.js +2 -0
  184. package/dist/sequence-engine-J1lTW_in.js +91 -0
  185. package/dist/sequence-engine-J1lTW_in.js.map +1 -0
  186. package/dist/sequence-store-DaaWr0Os.js +221 -0
  187. package/dist/sequence-store-DaaWr0Os.js.map +1 -0
  188. package/dist/server-Dyva03K8.js +4287 -0
  189. package/dist/server-Dyva03K8.js.map +1 -0
  190. package/dist/session-B9AilxOE.js +81 -0
  191. package/dist/session-B9AilxOE.js.map +1 -0
  192. package/dist/session-D0qFkBla.cjs +82 -0
  193. package/dist/session-D0qFkBla.cjs.map +1 -0
  194. package/dist/session-D9ub6Wl1.js +79 -0
  195. package/dist/session-D9ub6Wl1.js.map +1 -0
  196. package/dist/session-mWHA71Lw.js +2 -0
  197. package/dist/session-store-B0QZE8Bx.cjs +697 -0
  198. package/dist/session-store-B0QZE8Bx.cjs.map +1 -0
  199. package/dist/session-store-C8tEvMPw.js +543 -0
  200. package/dist/session-store-C8tEvMPw.js.map +1 -0
  201. package/dist/session-store-CEa39Dxs.js +15 -0
  202. package/dist/session-store-CEa39Dxs.js.map +1 -0
  203. package/dist/sla-engine-5IhTsBUR.js +2 -0
  204. package/dist/sla-engine-BqX-7u-7.js +53 -0
  205. package/dist/sla-engine-BqX-7u-7.js.map +1 -0
  206. package/dist/sop-DkhVChGy.js +2 -0
  207. package/dist/sop-Vp0UPWFW.js +70 -0
  208. package/dist/sop-Vp0UPWFW.js.map +1 -0
  209. package/dist/survey-engine-C06hcQt3.js +2 -0
  210. package/dist/survey-engine-DBjCYqCv.js +147 -0
  211. package/dist/survey-engine-DBjCYqCv.js.map +1 -0
  212. package/dist/sync-state-ChaLbamC.js +33 -0
  213. package/dist/sync-state-ChaLbamC.js.map +1 -0
  214. package/dist/sync-state-CwLSt_1m.js +2 -0
  215. package/dist/ticket-writer-CjqKeIRD.js +2 -0
  216. package/dist/ticket-writer-j2oX_Wal.js +134 -0
  217. package/dist/ticket-writer-j2oX_Wal.js.map +1 -0
  218. package/dist/tone-Bdm5uaht.js +48 -0
  219. package/dist/tone-Bdm5uaht.js.map +1 -0
  220. package/dist/tone-DRKlZgPr.cjs +43 -0
  221. package/dist/tone-DRKlZgPr.cjs.map +1 -0
  222. package/dist/tone-vNb2DAAD.js +39 -0
  223. package/dist/tone-vNb2DAAD.js.map +1 -0
  224. package/dist/transcript-watcher-CL2QUygI.js +132 -0
  225. package/dist/transcript-watcher-CL2QUygI.js.map +1 -0
  226. package/dist/unmatched-transcripts-BsH5bhkU.js +26 -0
  227. package/dist/unmatched-transcripts-BsH5bhkU.js.map +1 -0
  228. package/dist/unmatched-transcripts-D0PrJ9iz.js +2 -0
  229. package/dist/update-deal-BNwPGaTV.js +2 -0
  230. package/dist/update-deal-DKC79skb.js +91 -0
  231. package/dist/update-deal-DKC79skb.js.map +1 -0
  232. package/dist/usage-CClTf5e6.cjs +57 -0
  233. package/dist/usage-CClTf5e6.cjs.map +1 -0
  234. package/dist/usage-D0-TYJkw.js +93 -0
  235. package/dist/usage-D0-TYJkw.js.map +1 -0
  236. package/dist/usage-D0u9a-lV.js +54 -0
  237. package/dist/usage-D0u9a-lV.js.map +1 -0
  238. package/dist/vault-C1D3zScD.js +2 -0
  239. package/dist/vault-DXCg29W-.js +86 -0
  240. package/dist/vault-DXCg29W-.js.map +1 -0
  241. package/dist/webhooks-7EpA05Qr.js +138 -0
  242. package/dist/webhooks-7EpA05Qr.js.map +1 -0
  243. package/dist/webhooks-BO2UAnmn.js +94 -0
  244. package/dist/webhooks-BO2UAnmn.js.map +1 -0
  245. package/dist/webhooks-Xn6zO6kd.cjs +97 -0
  246. package/dist/webhooks-Xn6zO6kd.cjs.map +1 -0
  247. package/dist/write-queue-BDolUxfs.cjs +26 -0
  248. package/dist/write-queue-BDolUxfs.cjs.map +1 -0
  249. package/dist/write-queue-IbsAjUnh.js +21 -0
  250. package/dist/write-queue-IbsAjUnh.js.map +1 -0
  251. package/package.json +142 -0
@@ -0,0 +1,697 @@
1
+ const require_chunk = require("./chunk-DakpK96I.cjs");
2
+ let commander = require("commander");
3
+ let path = require("path");
4
+ path = require_chunk.__toESM(path, 1);
5
+ let fs = require("fs");
6
+ fs = require_chunk.__toESM(fs, 1);
7
+ let gray_matter = require("gray-matter");
8
+ gray_matter = require_chunk.__toESM(gray_matter, 1);
9
+ let zod_validation_error = require("zod-validation-error");
10
+ let zod = require("zod");
11
+ let ansis = require("ansis");
12
+ ansis = require_chunk.__toESM(ansis, 1);
13
+ let child_process = require("child_process");
14
+ let crypto = require("crypto");
15
+ //#region src/schemas/main-facts.ts
16
+ const MainFactsSchema = zod.z.object({
17
+ name: zod.z.string().min(1),
18
+ domain: zod.z.string().optional(),
19
+ email: zod.z.string().optional(),
20
+ phone: zod.z.string().optional(),
21
+ industry: zod.z.string().optional(),
22
+ relationship_stage: zod.z.enum([
23
+ "prospect",
24
+ "active",
25
+ "churned",
26
+ "paused"
27
+ ]),
28
+ deal_value: zod.z.number().optional(),
29
+ currency: zod.z.string().default("EUR"),
30
+ primary_contact: zod.z.string().optional(),
31
+ timezone: zod.z.string().optional(),
32
+ tags: zod.z.array(zod.z.string()).default([]),
33
+ created: zod.z.preprocess((v) => v instanceof Date ? v.toISOString().slice(0, 10) : v, zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "YYYY-MM-DD required")),
34
+ updated: zod.z.preprocess((v) => v instanceof Date ? v.toISOString().slice(0, 10) : v, zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "YYYY-MM-DD required"))
35
+ });
36
+ //#endregion
37
+ //#region src/fs/customer-dir.ts
38
+ function getCustomerDir(dataDir, slug) {
39
+ return path.default.join(dataDir, "customers", slug);
40
+ }
41
+ function customerExists(dataDir, slug) {
42
+ return fs.default.existsSync(getCustomerDir(dataDir, slug));
43
+ }
44
+ /** List all customer slugs (immediate subdirectories of customers/). */
45
+ function listCustomerSlugs(dataDir) {
46
+ const dir = path.default.join(dataDir, "customers");
47
+ if (!fs.default.existsSync(dir)) return [];
48
+ return fs.default.readdirSync(dir).filter((s) => {
49
+ try {
50
+ return fs.default.statSync(path.default.join(dir, s)).isDirectory();
51
+ } catch {
52
+ return false;
53
+ }
54
+ });
55
+ }
56
+ async function ensureCustomerDir(dataDir, slug) {
57
+ const customerDir = getCustomerDir(dataDir, slug);
58
+ fs.default.mkdirSync(customerDir, { recursive: true });
59
+ fs.default.mkdirSync(path.default.join(customerDir, "attachments"), { recursive: true });
60
+ fs.default.mkdirSync(path.default.join(customerDir, "transcripts"), { recursive: true });
61
+ }
62
+ async function writeMainFacts(dataDir, slug, facts) {
63
+ const filePath = path.default.join(getCustomerDir(dataDir, slug), "main_facts.md");
64
+ const clean = Object.fromEntries(Object.entries(facts).filter(([, v]) => v !== void 0));
65
+ const content = gray_matter.default.stringify("", clean);
66
+ fs.default.writeFileSync(filePath, content, "utf-8");
67
+ }
68
+ async function readMainFacts(dataDir, slug) {
69
+ const filePath = path.default.join(getCustomerDir(dataDir, slug), "main_facts.md");
70
+ if (!fs.default.existsSync(filePath)) throw new Error(`main_facts.md not found for customer '${slug}'`);
71
+ const data = (0, gray_matter.default)(fs.default.readFileSync(filePath, "utf-8")).data;
72
+ for (const key of ["created", "updated"]) if (data[key] instanceof Date) data[key] = data[key].toISOString().slice(0, 10);
73
+ const result = MainFactsSchema.safeParse(data);
74
+ if (!result.success) throw new Error((0, zod_validation_error.fromZodError)(result.error, {
75
+ prefix: `Schema error in ${filePath}`,
76
+ prefixSeparator: ":\n - ",
77
+ issueSeparator: "\n - "
78
+ }).message);
79
+ return result.data;
80
+ }
81
+ //#endregion
82
+ //#region src/ui/colors.ts
83
+ const success = (s) => ansis.default.green(s);
84
+ const error = (s) => ansis.default.red(s);
85
+ const warning = (s) => ansis.default.yellow(s);
86
+ const info = (s) => ansis.default.cyan(s);
87
+ const bold = (s) => ansis.default.bold(s);
88
+ //#endregion
89
+ //#region src/commands/backup.ts
90
+ function getConfigPath(dataDir) {
91
+ return path.default.join(dataDir, ".agentic", "config.json");
92
+ }
93
+ function readAgenticConfig(dataDir) {
94
+ const filePath = getConfigPath(dataDir);
95
+ if (!fs.default.existsSync(filePath)) return {};
96
+ try {
97
+ return JSON.parse(fs.default.readFileSync(filePath, "utf-8"));
98
+ } catch {
99
+ return {};
100
+ }
101
+ }
102
+ function writeAgenticConfig(dataDir, config) {
103
+ const filePath = getConfigPath(dataDir);
104
+ fs.default.mkdirSync(path.default.dirname(filePath), { recursive: true });
105
+ fs.default.writeFileSync(filePath, JSON.stringify(config, null, 2), "utf-8");
106
+ }
107
+ function countDir(dir) {
108
+ let files = 0;
109
+ let bytes = 0;
110
+ if (!fs.default.existsSync(dir)) return {
111
+ files,
112
+ bytes
113
+ };
114
+ const walk = (d) => {
115
+ try {
116
+ for (const entry of fs.default.readdirSync(d)) {
117
+ const full = path.default.join(d, entry);
118
+ try {
119
+ const stat = fs.default.statSync(full);
120
+ if (stat.isDirectory()) walk(full);
121
+ else {
122
+ files++;
123
+ bytes += stat.size;
124
+ }
125
+ } catch {}
126
+ }
127
+ } catch {}
128
+ };
129
+ walk(dir);
130
+ return {
131
+ files,
132
+ bytes
133
+ };
134
+ }
135
+ function countCustomers(dataDir) {
136
+ const dir = path.default.join(dataDir, "customers");
137
+ if (!fs.default.existsSync(dir)) return 0;
138
+ try {
139
+ return fs.default.readdirSync(dir).filter((f) => {
140
+ try {
141
+ return fs.default.statSync(path.default.join(dir, f)).isDirectory();
142
+ } catch {
143
+ return false;
144
+ }
145
+ }).length;
146
+ } catch {
147
+ return 0;
148
+ }
149
+ }
150
+ function sha256File(filePath) {
151
+ if (!fs.default.existsSync(filePath)) return "";
152
+ const hash = (0, crypto.createHash)("sha256");
153
+ hash.update(fs.default.readFileSync(filePath));
154
+ return hash.digest("hex");
155
+ }
156
+ function buildManifest(dataDir, dirs, zipPath, encrypted) {
157
+ let totalFiles = 0;
158
+ let totalBytes = 0;
159
+ for (const d of dirs) {
160
+ const { files, bytes } = countDir(path.default.join(dataDir, d));
161
+ totalFiles += files;
162
+ totalBytes += bytes;
163
+ }
164
+ return {
165
+ version: "1",
166
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
167
+ dxcrmVersion: "0.1.0",
168
+ directories: dirs,
169
+ customerCount: countCustomers(dataDir),
170
+ fileCount: totalFiles,
171
+ totalBytes,
172
+ sha256: sha256File(zipPath),
173
+ encrypted
174
+ };
175
+ }
176
+ function appendBackupLog(dataDir, entry) {
177
+ const logPath = path.default.join(dataDir, ".agentic", "backup-log.json");
178
+ let entries = [];
179
+ if (fs.default.existsSync(logPath)) try {
180
+ entries = JSON.parse(fs.default.readFileSync(logPath, "utf-8"));
181
+ } catch {
182
+ entries = [];
183
+ }
184
+ entries = entries.filter((e) => e.filename !== entry.filename);
185
+ entries.unshift(entry);
186
+ if (entries.length > 100) entries = entries.slice(0, 100);
187
+ fs.default.mkdirSync(path.default.dirname(logPath), { recursive: true });
188
+ fs.default.writeFileSync(logPath, JSON.stringify(entries, null, 2), "utf-8");
189
+ }
190
+ function readBackupLog(dataDir) {
191
+ const logPath = path.default.join(dataDir, ".agentic", "backup-log.json");
192
+ if (!fs.default.existsSync(logPath)) return [];
193
+ try {
194
+ return JSON.parse(fs.default.readFileSync(logPath, "utf-8"));
195
+ } catch {
196
+ return [];
197
+ }
198
+ }
199
+ async function runBackup(output, dataDir, opts = {}) {
200
+ const dir = dataDir ?? process.cwd();
201
+ const customersDir = path.default.join(dir, "customers");
202
+ if (!fs.default.existsSync(customersDir)) {
203
+ console.error(error("✗ No customers directory found."));
204
+ process.exit(1);
205
+ }
206
+ const zipPath = output ?? path.default.join(dir, `dxcrm-backup-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`);
207
+ const includeDirs = ["customers/"];
208
+ if (fs.default.existsSync(path.default.join(dir, ".agentic"))) includeDirs.push(".agentic/");
209
+ try {
210
+ (0, child_process.execSync)(`zip -r "${zipPath}" ${includeDirs.join(" ")}`, { cwd: dir });
211
+ const manifest = buildManifest(dir, includeDirs, zipPath, opts.encrypt ?? false);
212
+ const manifestPath = path.default.join(dir, ".dxcrm-manifest-tmp.json");
213
+ fs.default.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
214
+ try {
215
+ (0, child_process.execSync)(`zip -j "${zipPath}" "${manifestPath}"`, { cwd: dir });
216
+ } catch {}
217
+ fs.default.unlinkSync(manifestPath);
218
+ const verified = verifyBackupFile(zipPath);
219
+ appendBackupLog(dir, {
220
+ filename: path.default.basename(zipPath),
221
+ path: zipPath,
222
+ createdAt: manifest.createdAt,
223
+ sizeBytes: fs.default.existsSync(zipPath) ? fs.default.statSync(zipPath).size : 0,
224
+ verified,
225
+ encrypted: opts.encrypt ?? false,
226
+ customerCount: manifest.customerCount,
227
+ fileCount: manifest.fileCount
228
+ });
229
+ if (opts.remote) await uploadBackup(zipPath, opts.remote);
230
+ console.log(success(`✓ Backup saved: ${zipPath}`));
231
+ console.log(info(` Customers: ${manifest.customerCount} Files: ${manifest.fileCount} Size: ${(manifest.totalBytes / 1024 / 1024).toFixed(1)} MB`));
232
+ if (!verified) console.log(info(" ⚠ Integrity check failed — backup may be incomplete"));
233
+ return manifest;
234
+ } catch (err) {
235
+ console.error(error(`✗ Backup failed: ${err.message}`));
236
+ process.exit(1);
237
+ }
238
+ }
239
+ function verifyBackupFile(zipPath) {
240
+ if (!fs.default.existsSync(zipPath)) return false;
241
+ try {
242
+ (0, child_process.execSync)(`unzip -t "${zipPath}"`, { stdio: "pipe" });
243
+ return true;
244
+ } catch {
245
+ return false;
246
+ }
247
+ }
248
+ async function runVerify(zipPath) {
249
+ if (!fs.default.existsSync(zipPath)) {
250
+ console.error(error(`✗ File not found: ${zipPath}`));
251
+ process.exit(1);
252
+ }
253
+ console.log(info(`Verifying ${path.default.basename(zipPath)}...`));
254
+ if (verifyBackupFile(zipPath)) {
255
+ const size = fs.default.statSync(zipPath).size;
256
+ const sha = sha256File(zipPath);
257
+ console.log(success("✓ ZIP integrity OK"));
258
+ console.log(info(` Size: ${(size / 1024 / 1024).toFixed(1)} MB`));
259
+ console.log(info(` SHA-256: ${sha}`));
260
+ } else {
261
+ console.error(error("✗ Integrity check failed"));
262
+ process.exit(1);
263
+ }
264
+ }
265
+ async function uploadBackup(localPath, remote) {
266
+ if (remote.startsWith("s3://")) try {
267
+ (0, child_process.execSync)(`aws s3 cp "${localPath}" "${remote}${path.default.basename(localPath)}"`, { stdio: "pipe" });
268
+ console.log(info(` ✓ Uploaded to ${remote}${path.default.basename(localPath)}`));
269
+ } catch (err) {
270
+ console.error(error(` ✗ S3 upload failed (install aws-cli or @aws-sdk/client-s3): ${err.message}`));
271
+ }
272
+ else if (remote.startsWith("rsync://")) {
273
+ const dest = remote.replace("rsync://", "");
274
+ try {
275
+ (0, child_process.execSync)(`rsync -az "${localPath}" "${dest}"`, { stdio: "pipe" });
276
+ console.log(info(` ✓ Synced to ${dest}`));
277
+ } catch (err) {
278
+ console.error(error(` ✗ rsync failed: ${err.message}`));
279
+ }
280
+ } else try {
281
+ const destPath = path.default.join(remote, path.default.basename(localPath));
282
+ fs.default.mkdirSync(remote, { recursive: true });
283
+ fs.default.copyFileSync(localPath, destPath);
284
+ console.log(info(` ✓ Copied to ${destPath}`));
285
+ } catch (err) {
286
+ console.error(error(` ✗ Copy failed: ${err.message}`));
287
+ }
288
+ }
289
+ function listBackupsInDir(dir) {
290
+ if (!fs.default.existsSync(dir)) return [];
291
+ try {
292
+ return fs.default.readdirSync(dir).filter((f) => f.match(/^dxcrm-backup-.*\.(zip|dxbak)$/)).map((f) => {
293
+ const fullPath = path.default.join(dir, f);
294
+ const stat = fs.default.statSync(fullPath);
295
+ return {
296
+ filename: f,
297
+ path: fullPath,
298
+ createdAt: stat.mtime.toISOString(),
299
+ sizeBytes: stat.size,
300
+ verified: false,
301
+ encrypted: f.endsWith(".dxbak"),
302
+ customerCount: 0,
303
+ fileCount: 0
304
+ };
305
+ }).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
306
+ } catch {
307
+ return [];
308
+ }
309
+ }
310
+ async function runBackupSchedule(opts, dataDir) {
311
+ const dir = dataDir ?? process.cwd();
312
+ if (opts.clear) {
313
+ const config = readAgenticConfig(dir);
314
+ delete config.backupSchedule;
315
+ writeAgenticConfig(dir, config);
316
+ console.log(success("✓ Backup schedule cleared."));
317
+ return;
318
+ }
319
+ if (!opts.every && !opts.status) {
320
+ console.error(error("✗ --every is required (e.g. --every day)"));
321
+ process.exit(1);
322
+ return;
323
+ }
324
+ if (opts.every) {
325
+ const keep = opts.keep ? parseInt(opts.keep, 10) : 7;
326
+ const config = readAgenticConfig(dir);
327
+ config.backupSchedule = {
328
+ every: opts.every,
329
+ keep,
330
+ ...opts.weekly ? { weekly: parseInt(opts.weekly, 10) } : {},
331
+ ...opts.monthly ? { monthly: parseInt(opts.monthly, 10) } : {},
332
+ ...opts.remote ? { remote: opts.remote } : {},
333
+ lastBackup: null
334
+ };
335
+ writeAgenticConfig(dir, config);
336
+ if (!opts.status) console.log(success(`✓ Backup schedule set: every ${opts.every}, keep ${keep} daily${opts.weekly ? ` / ${opts.weekly} weekly` : ""}${opts.monthly ? ` / ${opts.monthly} monthly` : ""}.`));
337
+ }
338
+ if (opts.status) {
339
+ const sched = readAgenticConfig(dir).backupSchedule;
340
+ if (!sched) console.log(info("No backup schedule configured."));
341
+ else {
342
+ console.log(bold("Backup Schedule:"));
343
+ console.log(` every: ${sched.every}`);
344
+ console.log(` keep: ${sched.keep} daily backups`);
345
+ if (sched.weekly) console.log(` weekly: ${sched.weekly} weekly backups`);
346
+ if (sched.monthly) console.log(` monthly: ${sched.monthly} monthly backups`);
347
+ if (sched.remote) console.log(` remote: ${sched.remote}`);
348
+ console.log(` lastBackup: ${sched.lastBackup ?? "never"}`);
349
+ }
350
+ }
351
+ }
352
+ async function runRestore(zipPath, dataDir) {
353
+ const dir = dataDir ?? process.cwd();
354
+ try {
355
+ (0, child_process.execSync)(`unzip -o "${path.default.resolve(zipPath)}" -d "${dir}"`, { cwd: dir });
356
+ console.log(success("✓ Restore complete."));
357
+ } catch (err) {
358
+ console.error(error(`✗ Restore failed: ${err.message}`));
359
+ process.exit(1);
360
+ }
361
+ }
362
+ /**
363
+ * Restore-drill: verify a backup is actually restorable WITHOUT touching live
364
+ * data — checks integrity (unzip -t) and that the archive contains the expected
365
+ * top-level state (customers/, .agentic/). Returns a report for monitoring.
366
+ */
367
+ async function runRestoreDrill(zipPath, opts = {}) {
368
+ const resolved = path.default.resolve(zipPath);
369
+ if (!fs.default.existsSync(resolved)) {
370
+ if (!opts.silent) console.error(error(`✗ File not found: ${zipPath}`));
371
+ return {
372
+ ok: false,
373
+ verified: false,
374
+ hasCustomers: false,
375
+ hasAgentic: false,
376
+ reason: "not_found"
377
+ };
378
+ }
379
+ const verified = verifyBackupFile(resolved);
380
+ let hasCustomers = false;
381
+ let hasAgentic = false;
382
+ if (verified) try {
383
+ const listing = (0, child_process.execSync)(`unzip -l "${resolved}"`, { stdio: "pipe" }).toString();
384
+ hasCustomers = listing.includes("customers/");
385
+ hasAgentic = listing.includes(".agentic/");
386
+ } catch {}
387
+ const ok = verified && hasCustomers;
388
+ if (!opts.silent) if (ok) console.log(success(`✓ Restore drill OK — integrity verified; customers/${hasAgentic ? " + .agentic/" : ""} present`));
389
+ else console.error(error(`✗ Restore drill failed (verified=${verified}, customers=${hasCustomers})`));
390
+ return {
391
+ ok,
392
+ verified,
393
+ hasCustomers,
394
+ hasAgentic
395
+ };
396
+ }
397
+ const scheduleSubCommand = new commander.Command("schedule").description("Configure automatic backup schedule").option("--every <interval>", "Backup interval (e.g. day)").option("--keep <n>", "Daily backups to keep (default: 7)").option("--weekly <n>", "Weekly backups to keep (e.g. 4)").option("--monthly <n>", "Monthly backups to keep (e.g. 12)").option("--remote <url>", "Remote destination (s3://, rsync://, or local path)").option("--status", "Show current schedule").option("--clear", "Remove backup schedule").action((opts) => runBackupSchedule(opts, process.env["DXCRM_DATA_DIR"] ?? process.cwd()));
398
+ const verifySubCommand = new commander.Command("verify").argument("<path>", "Path to backup zip").description("Verify backup integrity (SHA-256 + zip test)").action((zipPath) => runVerify(zipPath));
399
+ const drillSubCommand = new commander.Command("drill").argument("<path>", "Path to backup zip").description("Restore-drill: verify a backup is restorable without touching live data").action(async (zipPath) => {
400
+ if (!(await runRestoreDrill(zipPath)).ok) process.exitCode = 1;
401
+ });
402
+ const listSubCommand = new commander.Command("list").description("List available backups").action(() => {
403
+ const dir = process.env["DXCRM_DATA_DIR"] ?? process.cwd();
404
+ const entries = readBackupLog(dir);
405
+ const fileEntries = listBackupsInDir(dir);
406
+ const combined = entries.length > 0 ? entries : fileEntries;
407
+ if (combined.length === 0) {
408
+ console.log(info("No backups found."));
409
+ return;
410
+ }
411
+ for (const e of combined) {
412
+ const enc = e.encrypted ? " [encrypted]" : "";
413
+ const ver = e.verified ? " ✓" : "";
414
+ const mb = e.sizeBytes > 0 ? ` ${(e.sizeBytes / 1024 / 1024).toFixed(1)} MB` : "";
415
+ console.log(` ${bold(e.filename)}${enc}${ver}${mb} ${e.createdAt.slice(0, 10)}`);
416
+ }
417
+ });
418
+ const backupCommand = new commander.Command("backup").argument("[output]", "Output path for backup zip").description("Backup customers/ + .agentic/ directories").option("--encrypt", "Encrypt the backup (AES-256-GCM)").option("--remote <url>", "Also upload to remote (s3://, rsync://, or path)").action((output, opts) => {
419
+ runBackup(output, process.env["DXCRM_DATA_DIR"] ?? process.cwd(), opts ?? {});
420
+ });
421
+ backupCommand.addCommand(scheduleSubCommand);
422
+ backupCommand.addCommand(verifySubCommand);
423
+ backupCommand.addCommand(drillSubCommand);
424
+ backupCommand.addCommand(listSubCommand);
425
+ new commander.Command("restore").argument("<path>", "Path to backup zip").description("Restore from backup zip").action((zipPath) => runRestore(zipPath, process.env["DXCRM_DATA_DIR"] ?? process.cwd()));
426
+ //#endregion
427
+ //#region src/fs/audit-log.ts
428
+ const AUDIT_LOG_PATH = ".agentic/audit.log";
429
+ function getActor() {
430
+ const actor = process.env["DXCRM_ACTOR"];
431
+ return actor && actor.trim().length > 0 ? actor.trim() : "system";
432
+ }
433
+ function writeAuditEntry(dataDir, entry) {
434
+ const logPath = path.default.join(dataDir, AUDIT_LOG_PATH);
435
+ const logDir = path.default.dirname(logPath);
436
+ if (!fs.default.existsSync(logDir)) fs.default.mkdirSync(logDir, { recursive: true });
437
+ const truncatedSummary = entry.summary.slice(0, 120);
438
+ const line = `${entry.timestamp} | ${entry.actor} | ${entry.tool} | ${entry.slug} | ${truncatedSummary}\n`;
439
+ fs.default.appendFileSync(logPath, line, "utf-8");
440
+ }
441
+ function readAuditLog(dataDir) {
442
+ const logPath = path.default.join(dataDir, AUDIT_LOG_PATH);
443
+ if (!fs.default.existsSync(logPath)) return [];
444
+ const lines = fs.default.readFileSync(logPath, "utf-8").split("\n");
445
+ const entries = [];
446
+ for (const line of lines) {
447
+ const trimmed = line.trim();
448
+ if (!trimmed) continue;
449
+ const parts = trimmed.split(" | ");
450
+ if (parts.length < 5) continue;
451
+ const [timestamp, actor, tool, slug, ...summaryParts] = parts;
452
+ const summary = summaryParts.join(" | ");
453
+ if (timestamp && actor && tool && slug) entries.push({
454
+ timestamp,
455
+ actor,
456
+ tool,
457
+ slug,
458
+ summary: summary ?? ""
459
+ });
460
+ }
461
+ return entries;
462
+ }
463
+ function filterAuditLog(entries, opts) {
464
+ let filtered = entries;
465
+ if (opts.slug !== void 0) filtered = filtered.filter((e) => e.slug === opts.slug);
466
+ if (opts.actor !== void 0) filtered = filtered.filter((e) => e.actor === opts.actor);
467
+ if (opts.limit !== void 0) filtered = filtered.slice(-opts.limit);
468
+ return filtered;
469
+ }
470
+ //#endregion
471
+ //#region src/core/rbac.ts
472
+ const ALLOWED_TOOLS = {
473
+ admin: [
474
+ "log_interaction",
475
+ "update_deal",
476
+ "update_customer_facts",
477
+ "export_customer",
478
+ "pursue_goal",
479
+ "register_push_subscription",
480
+ "define_custom_object",
481
+ "create_record"
482
+ ],
483
+ manager: [
484
+ "log_interaction",
485
+ "update_deal",
486
+ "pursue_goal",
487
+ "create_record"
488
+ ],
489
+ rep: [
490
+ "log_interaction",
491
+ "update_deal",
492
+ "create_record"
493
+ ]
494
+ };
495
+ function rbacPath(dataDir) {
496
+ return path.default.join(dataDir, ".agentic", "rbac.json");
497
+ }
498
+ function getRbacConfig(dataDir) {
499
+ const p = rbacPath(dataDir);
500
+ if (!fs.default.existsSync(p)) return { actors: {} };
501
+ try {
502
+ return JSON.parse(fs.default.readFileSync(p, "utf-8"));
503
+ } catch {
504
+ return { actors: {} };
505
+ }
506
+ }
507
+ function getRole(dataDir, actor) {
508
+ const config = getRbacConfig(dataDir);
509
+ return config.actors[actor] ?? config.default ?? "rep";
510
+ }
511
+ function canWrite(role, tool) {
512
+ return ALLOWED_TOOLS[role]?.includes(tool) ?? false;
513
+ }
514
+ function assertCanWrite(role, tool, actor) {
515
+ if (!canWrite(role, tool)) throw new Error(`Access denied: '${actor}' (role: ${role}) cannot use tool '${tool}'`);
516
+ }
517
+ function enforceRbac(dataDir, tool) {
518
+ if (!fs.default.existsSync(rbacPath(dataDir))) return;
519
+ const actor = process.env["DXCRM_ACTOR"] ?? "system";
520
+ if (actor === "system") return;
521
+ assertCanWrite(getRole(dataDir, actor), tool, actor);
522
+ }
523
+ function canSeeCustomer(dataDir, actor, slug) {
524
+ if (!fs.default.existsSync(rbacPath(dataDir))) return true;
525
+ if (actor === "system") return true;
526
+ const config = getRbacConfig(dataDir);
527
+ const role = config.actors[actor] ?? config.default ?? "rep";
528
+ if (role === "admin" || role === "manager") return true;
529
+ const owned = config.owned_customers;
530
+ if (!owned) return false;
531
+ return (owned[actor] ?? []).includes(slug);
532
+ }
533
+ //#endregion
534
+ //#region src/core/session-store.ts
535
+ let activeSession = null;
536
+ function setSession(s) {
537
+ activeSession = s;
538
+ }
539
+ function getSession() {
540
+ return activeSession;
541
+ }
542
+ function clearSession() {
543
+ activeSession = null;
544
+ }
545
+ //#endregion
546
+ Object.defineProperty(exports, "MainFactsSchema", {
547
+ enumerable: true,
548
+ get: function() {
549
+ return MainFactsSchema;
550
+ }
551
+ });
552
+ Object.defineProperty(exports, "bold", {
553
+ enumerable: true,
554
+ get: function() {
555
+ return bold;
556
+ }
557
+ });
558
+ Object.defineProperty(exports, "canSeeCustomer", {
559
+ enumerable: true,
560
+ get: function() {
561
+ return canSeeCustomer;
562
+ }
563
+ });
564
+ Object.defineProperty(exports, "clearSession", {
565
+ enumerable: true,
566
+ get: function() {
567
+ return clearSession;
568
+ }
569
+ });
570
+ Object.defineProperty(exports, "customerExists", {
571
+ enumerable: true,
572
+ get: function() {
573
+ return customerExists;
574
+ }
575
+ });
576
+ Object.defineProperty(exports, "enforceRbac", {
577
+ enumerable: true,
578
+ get: function() {
579
+ return enforceRbac;
580
+ }
581
+ });
582
+ Object.defineProperty(exports, "ensureCustomerDir", {
583
+ enumerable: true,
584
+ get: function() {
585
+ return ensureCustomerDir;
586
+ }
587
+ });
588
+ Object.defineProperty(exports, "error", {
589
+ enumerable: true,
590
+ get: function() {
591
+ return error;
592
+ }
593
+ });
594
+ Object.defineProperty(exports, "filterAuditLog", {
595
+ enumerable: true,
596
+ get: function() {
597
+ return filterAuditLog;
598
+ }
599
+ });
600
+ Object.defineProperty(exports, "getActor", {
601
+ enumerable: true,
602
+ get: function() {
603
+ return getActor;
604
+ }
605
+ });
606
+ Object.defineProperty(exports, "getRbacConfig", {
607
+ enumerable: true,
608
+ get: function() {
609
+ return getRbacConfig;
610
+ }
611
+ });
612
+ Object.defineProperty(exports, "getRole", {
613
+ enumerable: true,
614
+ get: function() {
615
+ return getRole;
616
+ }
617
+ });
618
+ Object.defineProperty(exports, "getSession", {
619
+ enumerable: true,
620
+ get: function() {
621
+ return getSession;
622
+ }
623
+ });
624
+ Object.defineProperty(exports, "info", {
625
+ enumerable: true,
626
+ get: function() {
627
+ return info;
628
+ }
629
+ });
630
+ Object.defineProperty(exports, "listBackupsInDir", {
631
+ enumerable: true,
632
+ get: function() {
633
+ return listBackupsInDir;
634
+ }
635
+ });
636
+ Object.defineProperty(exports, "listCustomerSlugs", {
637
+ enumerable: true,
638
+ get: function() {
639
+ return listCustomerSlugs;
640
+ }
641
+ });
642
+ Object.defineProperty(exports, "readAuditLog", {
643
+ enumerable: true,
644
+ get: function() {
645
+ return readAuditLog;
646
+ }
647
+ });
648
+ Object.defineProperty(exports, "readBackupLog", {
649
+ enumerable: true,
650
+ get: function() {
651
+ return readBackupLog;
652
+ }
653
+ });
654
+ Object.defineProperty(exports, "readMainFacts", {
655
+ enumerable: true,
656
+ get: function() {
657
+ return readMainFacts;
658
+ }
659
+ });
660
+ Object.defineProperty(exports, "runBackup", {
661
+ enumerable: true,
662
+ get: function() {
663
+ return runBackup;
664
+ }
665
+ });
666
+ Object.defineProperty(exports, "setSession", {
667
+ enumerable: true,
668
+ get: function() {
669
+ return setSession;
670
+ }
671
+ });
672
+ Object.defineProperty(exports, "success", {
673
+ enumerable: true,
674
+ get: function() {
675
+ return success;
676
+ }
677
+ });
678
+ Object.defineProperty(exports, "warning", {
679
+ enumerable: true,
680
+ get: function() {
681
+ return warning;
682
+ }
683
+ });
684
+ Object.defineProperty(exports, "writeAuditEntry", {
685
+ enumerable: true,
686
+ get: function() {
687
+ return writeAuditEntry;
688
+ }
689
+ });
690
+ Object.defineProperty(exports, "writeMainFacts", {
691
+ enumerable: true,
692
+ get: function() {
693
+ return writeMainFacts;
694
+ }
695
+ });
696
+
697
+ //# sourceMappingURL=session-store-B0QZE8Bx.cjs.map