@avallon-labs/mcp 57.1.0 → 57.2.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
@@ -46,5 +46,5 @@ function setupFetch() {
46
46
 
47
47
  // src/index.ts
48
48
  setupFetch();
49
- await import("./server-3JZUJX4G.js");
49
+ await import("./server-A5HM5YBX.js");
50
50
  //# sourceMappingURL=index.js.map
@@ -2227,6 +2227,28 @@ var updateCase = async (id, updateCaseBody, params, options) => {
2227
2227
  const data = body ? JSON.parse(body) : {};
2228
2228
  return { data, status: res.status, headers: res.headers };
2229
2229
  };
2230
+ var getGetCaseCitationsUrl = (id, params) => {
2231
+ const normalizedParams = new URLSearchParams();
2232
+ Object.entries(params || {}).forEach(([key, value]) => {
2233
+ if (value !== void 0) {
2234
+ normalizedParams.append(key, value === null ? "null" : String(value));
2235
+ }
2236
+ });
2237
+ const stringifiedParams = normalizedParams.toString();
2238
+ return stringifiedParams.length > 0 ? `/v1/cases/${id}/citations?${stringifiedParams}` : `/v1/cases/${id}/citations`;
2239
+ };
2240
+ var getCaseCitations = async (id, params, options) => {
2241
+ const res = await fetch(
2242
+ getGetCaseCitationsUrl(id, params),
2243
+ {
2244
+ ...options,
2245
+ method: "GET"
2246
+ }
2247
+ );
2248
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2249
+ const data = body ? JSON.parse(body) : {};
2250
+ return { data, status: res.status, headers: res.headers };
2251
+ };
2230
2252
  var getAddCaseLinksUrl = (id, params) => {
2231
2253
  const normalizedParams = new URLSearchParams();
2232
2254
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -6385,6 +6407,29 @@ var updateCaseHandler = async (args, options) => {
6385
6407
  structuredContent: res.data
6386
6408
  };
6387
6409
  };
6410
+ var getCaseCitationsHandler = async (args, options) => {
6411
+ const res = await getCaseCitations(args.pathParams.id, args.queryParams, options);
6412
+ if (res.status >= 400) {
6413
+ return {
6414
+ content: [
6415
+ {
6416
+ type: "text",
6417
+ text: JSON.stringify(res.data ?? null)
6418
+ }
6419
+ ],
6420
+ isError: true
6421
+ };
6422
+ }
6423
+ return {
6424
+ content: [
6425
+ {
6426
+ type: "text",
6427
+ text: JSON.stringify(res.data ?? null)
6428
+ }
6429
+ ],
6430
+ structuredContent: res.data
6431
+ };
6432
+ };
6388
6433
  var addCaseLinksHandler = async (args, options) => {
6389
6434
  const res = await addCaseLinks(args.pathParams.id, args.bodyParams, args.queryParams, options);
6390
6435
  if (res.status >= 400) {
@@ -11587,6 +11632,29 @@ var UpdateCaseResponse = zod.object({
11587
11632
  }),
11588
11633
  "message": zod.string()
11589
11634
  });
11635
+ var GetCaseCitationsParams = zod.object({
11636
+ "id": zod.string().min(1)
11637
+ });
11638
+ var GetCaseCitationsQueryParams = zod.object({
11639
+ "environment": zod.enum(["live", "test"]).optional().describe("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.")
11640
+ });
11641
+ var GetCaseCitationsResponse = zod.object({
11642
+ "data": zod.object({
11643
+ "chunks": zod.record(zod.string(), zod.object({
11644
+ "artifact_id": zod.string(),
11645
+ "artifact_name": zod.string(),
11646
+ "page": zod.union([zod.number(), zod.null()]),
11647
+ "bounding_box": zod.union([zod.object({
11648
+ "left": zod.number(),
11649
+ "top": zod.number(),
11650
+ "width": zod.number(),
11651
+ "height": zod.number()
11652
+ }), zod.null()]),
11653
+ "content": zod.string()
11654
+ }))
11655
+ }),
11656
+ "message": zod.string()
11657
+ });
11590
11658
  var AddCaseLinksParams = zod.object({
11591
11659
  "id": zod.string().min(1)
11592
11660
  });
@@ -15668,6 +15736,23 @@ var createMcpServer = (options) => {
15668
15736
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
15669
15737
  })
15670
15738
  );
15739
+ tools.getCaseCitations = server2.registerTool(
15740
+ "getCaseCitations",
15741
+ {
15742
+ title: "Get case citations",
15743
+ description: "Resolve the chunks cited by a case's current field values, keyed by chunk id.\n\nEach field in `GET /v1/cases/{id}` lists its citations as chunk ids; this endpoint\nreturns the document, page, bounding box and text for each. Chunks whose document\nwas deleted are omitted. A case with no cited fields returns an empty map.",
15744
+ inputSchema: {
15745
+ pathParams: GetCaseCitationsParams,
15746
+ queryParams: GetCaseCitationsQueryParams
15747
+ },
15748
+ outputSchema: GetCaseCitationsResponse,
15749
+ annotations: { readOnlyHint: true }
15750
+ },
15751
+ (args, ctx) => getCaseCitationsHandler(args, {
15752
+ ...options,
15753
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
15754
+ })
15755
+ );
15671
15756
  tools.addCaseLinks = server2.registerTool(
15672
15757
  "addCaseLinks",
15673
15758
  {
@@ -17065,4 +17150,4 @@ var transport = new StdioServerTransport();
17065
17150
  server.connect(transport).then(() => {
17066
17151
  console.error("MCP server running on stdio");
17067
17152
  }).catch(console.error);
17068
- //# sourceMappingURL=server-3JZUJX4G.js.map
17153
+ //# sourceMappingURL=server-A5HM5YBX.js.map