@avallon-labs/mcp 48.1.0 → 48.2.0-staging.1090

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
@@ -46,5 +46,5 @@ function setupFetch() {
46
46
 
47
47
  // src/index.ts
48
48
  setupFetch();
49
- await import("./server-XWEHYT6M.js");
49
+ await import("./server-5RGZMO6P.js");
50
50
  //# sourceMappingURL=index.js.map
@@ -1847,11 +1847,24 @@ var searchCases = async (params, options) => {
1847
1847
  headers: res.headers
1848
1848
  };
1849
1849
  };
1850
- var getGetCaseUrl = (id) => {
1851
- return `/v1/cases/${id}`;
1850
+ var getGetCaseUrl = (id, params) => {
1851
+ const normalizedParams = new URLSearchParams();
1852
+ Object.entries(params || {}).forEach(([key, value]) => {
1853
+ if (value !== void 0) {
1854
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
1855
+ for (const [sk, sv] of Object.entries(value)) {
1856
+ if (sv !== void 0) normalizedParams.append(`${key}[${sk}]`, String(sv));
1857
+ }
1858
+ } else {
1859
+ normalizedParams.append(key, value === null ? "null" : String(value));
1860
+ }
1861
+ }
1862
+ });
1863
+ const stringifiedParams = normalizedParams.toString();
1864
+ return stringifiedParams.length > 0 ? `/v1/cases/${id}?${stringifiedParams}` : `/v1/cases/${id}`;
1852
1865
  };
