@avallon-labs/mcp 70.0.0-staging.1501 → 70.2.0-staging.1509

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
@@ -56,5 +56,5 @@ function describeErrors(body) {
56
56
 
57
57
  // src/index.ts
58
58
  setupFetch();
59
- await import("./server-3FMVJP3N.js");
59
+ await import("./server-NDNGGNCB.js");
60
60
  //# sourceMappingURL=index.js.map
@@ -3114,6 +3114,51 @@ var promoteIntakeVersion = async (intakeId, version, promoteIntakeVersionBody, o
3114
3114
  const data = body ? JSON.parse(body) : {};
3115
3115
  return { data, status: res.status, headers: res.headers };
3116
3116
  };
3117
+ var getListIntakeBundlesUrl = (intakeId, params) => {
3118
+ const normalizedParams = new URLSearchParams();
3119
+ Object.entries(params || {}).forEach(([key, value]) => {
3120
+ if (value !== void 0) {
3121
+ normalizedParams.append(key, value === null ? "null" : String(value));
3122
+ }
3123
+ });
3124
+ const stringifiedParams = normalizedParams.toString();
3125
+ return stringifiedParams.length > 0 ? `/v1/intakes/${intakeId}/bundles?${stringifiedParams}` : `/v1/intakes/${intakeId}/bundles`;
3126
+ };
3127
+ var listIntakeBundles = async (intakeId, params, options) => {
3128
+ const res = await fetch(
3129
+ getListIntakeBundlesUrl(intakeId, params),
3130
+ {
3131
+ ...options,
3132
+ method: "GET"
3133
+ }
3134
+ );
3135
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3136
+ const data = body ? JSON.parse(body) : {};
3137
+ return { data, status: res.status, headers: res.headers };
3138
+ };
3139
+ var getResolveIntakeBundleUrl = (intakeId, bundleId) => {
3140
+ return `/v1/intakes/${intakeId}/bundles/${bundleId}/resolve`;
3141
+ };
3142
+ var resolveIntakeBundle = async (intakeId, bundleId, intakeBundleResolution, options) => {
3143
+ const getHeaders = (h) => {
3144
+ if (!h) return {};
3145
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
3146
+ if (Array.isArray(h)) return Object.fromEntries(h);
3147
+ return h;
3148
+ };
3149
+ const res = await fetch(
3150
+ getResolveIntakeBundleUrl(intakeId, bundleId),
3151
+ {
3152
+ ...options,
3153
+ method: "POST",
3154
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
3155
+ body: JSON.stringify(intakeBundleResolution)
3156
+ }
3157
+ );
3158
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3159
+ const data = body ? JSON.parse(body) : {};
3160
+ return { data, status: res.status, headers: res.headers };
3161
+ };
3117
3162
  var getGetExtractUrl = (id) => {
3118
3163
  return `/v1/extracts/${id}`;
3119
3164
  };
@@ -8127,6 +8172,52 @@ var promoteIntakeVersionHandler = async (args, options) => {
8127
8172
  structuredContent: res.data
8128
8173
  };
8129
8174
  };
