@fleox-agent-crm/agentcrm 0.0.0-stage → 0.3.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.
- package/LICENSE +143 -0
- package/README.md +223 -2
- package/changelog.json +57 -0
- package/dist/admin/admin-files.json +26 -0
- package/dist/admin/assets/chartsImpl-CE2akJat.js +91 -0
- package/dist/admin/assets/firebase-BHSUggRo.js +2 -0
- package/dist/admin/assets/gitJson-BulGh2KV.js +3 -0
- package/dist/admin/assets/index-DidVVK7L.js +1181 -0
- package/dist/admin/assets/index-hMXwHSvN.css +1 -0
- package/dist/admin/assets/index.esm-BFc7vwnl.js +400 -0
- package/dist/admin/assets/index.esm-CtEQZRb1.js +1651 -0
- package/dist/admin/assets/index.esm-Dum0J07z.js +16 -0
- package/dist/admin/assets/index.esm2017-EOzKbpUS.js +390 -0
- package/dist/admin/assets/lucide-react.min-DEDlHCPj.js +6 -0
- package/dist/admin/assets/sdk-CnrLnlRo.js +1717 -0
- package/dist/admin/config.js +3 -0
- package/dist/admin/favicon.svg +1 -0
- package/dist/admin/index.html +139 -0
- package/dist/admin/runtime/agentcrm-runtime.js +104 -0
- package/dist/admin/runtime/lucide-react.js +791 -0
- package/dist/admin/runtime/react-dom-client.js +17 -0
- package/dist/admin/runtime/react-dom.js +20 -0
- package/dist/admin/runtime/react-i18next.js +19 -0
- package/dist/admin/runtime/react-jsx-runtime.js +17 -0
- package/dist/admin/runtime/react.js +22 -0
- package/dist/agent/agentcrm.mjs +3932 -0
- package/dist/agent/chunks/_commonjsHelpers-ClciMIcB.mjs +14 -0
- package/dist/agent/chunks/activities-Cj_SIOay.mjs +227 -0
- package/dist/agent/chunks/api-B6OqNVWp.mjs +97 -0
- package/dist/agent/chunks/appearance-BaShelzt.mjs +174 -0
- package/dist/agent/chunks/automations-BWrvLqP6.mjs +698 -0
- package/dist/agent/chunks/backup-ClSmxmFZ.mjs +103 -0
- package/dist/agent/chunks/batch-CVETiJj5.mjs +142 -0
- package/dist/agent/chunks/compact-CsFPaAAq.mjs +69 -0
- package/dist/agent/chunks/context-CxFfqS4D.mjs +65 -0
- package/dist/agent/chunks/core-Dy7vY9H6.mjs +255 -0
- package/dist/agent/chunks/dedupe-BepmsaHv.mjs +123 -0
- package/dist/agent/chunks/encoding-C9MzdP95.mjs +36 -0
- package/dist/agent/chunks/exportCsv-B5hRvkNm.mjs +95 -0
- package/dist/agent/chunks/extCheck--7lmVvl7.mjs +193 -0
- package/dist/agent/chunks/extPackage-BGl5Oqs8.mjs +115 -0
- package/dist/agent/chunks/extScaffold-DqxI7R1e.mjs +320 -0
- package/dist/agent/chunks/extensionActions-D2HtpQz4.mjs +48 -0
- package/dist/agent/chunks/extensions-BP1k60md.mjs +151 -0
- package/dist/agent/chunks/featureRegistry-C9nbVShp.mjs +149 -0
- package/dist/agent/chunks/fields-B0bitgmr.mjs +476 -0
- package/dist/agent/chunks/files-CjsPJSR6.mjs +158 -0
- package/dist/agent/chunks/files-q8Xu5bft.mjs +367 -0
- package/dist/agent/chunks/firebase-DxGVQV9E.mjs +454 -0
- package/dist/agent/chunks/firebaseRules-iori-s7U.mjs +221 -0
- package/dist/agent/chunks/forms-BKU5F9WF.mjs +847 -0
- package/dist/agent/chunks/gitJson-fjr8mcHe.mjs +528 -0
- package/dist/agent/chunks/hosting-Bme7LxPc.mjs +144 -0
- package/dist/agent/chunks/http-Bk9ICb7I.mjs +127 -0
- package/dist/agent/chunks/ids-CvnmrMJX.mjs +59 -0
- package/dist/agent/chunks/ids-u-noYcy5.mjs +14 -0
- package/dist/agent/chunks/importCsv-DmE_sBch.mjs +334 -0
- package/dist/agent/chunks/index-B-4W0-P4.mjs +535 -0
- package/dist/agent/chunks/index-BM8qeGOb.mjs +2489 -0
- package/dist/agent/chunks/index-Bnmav-Oh.mjs +311 -0
- package/dist/agent/chunks/index-CRkw3_iF.mjs +147 -0
- package/dist/agent/chunks/index-CWrrF1wl.mjs +111 -0
- package/dist/agent/chunks/index-DUSdTBkz.mjs +2988 -0
- package/dist/agent/chunks/index-RCmo-uld.mjs +26 -0
- package/dist/agent/chunks/index-w03ReRs4.mjs +9780 -0
- package/dist/agent/chunks/install-CpHoUFtL.mjs +188 -0
- package/dist/agent/chunks/jsx-runtime-Ca2uwGDr.mjs +76 -0
- package/dist/agent/chunks/loader-C9nm3iwx.mjs +184 -0
- package/dist/agent/chunks/lucide-react.min-Bt3gtepY.mjs +64 -0
- package/dist/agent/chunks/memory-WNR3VHUJ.mjs +56 -0
- package/dist/agent/chunks/migrate-CsClnnN8.mjs +182 -0
- package/dist/agent/chunks/modules-CqdVQVJb.mjs +177 -0
- package/dist/agent/chunks/nodeImport-BPCt5uMu.mjs +38 -0
- package/dist/agent/chunks/package-DWbn3t2R.mjs +194 -0
- package/dist/agent/chunks/papaparse-DjBYnQM2.mjs +1285 -0
- package/dist/agent/chunks/pipelines-DCdRBNBV.mjs +234 -0
- package/dist/agent/chunks/plan-C0TBrU92.mjs +254 -0
- package/dist/agent/chunks/pluginRegistry-DyHtlkcr.mjs +83 -0
- package/dist/agent/chunks/query-C5nJB_3C.mjs +192 -0
- package/dist/agent/chunks/records-DoqiT9xR.mjs +2191 -0
- package/dist/agent/chunks/registry-Ceexawxl.mjs +182 -0
- package/dist/agent/chunks/registry-DijAKZ24.mjs +431 -0
- package/dist/agent/chunks/relations-B9TynBmA.mjs +191 -0
- package/dist/agent/chunks/reports-BB59N6ke.mjs +189 -0
- package/dist/agent/chunks/runtime-DHo7ZEEO.mjs +14852 -0
- package/dist/agent/chunks/runtimeConfig-CCOFg1RM.mjs +250 -0
- package/dist/agent/chunks/s3-Dz50-NuA.mjs +903 -0
- package/dist/agent/chunks/schema-7-4-qtSS.mjs +203 -0
- package/dist/agent/chunks/schema-DlHt2PxI.mjs +367 -0
- package/dist/agent/chunks/sdk-whvfg786.mjs +43644 -0
- package/dist/agent/chunks/seed-CugPGYZL.mjs +523 -0
- package/dist/agent/chunks/server-ISwlDRCN.mjs +242 -0
- package/dist/agent/chunks/settings-BtvR_jdm.mjs +76 -0
- package/dist/agent/chunks/standardObjects-CheqfDqa.mjs +243 -0
- package/dist/agent/chunks/stats-CfeJssSS.mjs +51 -0
- package/dist/agent/chunks/store-5gqRSKXg.mjs +122 -0
- package/dist/agent/chunks/themes-DPZFv3yc.mjs +43 -0
- package/dist/agent/chunks/tools-Bew8lxKx.mjs +844 -0
- package/dist/agent/chunks/types-BOy9PUl7.mjs +44 -0
- package/dist/agent/chunks/users-DI1BvS0f.mjs +107 -0
- package/dist/agent/chunks/utils-DmI8FtXP.mjs +83 -0
- package/dist/agent/chunks/views-fO_BM5U_.mjs +109 -0
- package/dist/version.json +7 -0
- package/package.json +97 -4
- package/plugin/.claude-plugin/plugin.json +17 -0
- package/plugin/skills/agentcrm-admin/SKILL.md +191 -0
- package/plugin/skills/agentcrm-admin/references/appearance.md +26 -0
- package/plugin/skills/agentcrm-admin/references/import.md +16 -0
- package/plugin/skills/agentcrm-admin/references/records.md +30 -0
- package/plugin/skills/agentcrm-admin/references/schema.md +59 -0
- package/plugin/skills/agentcrm-extensions/SKILL.md +93 -0
- package/plugin/skills/agentcrm-extensions/references/module-recipes.md +213 -0
- package/plugin/skills/agentcrm-extensions/references/runtime-api.md +41 -0
- package/plugin/skills/agentcrm-extensions/references/testing.md +76 -0
- package/plugin/skills/agentcrm-extensions/references/theme-recipes.md +65 -0
- package/plugin/skills/agentcrm-install/SKILL.md +116 -0
- package/plugin/skills/agentcrm-install/references/firebase.md +18 -0
- package/plugin/skills/agentcrm-install/references/github.md +20 -0
- package/plugin/skills/agentcrm-install/references/mcp.md +17 -0
- package/plugin/skills/agentcrm-install/references/plans.md +45 -0
- package/plugin/skills/agentcrm-install/references/s3.md +24 -0
- package/plugin/skills/agentcrm-manage/SKILL.md +108 -0
- package/plugin/skills/agentcrm-manage/references/cron.md +11 -0
- package/plugin/skills/agentcrm-manage/references/doctor.md +18 -0
- package/plugin/skills/agentcrm-sales/SKILL.md +92 -0
- package/plugin/skills/agentcrm-sales/references/enrichment.md +13 -0
- package/plugin/skills/agentcrm-sales/references/playbooks.md +29 -0
- package/plugin/skills/agentcrm-sales/references/weekly-report.md +27 -0
- package/types/agentcrm-runtime.d.ts +894 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { createRequire as __acrmRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __acrmPath } from "node:url";
|
|
3
|
+
import { dirname as __acrmDirname } from "node:path";
|
|
4
|
+
const require2 = __acrmRequire(import.meta.url);
|
|
5
|
+
const __filename = __acrmPath(import.meta.url);
|
|
6
|
+
const __dirname = __acrmDirname(__filename);
|
|
7
|
+
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-ClciMIcB.mjs";
|
|
8
|
+
function _mergeNamespaces(n, m) {
|
|
9
|
+
for (var i = 0; i < m.length; i++) {
|
|
10
|
+
const e = m[i];
|
|
11
|
+
if (typeof e !== "string" && !Array.isArray(e)) {
|
|
12
|
+
for (const k in e) {
|
|
13
|
+
if (k !== "default" && !(k in n)) {
|
|
14
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
if (d) {
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: () => e[k]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
|
|
26
|
+
}
|
|
27
|
+
var react = { exports: {} };
|
|
28
|
+
var react_production_min = {};
|
|
29
|
+
/**
|
|
30
|
+
* @license React
|
|
31
|
+
* react.production.min.js
|
|
32
|
+
*
|
|
33
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the MIT license found in the
|
|
36
|
+
* LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/
|
|
38
|
+
var hasRequiredReact_production_min;
|
|
39
|
+
function requireReact_production_min() {
|
|
40
|
+
if (hasRequiredReact_production_min) return react_production_min;
|
|
41
|
+
hasRequiredReact_production_min = 1;
|
|
42
|
+
var l = Symbol.for("react.element"), n = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), u = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), x = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), z = Symbol.iterator;
|
|
43
|
+
function A(a) {
|
|
44
|
+
if (null === a || "object" !== typeof a) return null;
|
|
45
|
+
a = z && a[z] || a["@@iterator"];
|
|
46
|
+
return "function" === typeof a ? a : null;
|
|
47
|
+
}
|
|
48
|
+
var B = { isMounted: function() {
|
|
49
|
+
return false;
|
|
50
|
+
}, enqueueForceUpdate: function() {
|
|
51
|
+
}, enqueueReplaceState: function() {
|
|
52
|
+
}, enqueueSetState: function() {
|
|
53
|
+
} }, C = Object.assign, D = {};
|
|
54
|
+
function E(a, b, e) {
|
|
55
|
+
this.props = a;
|
|
56
|
+
this.context = b;
|
|
57
|
+
this.refs = D;
|
|
58
|
+
this.updater = e || B;
|
|
59
|
+
}
|
|
60
|
+
E.prototype.isReactComponent = {};
|
|
61
|
+
E.prototype.setState = function(a, b) {
|
|
62
|
+
if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
63
|
+
this.updater.enqueueSetState(this, a, b, "setState");
|
|
64
|
+
};
|
|
65
|
+
E.prototype.forceUpdate = function(a) {
|
|
66
|
+
this.updater.enqueueForceUpdate(this, a, "forceUpdate");
|
|
67
|
+
};
|
|
68
|
+
function F() {
|
|
69
|
+
}
|
|
70
|
+
F.prototype = E.prototype;
|
|
71
|
+
function G(a, b, e) {
|
|
72
|
+
this.props = a;
|
|
73
|
+
this.context = b;
|
|
74
|
+
this.refs = D;
|
|
75
|
+
this.updater = e || B;
|
|
76
|
+
}
|
|
77
|
+
var H = G.prototype = new F();
|
|
78
|
+
H.constructor = G;
|
|
79
|
+
C(H, E.prototype);
|
|
80
|
+
H.isPureReactComponent = true;
|
|
81
|
+
var I = Array.isArray, J = Object.prototype.hasOwnProperty, K = { current: null }, L = { key: true, ref: true, __self: true, __source: true };
|
|
82
|
+
function M(a, b, e) {
|
|
83
|
+
var d, c = {}, k = null, h = null;
|
|
84
|
+
if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]);
|
|
85
|
+
var g = arguments.length - 2;
|
|
86
|
+
if (1 === g) c.children = e;
|
|
87
|
+
else if (1 < g) {
|
|
88
|
+
for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2];
|
|
89
|
+
c.children = f;
|
|
90
|
+
}
|
|
91
|
+
if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]);
|
|
92
|
+
return { $$typeof: l, type: a, key: k, ref: h, props: c, _owner: K.current };
|
|
93
|
+
}
|
|
94
|
+
function N(a, b) {
|
|
95
|
+
return { $$typeof: l, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner };
|
|
96
|
+
}
|
|
97
|
+
function O(a) {
|
|
98
|
+
return "object" === typeof a && null !== a && a.$$typeof === l;
|
|
99
|
+
}
|
|
100
|
+
function escape(a) {
|
|
101
|
+
var b = { "=": "=0", ":": "=2" };
|
|
102
|
+
return "$" + a.replace(/[=:]/g, function(a2) {
|
|
103
|
+
return b[a2];
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
var P = /\/+/g;
|
|
107
|
+
function Q(a, b) {
|
|
108
|
+
return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
|
|
109
|
+
}
|
|
110
|
+
function R(a, b, e, d, c) {
|
|
111
|
+
var k = typeof a;
|
|
112
|
+
if ("undefined" === k || "boolean" === k) a = null;
|
|
113
|
+
var h = false;
|
|
114
|
+
if (null === a) h = true;
|
|
115
|
+
else switch (k) {
|
|
116
|
+
case "string":
|
|
117
|
+
case "number":
|
|
118
|
+
h = true;
|
|
119
|
+
break;
|
|
120
|
+
case "object":
|
|
121
|
+
switch (a.$$typeof) {
|
|
122
|
+
case l:
|
|
123
|
+
case n:
|
|
124
|
+
h = true;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (h) return h = a, c = c(h), a = "" === d ? "." + Q(h, 0) : d, I(c) ? (e = "", null != a && (e = a.replace(P, "$&/") + "/"), R(c, b, e, "", function(a2) {
|
|
128
|
+
return a2;
|
|
129
|
+
})) : null != c && (O(c) && (c = N(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P, "$&/") + "/") + a)), b.push(c)), 1;
|
|
130
|
+
h = 0;
|
|
131
|
+
d = "" === d ? "." : d + ":";
|
|
132
|
+
if (I(a)) for (var g = 0; g < a.length; g++) {
|
|
133
|
+
k = a[g];
|
|
134
|
+
var f = d + Q(k, g);
|
|
135
|
+
h += R(k, b, e, f, c);
|
|
136
|
+
}
|
|
137
|
+
else if (f = A(a), "function" === typeof f) for (a = f.call(a), g = 0; !(k = a.next()).done; ) k = k.value, f = d + Q(k, g++), h += R(k, b, e, f, c);
|
|
138
|
+
else if ("object" === k) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead.");
|
|
139
|
+
return h;
|
|
140
|
+
}
|
|
141
|
+
function S(a, b, e) {
|
|
142
|
+
if (null == a) return a;
|
|
143
|
+
var d = [], c = 0;
|
|
144
|
+
R(a, d, "", "", function(a2) {
|
|
145
|
+
return b.call(e, a2, c++);
|
|
146
|
+
});
|
|
147
|
+
return d;
|
|
148
|
+
}
|
|
149
|
+
function T(a) {
|
|
150
|
+
if (-1 === a._status) {
|
|
151
|
+
var b = a._result;
|
|
152
|
+
b = b();
|
|
153
|
+
b.then(function(b2) {
|
|
154
|
+
if (0 === a._status || -1 === a._status) a._status = 1, a._result = b2;
|
|
155
|
+
}, function(b2) {
|
|
156
|
+
if (0 === a._status || -1 === a._status) a._status = 2, a._result = b2;
|
|
157
|
+
});
|
|
158
|
+
-1 === a._status && (a._status = 0, a._result = b);
|
|
159
|
+
}
|
|
160
|
+
if (1 === a._status) return a._result.default;
|
|
161
|
+
throw a._result;
|
|
162
|
+
}
|
|
163
|
+
var U = { current: null }, V = { transition: null }, W = { ReactCurrentDispatcher: U, ReactCurrentBatchConfig: V, ReactCurrentOwner: K };
|
|
164
|
+
function X() {
|
|
165
|
+
throw Error("act(...) is not supported in production builds of React.");
|
|
166
|
+
}
|
|
167
|
+
react_production_min.Children = { map: S, forEach: function(a, b, e) {
|
|
168
|
+
S(a, function() {
|
|
169
|
+
b.apply(this, arguments);
|
|
170
|
+
}, e);
|
|
171
|
+
}, count: function(a) {
|
|
172
|
+
var b = 0;
|
|
173
|
+
S(a, function() {
|
|
174
|
+
b++;
|
|
175
|
+
});
|
|
176
|
+
return b;
|
|
177
|
+
}, toArray: function(a) {
|
|
178
|
+
return S(a, function(a2) {
|
|
179
|
+
return a2;
|
|
180
|
+
}) || [];
|
|
181
|
+
}, only: function(a) {
|
|
182
|
+
if (!O(a)) throw Error("React.Children.only expected to receive a single React element child.");
|
|
183
|
+
return a;
|
|
184
|
+
} };
|
|
185
|
+
react_production_min.Component = E;
|
|
186
|
+
react_production_min.Fragment = p;
|
|
187
|
+
react_production_min.Profiler = r;
|
|
188
|
+
react_production_min.PureComponent = G;
|
|
189
|
+
react_production_min.StrictMode = q;
|
|
190
|
+
react_production_min.Suspense = w;
|
|
191
|
+
react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
|
|
192
|
+
react_production_min.act = X;
|
|
193
|
+
react_production_min.cloneElement = function(a, b, e) {
|
|
194
|
+
if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
|
|
195
|
+
var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner;
|
|
196
|
+
if (null != b) {
|
|
197
|
+
void 0 !== b.ref && (k = b.ref, h = K.current);
|
|
198
|
+
void 0 !== b.key && (c = "" + b.key);
|
|
199
|
+
if (a.type && a.type.defaultProps) var g = a.type.defaultProps;
|
|
200
|
+
for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
|
|
201
|
+
}
|
|
202
|
+
var f = arguments.length - 2;
|
|
203
|
+
if (1 === f) d.children = e;
|
|
204
|
+
else if (1 < f) {
|
|
205
|
+
g = Array(f);
|
|
206
|
+
for (var m = 0; m < f; m++) g[m] = arguments[m + 2];
|
|
207
|
+
d.children = g;
|
|
208
|
+
}
|
|
209
|
+
return { $$typeof: l, type: a.type, key: c, ref: k, props: d, _owner: h };
|
|
210
|
+
};
|
|
211
|
+
react_production_min.createContext = function(a) {
|
|
212
|
+
a = { $$typeof: u, _currentValue: a, _currentValue2: a, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null };
|
|
213
|
+
a.Provider = { $$typeof: t, _context: a };
|
|
214
|
+
return a.Consumer = a;
|
|
215
|
+
};
|
|
216
|
+
react_production_min.createElement = M;
|
|
217
|
+
react_production_min.createFactory = function(a) {
|
|
218
|
+
var b = M.bind(null, a);
|
|
219
|
+
b.type = a;
|
|
220
|
+
return b;
|
|
221
|
+
};
|
|
222
|
+
react_production_min.createRef = function() {
|
|
223
|
+
return { current: null };
|
|
224
|
+
};
|
|
225
|
+
react_production_min.forwardRef = function(a) {
|
|
226
|
+
return { $$typeof: v, render: a };
|
|
227
|
+
};
|
|
228
|
+
react_production_min.isValidElement = O;
|
|
229
|
+
react_production_min.lazy = function(a) {
|
|
230
|
+
return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T };
|
|
231
|
+
};
|
|
232
|
+
react_production_min.memo = function(a, b) {
|
|
233
|
+
return { $$typeof: x, type: a, compare: void 0 === b ? null : b };
|
|
234
|
+
};
|
|
235
|
+
react_production_min.startTransition = function(a) {
|
|
236
|
+
var b = V.transition;
|
|
237
|
+
V.transition = {};
|
|
238
|
+
try {
|
|
239
|
+
a();
|
|
240
|
+
} finally {
|
|
241
|
+
V.transition = b;
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
react_production_min.unstable_act = X;
|
|
245
|
+
react_production_min.useCallback = function(a, b) {
|
|
246
|
+
return U.current.useCallback(a, b);
|
|
247
|
+
};
|
|
248
|
+
react_production_min.useContext = function(a) {
|
|
249
|
+
return U.current.useContext(a);
|
|
250
|
+
};
|
|
251
|
+
react_production_min.useDebugValue = function() {
|
|
252
|
+
};
|
|
253
|
+
react_production_min.useDeferredValue = function(a) {
|
|
254
|
+
return U.current.useDeferredValue(a);
|
|
255
|
+
};
|
|
256
|
+
react_production_min.useEffect = function(a, b) {
|
|
257
|
+
return U.current.useEffect(a, b);
|
|
258
|
+
};
|
|
259
|
+
react_production_min.useId = function() {
|
|
260
|
+
return U.current.useId();
|
|
261
|
+
};
|
|
262
|
+
react_production_min.useImperativeHandle = function(a, b, e) {
|
|
263
|
+
return U.current.useImperativeHandle(a, b, e);
|
|
264
|
+
};
|
|
265
|
+
react_production_min.useInsertionEffect = function(a, b) {
|
|
266
|
+
return U.current.useInsertionEffect(a, b);
|
|
267
|
+
};
|
|
268
|
+
react_production_min.useLayoutEffect = function(a, b) {
|
|
269
|
+
return U.current.useLayoutEffect(a, b);
|
|
270
|
+
};
|
|
271
|
+
react_production_min.useMemo = function(a, b) {
|
|
272
|
+
return U.current.useMemo(a, b);
|
|
273
|
+
};
|
|
274
|
+
react_production_min.useReducer = function(a, b, e) {
|
|
275
|
+
return U.current.useReducer(a, b, e);
|
|
276
|
+
};
|
|
277
|
+
react_production_min.useRef = function(a) {
|
|
278
|
+
return U.current.useRef(a);
|
|
279
|
+
};
|
|
280
|
+
react_production_min.useState = function(a) {
|
|
281
|
+
return U.current.useState(a);
|
|
282
|
+
};
|
|
283
|
+
react_production_min.useSyncExternalStore = function(a, b, e) {
|
|
284
|
+
return U.current.useSyncExternalStore(a, b, e);
|
|
285
|
+
};
|
|
286
|
+
react_production_min.useTransition = function() {
|
|
287
|
+
return U.current.useTransition();
|
|
288
|
+
};
|
|
289
|
+
react_production_min.version = "18.3.1";
|
|
290
|
+
return react_production_min;
|
|
291
|
+
}
|
|
292
|
+
var hasRequiredReact;
|
|
293
|
+
function requireReact() {
|
|
294
|
+
if (hasRequiredReact) return react.exports;
|
|
295
|
+
hasRequiredReact = 1;
|
|
296
|
+
{
|
|
297
|
+
react.exports = requireReact_production_min();
|
|
298
|
+
}
|
|
299
|
+
return react.exports;
|
|
300
|
+
}
|
|
301
|
+
var reactExports = requireReact();
|
|
302
|
+
const index = /* @__PURE__ */ getDefaultExportFromCjs(reactExports);
|
|
303
|
+
const React = /* @__PURE__ */ _mergeNamespaces({
|
|
304
|
+
__proto__: null,
|
|
305
|
+
default: index
|
|
306
|
+
}, [reactExports]);
|
|
307
|
+
export {
|
|
308
|
+
React as R,
|
|
309
|
+
requireReact as a,
|
|
310
|
+
reactExports as r
|
|
311
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { createRequire as __acrmRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __acrmPath } from "node:url";
|
|
3
|
+
import { dirname as __acrmDirname } from "node:path";
|
|
4
|
+
const require2 = __acrmRequire(import.meta.url);
|
|
5
|
+
const __filename = __acrmPath(import.meta.url);
|
|
6
|
+
const __dirname = __acrmDirname(__filename);
|
|
7
|
+
import { l as loadFolderHandle, e as ensureFolderPermission, a as createKvStore, i as instantiateStorageConnector } from "./registry-DijAKZ24.mjs";
|
|
8
|
+
import { createJournalStore } from "./index-B-4W0-P4.mjs";
|
|
9
|
+
import "./index-CWrrF1wl.mjs";
|
|
10
|
+
import { isCollectionName } from "./types-BOy9PUl7.mjs";
|
|
11
|
+
import { COLLECTIONS, DocConflictError, StoreNotReadyError } from "./types-BOy9PUl7.mjs";
|
|
12
|
+
import "./index-BM8qeGOb.mjs";
|
|
13
|
+
import { c as createStoreCore, p as plainCopy, e as emptySnapshot } from "./core-Dy7vY9H6.mjs";
|
|
14
|
+
import { s } from "./core-Dy7vY9H6.mjs";
|
|
15
|
+
import { w as withFileStore } from "./index-RCmo-uld.mjs";
|
|
16
|
+
import { a as assertFileId } from "./ids-u-noYcy5.mjs";
|
|
17
|
+
import { createMemoryStore } from "./memory-WNR3VHUJ.mjs";
|
|
18
|
+
import "./http-Bk9ICb7I.mjs";
|
|
19
|
+
import "./index-w03ReRs4.mjs";
|
|
20
|
+
import "./_commonjsHelpers-ClciMIcB.mjs";
|
|
21
|
+
import "stream";
|
|
22
|
+
import "events";
|
|
23
|
+
import "buffer";
|
|
24
|
+
import "util";
|
|
25
|
+
import "./encoding-C9MzdP95.mjs";
|
|
26
|
+
import "./s3-Dz50-NuA.mjs";
|
|
27
|
+
import "./runtimeConfig-CCOFg1RM.mjs";
|
|
28
|
+
const CONNECTOR_SECRET_FIELDS = {
|
|
29
|
+
s3: ["accessKeyId", "secretAccessKey"],
|
|
30
|
+
"git-pages": ["token"],
|
|
31
|
+
"local-folder": [],
|
|
32
|
+
"browser-mirror": []
|
|
33
|
+
};
|
|
34
|
+
const LOCAL_DATA_HANDLE_KEY = "data-folder";
|
|
35
|
+
async function missingJournalAccess(connectorId, settings) {
|
|
36
|
+
const missing = (CONNECTOR_SECRET_FIELDS[connectorId] ?? []).filter((k) => typeof settings[k] !== "string" || !settings[k].trim());
|
|
37
|
+
if (connectorId === "local-folder") {
|
|
38
|
+
if (typeof indexedDB === "undefined") return missing;
|
|
39
|
+
const handle = await loadFolderHandle(typeof settings.handleKey === "string" && settings.handleKey ? settings.handleKey : LOCAL_DATA_HANDLE_KEY);
|
|
40
|
+
if (!handle || !await ensureFolderPermission(handle).catch(() => false)) missing.push("folder");
|
|
41
|
+
}
|
|
42
|
+
return missing;
|
|
43
|
+
}
|
|
44
|
+
const LOCAL_FILES_DB_NAME = "agentcrm-local-files";
|
|
45
|
+
function createLocalFileStore(opts = {}) {
|
|
46
|
+
const kv = createKvStore(opts.dbName ?? LOCAL_FILES_DB_NAME, "files");
|
|
47
|
+
return {
|
|
48
|
+
kind: "local",
|
|
49
|
+
async put(id, bytes) {
|
|
50
|
+
assertFileId(id);
|
|
51
|
+
await kv.set(id, new Uint8Array(bytes));
|
|
52
|
+
},
|
|
53
|
+
async putMany(items) {
|
|
54
|
+
for (const it of items) {
|
|
55
|
+
assertFileId(it.id);
|
|
56
|
+
await kv.set(it.id, new Uint8Array(it.bytes));
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
async get(id) {
|
|
60
|
+
const v = await kv.get(id);
|
|
61
|
+
if (!v) return null;
|
|
62
|
+
return v instanceof Uint8Array ? v : new Uint8Array(v);
|
|
63
|
+
},
|
|
64
|
+
async delete(id) {
|
|
65
|
+
await kv.delete(id);
|
|
66
|
+
},
|
|
67
|
+
async list() {
|
|
68
|
+
return (await kv.keys()).sort();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const LOCAL_DB_NAME = "agentcrm-local-data";
|
|
73
|
+
const keyOf = (collection, id) => `${collection}/${id}`;
|
|
74
|
+
function createLocalStore(opts = {}) {
|
|
75
|
+
const kv = createKvStore(opts.dbName ?? LOCAL_DB_NAME, "docs");
|
|
76
|
+
const store = createStoreCore({
|
|
77
|
+
kind: "local",
|
|
78
|
+
async load() {
|
|
79
|
+
const snapshot = emptySnapshot();
|
|
80
|
+
for (const [key, doc] of await kv.entries()) {
|
|
81
|
+
const collection = key.slice(0, key.indexOf("/"));
|
|
82
|
+
if (isCollectionName(collection)) snapshot[collection].set(doc.id, Object.freeze(doc));
|
|
83
|
+
}
|
|
84
|
+
return snapshot;
|
|
85
|
+
},
|
|
86
|
+
async persist(mutations, _before, after) {
|
|
87
|
+
const touched = /* @__PURE__ */ new Map();
|
|
88
|
+
for (const m of mutations) {
|
|
89
|
+
const id = m.op === "set" ? m.doc.id : m.id;
|
|
90
|
+
touched.set(keyOf(m.collection, id), { collection: m.collection, id });
|
|
91
|
+
}
|
|
92
|
+
for (const [key, { collection, id }] of touched) {
|
|
93
|
+
const doc = after[collection].get(id);
|
|
94
|
+
if (doc) await kv.set(key, plainCopy(doc));
|
|
95
|
+
else await kv.delete(key);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
async identity() {
|
|
99
|
+
return { uid: "local", email: "admin@localhost", displayName: "Local admin", role: "admin" };
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
return withFileStore(store, createLocalFileStore({ dbName: opts.filesDbName }));
|
|
103
|
+
}
|
|
104
|
+
const factories = /* @__PURE__ */ new Map();
|
|
105
|
+
function registerBackend(kind, factory) {
|
|
106
|
+
factories.set(kind, factory);
|
|
107
|
+
}
|
|
108
|
+
function getBackendFactory(kind) {
|
|
109
|
+
return factories.get(kind);
|
|
110
|
+
}
|
|
111
|
+
registerBackend("local", () => createLocalStore());
|
|
112
|
+
registerBackend("memory", () => createMemoryStore());
|
|
113
|
+
registerBackend("journal", (config, opts) => {
|
|
114
|
+
const cfg = config.journal;
|
|
115
|
+
const settings = { ...cfg.settings, ...opts.secrets ?? {} };
|
|
116
|
+
const connector = instantiateStorageConnector(cfg.connectorId, settings);
|
|
117
|
+
const store = createJournalStore({
|
|
118
|
+
connector,
|
|
119
|
+
root: cfg.root,
|
|
120
|
+
encrypted: cfg.encrypted,
|
|
121
|
+
passphrase: opts.passphrase,
|
|
122
|
+
clientId: opts.clientId,
|
|
123
|
+
pollIntervalMs: opts.pollIntervalMs
|
|
124
|
+
});
|
|
125
|
+
const identity = store.identity.bind(store);
|
|
126
|
+
store.identity = async () => (await missingJournalAccess(cfg.connectorId, settings)).length ? null : identity();
|
|
127
|
+
return store;
|
|
128
|
+
});
|
|
129
|
+
registerBackend("firebase", async (config, opts) => (await import("./firebase-DxGVQV9E.mjs")).createFirebaseStore(config, opts));
|
|
130
|
+
registerBackend("git-json", async (config, opts) => (await import("./gitJson-fjr8mcHe.mjs")).createGitJsonStore(config, opts));
|
|
131
|
+
async function createDataStore(config, opts = {}) {
|
|
132
|
+
const factory = getBackendFactory(config.backend);
|
|
133
|
+
if (!factory) throw new Error(`Unknown data backend "${config.backend}".`);
|
|
134
|
+
return factory(config, opts);
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
COLLECTIONS,
|
|
138
|
+
DocConflictError,
|
|
139
|
+
StoreNotReadyError,
|
|
140
|
+
createDataStore,
|
|
141
|
+
createMemoryStore,
|
|
142
|
+
createStoreCore,
|
|
143
|
+
emptySnapshot,
|
|
144
|
+
isCollectionName,
|
|
145
|
+
registerBackend,
|
|
146
|
+
s as snapshotFromDocs
|
|
147
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { createRequire as __acrmRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __acrmPath } from "node:url";
|
|
3
|
+
import { dirname as __acrmDirname } from "node:path";
|
|
4
|
+
const require2 = __acrmRequire(import.meta.url);
|
|
5
|
+
const __filename = __acrmPath(import.meta.url);
|
|
6
|
+
const __dirname = __acrmDirname(__filename);
|
|
7
|
+
const MAGIC = new TextEncoder().encode("ACRMENC1");
|
|
8
|
+
const HEADER_LENGTH = MAGIC.length + 4 + 16 + 12;
|
|
9
|
+
const PBKDF2_ITERATIONS = 6e5;
|
|
10
|
+
class PassphraseError extends Error {
|
|
11
|
+
constructor(reason) {
|
|
12
|
+
super(reason === "missing" ? "This data is encrypted: enter its passphrase." : "Wrong passphrase: the data could not be decrypted.");
|
|
13
|
+
this.reason = reason;
|
|
14
|
+
this.name = "PassphraseError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function isEncrypted(bytes) {
|
|
18
|
+
return !!bytes && bytes.length >= HEADER_LENGTH && MAGIC.every((b, i) => bytes[i] === b);
|
|
19
|
+
}
|
|
20
|
+
const keyCache = /* @__PURE__ */ new Map();
|
|
21
|
+
function hex(bytes) {
|
|
22
|
+
return [...bytes].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
23
|
+
}
|
|
24
|
+
function deriveKey(passphrase, salt, iterations) {
|
|
25
|
+
const id = `${iterations}:${hex(salt)}:${passphrase}`;
|
|
26
|
+
let key = keyCache.get(id);
|
|
27
|
+
if (!key) {
|
|
28
|
+
key = (async () => {
|
|
29
|
+
const material = await crypto.subtle.importKey(
|
|
30
|
+
"raw",
|
|
31
|
+
new TextEncoder().encode(passphrase.normalize("NFC")),
|
|
32
|
+
"PBKDF2",
|
|
33
|
+
false,
|
|
34
|
+
["deriveKey"]
|
|
35
|
+
);
|
|
36
|
+
return crypto.subtle.deriveKey(
|
|
37
|
+
{ name: "PBKDF2", hash: "SHA-256", salt, iterations },
|
|
38
|
+
material,
|
|
39
|
+
{ name: "AES-GCM", length: 256 },
|
|
40
|
+
false,
|
|
41
|
+
["encrypt", "decrypt"]
|
|
42
|
+
);
|
|
43
|
+
})();
|
|
44
|
+
key.catch(() => keyCache.delete(id));
|
|
45
|
+
keyCache.set(id, key);
|
|
46
|
+
}
|
|
47
|
+
return key;
|
|
48
|
+
}
|
|
49
|
+
function newEncryptionParams(iterations = PBKDF2_ITERATIONS) {
|
|
50
|
+
return { salt: crypto.getRandomValues(new Uint8Array(16)), iterations };
|
|
51
|
+
}
|
|
52
|
+
function encryptionParams(bytes) {
|
|
53
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
54
|
+
return {
|
|
55
|
+
iterations: view.getUint32(MAGIC.length),
|
|
56
|
+
salt: bytes.slice(MAGIC.length + 4, MAGIC.length + 20)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
async function encryptBytes(plain, passphrase, params) {
|
|
60
|
+
if (!passphrase) throw new PassphraseError("missing");
|
|
61
|
+
const { salt, iterations } = params ?? newEncryptionParams();
|
|
62
|
+
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
63
|
+
const key = await deriveKey(passphrase, salt, iterations);
|
|
64
|
+
const cipher = new Uint8Array(await crypto.subtle.encrypt({ name: "AES-GCM", iv }, key, plain));
|
|
65
|
+
const out = new Uint8Array(HEADER_LENGTH + cipher.length);
|
|
66
|
+
out.set(MAGIC, 0);
|
|
67
|
+
new DataView(out.buffer).setUint32(MAGIC.length, iterations);
|
|
68
|
+
out.set(salt, MAGIC.length + 4);
|
|
69
|
+
out.set(iv, MAGIC.length + 20);
|
|
70
|
+
out.set(cipher, HEADER_LENGTH);
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
async function decryptBytes(bytes, passphrase) {
|
|
74
|
+
if (!passphrase) throw new PassphraseError("missing");
|
|
75
|
+
if (!isEncrypted(bytes)) throw new Error("Not an AgentCRM encrypted file (bad magic).");
|
|
76
|
+
const { salt, iterations } = encryptionParams(bytes);
|
|
77
|
+
const iv = bytes.slice(MAGIC.length + 20, HEADER_LENGTH);
|
|
78
|
+
const key = await deriveKey(passphrase, salt, iterations);
|
|
79
|
+
try {
|
|
80
|
+
return new Uint8Array(await crypto.subtle.decrypt({ name: "AES-GCM", iv }, key, bytes.slice(HEADER_LENGTH)));
|
|
81
|
+
} catch {
|
|
82
|
+
throw new PassphraseError("wrong");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function encryptText(text, passphrase, params) {
|
|
86
|
+
return encryptBytes(new TextEncoder().encode(text), passphrase, params);
|
|
87
|
+
}
|
|
88
|
+
async function decryptText(bytes, passphrase) {
|
|
89
|
+
return new TextDecoder().decode(await decryptBytes(bytes, passphrase));
|
|
90
|
+
}
|
|
91
|
+
function generatePassphrase() {
|
|
92
|
+
const alphabet = "abcdefghjkmnpqrstuvwxyz23456789";
|
|
93
|
+
const pick = crypto.getRandomValues(new Uint8Array(30));
|
|
94
|
+
const chars = [...pick].map((b) => alphabet[b % alphabet.length]);
|
|
95
|
+
return Array.from({ length: 6 }, (_, i) => chars.slice(i * 5, i * 5 + 5).join("")).join("-");
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
HEADER_LENGTH,
|
|
99
|
+
MAGIC,
|
|
100
|
+
PBKDF2_ITERATIONS,
|
|
101
|
+
PassphraseError,
|
|
102
|
+
decryptBytes,
|
|
103
|
+
decryptText,
|
|
104
|
+
deriveKey,
|
|
105
|
+
encryptBytes,
|
|
106
|
+
encryptText,
|
|
107
|
+
encryptionParams,
|
|
108
|
+
generatePassphrase,
|
|
109
|
+
isEncrypted,
|
|
110
|
+
newEncryptionParams
|
|
111
|
+
};
|