@lumibase/mcp-server 0.21.0 → 0.22.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 (3) hide show
  1. package/dist/index.cjs +275 -210
  2. package/dist/index.js +275 -210
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -718,47 +718,111 @@ function registerApiKeyTools(server, client) {
718
718
  );
719
719
  }
720
720
 
721
- // src/tools/collections.ts
721
+ // src/tools/cdc.ts
722
722
  import { z as z7 } from "zod";
723
- var collectionInputSchema = z7.object({
723
+ var subscriptionSchema = z7.object({
724
+ name: z7.string().min(1).max(128),
725
+ kind: z7.enum(["pull", "webhook", "extension"]),
726
+ collections: z7.array(z7.string()).optional().describe("Collections to include; empty = all."),
727
+ operations: z7.array(z7.enum(["create", "update", "delete"])).optional().describe("Operations to include; empty = all."),
728
+ payload_mode: z7.enum(["reference", "snapshot"]).optional().describe("reference = ids only (consumer re-fetches); snapshot = masked data inline."),
729
+ webhook_id: z7.string().optional().describe("Required for kind=webhook (must have a secret)."),
730
+ extension_name: z7.string().optional().describe("Required for kind=extension.")
731
+ });
732
+ function registerCdcTools(server, client) {
733
+ registerCrud(server, client, {
734
+ basePath: "/cdc/subscriptions",
735
+ resource: "CDC change-feed subscription",
736
+ namePrefix: "cdc_subscription",
737
+ createSchema: subscriptionSchema.shape,
738
+ updateSchema: subscriptionSchema.partial().shape
739
+ });
740
+ server.registerTool(
741
+ "cdc_events_read",
742
+ {
743
+ description: "Read the change feed (keyset pagination). Pass the previous meta.nextCursor to continue; filter by collections/operations CSV.",
744
+ inputSchema: {
745
+ cursor: z7.string().optional().describe("Opaque cursor from meta.nextCursor."),
746
+ collections: z7.string().optional().describe("CSV of collections to include."),
747
+ operations: z7.string().optional().describe("CSV of create,update,delete."),
748
+ limit: z7.number().int().min(1).max(500).optional()
749
+ }
750
+ },
751
+ async (args) => {
752
+ const params = new URLSearchParams();
753
+ if (args.cursor) params.set("cursor", args.cursor);
754
+ if (args.collections) params.set("collections", args.collections);
755
+ if (args.operations) params.set("operations", args.operations);
756
+ if (args.limit) params.set("limit", String(args.limit));
757
+ const qs = params.size > 0 ? `?${params.toString()}` : "";
758
+ const result = await client.get(`/cdc/events${qs}`);
759
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
760
+ }
761
+ );
762
+ server.registerTool(
763
+ "cdc_subscription_replay",
764
+ {
765
+ description: "Rewind a subscription checkpoint inside the retention window (resets dead/stale back to active).",
766
+ inputSchema: {
767
+ subscription_id: z7.string().describe("Subscription id."),
768
+ occurred_after: z7.string().optional().describe("ISO timestamp to rewind to (within retention)."),
769
+ cursor: z7.string().optional().describe("Exact cursor token to rewind to.")
770
+ }
771
+ },
772
+ async (args) => {
773
+ const body = {};
774
+ if (args.cursor) body.cursor = args.cursor;
775
+ if (args.occurred_after) body.occurred_after = args.occurred_after;
776
+ const result = await client.post(
777
+ `/cdc/subscriptions/${encodeURIComponent(args.subscription_id)}/replay`,
778
+ body
779
+ );
780
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
781
+ }
782
+ );
783
+ }
784
+
785
+ // src/tools/collections.ts
786
+ import { z as z8 } from "zod";
787
+ var collectionInputSchema = z8.object({
724
788
  name: collectionNameSchema,
725
- label: z7.string().optional(),
726
- pluralLabel: z7.string().optional(),
727
- hidden: z7.boolean().optional(),
728
- singleton: z7.boolean().optional(),
729
- icon: z7.string().optional(),
730
- color: z7.string().optional(),
731
- note: z7.string().optional(),
732
- primaryKeyField: z7.string().optional(),
733
- primaryKeyType: z7.enum(["nanoid", "uuid", "integer", "bigInteger", "string"]).optional(),
734
- storageMode: z7.enum(["jsonb", "materialized", "physical", "external"]).optional(),
735
- displayTemplate: z7.string().optional(),
736
- sortField: z7.string().optional(),
737
- archiveField: z7.string().optional(),
738
- archiveValue: z7.string().optional(),
739
- unarchiveValue: z7.string().optional(),
740
- accountability: z7.enum(["all", "activity", "none"]).optional(),
741
- versioning: z7.boolean().optional()
789
+ label: z8.string().optional(),
790
+ pluralLabel: z8.string().optional(),
791
+ hidden: z8.boolean().optional(),
792
+ singleton: z8.boolean().optional(),
793
+ icon: z8.string().optional(),
794
+ color: z8.string().optional(),
795
+ note: z8.string().optional(),
796
+ primaryKeyField: z8.string().optional(),
797
+ primaryKeyType: z8.enum(["nanoid", "uuid", "integer", "bigInteger", "string"]).optional(),
798
+ storageMode: z8.enum(["jsonb", "materialized", "physical", "external"]).optional(),
799
+ displayTemplate: z8.string().optional(),
800
+ sortField: z8.string().optional(),
801
+ archiveField: z8.string().optional(),
802
+ archiveValue: z8.string().optional(),
803
+ unarchiveValue: z8.string().optional(),
804
+ accountability: z8.enum(["all", "activity", "none"]).optional(),
805
+ versioning: z8.boolean().optional()
742
806
  });
743
- var fieldInputSchema = z7.object({
807
+ var fieldInputSchema = z8.object({
744
808
  name: fieldNameSchema,
745
- type: z7.string().min(1),
746
- interface: z7.string().min(1),
747
- display: z7.string().optional(),
748
- label: z7.string().optional(),
749
- note: z7.string().optional(),
750
- nullable: z7.boolean().optional(),
751
- unique: z7.boolean().optional(),
752
- indexed: z7.boolean().optional(),
753
- searchable: z7.boolean().optional(),
754
- required: z7.boolean().optional(),
755
- readonly: z7.boolean().optional(),
756
- hidden: z7.boolean().optional(),
757
- width: z7.enum(["half", "full", "fill"]).optional(),
758
- sortOrder: z7.number().int().optional(),
759
- group: z7.string().optional(),
760
- options: z7.record(z7.unknown()).optional(),
761
- defaultValue: z7.unknown().optional()
809
+ type: z8.string().min(1),
810
+ interface: z8.string().min(1),
811
+ display: z8.string().optional(),
812
+ label: z8.string().optional(),
813
+ note: z8.string().optional(),
814
+ nullable: z8.boolean().optional(),
815
+ unique: z8.boolean().optional(),
816
+ indexed: z8.boolean().optional(),
817
+ searchable: z8.boolean().optional(),
818
+ required: z8.boolean().optional(),
819
+ readonly: z8.boolean().optional(),
820
+ hidden: z8.boolean().optional(),
821
+ width: z8.enum(["half", "full", "fill"]).optional(),
822
+ sortOrder: z8.number().int().optional(),
823
+ group: z8.string().optional(),
824
+ options: z8.record(z8.unknown()).optional(),
825
+ defaultValue: z8.unknown().optional()
762
826
  });
763
827
  function formatError2(err) {
764
828
  if (err instanceof LumiBaseApiError) {
@@ -836,7 +900,7 @@ function registerCollectionTools(server, client) {
836
900
  description: "Delete a collection and all its items. DESTRUCTIVE \u2014 cannot be undone. You MUST pass confirm=true explicitly after warning the user.",
837
901
  inputSchema: {
838
902
  name: collectionNameSchema,
839
- confirm: z7.literal(true).describe("Must be true to confirm destructive operation")
903
+ confirm: z8.literal(true).describe("Must be true to confirm destructive operation")
840
904
  }
841
905
  },
842
906
  async ({ name, confirm: _ }) => {
@@ -854,9 +918,9 @@ function registerCollectionTools(server, client) {
854
918
  description: "Preview what would change if you applied a schema update. Returns added/modified/removed fields and any risky changes. Always call this before apply_schema to check for breaking changes.",
855
919
  inputSchema: {
856
920
  name: collectionNameSchema,
857
- fields: z7.array(fieldInputSchema).optional(),
858
- label: z7.string().optional(),
859
- note: z7.string().optional()
921
+ fields: z8.array(fieldInputSchema).optional(),
922
+ label: z8.string().optional(),
923
+ note: z8.string().optional()
860
924
  }
861
925
  },
862
926
  async (input) => {
@@ -874,16 +938,16 @@ function registerCollectionTools(server, client) {
874
938
  description: "Atomically apply a schema migration to a collection (add/update/remove fields and relations). Call diff_schema first to preview changes. Pass confirmRiskyChange=true on field inputs that have risky changes.",
875
939
  inputSchema: {
876
940
  name: collectionNameSchema,
877
- fields: z7.array(
941
+ fields: z8.array(
878
942
  fieldInputSchema.extend({
879
943
  renameFrom: fieldNameSchema.optional(),
880
- confirmRiskyChange: z7.boolean().optional()
944
+ confirmRiskyChange: z8.boolean().optional()
881
945
  })
882
946
  ).optional(),
883
- label: z7.string().optional(),
884
- note: z7.string().optional(),
885
- accountability: z7.enum(["all", "activity", "none"]).optional(),
886
- versioning: z7.boolean().optional()
947
+ label: z8.string().optional(),
948
+ note: z8.string().optional(),
949
+ accountability: z8.enum(["all", "activity", "none"]).optional(),
950
+ versioning: z8.boolean().optional()
887
951
  }
888
952
  },
889
953
  async (input) => {
@@ -902,34 +966,34 @@ function registerCollectionTools(server, client) {
902
966
  }
903
967
 
904
968
  // src/tools/content-config.ts
905
- import { z as z8 } from "zod";
906
- var presetSchema = z8.object({
907
- bookmark: z8.string().nullable().optional(),
908
- collection: z8.string(),
909
- userId: z8.string().nullable().optional(),
910
- roleId: z8.string().nullable().optional(),
911
- layout: z8.string().optional(),
912
- layoutQuery: z8.record(z8.unknown()).optional(),
913
- layoutOptions: z8.record(z8.unknown()).optional(),
914
- search: z8.string().nullable().optional(),
915
- filter: z8.record(z8.unknown()).optional(),
916
- icon: z8.string().nullable().optional(),
917
- color: z8.string().nullable().optional(),
918
- refreshInterval: z8.number().int().min(0).optional()
969
+ import { z as z9 } from "zod";
970
+ var presetSchema = z9.object({
971
+ bookmark: z9.string().nullable().optional(),
972
+ collection: z9.string(),
973
+ userId: z9.string().nullable().optional(),
974
+ roleId: z9.string().nullable().optional(),
975
+ layout: z9.string().optional(),
976
+ layoutQuery: z9.record(z9.unknown()).optional(),
977
+ layoutOptions: z9.record(z9.unknown()).optional(),
978
+ search: z9.string().nullable().optional(),
979
+ filter: z9.record(z9.unknown()).optional(),
980
+ icon: z9.string().nullable().optional(),
981
+ color: z9.string().nullable().optional(),
982
+ refreshInterval: z9.number().int().min(0).optional()
919
983
  });
920
- var translationSchema = z8.object({
921
- language: z8.string(),
922
- namespace: z8.string(),
923
- key: z8.string(),
924
- value: z8.string(),
925
- status: z8.string().optional()
984
+ var translationSchema = z9.object({
985
+ language: z9.string(),
986
+ namespace: z9.string(),
987
+ key: z9.string(),
988
+ value: z9.string(),
989
+ status: z9.string().optional()
926
990
  });
927
991
  function registerContentConfigTools(server, client) {
928
992
  registerCrud(server, client, {
929
993
  basePath: "/presets",
930
994
  resource: "preset",
931
995
  namePrefix: "preset",
932
- listQuery: { collection: z8.string().optional() },
996
+ listQuery: { collection: z9.string().optional() },
933
997
  createSchema: presetSchema.shape,
934
998
  updateSchema: presetSchema.partial().shape
935
999
  });
@@ -938,8 +1002,8 @@ function registerContentConfigTools(server, client) {
938
1002
  resource: "translation",
939
1003
  namePrefix: "translation",
940
1004
  listQuery: {
941
- namespace: z8.string().optional(),
942
- language: z8.string().optional()
1005
+ namespace: z9.string().optional(),
1006
+ language: z9.string().optional()
943
1007
  },
944
1008
  createSchema: translationSchema.shape,
945
1009
  updateSchema: translationSchema.partial().shape
@@ -948,7 +1012,7 @@ function registerContentConfigTools(server, client) {
948
1012
  "list_settings",
949
1013
  {
950
1014
  description: "List site settings, optionally filtered by scope.",
951
- inputSchema: { scope: z8.string().optional() }
1015
+ inputSchema: { scope: z9.string().optional() }
952
1016
  },
953
1017
  async ({ scope }) => run(() => client.get(`/settings${scope ? `?scope=${encodeURIComponent(scope)}` : ""}`))
954
1018
  );
@@ -966,8 +1030,8 @@ function registerContentConfigTools(server, client) {
966
1030
  description: "Create or update a setting (upsert by key).",
967
1031
  inputSchema: {
968
1032
  key: idPathSegmentSchema,
969
- value: z8.record(z8.unknown()).describe("Arbitrary JSON value object for the setting."),
970
- scope: z8.string().optional()
1033
+ value: z9.record(z9.unknown()).describe("Arbitrary JSON value object for the setting."),
1034
+ scope: z9.string().optional()
971
1035
  }
972
1036
  },
973
1037
  async (input) => run(() => client.post("/settings", input))
@@ -978,7 +1042,7 @@ function registerContentConfigTools(server, client) {
978
1042
  description: "Delete a setting by key. DESTRUCTIVE \u2014 warn the user first and pass confirm=true.",
979
1043
  inputSchema: {
980
1044
  key: idPathSegmentSchema,
981
- confirm: z8.literal(true).describe(confirmDescription)
1045
+ confirm: z9.literal(true).describe(confirmDescription)
982
1046
  }
983
1047
  },
984
1048
  async ({ key }) => run(async () => {
@@ -989,17 +1053,17 @@ function registerContentConfigTools(server, client) {
989
1053
  }
990
1054
 
991
1055
  // src/tools/extensions.ts
992
- import { z as z9 } from "zod";
1056
+ import { z as z10 } from "zod";
993
1057
  var EXTENSION_TYPES = ["interface", "display", "layout", "panel", "module", "hook", "endpoint"];
994
- var extensionSchema = z9.object({
995
- key: z9.string().regex(/^[a-z0-9_:-]+$/).optional(),
996
- name: z9.string().min(1),
997
- version: z9.string().min(1),
998
- type: z9.enum(EXTENSION_TYPES),
999
- enabled: z9.boolean().optional(),
1000
- bundleUrl: z9.string().min(1).describe("https:, http:, or data:text/javascript bundle URL."),
1001
- manifest: z9.record(z9.string()).optional(),
1002
- capabilities: z9.array(z9.string()).optional()
1058
+ var extensionSchema = z10.object({
1059
+ key: z10.string().regex(/^[a-z0-9_:-]+$/).optional(),
1060
+ name: z10.string().min(1),
1061
+ version: z10.string().min(1),
1062
+ type: z10.enum(EXTENSION_TYPES),
1063
+ enabled: z10.boolean().optional(),
1064
+ bundleUrl: z10.string().min(1).describe("https:, http:, or data:text/javascript bundle URL."),
1065
+ manifest: z10.record(z10.string()).optional(),
1066
+ capabilities: z10.array(z10.string()).optional()
1003
1067
  });
1004
1068
  function registerExtensionTools(server, client) {
1005
1069
  server.registerTool(
@@ -1027,7 +1091,7 @@ function registerExtensionTools(server, client) {
1027
1091
  "uninstall_extension",
1028
1092
  {
1029
1093
  description: "Uninstall an extension from the site. DESTRUCTIVE \u2014 pass confirm=true.",
1030
- inputSchema: { id: idPathSegmentSchema, confirm: z9.literal(true).describe(confirmDescription) }
1094
+ inputSchema: { id: idPathSegmentSchema, confirm: z10.literal(true).describe(confirmDescription) }
1031
1095
  },
1032
1096
  async ({ id }) => run(async () => {
1033
1097
  await client.delete(`/extensions/${encodePathSegment(id)}`);
@@ -1039,12 +1103,12 @@ function registerExtensionTools(server, client) {
1039
1103
  {
1040
1104
  description: "Browse the published extension marketplace.",
1041
1105
  inputSchema: {
1042
- q: z9.string().optional(),
1043
- category: z9.string().optional(),
1044
- tags: z9.string().optional().describe("Comma-separated tags."),
1045
- sort: z9.string().optional(),
1046
- page: z9.number().int().min(1).optional(),
1047
- perPage: z9.number().int().min(1).optional()
1106
+ q: z10.string().optional(),
1107
+ category: z10.string().optional(),
1108
+ tags: z10.string().optional().describe("Comma-separated tags."),
1109
+ sort: z10.string().optional(),
1110
+ page: z10.number().int().min(1).optional(),
1111
+ perPage: z10.number().int().min(1).optional()
1048
1112
  }
1049
1113
  },
1050
1114
  async (args) => run(
@@ -1079,13 +1143,13 @@ function registerExtensionTools(server, client) {
1079
1143
  {
1080
1144
  description: "Publish an extension to the marketplace (signs + marks it published).",
1081
1145
  inputSchema: {
1082
- extensionId: z9.string().min(1),
1083
- marketplaceSlug: z9.string().min(1),
1084
- publisher: z9.record(z9.unknown()).optional(),
1085
- signature: z9.string().optional(),
1086
- signatureAlg: z9.string().optional(),
1087
- publisherKeyId: z9.string().optional(),
1088
- bundleSha256: z9.string().optional()
1146
+ extensionId: z10.string().min(1),
1147
+ marketplaceSlug: z10.string().min(1),
1148
+ publisher: z10.record(z10.unknown()).optional(),
1149
+ signature: z10.string().optional(),
1150
+ signatureAlg: z10.string().optional(),
1151
+ publisherKeyId: z10.string().optional(),
1152
+ bundleSha256: z10.string().optional()
1089
1153
  }
1090
1154
  },
1091
1155
  async (input) => run(() => client.post("/marketplace/publish", input))
@@ -1093,39 +1157,39 @@ function registerExtensionTools(server, client) {
1093
1157
  }
1094
1158
 
1095
1159
  // src/tools/fields.ts
1096
- import { z as z10 } from "zod";
1097
- var fieldInputSchema2 = z10.object({
1098
- type: z10.string().min(1).describe(
1160
+ import { z as z11 } from "zod";
1161
+ var fieldInputSchema2 = z11.object({
1162
+ type: z11.string().min(1).describe(
1099
1163
  "Storage type: string, text, integer, bigInteger, float, decimal, boolean, date, dateTime, time, json, uuid, csv, hash, alias"
1100
1164
  ),
1101
- interface: z10.string().min(1).describe(
1165
+ interface: z11.string().min(1).describe(
1102
1166
  "UI widget: input, textarea, select, toggle, datetime, file, image, repeater, relation-m2o, relation-o2m, relation-m2m, code, markdown, wysiwyg, \u2026"
1103
1167
  ),
1104
- display: z10.string().optional(),
1105
- label: z10.string().optional(),
1106
- note: z10.string().optional(),
1107
- defaultValue: z10.unknown().optional(),
1108
- nullable: z10.boolean().optional().default(true),
1109
- unique: z10.boolean().optional().default(false),
1110
- indexed: z10.boolean().optional().default(false),
1111
- searchable: z10.boolean().optional().default(false),
1112
- length: z10.number().int().positive().optional(),
1113
- precision: z10.number().int().positive().optional(),
1114
- scale: z10.number().int().min(0).optional(),
1115
- special: z10.array(z10.string()).optional(),
1116
- options: z10.record(z10.unknown()).optional(),
1117
- displayOptions: z10.record(z10.unknown()).optional(),
1118
- conditions: z10.array(z10.unknown()).optional(),
1119
- required: z10.boolean().optional().default(false),
1120
- readonly: z10.boolean().optional().default(false),
1121
- hidden: z10.boolean().optional().default(false),
1122
- encrypted: z10.boolean().optional().default(false),
1123
- versioned: z10.boolean().optional().default(false),
1124
- width: z10.enum(["half", "full", "fill"]).optional().default("full"),
1125
- group: z10.string().optional(),
1126
- sortOrder: z10.number().int().optional(),
1168
+ display: z11.string().optional(),
1169
+ label: z11.string().optional(),
1170
+ note: z11.string().optional(),
1171
+ defaultValue: z11.unknown().optional(),
1172
+ nullable: z11.boolean().optional().default(true),
1173
+ unique: z11.boolean().optional().default(false),
1174
+ indexed: z11.boolean().optional().default(false),
1175
+ searchable: z11.boolean().optional().default(false),
1176
+ length: z11.number().int().positive().optional(),
1177
+ precision: z11.number().int().positive().optional(),
1178
+ scale: z11.number().int().min(0).optional(),
1179
+ special: z11.array(z11.string()).optional(),
1180
+ options: z11.record(z11.unknown()).optional(),
1181
+ displayOptions: z11.record(z11.unknown()).optional(),
1182
+ conditions: z11.array(z11.unknown()).optional(),
1183
+ required: z11.boolean().optional().default(false),
1184
+ readonly: z11.boolean().optional().default(false),
1185
+ hidden: z11.boolean().optional().default(false),
1186
+ encrypted: z11.boolean().optional().default(false),
1187
+ versioned: z11.boolean().optional().default(false),
1188
+ width: z11.enum(["half", "full", "fill"]).optional().default("full"),
1189
+ group: z11.string().optional(),
1190
+ sortOrder: z11.number().int().optional(),
1127
1191
  renameFrom: fieldNameSchema.optional().describe("Previous field name if this is a rename operation"),
1128
- confirmRiskyChange: z10.boolean().optional().describe("Set true to confirm type-change or destructive migration")
1192
+ confirmRiskyChange: z11.boolean().optional().describe("Set true to confirm type-change or destructive migration")
1129
1193
  });
1130
1194
  function formatError3(err) {
1131
1195
  if (err instanceof LumiBaseApiError) {
@@ -1180,8 +1244,8 @@ function registerFieldTools(server, client) {
1180
1244
  inputSchema: {
1181
1245
  collection: collectionNameSchema,
1182
1246
  field_name: fieldNameSchema,
1183
- confirm: z10.literal(true).describe("Must be true to confirm destructive operation"),
1184
- force: z10.boolean().optional().describe("Force deletion even if risky (foreign keys, etc.)")
1247
+ confirm: z11.literal(true).describe("Must be true to confirm destructive operation"),
1248
+ force: z11.boolean().optional().describe("Force deletion even if risky (foreign keys, etc.)")
1185
1249
  }
1186
1250
  },
1187
1251
  async ({ collection, field_name, force }) => {
@@ -1201,7 +1265,7 @@ function registerFieldTools(server, client) {
1201
1265
  }
1202
1266
 
1203
1267
  // src/tools/items.ts
1204
- import { z as z11 } from "zod";
1268
+ import { z as z12 } from "zod";
1205
1269
  function formatError4(err) {
1206
1270
  if (err instanceof LumiBaseApiError) {
1207
1271
  return err.errors.map((e) => `[${e.code}] ${e.message}`).join("; ");
@@ -1223,12 +1287,12 @@ function registerItemTools(server, client) {
1223
1287
  description: "List items from a collection with optional filtering, sorting, and pagination.",
1224
1288
  inputSchema: {
1225
1289
  collection: collectionNameSchema,
1226
- limit: z11.number().int().min(1).max(200).optional().default(25),
1227
- offset: z11.number().int().min(0).optional().default(0),
1228
- status: z11.enum(["draft", "published", "archived"]).optional(),
1229
- sort: z11.string().optional().describe('Comma-separated field names; prefix with - for descending (e.g. "-created_at")'),
1230
- fields: z11.string().optional().describe('Comma-separated field names to return (e.g. "id,title,status")'),
1231
- search: z11.string().optional().describe("Full-text search across searchable fields")
1290
+ limit: z12.number().int().min(1).max(200).optional().default(25),
1291
+ offset: z12.number().int().min(0).optional().default(0),
1292
+ status: z12.enum(["draft", "published", "archived"]).optional(),
1293
+ sort: z12.string().optional().describe('Comma-separated field names; prefix with - for descending (e.g. "-created_at")'),
1294
+ fields: z12.string().optional().describe('Comma-separated field names to return (e.g. "id,title,status")'),
1295
+ search: z12.string().optional().describe("Full-text search across searchable fields")
1232
1296
  }
1233
1297
  },
1234
1298
  async ({ collection, ...params }) => {
@@ -1248,7 +1312,7 @@ function registerItemTools(server, client) {
1248
1312
  inputSchema: {
1249
1313
  collection: collectionNameSchema,
1250
1314
  id: idPathSegmentSchema,
1251
- fields: z11.string().optional().describe("Comma-separated field names to return")
1315
+ fields: z12.string().optional().describe("Comma-separated field names to return")
1252
1316
  }
1253
1317
  },
1254
1318
  async ({ collection, id, fields }) => {
@@ -1269,8 +1333,8 @@ function registerItemTools(server, client) {
1269
1333
  description: "Create a new item in a collection.",
1270
1334
  inputSchema: {
1271
1335
  collection: collectionNameSchema,
1272
- data: z11.record(z11.unknown()).describe("Field values for the new item"),
1273
- status: z11.enum(["draft", "published"]).optional().default("draft")
1336
+ data: z12.record(z12.unknown()).describe("Field values for the new item"),
1337
+ status: z12.enum(["draft", "published"]).optional().default("draft")
1274
1338
  }
1275
1339
  },
1276
1340
  async ({ collection, data: itemData, status }) => {
@@ -1292,7 +1356,7 @@ function registerItemTools(server, client) {
1292
1356
  inputSchema: {
1293
1357
  collection: collectionNameSchema,
1294
1358
  id: idPathSegmentSchema,
1295
- data: z11.record(z11.unknown()).describe("Fields to update")
1359
+ data: z12.record(z12.unknown()).describe("Fields to update")
1296
1360
  }
1297
1361
  },
1298
1362
  async ({ collection, id, data: itemData }) => {
@@ -1314,7 +1378,7 @@ function registerItemTools(server, client) {
1314
1378
  inputSchema: {
1315
1379
  collection: collectionNameSchema,
1316
1380
  id: idPathSegmentSchema,
1317
- confirm: z11.literal(true).describe("Must be true to confirm deletion")
1381
+ confirm: z12.literal(true).describe("Must be true to confirm deletion")
1318
1382
  }
1319
1383
  },
1320
1384
  async ({ collection, id }) => {
@@ -1329,15 +1393,15 @@ function registerItemTools(server, client) {
1329
1393
  }
1330
1394
 
1331
1395
  // src/tools/ops.ts
1332
- import { z as z12 } from "zod";
1396
+ import { z as z13 } from "zod";
1333
1397
  function registerOpsTools(server, client) {
1334
1398
  server.registerTool(
1335
1399
  "list_activity",
1336
1400
  {
1337
1401
  description: "List the site activity / audit trail (most recent first).",
1338
1402
  inputSchema: {
1339
- limit: z12.number().int().min(1).max(500).optional(),
1340
- offset: z12.number().int().min(0).optional()
1403
+ limit: z13.number().int().min(1).max(500).optional(),
1404
+ offset: z13.number().int().min(0).optional()
1341
1405
  }
1342
1406
  },
1343
1407
  async (args) => run(
@@ -1359,7 +1423,7 @@ function registerOpsTools(server, client) {
1359
1423
  }
1360
1424
 
1361
1425
  // src/tools/permissions.ts
1362
- import { z as z13 } from "zod";
1426
+ import { z as z14 } from "zod";
1363
1427
  function registerPermissionTools(server, client) {
1364
1428
  server.registerTool(
1365
1429
  "get_my_permissions",
@@ -1374,9 +1438,9 @@ function registerPermissionTools(server, client) {
1374
1438
  {
1375
1439
  description: "Evaluate whether the current principal may perform an action on a collection (optionally against a specific item), returning { allowed, reason, fields }.",
1376
1440
  inputSchema: {
1377
- collection: z13.string().min(1),
1378
- action: z13.enum(["create", "read", "update", "delete", "share"]),
1379
- item: z13.record(z13.unknown()).optional().describe("Item payload to evaluate row-level rules against.")
1441
+ collection: z14.string().min(1),
1442
+ action: z14.enum(["create", "read", "update", "delete", "share"]),
1443
+ item: z14.record(z14.unknown()).optional().describe("Item payload to evaluate row-level rules against.")
1380
1444
  }
1381
1445
  },
1382
1446
  async (input) => run(() => client.post("/permissions/check", input))
@@ -1384,21 +1448,21 @@ function registerPermissionTools(server, client) {
1384
1448
  }
1385
1449
 
1386
1450
  // src/tools/relations.ts
1387
- import { z as z14 } from "zod";
1451
+ import { z as z15 } from "zod";
1388
1452
  var relationInputSchema = {
1389
- manyCollection: z14.string().min(1).describe('Collection that holds the foreign key (the "many" side).'),
1390
- manyField: z14.string().min(1).describe("Field on manyCollection that stores the relation."),
1391
- oneCollection: z14.string().min(1).describe('Related collection (the "one" side).'),
1392
- oneField: z14.string().nullable().optional(),
1393
- junctionCollection: z14.string().nullable().optional().describe("Junction table for m2m relations."),
1394
- type: z14.enum(["m2o", "o2m", "m2m", "m2a"]).optional(),
1395
- aliasField: z14.string().nullable().optional(),
1396
- relatedDisplayTemplate: z14.string().nullable().optional(),
1397
- junctionManyField: z14.string().nullable().optional(),
1398
- junctionOneField: z14.string().nullable().optional(),
1399
- sortField: z14.string().nullable().optional(),
1400
- onDelete: z14.enum(["restrict", "cascade", "set null", "no action"]).optional(),
1401
- meta: z14.record(z14.unknown()).optional()
1453
+ manyCollection: z15.string().min(1).describe('Collection that holds the foreign key (the "many" side).'),
1454
+ manyField: z15.string().min(1).describe("Field on manyCollection that stores the relation."),
1455
+ oneCollection: z15.string().min(1).describe('Related collection (the "one" side).'),
1456
+ oneField: z15.string().nullable().optional(),
1457
+ junctionCollection: z15.string().nullable().optional().describe("Junction table for m2m relations."),
1458
+ type: z15.enum(["m2o", "o2m", "m2m", "m2a"]).optional(),
1459
+ aliasField: z15.string().nullable().optional(),
1460
+ relatedDisplayTemplate: z15.string().nullable().optional(),
1461
+ junctionManyField: z15.string().nullable().optional(),
1462
+ junctionOneField: z15.string().nullable().optional(),
1463
+ sortField: z15.string().nullable().optional(),
1464
+ onDelete: z15.enum(["restrict", "cascade", "set null", "no action"]).optional(),
1465
+ meta: z15.record(z15.unknown()).optional()
1402
1466
  };
1403
1467
  function registerRelationTools(server, client) {
1404
1468
  server.registerTool(
@@ -1420,7 +1484,7 @@ function registerRelationTools(server, client) {
1420
1484
  description: "Delete a relation by id. DESTRUCTIVE \u2014 warn the user first and pass confirm=true.",
1421
1485
  inputSchema: {
1422
1486
  id: idPathSegmentSchema,
1423
- confirm: z14.literal(true).describe(confirmDescription)
1487
+ confirm: z15.literal(true).describe(confirmDescription)
1424
1488
  }
1425
1489
  },
1426
1490
  async ({ id }) => run(async () => {
@@ -1431,19 +1495,19 @@ function registerRelationTools(server, client) {
1431
1495
  }
1432
1496
 
1433
1497
  // src/tools/search-media.ts
1434
- import { z as z15 } from "zod";
1498
+ import { z as z16 } from "zod";
1435
1499
  function registerSearchMediaTools(server, client) {
1436
1500
  server.registerTool(
1437
1501
  "search",
1438
1502
  {
1439
1503
  description: "Full-text search within a collection. Returns ranked hits from the search backend. The `collection` parameter is required.",
1440
1504
  inputSchema: {
1441
- q: z15.string().min(1).describe("Query string."),
1442
- collection: z15.string().min(1).describe("Collection to search."),
1443
- filter: z15.string().optional().describe("Backend filter expression."),
1444
- sort: z15.string().optional().describe("Comma-separated sort fields."),
1445
- limit: z15.number().int().min(1).max(200).optional(),
1446
- offset: z15.number().int().min(0).optional()
1505
+ q: z16.string().min(1).describe("Query string."),
1506
+ collection: z16.string().min(1).describe("Collection to search."),
1507
+ filter: z16.string().optional().describe("Backend filter expression."),
1508
+ sort: z16.string().optional().describe("Comma-separated sort fields."),
1509
+ limit: z16.number().int().min(1).max(200).optional(),
1510
+ offset: z16.number().int().min(0).optional()
1447
1511
  }
1448
1512
  },
1449
1513
  async (args) => run(
@@ -1456,7 +1520,7 @@ function registerSearchMediaTools(server, client) {
1456
1520
  "list_media",
1457
1521
  {
1458
1522
  description: "List media asset keys, optionally filtered by key prefix.",
1459
- inputSchema: { prefix: z15.string().optional() }
1523
+ inputSchema: { prefix: z16.string().optional() }
1460
1524
  },
1461
1525
  async ({ prefix }) => run(() => client.get(`/media${prefix ? `?prefix=${encodeURIComponent(prefix)}` : ""}`))
1462
1526
  );
@@ -1466,7 +1530,7 @@ function registerSearchMediaTools(server, client) {
1466
1530
  description: "Delete a media asset by key. DESTRUCTIVE \u2014 warn the user first and pass confirm=true.",
1467
1531
  inputSchema: {
1468
1532
  key: mediaKeySchema.describe("Full storage key of the asset."),
1469
- confirm: z15.literal(true).describe(confirmDescription)
1533
+ confirm: z16.literal(true).describe(confirmDescription)
1470
1534
  }
1471
1535
  },
1472
1536
  async ({ key }) => run(async () => {
@@ -1477,15 +1541,15 @@ function registerSearchMediaTools(server, client) {
1477
1541
  }
1478
1542
 
1479
1543
  // src/tools/translation-memory.ts
1480
- import { z as z16 } from "zod";
1544
+ import { z as z17 } from "zod";
1481
1545
  function registerTranslationMemoryTools(server, client) {
1482
1546
  server.registerTool(
1483
1547
  "list_tm",
1484
1548
  {
1485
1549
  description: "List translation-memory entries, optionally filtered by source/target language.",
1486
1550
  inputSchema: {
1487
- source: z16.string().optional().describe("Source language code."),
1488
- target: z16.string().optional().describe("Target language code.")
1551
+ source: z17.string().optional().describe("Source language code."),
1552
+ target: z17.string().optional().describe("Target language code.")
1489
1553
  }
1490
1554
  },
1491
1555
  async (args) => run(
@@ -1497,14 +1561,14 @@ function registerTranslationMemoryTools(server, client) {
1497
1561
  {
1498
1562
  description: "Add or update a translation-memory entry.",
1499
1563
  inputSchema: {
1500
- sourceLang: z16.string().min(2),
1501
- targetLang: z16.string().min(2),
1502
- sourceText: z16.string().min(1),
1503
- targetText: z16.string().min(1),
1504
- context: z16.string().optional(),
1505
- quality: z16.number().min(0).max(100).optional(),
1506
- source: z16.enum(["human", "mt", "imported"]).optional(),
1507
- provider: z16.string().optional()
1564
+ sourceLang: z17.string().min(2),
1565
+ targetLang: z17.string().min(2),
1566
+ sourceText: z17.string().min(1),
1567
+ targetText: z17.string().min(1),
1568
+ context: z17.string().optional(),
1569
+ quality: z17.number().min(0).max(100).optional(),
1570
+ source: z17.enum(["human", "mt", "imported"]).optional(),
1571
+ provider: z17.string().optional()
1508
1572
  }
1509
1573
  },
1510
1574
  async (input) => run(() => client.post("/tm", input))
@@ -1514,10 +1578,10 @@ function registerTranslationMemoryTools(server, client) {
1514
1578
  {
1515
1579
  description: "Fuzzy-match a query string against translation memory for a language pair.",
1516
1580
  inputSchema: {
1517
- query: z16.string().min(1),
1518
- sourceLang: z16.string().min(2),
1519
- targetLang: z16.string().min(2),
1520
- threshold: z16.number().min(0).max(100).optional().describe("Minimum match score (default 75).")
1581
+ query: z17.string().min(1),
1582
+ sourceLang: z17.string().min(2),
1583
+ targetLang: z17.string().min(2),
1584
+ threshold: z17.number().min(0).max(100).optional().describe("Minimum match score (default 75).")
1521
1585
  }
1522
1586
  },
1523
1587
  async (input) => run(() => client.post("/tm/lookup", input))
@@ -1527,10 +1591,10 @@ function registerTranslationMemoryTools(server, client) {
1527
1591
  {
1528
1592
  description: "Run the full translation pipeline (TM + glossary + MT provider) for a text.",
1529
1593
  inputSchema: {
1530
- text: z16.string().min(1),
1531
- from: z16.string().min(2),
1532
- to: z16.string().min(2),
1533
- provider: z16.string().optional()
1594
+ text: z17.string().min(1),
1595
+ from: z17.string().min(2),
1596
+ to: z17.string().min(2),
1597
+ provider: z17.string().optional()
1534
1598
  }
1535
1599
  },
1536
1600
  async (input) => run(() => client.post("/tm/translate", input))
@@ -1538,7 +1602,7 @@ function registerTranslationMemoryTools(server, client) {
1538
1602
  }
1539
1603
 
1540
1604
  // src/tools/users-teams.ts
1541
- import { z as z17 } from "zod";
1605
+ import { z as z18 } from "zod";
1542
1606
  function registerUsersTeamsTools(server, client) {
1543
1607
  server.registerTool(
1544
1608
  "list_users",
@@ -1555,8 +1619,8 @@ function registerUsersTeamsTools(server, client) {
1555
1619
  {
1556
1620
  description: "Invite a user to the site by email, optionally assigning a role. Sends an invite email.",
1557
1621
  inputSchema: {
1558
- email: z17.string().email(),
1559
- roleId: z17.string().optional()
1622
+ email: z18.string().email(),
1623
+ roleId: z18.string().optional()
1560
1624
  }
1561
1625
  },
1562
1626
  async (input) => run(() => client.post("/users/invite", input))
@@ -1567,8 +1631,8 @@ function registerUsersTeamsTools(server, client) {
1567
1631
  description: "Update a user's site membership (role and/or status).",
1568
1632
  inputSchema: {
1569
1633
  id: idPathSegmentSchema,
1570
- roleId: z17.string().nullable().optional(),
1571
- status: z17.string().optional().describe("e.g. active, suspended.")
1634
+ roleId: z18.string().nullable().optional(),
1635
+ status: z18.string().optional().describe("e.g. active, suspended.")
1572
1636
  }
1573
1637
  },
1574
1638
  async ({ id, ...patch }) => run(() => client.patch(`/users/${encodePathSegment(id)}`, patch))
@@ -1577,7 +1641,7 @@ function registerUsersTeamsTools(server, client) {
1577
1641
  "remove_user",
1578
1642
  {
1579
1643
  description: "Remove a user from the site. DESTRUCTIVE \u2014 pass confirm=true.",
1580
- inputSchema: { id: idPathSegmentSchema, confirm: z17.literal(true).describe(confirmDescription) }
1644
+ inputSchema: { id: idPathSegmentSchema, confirm: z18.literal(true).describe(confirmDescription) }
1581
1645
  },
1582
1646
  async ({ id }) => run(async () => {
1583
1647
  await client.delete(`/users/${encodePathSegment(id)}`);
@@ -1598,7 +1662,7 @@ function registerUsersTeamsTools(server, client) {
1598
1662
  "create_team",
1599
1663
  {
1600
1664
  description: "Create a team.",
1601
- inputSchema: { name: z17.string().min(1).max(128), description: z17.string().nullable().optional() }
1665
+ inputSchema: { name: z18.string().min(1).max(128), description: z18.string().nullable().optional() }
1602
1666
  },
1603
1667
  async (input) => run(() => client.post("/teams", input))
1604
1668
  );
@@ -1608,8 +1672,8 @@ function registerUsersTeamsTools(server, client) {
1608
1672
  description: "Update a team (partial PATCH).",
1609
1673
  inputSchema: {
1610
1674
  id: idPathSegmentSchema,
1611
- name: z17.string().min(1).max(128).optional(),
1612
- description: z17.string().nullable().optional()
1675
+ name: z18.string().min(1).max(128).optional(),
1676
+ description: z18.string().nullable().optional()
1613
1677
  }
1614
1678
  },
1615
1679
  async ({ id, ...patch }) => run(() => client.patch(`/teams/${encodePathSegment(id)}`, patch))
@@ -1618,7 +1682,7 @@ function registerUsersTeamsTools(server, client) {
1618
1682
  "delete_team",
1619
1683
  {
1620
1684
  description: "Delete a team. DESTRUCTIVE \u2014 pass confirm=true.",
1621
- inputSchema: { id: idPathSegmentSchema, confirm: z17.literal(true).describe(confirmDescription) }
1685
+ inputSchema: { id: idPathSegmentSchema, confirm: z18.literal(true).describe(confirmDescription) }
1622
1686
  },
1623
1687
  async ({ id }) => run(async () => {
1624
1688
  await client.delete(`/teams/${encodePathSegment(id)}`);
@@ -1645,7 +1709,7 @@ function registerUsersTeamsTools(server, client) {
1645
1709
  inputSchema: {
1646
1710
  id: idPathSegmentSchema.describe("Team id."),
1647
1711
  userId: idPathSegmentSchema,
1648
- confirm: z17.literal(true).describe(confirmDescription)
1712
+ confirm: z18.literal(true).describe(confirmDescription)
1649
1713
  }
1650
1714
  },
1651
1715
  async ({ id, userId }) => run(async () => {
@@ -1656,15 +1720,15 @@ function registerUsersTeamsTools(server, client) {
1656
1720
  }
1657
1721
 
1658
1722
  // src/tools/webhooks.ts
1659
- import { z as z18 } from "zod";
1660
- var webhookSchema = z18.object({
1661
- name: z18.string().min(1).max(255),
1662
- url: z18.string().url(),
1663
- actions: z18.array(z18.string()).optional().describe("Item events that trigger the webhook (e.g. create, update, delete)."),
1664
- collections: z18.array(z18.string()).optional().describe("Collections to filter on (empty = all)."),
1665
- headers: z18.record(z18.string()).optional(),
1666
- status: z18.enum(["active", "inactive"]).optional(),
1667
- secret: z18.string().nullable().optional()
1723
+ import { z as z19 } from "zod";
1724
+ var webhookSchema = z19.object({
1725
+ name: z19.string().min(1).max(255),
1726
+ url: z19.string().url(),
1727
+ actions: z19.array(z19.string()).optional().describe("Item events that trigger the webhook (e.g. create, update, delete)."),
1728
+ collections: z19.array(z19.string()).optional().describe("Collections to filter on (empty = all)."),
1729
+ headers: z19.record(z19.string()).optional(),
1730
+ status: z19.enum(["active", "inactive"]).optional(),
1731
+ secret: z19.string().nullable().optional()
1668
1732
  });
1669
1733
  function registerWebhookTools(server, client) {
1670
1734
  registerCrud(server, client, {
@@ -1692,6 +1756,7 @@ function registerAllTools(server, client) {
1692
1756
  registerApiKeyTools(server, client);
1693
1757
  registerUsersTeamsTools(server, client);
1694
1758
  registerWebhookTools(server, client);
1759
+ registerCdcTools(server, client);
1695
1760
  registerAgentTools(server, client);
1696
1761
  registerOpsTools(server, client);
1697
1762
  registerAdminTools(server, client);