8175
+ var listIntakeBundlesHandler = async (args, options) => {
8176
+ const res = await listIntakeBundles(args.pathParams.intakeId, args.queryParams, options);
8177
+ if (res.status >= 400) {
8178
+ return {
8179
+ content: [
8180
+ {
8181
+ type: "text",
8182
+ text: JSON.stringify(res.data ?? null)
8183
+ }
8184
+ ],
8185
+ isError: true
8186
+ };
8187
+ }
8188
+ return {
8189
+ content: [
8190
+ {
8191
+ type: "text",
8192
+ text: JSON.stringify(res.data ?? null)
8193
+ }
8194
+ ],
8195
+ structuredContent: res.data
8196
+ };
8197
+ };
8198
+ var resolveIntakeBundleHandler = async (args, options) => {
8199
+ const res = await resolveIntakeBundle(args.pathParams.intakeId, args.pathParams.bundleId, args.bodyParams, options);
8200
+ if (res.status >= 400) {
8201
+ return {
8202
+ content: [
8203
+ {
8204
+ type: "text",
8205
+ text: JSON.stringify(res.data ?? null)
8206
+ }
8207
+ ],
8208
+ isError: true
8209
+ };
8210
+ }
8211
+ return {
8212
+ content: [
8213
+ {
8214
+ type: "text",
8215
+ text: JSON.stringify(res.data ?? null)
8216
+ }
8217
+ ],
8218
+ structuredContent: res.data
8219
+ };
8220
+ };
8130
8221
  var getExtractHandler = async (args, options) => {
8131
8222
  const res = await getExtract(args.pathParams.id, options);
8132
8223
  if (res.status >= 400) {
@@ -13000,7 +13091,8 @@ var CreateWorkerBody = zod.object({
13000
13091
  "name": zod.string().min(1),
13001
13092
  "prompt": zod.string().min(1).optional(),
13002
13093
  "instruction_template": zod.string().min(1).optional().describe("Deprecated. Use `prompt` instead."),
13003
- "mcp_type": zod.null().optional().describe("Deprecated. A worker is created without MCP servers; add them by updating the worker.")
13094
+ "mcp_type": zod.null().optional().describe("Deprecated. A worker is created without MCP servers; add them by updating the worker."),
13095
+ "intake_id": zod.string().uuid().optional().describe("Intake whose items the worker routes. Fixed once the worker is created.")
13004
13096
  });
13005
13097
  var createWorkerResponseDataVersionMin = 0;
13006
13098
  var createWorkerResponseDataVersionsLatestMin = -9007199254740991;
@@ -13142,8 +13234,7 @@ var UpdateWorkerBody = zod.object({
13142
13234
  "schema": zod.record(zod.string(), zod.unknown()).optional(),
13143
13235
  "tools": zod.array(zod.string().uuid()).optional().describe("Replace the worker's attached tool set. Omit to leave unchanged; pass [] to clear."),
13144
13236
  "secrets": zod.array(zod.string().uuid()).optional().describe("Replace the worker's attached secret set. Omit to leave unchanged; pass [] to detach all."),
13145
- "permissions": zod.array(zod.enum(["inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write", "forms:request"])).optional().describe("Permissions granted to the worker on each run"),
13146
- "intake_id": zod.union([zod.string().uuid(), zod.null()]).optional().describe("Intake whose items the worker routes. Omit to leave unchanged; pass null to clear. Saved as a new config version.")
13237
+ "permissions": zod.array(zod.enum(["inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write", "forms:request"])).optional().describe("Permissions granted to the worker on each run")
13147
13238
  });
13148
13239
  var updateWorkerResponseDataVersionMin = 0;
13149
13240
  var updateWorkerResponseDataVersionsLatestMin = -9007199254740991;
@@ -14574,6 +14665,79 @@ var PromoteIntakeVersionResponse = zod.object({
14574
14665
  }),
14575
14666
  "message": zod.string()
14576
14667
  });
