@avallon-labs/mcp 54.8.0-staging.1259 → 54.9.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-6UFKGEJF.js");
49
+ await import("./server-Z3MVWEM5.js");
50
50
  //# sourceMappingURL=index.js.map
@@ -2197,6 +2197,36 @@ var deleteCase = async (id, params, options) => {
2197
2197
  const data = body ? JSON.parse(body) : {};
2198
2198
  return { data, status: res.status, headers: res.headers };
2199
2199
  };
2200
+ var getUpdateCaseUrl = (id, params) => {
2201
+ const normalizedParams = new URLSearchParams();
2202
+ Object.entries(params || {}).forEach(([key, value]) => {
2203
+ if (value !== void 0) {
2204
+ normalizedParams.append(key, value === null ? "null" : String(value));
2205
+ }
2206
+ });
2207
+ const stringifiedParams = normalizedParams.toString();
2208
+ return stringifiedParams.length > 0 ? `/v1/cases/${id}?${stringifiedParams}` : `/v1/cases/${id}`;
2209
+ };
2210
+ var updateCase = async (id, updateCaseBody, params, options) => {
2211
+ const getHeaders = (h) => {
2212
+ if (!h) return {};
2213
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
2214
+ if (Array.isArray(h)) return Object.fromEntries(h);
2215
+ return h;
2216
+ };
2217
+ const res = await fetch(
2218
+ getUpdateCaseUrl(id, params),
2219
+ {
2220
+ ...options,
2221
+ method: "PATCH",
2222
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2223
+ body: JSON.stringify(updateCaseBody)
2224
+ }
2225
+ );
2226
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2227
+ const data = body ? JSON.parse(body) : {};
2228
+ return { data, status: res.status, headers: res.headers };
2229
+ };
2200
2230
  var getAddCaseLinksUrl = (id, params) => {
2201
2231
  const normalizedParams = new URLSearchParams();
2202
2232
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -6279,6 +6309,29 @@ var deleteCaseHandler = async (args, options) => {
6279
6309
  structuredContent: res.data
6280
6310
  };
6281
6311
  };