1853
- var getCase = async (id, options) => {
1854
- const res = await fetch(getGetCaseUrl(id), {
1866
+ var getCase = async (id, params, options) => {
1867
+ const res = await fetch(getGetCaseUrl(id, params), {
1855
1868
  ...options,
1856
1869
  method: "GET"
1857
1870
  });
@@ -1859,11 +1872,24 @@ var getCase = async (id, options) => {
1859
1872
  const data = body ? JSON.parse(body) : {};
1860
1873
  return { data, status: res.status, headers: res.headers };
1861
1874
  };
1862
- var getAddCaseLinksUrl = (id) => {
1863
- return `/v1/cases/${id}/links`;
1875
+ var getAddCaseLinksUrl = (id, params) => {
1876
+ const normalizedParams = new URLSearchParams();
1877
+ Object.entries(params || {}).forEach(([key, value]) => {
1878
+ if (value !== void 0) {
1879
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
1880
+ for (const [sk, sv] of Object.entries(value)) {
1881
+ if (sv !== void 0) normalizedParams.append(`${key}[${sk}]`, String(sv));
1882
+ }
1883
+ } else {
1884
+ normalizedParams.append(key, value === null ? "null" : String(value));
1885
+ }
1886
+ }
1887
+ });
1888
+ const stringifiedParams = normalizedParams.toString();
1889
+ return stringifiedParams.length > 0 ? `/v1/cases/${id}/links?${stringifiedParams}` : `/v1/cases/${id}/links`;
1864
1890
  };
1865
- var addCaseLinks = async (id, addCaseLinksBody, options) => {
1866
- const res = await fetch(getAddCaseLinksUrl(id), {
1891
+ var addCaseLinks = async (id, addCaseLinksBody, params, options) => {
1892
+ const res = await fetch(getAddCaseLinksUrl(id, params), {
1867
1893
  ...options,
1868
1894
  method: "POST",
1869
1895
  headers: { "Content-Type": "application/json", ...options?.headers },
@@ -1906,14 +1932,30 @@ var listCaseLinks = async (id, params, options) => {
1906
1932
  headers: res.headers
1907
1933
  };
1908
1934
  };
1909
- var getRemoveCaseLinkUrl = (id, entityType, entityId) => {
1910
- return `/v1/cases/${id}/links/${entityType}/${entityId}`;
1911
- };
1912
- var removeCaseLink = async (id, entityType, entityId, options) => {
1913
- const res = await fetch(getRemoveCaseLinkUrl(id, entityType, entityId), {
1914
- ...options,
1915
- method: "DELETE"
1935
+ var getRemoveCaseLinkUrl = (id, entityType, entityId, params) => {
1936
+ const normalizedParams = new URLSearchParams();
1937
+ Object.entries(params || {}).forEach(([key, value]) => {
1938
+ if (value !== void 0) {
1939
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
1940
+ for (const [sk, sv] of Object.entries(value)) {
1941
+ if (sv !== void 0) normalizedParams.append(`${key}[${sk}]`, String(sv));
1942
+ }
1943
+ } else {
1944
+ normalizedParams.append(key, value === null ? "null" : String(value));
1945
+ }
1946
+ }
1916
1947
  });
1948
+ const stringifiedParams = normalizedParams.toString();
1949
+ return stringifiedParams.length > 0 ? `/v1/cases/${id}/links/${entityType}/${entityId}?${stringifiedParams}` : `/v1/cases/${id}/links/${entityType}/${entityId}`;
1950
+ };
1951
+ var removeCaseLink = async (id, entityType, entityId, params, options) => {
1952
+ const res = await fetch(
1953
+ getRemoveCaseLinkUrl(id, entityType, entityId, params),
1954
+ {
1955
+ ...options,
1956
+ method: "DELETE"
1957
+ }
1958
+ );
1917
1959
  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1918
1960
  const data = body ? JSON.parse(body) : {};
1919
1961
  return {
@@ -4258,7 +4300,7 @@ var searchCasesHandler = async (args) => {
4258
4300
  };
4259
4301
  };
4260
4302
  var getCaseHandler = async (args) => {
4261
- const res = await getCase(args.pathParams.id);
4303
+ const res = await getCase(args.pathParams.id, args.queryParams);
4262
4304
  return {
4263
4305
  content: [
4264
4306
  {
@@ -4269,7 +4311,11 @@ var getCaseHandler = async (args) => {
4269
4311
  };
4270
4312
  };
4271
4313
  var addCaseLinksHandler = async (args) => {
4272
- const res = await addCaseLinks(args.pathParams.id, args.bodyParams);
4314
+ const res = await addCaseLinks(
4315
+ args.pathParams.id,
4316
+ args.bodyParams,
4317
+ args.queryParams
4318
+ );
4273
4319
  return {
4274
4320
  content: [
4275
4321
  {
@@ -4294,7 +4340,8 @@ var removeCaseLinkHandler = async (args) => {
4294
4340
  const res = await removeCaseLink(
4295
4341
  args.pathParams.id,
4296
4342
  args.pathParams.entityType,
4297
- args.pathParams.entityId
4343
+ args.pathParams.entityId,
4344
+ args.queryParams
4298
4345
  );
4299
4346
  return {
4300
4347
  content: [
@@ -8262,6 +8309,7 @@ var listCasesQueryOffsetMin = 0;
8262
8309
  var listCasesQuerySortByDefault = `created_at`;
8263
8310
  var listCasesQuerySortOrderDefault = `desc`;
8264
8311
  var ListCasesQueryParams = zod.object({
8312
+ environment: zod.enum(["live", "test"]).optional().describe("Filter by environment. Omit to list cases in both."),
8265
8313
  id: zod.string().min(1).optional().describe(
8266
8314
  "Filter by exact case id. Values are normalized server-side (trimmed and lowercased) to match how case ids are stored."
8267
8315
  ),
@@ -8286,6 +8334,7 @@ var ListCasesResponse = zod.object({
8286
8334
  data: zod.array(
8287
8335
  zod.object({
8288
8336
  id: zod.string(),
8337
+ environment: zod.enum(["live", "test"]),
8289
8338
  subject: zod.union([zod.string(), zod.null()]),
8290
8339
  reporter: zod.union([zod.string(), zod.null()]),
8291
8340
  created_by: zod.string().regex(listCasesResponseDataItemCreatedByRegExp).describe(
@@ -8304,6 +8353,7 @@ var CreateCaseBody = zod.object({
8304
8353
  id: zod.string().min(1).describe(
8305
8354
  "Case id, e.g. a claim number. Normalized server-side (trimmed and lowercased) to match how case ids are stored."
8306
8355
  ),
8356
+ environment: zod.enum(["live", "test"]).optional(),
8307
8357
  subject: zod.union([zod.string().min(1), zod.null()]).optional().describe("Short description of what the case is about."),
8308
8358
  reporter: zod.union([zod.string().min(1), zod.null()]).optional().describe("Name of the person or organization that reported the case.")
8309
8359
  });
@@ -8325,6 +8375,7 @@ var SearchCasesResponse = zod.object({
8325
8375
  data: zod.array(
8326
8376
  zod.object({
8327
8377
  id: zod.string(),
8378
+ environment: zod.enum(["live", "test"]),
8328
8379
  subject: zod.union([zod.string(), zod.null()]),
8329
8380
  reporter: zod.union([zod.string(), zod.null()]),
8330
8381
  created_by: zod.string().regex(searchCasesResponseDataItemCreatedByRegExp).describe(
@@ -8342,6 +8393,11 @@ var SearchCasesResponse = zod.object({
8342
8393
  var GetCaseParams = zod.object({
8343
8394
  id: zod.string().min(1)
8344
8395
  });
8396
+ var GetCaseQueryParams = zod.object({
8397
+ environment: zod.enum(["live", "test"]).optional().describe(
8398
+ "Environment the case belongs to. A case reference is unique per environment, so the same reference can name a different case in each. Defaults to `live`. A worker run may omit this or pass its own run's environment; any other value is rejected."
8399
+ )
8400
+ });
8345
8401
  var getCaseResponseDataCaseCreatedByRegExp = new RegExp(
8346
8402
  "^(?:worker|user):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
8347
8403
  );
@@ -8349,6 +8405,7 @@ var GetCaseResponse = zod.object({
8349
8405
  data: zod.object({
8350
8406
  case: zod.object({
8351
8407
  id: zod.string(),
8408
+ environment: zod.enum(["live", "test"]),
8352
8409
  subject: zod.union([zod.string(), zod.null()]),
8353
8410
  reporter: zod.union([zod.string(), zod.null()]),
8354
8411
  created_by: zod.string().regex(getCaseResponseDataCaseCreatedByRegExp).describe(
@@ -8363,6 +8420,11 @@ var GetCaseResponse = zod.object({
8363
8420
  var AddCaseLinksParams = zod.object({
8364
8421
  id: zod.string().min(1)
8365
8422
  });
8423
+ var AddCaseLinksQueryParams = zod.object({
8424
+ environment: zod.enum(["live", "test"]).optional().describe(
8425
+ "Environment the case belongs to. A case reference is unique per environment, so the same reference can name a different case in each. Defaults to `live`. A worker run may omit this or pass its own run's environment; any other value is rejected."
8426
+ )
8427
+ });
8366
8428
  var addCaseLinksBodyEntitiesMax = 100;
8367
8429
  var AddCaseLinksBody = zod.object({
8368
8430
  entities: zod.array(
@@ -8413,6 +8475,9 @@ var listCaseLinksQueryOffsetMin = 0;
8413
8475
  var listCaseLinksQuerySortByDefault = `created_at`;
8414
8476
  var listCaseLinksQuerySortOrderDefault = `desc`;
8415
8477
  var ListCaseLinksQueryParams = zod.object({
8478
+ environment: zod.enum(["live", "test"]).optional().describe(
8479
+ "Environment the case belongs to. A case reference is unique per environment, so the same reference can name a different case in each. Defaults to `live`. A worker run may omit this or pass its own run's environment; any other value is rejected."
8480
+ ),
8416
8481
  entity_type: zod.enum([
8417
8482
  "artifact",
8418
8483
  "call",
@@ -8465,6 +8530,11 @@ var RemoveCaseLinkParams = zod.object({
8465
8530
  ]),
8466
8531
  entityId: zod.string().uuid()
8467
8532
  });
8533
+ var RemoveCaseLinkQueryParams = zod.object({
8534
+ environment: zod.enum(["live", "test"]).optional().describe(
8535
+ "Environment the case belongs to. A case reference is unique per environment, so the same reference can name a different case in each. Defaults to `live`. A worker run may omit this or pass its own run's environment; any other value is rejected."
8536
+ )
8537
+ });
8468
8538
  var RemoveCaseLinkResponse = zod.object({
8469
8539
  data: zod.object({}),
8470
8540
  message: zod.string()
@@ -11139,7 +11209,8 @@ server.tool(
11139
11209
  "getCase",
11140
11210
  "Get case",
11141
11211
  {
11142
- pathParams: GetCaseParams
11212
+ pathParams: GetCaseParams,
11213
+ queryParams: GetCaseQueryParams
11143
11214
  },
11144
11215
  getCaseHandler
11145
11216
  );
@@ -11148,6 +11219,7 @@ server.tool(
11148
11219
  "Add case links",
11149
11220
  {
11150
11221
  pathParams: AddCaseLinksParams,
11222
+ queryParams: AddCaseLinksQueryParams,
11151
11223
  bodyParams: AddCaseLinksBody
11152
11224
  },
11153
11225
  addCaseLinksHandler
@@ -11165,7 +11237,8 @@ server.tool(
11165
11237
  "removeCaseLink",
11166
11238
  "Remove case link",
11167
11239
  {
11168
- pathParams: RemoveCaseLinkParams
11240
+ pathParams: RemoveCaseLinkParams,
11241
+ queryParams: RemoveCaseLinkQueryParams
11169
11242
  },
11170
11243
  removeCaseLinkHandler
11171
11244
  );
@@ -11706,4 +11779,4 @@ var transport = new StdioServerTransport();
11706
11779
  server.connect(transport).then(() => {
11707
11780
  console.error("MCP server running on stdio");
11708
11781
  }).catch(console.error);
11709
- //# sourceMappingURL=server-XWEHYT6M.js.map
11782
+ //# sourceMappingURL=server-5RGZMO6P.js.map