@avallon-labs/mcp 32.4.0 → 33.0.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/dist/index.js CHANGED
@@ -54,5 +54,5 @@ function setupFetch() {
54
54
 
55
55
  // src/index.ts
56
56
  setupFetch();
57
- await import("./server-C5ZJRZEH.js");
57
+ await import("./server-HFVJQABW.js");
58
58
  //# sourceMappingURL=index.js.map
@@ -1678,6 +1678,24 @@ var listCases = async (params, options) => {
1678
1678
  headers: res.headers
1679
1679
  };
1680
1680
  };
1681
+ var getCreateCaseUrl = () => {
1682
+ return `/v1/cases`;
1683
+ };
1684
+ var createCase = async (createCaseBody, options) => {
1685
+ const res = await fetch(getCreateCaseUrl(), {
1686
+ ...options,
1687
+ method: "POST",
1688
+ headers: { "Content-Type": "application/json", ...options?.headers },
1689
+ body: JSON.stringify(createCaseBody)
1690
+ });
1691
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1692
+ const data = body ? JSON.parse(body) : {};
1693
+ return {
1694
+ data,
1695
+ status: res.status,
1696
+ headers: res.headers
1697
+ };
1698
+ };
1681
1699
  var getSearchCasesUrl = (params) => {
1682
1700
  const normalizedParams = new URLSearchParams();
1683
1701
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -3566,6 +3584,17 @@ var listCasesHandler = async (args) => {
3566
3584
  ]
3567
3585
  };
3568
3586
  };