14668
+ var ListIntakeBundlesParams = zod.object({
14669
+ "intakeId": zod.string().uuid()
14670
+ });
14671
+ var listIntakeBundlesQueryCountDefault = 50;
14672
+ var listIntakeBundlesQueryCountMax = 100;
14673
+ var listIntakeBundlesQueryOffsetDefault = 0;
14674
+ var listIntakeBundlesQueryOffsetMin = 0;
14675
+ var listIntakeBundlesQuerySortByDefault = `created_at`;
14676
+ var listIntakeBundlesQuerySortOrderDefault = `desc`;
14677
+ var ListIntakeBundlesQueryParams = zod.object({
14678
+ "destination": zod.enum(["route", "ignore", "review", "reroute"]).optional(),
14679
+ "environment": zod.enum(["live", "test"]).optional(),
14680
+ "deferred": zod.enum(["true", "false"]).optional().describe("`true` for bundles deferred until a later time, `false` for bundles that are due. Omit to list both."),
14681
+ "count": zod.number().min(1).max(listIntakeBundlesQueryCountMax).default(listIntakeBundlesQueryCountDefault),
14682
+ "offset": zod.number().min(listIntakeBundlesQueryOffsetMin).default(listIntakeBundlesQueryOffsetDefault),
14683
+ "sort_by": zod.enum(["created_at"]).default(listIntakeBundlesQuerySortByDefault),
14684
+ "sort_order": zod.enum(["asc", "desc"]).default(listIntakeBundlesQuerySortOrderDefault)
14685
+ });
14686
+ var ListIntakeBundlesResponse = zod.object({
14687
+ "data": zod.array(zod.object({
14688
+ "id": zod.string(),
14689
+ "intake_id": zod.string(),
14690
+ "environment": zod.enum(["live", "test"]),
14691
+ "routing_run_id": zod.string(),
14692
+ "destination": zod.enum(["route", "ignore", "review", "reroute"]),
14693
+ "route_id": zod.union([zod.string(), zod.null()]).describe("On a bundle in review, the route routing suggests."),
14694
+ "deferred_until": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
14695
+ "routing_reason": zod.string(),
14696
+ "delivery_failure": zod.union([zod.string(), zod.null()]),
14697
+ "artifact_ids": zod.array(zod.string()),
14698
+ "created_at": zod.string().datetime({ "offset": true }),
14699
+ "updated_at": zod.string().datetime({ "offset": true })
14700
+ })),
14701
+ "message": zod.string(),
14702
+ "meta": zod.object({
14703
+ "total": zod.number()
14704
+ })
14705
+ });
14706
+ var ResolveIntakeBundleParams = zod.object({
14707
+ "intakeId": zod.string().uuid(),
14708
+ "bundleId": zod.string().uuid()
14709
+ });
14710
+ var resolveIntakeBundleBodyOneReasonMax = 1e4;
14711
+ var resolveIntakeBundleBodyTwoReasonMax = 1e4;
14712
+ var resolveIntakeBundleBodyThreeReasonMax = 1e4;
14713
+ var ResolveIntakeBundleBody = zod.union([zod.object({
14714
+ "destination": zod.literal("route"),
14715
+ "route_id": zod.string().uuid(),
14716
+ "reason": zod.string().min(1).max(resolveIntakeBundleBodyOneReasonMax).optional().describe("Why you chose this destination.")
14717
+ }), zod.object({
14718
+ "destination": zod.literal("ignore"),
14719
+ "reason": zod.string().min(1).max(resolveIntakeBundleBodyTwoReasonMax).optional().describe("Why you chose this destination.")
14720
+ }), zod.object({
14721
+ "destination": zod.literal("reroute"),
14722
+ "reason": zod.string().min(1).max(resolveIntakeBundleBodyThreeReasonMax).optional().describe("Why you chose this destination.")
14723
+ })]);
14724
+ var ResolveIntakeBundleResponse = zod.object({
14725
+ "data": zod.object({
14726
+ "id": zod.string(),
14727
+ "intake_id": zod.string(),
14728
+ "environment": zod.enum(["live", "test"]),
14729
+ "routing_run_id": zod.string(),
14730
+ "destination": zod.enum(["route", "ignore", "review", "reroute"]),
14731
+ "route_id": zod.union([zod.string(), zod.null()]).describe("On a bundle in review, the route routing suggests."),
14732
+ "deferred_until": zod.union([zod.string().datetime({ "offset": true }), zod.null()]),
14733
+ "routing_reason": zod.string(),
14734
+ "delivery_failure": zod.union([zod.string(), zod.null()]),
14735
+ "artifact_ids": zod.array(zod.string()),
14736
+ "created_at": zod.string().datetime({ "offset": true }),
14737
+ "updated_at": zod.string().datetime({ "offset": true })
14738
+ }),
14739
+ "message": zod.string()
14740
+ });
14577
14741
  var GetExtractParams = zod.object({
14578
14742
  "id": zod.string().uuid()
14579
14743
  });
