@fleox-agent-crm/agentcrm 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/changelog.json +30 -0
- package/dist/admin/admin-files.json +8 -8
- package/dist/admin/assets/{chartsImpl-CE2akJat.js → chartsImpl-qlHW3VOv.js} +30 -30
- package/dist/admin/assets/firebase-U38f5kc9.js +2 -0
- package/dist/admin/assets/{gitJson-BulGh2KV.js → gitJson-wy2Tytfd.js} +1 -1
- package/dist/admin/assets/{index-DidVVK7L.js → index-BpaxrJx9.js} +265 -265
- package/dist/admin/assets/{index-hMXwHSvN.css → index-TcjySLVg.css} +1 -1
- package/dist/admin/assets/{lucide-react.min-DEDlHCPj.js → lucide-react.min-Djrg16BH.js} +1 -1
- package/dist/admin/assets/{sdk-CnrLnlRo.js → sdk-mu08RFtk.js} +1 -1
- package/dist/admin/index.html +2 -2
- package/dist/agent/agentcrm.mjs +334 -151
- package/dist/agent/chunks/{api-B6OqNVWp.mjs → api-Cz0Ubj-B.mjs} +4 -3
- package/dist/agent/chunks/api-Dwb4xz1k.mjs +27 -0
- package/dist/agent/chunks/{appearance-BaShelzt.mjs → appearance-BloHbiLA.mjs} +1 -1
- package/dist/agent/chunks/{automations-BWrvLqP6.mjs → automations-DwWruxmu.mjs} +3 -3
- package/dist/agent/chunks/{backup-ClSmxmFZ.mjs → backup-W3CjgkAJ.mjs} +16 -3
- package/dist/agent/chunks/{compact-CsFPaAAq.mjs → compact-BGHI92tm.mjs} +2 -2
- package/dist/agent/chunks/{exportCsv-B5hRvkNm.mjs → exportCsv-C6e6XEmB.mjs} +38 -3
- package/dist/agent/chunks/{extCheck--7lmVvl7.mjs → extCheck-GgHG1dYB.mjs} +16 -9
- package/dist/agent/chunks/{extPackage-BGl5Oqs8.mjs → extPackage-DuZ6GZhp.mjs} +2 -2
- package/dist/agent/chunks/{extScaffold-DqxI7R1e.mjs → extScaffold-Aqyjf1nr.mjs} +3 -3
- package/dist/agent/chunks/{extensions-BP1k60md.mjs → extensions-Bp72uZ9a.mjs} +19 -6
- package/dist/agent/chunks/{featureRegistry-C9nbVShp.mjs → featureRegistry-DSsZbhrh.mjs} +3 -3
- package/dist/agent/chunks/{files-q8Xu5bft.mjs → files-D1daDgY0.mjs} +1 -1
- package/dist/agent/chunks/{firebase-DxGVQV9E.mjs → firebase-BciZWdc6.mjs} +41 -17
- package/dist/agent/chunks/{forms-BKU5F9WF.mjs → forms-BfuWaQjA.mjs} +1 -1
- package/dist/agent/chunks/{hosting-Bme7LxPc.mjs → hosting-Dnn1k3cV.mjs} +1 -1
- package/dist/agent/chunks/{importCsv-DmE_sBch.mjs → importCsv-LVmMTaWU.mjs} +2 -2
- package/dist/agent/chunks/{index-DUSdTBkz.mjs → index-CNXq2Yk_.mjs} +1 -24
- package/dist/agent/chunks/index-Dio0aBWA.mjs +6920 -0
- package/dist/agent/chunks/{index-CRkw3_iF.mjs → index-rut-KC39.mjs} +1 -1
- package/dist/agent/chunks/{install-CpHoUFtL.mjs → install-BBTA4nMm.mjs} +16 -7
- package/dist/agent/chunks/{loader-C9nm3iwx.mjs → loader-MPD9iAvh.mjs} +20 -20
- package/dist/agent/chunks/{modules-CqdVQVJb.mjs → modules-clWdE-K2.mjs} +27 -2
- package/dist/agent/chunks/{nodeImport-BPCt5uMu.mjs → nodeImport-ylfRDvqt.mjs} +2 -2
- package/dist/agent/chunks/{package-DWbn3t2R.mjs → package-B7mI6HGi.mjs} +1 -1
- package/dist/agent/chunks/{papaparse-DjBYnQM2.mjs → papaparse-Df7i1dHr.mjs} +31 -7
- package/dist/agent/chunks/{pipelines-DCdRBNBV.mjs → pipelines-BAKpPk1w.mjs} +1 -1
- package/dist/agent/chunks/{plan-C0TBrU92.mjs → plan-BmTat6-T.mjs} +1 -1
- package/dist/agent/chunks/{records-DoqiT9xR.mjs → records-DcHFelq5.mjs} +5 -1
- package/dist/agent/chunks/{registry-Ceexawxl.mjs → registry-COfJrSmg.mjs} +18 -18
- package/dist/agent/chunks/{reports-BB59N6ke.mjs → reports-BACHGccj.mjs} +3 -3
- package/dist/agent/chunks/{runtime-DHo7ZEEO.mjs → runtime-C0Xf0Axi.mjs} +53 -32
- package/dist/agent/chunks/{schema-DlHt2PxI.mjs → schema-C4lSslXv.mjs} +10 -4
- package/dist/agent/chunks/{schema-7-4-qtSS.mjs → schema-DnLj8dUO.mjs} +10 -0
- package/dist/agent/chunks/{sdk-whvfg786.mjs → sdk-CYgNyuoK.mjs} +132 -7005
- package/dist/agent/chunks/{seed-CugPGYZL.mjs → seed-6MRmQQBR.mjs} +26 -8
- package/dist/agent/chunks/{server-ISwlDRCN.mjs → server-DC3t8r30.mjs} +5 -5
- package/dist/agent/chunks/{settings-BtvR_jdm.mjs → settings-Di8nzNEL.mjs} +35 -0
- package/dist/agent/chunks/{stats-CfeJssSS.mjs → stats-BfuLWhVV.mjs} +2 -2
- package/dist/agent/chunks/{tools-Bew8lxKx.mjs → tools-iSH-yMpl.mjs} +59 -19
- package/dist/agent/chunks/{views-fO_BM5U_.mjs → views-DH1n9Lrt.mjs} +1 -1
- package/dist/version.json +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/agentcrm-admin/SKILL.md +67 -67
- package/plugin/skills/agentcrm-admin/references/appearance.md +1 -1
- package/plugin/skills/agentcrm-admin/references/records.md +5 -5
- package/plugin/skills/agentcrm-admin/references/schema.md +20 -20
- package/plugin/skills/agentcrm-extensions/SKILL.md +9 -9
- package/plugin/skills/agentcrm-extensions/references/module-recipes.md +2 -2
- package/plugin/skills/agentcrm-extensions/references/testing.md +16 -14
- package/plugin/skills/agentcrm-extensions/references/theme-recipes.md +3 -3
- package/plugin/skills/agentcrm-install/SKILL.md +13 -13
- package/plugin/skills/agentcrm-install/references/firebase.md +1 -1
- package/plugin/skills/agentcrm-install/references/github.md +1 -1
- package/plugin/skills/agentcrm-install/references/mcp.md +3 -3
- package/plugin/skills/agentcrm-install/references/plans.md +1 -1
- package/plugin/skills/agentcrm-install/references/s3.md +1 -1
- package/plugin/skills/agentcrm-manage/SKILL.md +15 -15
- package/plugin/skills/agentcrm-sales/SKILL.md +18 -18
- package/dist/admin/assets/firebase-BHSUggRo.js +0 -2
|
@@ -8,10 +8,10 @@ import { c as camelId } from "./utils-DmI8FtXP.mjs";
|
|
|
8
8
|
import { colorAt, canConvertType, isEmptyFieldValue, convertValue } from "./fields-B0bitgmr.mjs";
|
|
9
9
|
import { s as slugId } from "./ids-CvnmrMJX.mjs";
|
|
10
10
|
import { d as defaultViewFor } from "./standardObjects-CheqfDqa.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { a as FIELD_TYPES } from "../agentcrm.mjs";
|
|
12
12
|
import { assertCan, OpsError } from "./context-CxFfqS4D.mjs";
|
|
13
|
-
import { hardDeleteMutations } from "./records-
|
|
14
|
-
import { requireObject, objectsOf, pipelinesOf, recordsOf,
|
|
13
|
+
import { hardDeleteMutations } from "./records-DcHFelq5.mjs";
|
|
14
|
+
import { requireObject, objectsOf, pipelinesOf, recordsOf, viewsOf, asDoc, thaw } from "./store-5gqRSKXg.mjs";
|
|
15
15
|
import "node:util";
|
|
16
16
|
import "node:fs";
|
|
17
17
|
import "node:path";
|
|
@@ -183,9 +183,15 @@ async function createField(ctx, objectId, input) {
|
|
|
183
183
|
const object = requireObject(ctx.store, objectId);
|
|
184
184
|
const field = buildField(ctx, object, input);
|
|
185
185
|
const imageField = object.imageField ?? (field.type === "image" ? field.id : void 0);
|
|
186
|
-
|
|
186
|
+
const mutations = [saveObject(ctx, { ...object, ...imageField ? { imageField } : {}, fields: [...object.fields, field] })];
|
|
187
|
+
const defaultView = viewsOf(ctx.store, objectId).find((v) => v.id === defaultViewFor(object).id);
|
|
188
|
+
if (defaultView && defaultView.type === "table" && !field.hidden && field.type !== "image" && !defaultView.columns.includes(field.id) && defaultView.columns.length < DEFAULT_VIEW_MAX_COLUMNS) {
|
|
189
|
+
mutations.push({ op: "patch", collection: "views", id: defaultView.id, fields: { columns: [...defaultView.columns, field.id] } });
|
|
190
|
+
}
|
|
191
|
+
await ctx.store.write(mutations, { message: `Add field ${field.label}` });
|
|
187
192
|
return field;
|
|
188
193
|
}
|
|
194
|
+
const DEFAULT_VIEW_MAX_COLUMNS = 7;
|
|
189
195
|
function requireField(object, fieldId) {
|
|
190
196
|
const f = object.fields.find((x) => x.id === fieldId);
|
|
191
197
|
if (!f) throw new OpsError("notFound", `Field "${fieldId}" not found on ${object.labelPlural}.`);
|
|
@@ -87,6 +87,15 @@ const ENUMS = {
|
|
|
87
87
|
};
|
|
88
88
|
const IMAGE_RE = /^data:image\/(png|jpeg|gif|webp|svg\+xml|x-icon|vnd\.microsoft\.icon);base64,[A-Za-z0-9+/]+=*$/;
|
|
89
89
|
const ID_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
90
|
+
function svgHasActiveContent(dataUrl) {
|
|
91
|
+
let text;
|
|
92
|
+
try {
|
|
93
|
+
text = atob(dataUrl.slice(dataUrl.indexOf(",") + 1));
|
|
94
|
+
} catch {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
return /<script[\s>/]|<foreignObject[\s>/]|\son[a-z]+\s*=|javascript:/i.test(text);
|
|
98
|
+
}
|
|
90
99
|
function dataUrlBytes(url) {
|
|
91
100
|
const b64 = url.slice(url.indexOf(",") + 1);
|
|
92
101
|
const pad = b64.endsWith("==") ? 2 : b64.endsWith("=") ? 1 : 0;
|
|
@@ -96,6 +105,7 @@ function validateImageDataUrl(value, label = "image") {
|
|
|
96
105
|
if (typeof value !== "string" || !IMAGE_RE.test(value)) return `The ${label} must be a base64 image data URL (PNG, JPEG, GIF, WebP, SVG or ICO).`;
|
|
97
106
|
const bytes = dataUrlBytes(value);
|
|
98
107
|
if (bytes > MAX_IMAGE_BYTES) return `The ${label} is ${Math.round(bytes / 1024)} KB — the limit is ${MAX_IMAGE_BYTES / 1024} KB.`;
|
|
108
|
+
if (/^data:image\/svg\+xml/i.test(value) && svgHasActiveContent(value)) return `The ${label} SVG contains scripts or event handlers — export it as a plain SVG (or a PNG).`;
|
|
99
109
|
return null;
|
|
100
110
|
}
|
|
101
111
|
function validateAppearancePatch(patch) {
|