6312
+ var updateCaseHandler = async (args, options) => {
6313
+ const res = await updateCase(args.pathParams.id, args.bodyParams, args.queryParams, options);
6314
+ if (res.status >= 400) {
6315
+ return {
6316
+ content: [
6317
+ {
6318
+ type: "text",
6319
+ text: JSON.stringify(res.data ?? null)
6320
+ }
6321
+ ],
6322
+ isError: true
6323
+ };
6324
+ }
6325
+ return {
6326
+ content: [
6327
+ {
6328
+ type: "text",
6329
+ text: JSON.stringify(res.data ?? null)
6330
+ }
6331
+ ],
6332
+ structuredContent: res.data
6333
+ };
6334
+ };
6282
6335
  var addCaseLinksHandler = async (args, options) => {
6283
6336
  const res = await addCaseLinks(args.pathParams.id, args.bodyParams, args.queryParams, options);
6284
6337
  if (res.status >= 400) {
@@ -11272,6 +11325,7 @@ var ListCasesResponse = zod.object({
11272
11325
  "data": zod.array(zod.object({
11273
11326
  "id": zod.string(),
11274
11327
  "environment": zod.enum(["live", "test"]),
11328
+ "type_slug": zod.string(),
11275
11329
  "subject": zod.union([zod.string(), zod.null()]),
11276
11330
  "reporter": zod.union([zod.string(), zod.null()]),
11277
11331
  "created_by": zod.string().describe('Actor that created the case, e.g. "worker:<workerId>" or "user:<profileId>".'),
@@ -11286,6 +11340,11 @@ var ListCasesResponse = zod.object({
11286
11340
  var CreateCaseBody = zod.object({
11287
11341
  "id": zod.string().min(1).describe("Case id, e.g. a claim number. Normalized server-side (trimmed and lowercased) to match how case ids are stored."),
11288
11342
  "environment": zod.enum(["live", "test"]).optional(),
11343
+ "type_slug": zod.string().optional().describe("Defaults to `default`."),
11344
+ "fields": zod.record(zod.string(), zod.union([zod.object({
11345
+ "value": zod.union([zod.union([zod.string(), zod.number(), zod.boolean()]), zod.array(zod.union([zod.string(), zod.number(), zod.boolean()]))]),
11346
+ "citations": zod.array(zod.string().uuid()).describe("Chunk IDs from the `[chunk_id=\u2026]` markers of the sources.")
11347
+ }), zod.null()])).optional().describe("Initial field values."),
11289
11348
  "subject": zod.union([zod.string().min(1), zod.null()]).optional().describe("Short description of what the case is about."),
11290
11349
  "reporter": zod.union([zod.string().min(1), zod.null()]).optional().describe("Name of the person or organization that reported the case.")
11291
11350
  });
@@ -11294,11 +11353,19 @@ var CreateCaseResponse = zod.object({
11294
11353
  "case": zod.object({
11295
11354
  "id": zod.string(),
11296
11355
  "environment": zod.enum(["live", "test"]),
11356
+ "type_slug": zod.string(),
11297
11357
  "subject": zod.union([zod.string(), zod.null()]),
11298
11358
  "reporter": zod.union([zod.string(), zod.null()]),
11299
11359
  "created_by": zod.string().describe('Actor that created the case, e.g. "worker:<workerId>" or "user:<profileId>".'),
11300
11360
  "created_at": zod.string().datetime({ "offset": true }),
11301
- "updated_at": zod.string().datetime({ "offset": true })
11361
+ "updated_at": zod.string().datetime({ "offset": true }),
11362
+ "version": zod.number().describe("Version the fields below belong to."),
11363
+ "fields": zod.record(zod.string(), zod.object({
11364
+ "value": zod.union([zod.union([zod.union([zod.string(), zod.number(), zod.boolean()]), zod.array(zod.union([zod.string(), zod.number(), zod.boolean()]))]), zod.null()]),
11365
+ "set_by": zod.string().describe('Actor string, e.g. "worker:<workerId>" or "user:<profileId>".'),
11366
+ "set_at": zod.string().datetime({ "offset": true }),
11367
+ "citations": zod.array(zod.string().uuid())
11368
+ }))
11302
11369
  })
11303
11370
  }),
11304
11371
  "message": zod.string()
@@ -11316,6 +11383,7 @@ var SearchCasesResponse = zod.object({
11316
11383
  "data": zod.array(zod.object({
11317
11384
  "id": zod.string(),
11318
11385
  "environment": zod.enum(["live", "test"]),
11386
+ "type_slug": zod.string(),
11319
11387
  "subject": zod.union([zod.string(), zod.null()]),
11320
11388
  "reporter": zod.union([zod.string(), zod.null()]),
11321
11389
  "created_by": zod.string().describe('Actor that created the case, e.g. "worker:<workerId>" or "user:<profileId>".'),
@@ -11338,11 +11406,19 @@ var GetCaseResponse = zod.object({
11338
11406
  "case": zod.object({
11339
11407
  "id": zod.string(),
11340
11408
  "environment": zod.enum(["live", "test"]),
11409
+ "type_slug": zod.string(),
11341
11410
  "subject": zod.union([zod.string(), zod.null()]),
11342
11411
  "reporter": zod.union([zod.string(), zod.null()]),
11343
11412
  "created_by": zod.string().describe('Actor that created the case, e.g. "worker:<workerId>" or "user:<profileId>".'),
11344
11413
  "created_at": zod.string().datetime({ "offset": true }),
11345
- "updated_at": zod.string().datetime({ "offset": true })
11414
+ "updated_at": zod.string().datetime({ "offset": true }),
11415
+ "version": zod.number().describe("Version the fields below belong to."),
11416
+ "fields": zod.record(zod.string(), zod.object({
11417
+ "value": zod.union([zod.union([zod.union([zod.string(), zod.number(), zod.boolean()]), zod.array(zod.union([zod.string(), zod.number(), zod.boolean()]))]), zod.null()]),
11418
+ "set_by": zod.string().describe('Actor string, e.g. "worker:<workerId>" or "user:<profileId>".'),
11419
+ "set_at": zod.string().datetime({ "offset": true }),
11420
+ "citations": zod.array(zod.string().uuid())
11421
+ }))
11346
11422
  })
11347
11423
  }),
11348
11424
  "message": zod.string()
@@ -11357,6 +11433,40 @@ var DeleteCaseResponse = zod.object({
11357
11433
  "data": zod.object({}),
11358
11434
  "message": zod.string()
11359
11435
  });
11436
+ var UpdateCaseParams = zod.object({
11437
+ "id": zod.string().min(1)
11438
+ });
11439
+ var UpdateCaseQueryParams = zod.object({
11440
+ "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.")
11441
+ });
11442
+ var UpdateCaseBody = zod.object({
11443
+ "fields": zod.record(zod.string(), zod.union([zod.object({
11444
+ "value": zod.union([zod.union([zod.string(), zod.number(), zod.boolean()]), zod.array(zod.union([zod.string(), zod.number(), zod.boolean()]))]),
11445
+ "citations": zod.array(zod.string().uuid()).describe("Chunk IDs from the `[chunk_id=\u2026]` markers of the sources.")
11446
+ }), zod.null()])).optional().describe("Values keyed by field key, validated against the case type. `null` clears a field.")
11447
+ });
11448
+ var UpdateCaseResponse = zod.object({
11449
+ "data": zod.object({
11450
+ "case": zod.object({
11451
+ "id": zod.string(),
11452
+ "environment": zod.enum(["live", "test"]),
11453
+ "type_slug": zod.string(),
11454
+ "subject": zod.union([zod.string(), zod.null()]),
11455
+ "reporter": zod.union([zod.string(), zod.null()]),
11456
+ "created_by": zod.string().describe('Actor that created the case, e.g. "worker:<workerId>" or "user:<profileId>".'),
11457
+ "created_at": zod.string().datetime({ "offset": true }),
11458
+ "updated_at": zod.string().datetime({ "offset": true }),
11459
+ "version": zod.number().describe("Version the fields below belong to."),
11460
+ "fields": zod.record(zod.string(), zod.object({
11461
+ "value": zod.union([zod.union([zod.union([zod.string(), zod.number(), zod.boolean()]), zod.array(zod.union([zod.string(), zod.number(), zod.boolean()]))]), zod.null()]),
11462
+ "set_by": zod.string().describe('Actor string, e.g. "worker:<workerId>" or "user:<profileId>".'),
11463
+ "set_at": zod.string().datetime({ "offset": true }),
11464
+ "citations": zod.array(zod.string().uuid())
11465
+ }))
11466
+ })
11467
+ }),
11468
+ "message": zod.string()
11469
+ });
11360
11470
  var AddCaseLinksParams = zod.object({
11361
11471
  "id": zod.string().min(1)
11362
11472
  });
@@ -15356,7 +15466,7 @@ var createMcpServer = (options) => {
15356
15466
  "getCase",
15357
15467
  {
15358
15468
  title: "Get case",
15359
- description: "Retrieve a case by id.\n\nRelated entities are not embedded \u2014 fetch them via the filtered list endpoints,\ne.g. `GET /v1/worker-runs?case_id=\u2026` and `GET /v1/artifacts?metadata[case_id]=\u2026`.",
15469
+ description: "Retrieve a case by id, with its current fields.\n\nRelated entities are not embedded \u2014 fetch them via the filtered list endpoints,\ne.g. `GET /v1/worker-runs?case_id=\u2026` and `GET /v1/artifacts?metadata[case_id]=\u2026`.",
15360
15470
  inputSchema: {
15361
15471
  pathParams: GetCaseParams,
15362
15472
  queryParams: GetCaseQueryParams
@@ -15386,6 +15496,24 @@ var createMcpServer = (options) => {
15386
15496
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
15387
15497
  })
15388
15498
  );
15499
+ tools.updateCase = server2.registerTool(
15500
+ "updateCase",
15501
+ {
15502
+ title: "Update case",
15503
+ description: "Only the fields sent change; `null` clears one.",
15504
+ inputSchema: {
15505
+ pathParams: UpdateCaseParams,
15506
+ queryParams: UpdateCaseQueryParams,
15507
+ bodyParams: UpdateCaseBody.optional()
15508
+ },
15509
+ outputSchema: UpdateCaseResponse,
15510
+ annotations: { destructiveHint: true }
15511
+ },
15512
+ (args, ctx) => updateCaseHandler(args, {
15513
+ ...options,
15514
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
15515
+ })
15516
+ );
15389
15517
  tools.addCaseLinks = server2.registerTool(
15390
15518
  "addCaseLinks",
15391
15519
  {
@@ -16738,4 +16866,4 @@ var transport = new StdioServerTransport();
16738
16866
  server.connect(transport).then(() => {
16739
16867
  console.error("MCP server running on stdio");
16740
16868
  }).catch(console.error);
16741
- //# sourceMappingURL=server-6UFKGEJF.js.map
16869
+ //# sourceMappingURL=server-Z3MVWEM5.js.map