3587
+ var createCaseHandler = async (args) => {
3588
+ const res = await createCase(args.bodyParams);
3589
+ return {
3590
+ content: [
3591
+ {
3592
+ type: "text",
3593
+ text: JSON.stringify(res)
3594
+ }
3595
+ ]
3596
+ };
3597
+ };
3569
3598
  var searchCasesHandler = async (args) => {
3570
3599
  const res = await searchCases(args.queryParams);
3571
3600
  return {
@@ -6764,24 +6793,35 @@ var ListCasesQueryParams = zod.object({
6764
6793
  reporter: zod.string().min(1).optional().describe(
6765
6794
  "Filter by reporter. Case-insensitive substring match against the case reporter."
6766
6795
  ),
6767
- created_by: zod.string().optional().describe("Filter by the worker id that created the case."),
6796
+ created_by: zod.string().optional().describe(
6797
+ 'Filter by the actor that created the case: "worker:<workerId>" or "user:<profileId>".'
6798
+ ),
6768
6799
  count: zod.number().min(1).max(listCasesQueryCountMax).default(listCasesQueryCountDefault),
6769
6800
  offset: zod.number().min(listCasesQueryOffsetMin).default(listCasesQueryOffsetDefault),
6770
6801
  sort_by: zod.enum(["created_at", "updated_at"]).default(listCasesQuerySortByDefault),
6771
6802
  sort_order: zod.enum(["asc", "desc"]).default(listCasesQuerySortOrderDefault)
6772
6803
  });
6804
+ var listCasesResponseCreatedByRegExp = new RegExp(
6805
+ "^(?:worker|user):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
6806
+ );
6773
6807
  var ListCasesResponseItem = zod.object({
6774
6808
  id: zod.string(),
6775
6809
  subject: zod.union([zod.string(), zod.null()]),
6776
6810
  reporter: zod.union([zod.string(), zod.null()]),
6777
- created_by: zod.object({
6778
- type: zod.literal("worker"),
6779
- id: zod.string()
6780
- }),
6811
+ created_by: zod.string().regex(listCasesResponseCreatedByRegExp).describe(
6812
+ 'Actor that created the case, e.g. "worker:<workerId>" or "user:<profileId>".'
6813
+ ),
6781
6814
  created_at: zod.string().datetime({}),
6782
6815
  updated_at: zod.string().datetime({})
6783
6816
  });
6784
6817
  var ListCasesResponse = zod.array(ListCasesResponseItem);
6818
+ var CreateCaseBody = zod.object({
6819
+ id: zod.string().min(1).describe(
6820
+ "Case id, e.g. a claim number. Normalized server-side (trimmed and lowercased) to match how case ids are stored."
6821
+ ),
6822
+ subject: zod.union([zod.string().min(1), zod.null()]).optional().describe("Short description of what the case is about."),
6823
+ reporter: zod.union([zod.string().min(1), zod.null()]).optional().describe("Name of the person or organization that reported the case.")
6824
+ });
6785
6825
  var searchCasesQueryCountDefault = 20;
6786
6826
  var searchCasesQueryCountMax = 50;
6787
6827
  var searchCasesQueryOffsetDefault = 0;
@@ -6793,14 +6833,16 @@ var SearchCasesQueryParams = zod.object({
6793
6833
  count: zod.number().min(1).max(searchCasesQueryCountMax).default(searchCasesQueryCountDefault),
6794
6834
  offset: zod.number().min(searchCasesQueryOffsetMin).default(searchCasesQueryOffsetDefault)
6795
6835
  });
6836
+ var searchCasesResponseCreatedByRegExp = new RegExp(
6837
+ "^(?:worker|user):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
6838
+ );
6796
6839
  var SearchCasesResponseItem = zod.object({
6797
6840
  id: zod.string(),
6798
6841
  subject: zod.union([zod.string(), zod.null()]),
6799
6842
  reporter: zod.union([zod.string(), zod.null()]),
6800
- created_by: zod.object({
6801
- type: zod.literal("worker"),
6802
- id: zod.string()
6803
- }),
6843
+ created_by: zod.string().regex(searchCasesResponseCreatedByRegExp).describe(
6844
+ 'Actor that created the case, e.g. "worker:<workerId>" or "user:<profileId>".'
6845
+ ),
6804
6846
  created_at: zod.string().datetime({}),
6805
6847
  updated_at: zod.string().datetime({})
6806
6848
  });
@@ -6808,15 +6850,17 @@ var SearchCasesResponse = zod.array(SearchCasesResponseItem);
6808
6850
  var GetCaseParams = zod.object({
6809
6851
  id: zod.string().min(1)
6810
6852
  });
6853
+ var getCaseResponseCaseCreatedByRegExp = new RegExp(
6854
+ "^(?:worker|user):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
6855
+ );
6811
6856
  var GetCaseResponse = zod.object({
6812
6857
  case: zod.object({
6813
6858
  id: zod.string(),
6814
6859
  subject: zod.union([zod.string(), zod.null()]),
6815
6860
  reporter: zod.union([zod.string(), zod.null()]),
6816
- created_by: zod.object({
6817
- type: zod.literal("worker"),
6818
- id: zod.string()
6819
- }),
6861
+ created_by: zod.string().regex(getCaseResponseCaseCreatedByRegExp).describe(
6862
+ 'Actor that created the case, e.g. "worker:<workerId>" or "user:<profileId>".'
6863
+ ),
6820
6864
  created_at: zod.string().datetime({}),
6821
6865
  updated_at: zod.string().datetime({})
6822
6866
  })
@@ -8369,6 +8413,14 @@ server.tool(
8369
8413
  },
8370
8414
  listCasesHandler
8371
8415
  );
8416
+ server.tool(
8417
+ "createCase",
8418
+ "Create case",
8419
+ {
8420
+ bodyParams: CreateCaseBody
8421
+ },
8422
+ createCaseHandler
8423
+ );
8372
8424
  server.tool(
8373
8425
  "searchCases",
8374
8426
  "Search cases",
@@ -8767,4 +8819,4 @@ var transport = new StdioServerTransport();
8767
8819
  server.connect(transport).then(() => {
8768
8820
  console.error("MCP server running on stdio");
8769
8821
  }).catch(console.error);
8770
- //# sourceMappingURL=server-C5ZJRZEH.js.map
8822
+ //# sourceMappingURL=server-HFVJQABW.js.map