@@ -14661,7 +14825,7 @@ var GetProfileResponse = zod.object({
14661
14825
  "last_name": zod.union([zod.string(), zod.null()]),
14662
14826
  "email": zod.string(),
14663
14827
  "role": zod.enum(["admin", "avallon_admin", "member"]),
14664
- "permissions": zod.array(zod.enum(["voice-agents:read", "voice-agents:write", "voice-agents:promote", "tools:write", "tools:execute", "tools:promote", "tool-calls:read", "extractors:write", "inboxes:write", "inboxes:send", "artifacts:write", "api-keys:write", "teams:write", "cases:write", "cases:delete", "case-types:read", "case-types:create", "case-types:write", "forms:read", "forms:create", "forms:write", "forms:request", "forms:promote", "information-requests:write", "information-requests:resolve", "information-requests:delete", "feedback:write", "outbound-jobs:write", "outbound-jobs:schedule", "calls:monitor", "workers:read", "workers:create", "workers:write", "workers:execute", "workers:write-mcp", "workers:run", "workers:promote", "chat-agents:write", "evaluators:write", "intakes:write", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "identity-providers:write", "schedules:read", "schedules:write", "tenants:write", "analytics:view-cost"])),
14828
+ "permissions": zod.array(zod.enum(["voice-agents:read", "voice-agents:write", "voice-agents:promote", "tools:write", "tools:execute", "tools:promote", "tool-calls:read", "extractors:write", "inboxes:write", "inboxes:send", "artifacts:write", "api-keys:write", "teams:write", "cases:write", "cases:delete", "case-types:read", "case-types:create", "case-types:write", "forms:read", "forms:create", "forms:write", "forms:request", "forms:promote", "information-requests:write", "information-requests:resolve", "information-requests:delete", "feedback:write", "outbound-jobs:write", "outbound-jobs:schedule", "calls:monitor", "workers:read", "workers:create", "workers:write", "workers:execute", "workers:write-mcp", "workers:run", "workers:promote", "chat-agents:write", "evaluators:write", "intakes:write", "intakes:review", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "identity-providers:write", "schedules:read", "schedules:write", "tenants:write", "analytics:view-cost"])),
14665
14829
  "tenants": zod.object({
14666
14830
  "active": zod.object({
14667
14831
  "id": zod.string(),
@@ -19097,6 +19261,40 @@ var createMcpServer = (options) => {
19097
19261
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
19098
19262
  })
19099
19263
  );
19264
+ tools.listIntakeBundles = server2.registerTool(
19265
+ "listIntakeBundles",
19266
+ {
19267
+ title: "List intake bundles",
19268
+ description: "List the bundles an intake sorted its documents into. Bundles waiting for review have the destination `review`.",
19269
+ inputSchema: {
19270
+ pathParams: ListIntakeBundlesParams,
19271
+ queryParams: ListIntakeBundlesQueryParams
19272
+ },
19273
+ outputSchema: ListIntakeBundlesResponse,
19274
+ annotations: { readOnlyHint: true }
19275
+ },
19276
+ (args, ctx) => listIntakeBundlesHandler(args, {
19277
+ ...options,
19278
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
19279
+ })
19280
+ );
19281
+ tools.resolveIntakeBundle = server2.registerTool(
19282
+ "resolveIntakeBundle",
19283
+ {
19284
+ title: "Resolve intake bundle",
19285
+ description: "Move a bundle out of review: send it to a route, ignore it, or route it again.",
19286
+ inputSchema: {
19287
+ pathParams: ResolveIntakeBundleParams,
19288
+ bodyParams: ResolveIntakeBundleBody.optional()
19289
+ },
19290
+ outputSchema: ResolveIntakeBundleResponse,
19291
+ annotations: { destructiveHint: true }
19292
+ },
19293
+ (args, ctx) => resolveIntakeBundleHandler(args, {
19294
+ ...options,
19295
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
19296
+ })
19297
+ );
19100
19298
  tools.getExtract = server2.registerTool(
19101
19299
  "getExtract",
19102
19300
  {
@@ -20377,4 +20575,4 @@ var transport = new StdioServerTransport();
20377
20575
  server.connect(transport).then(() => {
20378
20576
  console.error("MCP server running on stdio");
20379
20577
  }).catch(console.error);
20380
- //# sourceMappingURL=server-3FMVJP3N.js.map
20578
+ //# sourceMappingURL=server-NDNGGNCB.js.map