@avallon-labs/mcp 58.0.0 → 59.1.0-staging.1312

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-2J3FHU34.js");
59
+ await import("./server-NRTUNVHI.js");
60
60
  //# sourceMappingURL=index.js.map
@@ -3583,6 +3583,43 @@ var getToolVersionChangeSummary = async (id, version, options) => {
3583
3583
  const data = body ? JSON.parse(body) : {};
3584
3584
  return { data, status: res.status, headers: res.headers };
3585
3585
  };
3586
+ var getListToolCallsUrl = (params) => {
3587
+ const normalizedParams = new URLSearchParams();
3588
+ Object.entries(params || {}).forEach(([key, value]) => {
3589
+ if (value !== void 0) {
3590
+ normalizedParams.append(key, value === null ? "null" : String(value));
3591
+ }
3592
+ });
3593
+ const stringifiedParams = normalizedParams.toString();
3594
+ return stringifiedParams.length > 0 ? `/v1/tool-calls?${stringifiedParams}` : `/v1/tool-calls`;
3595
+ };
3596
+ var listToolCalls = async (params, options) => {
3597
+ const res = await fetch(
3598
+ getListToolCallsUrl(params),
3599
+ {
3600
+ ...options,
3601
+ method: "GET"
3602
+ }
3603
+ );
3604
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3605
+ const data = body ? JSON.parse(body) : {};
3606
+ return { data, status: res.status, headers: res.headers };
3607
+ };
3608
+ var getGetToolCallUrl = (toolCallId) => {
3609
+ return `/v1/tool-calls/${toolCallId}`;
3610
+ };
3611
+ var getToolCall = async (toolCallId, options) => {
3612
+ const res = await fetch(
3613
+ getGetToolCallUrl(toolCallId),
3614
+ {
3615
+ ...options,
3616
+ method: "GET"
3617
+ }
3618
+ );
3619
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3620
+ const data = body ? JSON.parse(body) : {};
3621
+ return { data, status: res.status, headers: res.headers };
3622
+ };
3586
3623
  var getWorkerListToolsUrl = (params) => {
3587
3624
  const normalizedParams = new URLSearchParams();
3588
3625
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -7994,6 +8031,52 @@ var getToolVersionChangeSummaryHandler = async (args, options) => {
7994
8031
  structuredContent: res.data
7995
8032
  };
7996
8033
  };
8034
+ var listToolCallsHandler = async (args, options) => {
8035
+ const res = await listToolCalls(args.queryParams, options);
8036
+ if (res.status >= 400) {
8037
+ return {
8038
+ content: [
8039
+ {
8040
+ type: "text",
8041
+ text: JSON.stringify(res.data ?? null)
8042
+ }
8043
+ ],
8044
+ isError: true
8045
+ };
8046
+ }
8047
+ return {
8048
+ content: [
8049
+ {
8050
+ type: "text",
8051
+ text: JSON.stringify(res.data ?? null)
8052
+ }
8053
+ ],
8054
+ structuredContent: res.data
8055
+ };
8056
+ };
8057
+ var getToolCallHandler = async (args, options) => {
8058
+ const res = await getToolCall(args.pathParams.toolCallId, options);
8059
+ if (res.status >= 400) {
8060
+ return {
8061
+ content: [
8062
+ {
8063
+ type: "text",
8064
+ text: JSON.stringify(res.data ?? null)
8065
+ }
8066
+ ],
8067
+ isError: true
8068
+ };
8069
+ }
8070
+ return {
8071
+ content: [
8072
+ {
8073
+ type: "text",
8074
+ text: JSON.stringify(res.data ?? null)
8075
+ }
8076
+ ],
8077
+ structuredContent: res.data
8078
+ };
8079
+ };
7997
8080
  var workerListToolsHandler = async (args, options) => {
7998
8081
  const res = await workerListTools(args.queryParams, options);
7999
8082
  if (res.status >= 400) {
@@ -11261,50 +11344,50 @@ var UpdateWorkerMcpsResponse = zod.object({
11261
11344
  "message": zod.string()
11262
11345
  });
11263
11346
  var GetAccessParams = zod.object({
11264
- "entityType": zod.enum(["worker"]),
11265
- "entityId": zod.string().uuid()
11347
+ "entityType": zod.enum(["worker", "case_type"]),
11348
+ "entityId": zod.string().describe("The worker's id or the case type's slug.")
11266
11349
  });
11267
11350
  var GetAccessResponse = zod.object({
11268
11351
  "data": zod.object({
11269
11352
  "grants": zod.array(zod.object({
11270
- "principal_type": zod.enum(["profile", "worker"]).describe("Who holds the grant: a team member's `profile`, or a `worker`, whose runs act with it."),
11353
+ "principal_type": zod.enum(["profile", "worker", "tenant"]).describe("Who holds the grant: a team member's `profile`, a `worker`, whose runs act with it, or the whole `tenant`. `tenant` is not supported yet."),
11271
11354
  "principal_id": zod.string().uuid(),
11272
- "level": zod.enum(["viewer", "editor"]).describe("`viewer` can see and use the entity. `editor` can also change and share it. On a `worker`, `viewer` sees the worker, its prompt and everything it owns, and can start it; `editor` can also edit, promote, delete and share it. Attaching secrets and managing schedules still need the matching role permission."),
11355
+ "level": zod.enum(["viewer", "editor"]).describe("`viewer` can see and use the entity. `editor` can also change and share it. On a `worker`, `viewer` sees the worker, its prompt and everything it owns, and can start it; `editor` can also edit, promote, delete and share it. Attaching secrets and managing schedules still need the matching role permission. On a `case_type`, `editor` can also edit, promote and share it."),
11273
11356
  "created_at": zod.string().datetime({ "offset": true })
11274
11357
  }))
11275
11358
  }),
11276
11359
  "message": zod.string()
11277
11360
  });
11278
11361
  var UpdateAccessParams = zod.object({
11279
- "entityType": zod.enum(["worker"]),
11280
- "entityId": zod.string().uuid()
11362
+ "entityType": zod.enum(["worker", "case_type"]),
11363
+ "entityId": zod.string().describe("The worker's id or the case type's slug.")
11281
11364
  });
11282
11365
  var updateAccessBodyGrantsMax = 1e3;
11283
11366
  var UpdateAccessBody = zod.object({
11284
11367
  "grants": zod.array(zod.object({
11285
- "principal_type": zod.enum(["profile", "worker"]).describe("Who holds the grant: a team member's `profile`, or a `worker`, whose runs act with it."),
11368
+ "principal_type": zod.enum(["profile", "worker", "tenant"]).describe("Who holds the grant: a team member's `profile`, a `worker`, whose runs act with it, or the whole `tenant`. `tenant` is not supported yet."),
11286
11369
  "principal_id": zod.string().uuid(),
11287
- "level": zod.enum(["viewer", "editor"]).describe("`viewer` can see and use the entity. `editor` can also change and share it. On a `worker`, `viewer` sees the worker, its prompt and everything it owns, and can start it; `editor` can also edit, promote, delete and share it. Attaching secrets and managing schedules still need the matching role permission.")
11370
+ "level": zod.enum(["viewer", "editor"]).describe("`viewer` can see and use the entity. `editor` can also change and share it. On a `worker`, `viewer` sees the worker, its prompt and everything it owns, and can start it; `editor` can also edit, promote, delete and share it. Attaching secrets and managing schedules still need the matching role permission. On a `case_type`, `editor` can also edit, promote and share it.")
11288
11371
  })).max(updateAccessBodyGrantsMax).describe("Everyone the entity is shared with, replacing the current set. Pass an empty array to share it with no one.")
11289
11372
  });
11290
11373
  var UpdateAccessResponse = zod.object({
11291
11374
  "data": zod.object({
11292
11375
  "grants": zod.array(zod.object({
11293
- "principal_type": zod.enum(["profile", "worker"]).describe("Who holds the grant: a team member's `profile`, or a `worker`, whose runs act with it."),
11376
+ "principal_type": zod.enum(["profile", "worker", "tenant"]).describe("Who holds the grant: a team member's `profile`, a `worker`, whose runs act with it, or the whole `tenant`. `tenant` is not supported yet."),
11294
11377
  "principal_id": zod.string().uuid(),
11295
- "level": zod.enum(["viewer", "editor"]).describe("`viewer` can see and use the entity. `editor` can also change and share it. On a `worker`, `viewer` sees the worker, its prompt and everything it owns, and can start it; `editor` can also edit, promote, delete and share it. Attaching secrets and managing schedules still need the matching role permission."),
11378
+ "level": zod.enum(["viewer", "editor"]).describe("`viewer` can see and use the entity. `editor` can also change and share it. On a `worker`, `viewer` sees the worker, its prompt and everything it owns, and can start it; `editor` can also edit, promote, delete and share it. Attaching secrets and managing schedules still need the matching role permission. On a `case_type`, `editor` can also edit, promote and share it."),
11296
11379
  "created_at": zod.string().datetime({ "offset": true })
11297
11380
  }))
11298
11381
  }),
11299
11382
  "message": zod.string()
11300
11383
  });
11301
11384
  var GetMyAccessParams = zod.object({
11302
- "entityType": zod.enum(["worker"]),
11303
- "entityId": zod.string().uuid()
11385
+ "entityType": zod.enum(["worker", "case_type"]),
11386
+ "entityId": zod.string().describe("The worker's id or the case type's slug.")
11304
11387
  });
11305
11388
  var GetMyAccessResponse = zod.object({
11306
11389
  "data": zod.object({
11307
- "permissions": zod.array(zod.enum(["workers:read", "workers:run", "workers:write", "workers:promote"])).describe("What the caller may do with the entity, through their role or a grant on it. On a worker, `workers:write` also lets the caller share it.")
11390
+ "permissions": zod.array(zod.enum(["workers:read", "workers:run", "workers:write", "workers:promote", "case-types:read", "case-types:write"])).describe("What the caller may do with the entity, through their role or a grant on it. `workers:write` on a worker and `case-types:write` on a case type also let the caller share it.")
11308
11391
  }),
11309
11392
  "message": zod.string()
11310
11393
  });
@@ -12033,7 +12116,7 @@ var GetProfileResponse = zod.object({
12033
12116
  "last_name": zod.union([zod.string(), zod.null()]),
12034
12117
  "email": zod.string(),
12035
12118
  "role": zod.enum(["admin", "avallon_admin", "member"]),
12036
- "permissions": zod.array(zod.enum(["voice-agents:write", "voice-agents:promote", "tools:write", "tools:execute", "tools:promote", "extractors:write", "inboxes:write", "inboxes:send", "artifacts:write", "api-keys:write", "teams:write", "cases:write", "cases:delete", "case-types:write", "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", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "schedules:read", "schedules:write", "tenants:write", "analytics:view-cost"])),
12119
+ "permissions": zod.array(zod.enum(["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", "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", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "schedules:read", "schedules:write", "tenants:write", "analytics:view-cost"])),
12037
12120
  "tenants": zod.object({
12038
12121
  "active": zod.object({
12039
12122
  "id": zod.string(),
@@ -13497,6 +13580,77 @@ var GetToolVersionChangeSummaryResponse = zod.object({
13497
13580
  }),
13498
13581
  "message": zod.string()
13499
13582
  });
13583
+ var listToolCallsQueryCountDefault = 50;
13584
+ var listToolCallsQueryCountMax = 100;
13585
+ var listToolCallsQueryOffsetDefault = 0;
13586
+ var listToolCallsQueryOffsetMin = 0;
13587
+ var listToolCallsQuerySortByDefault = `created_at`;
13588
+ var listToolCallsQuerySortOrderDefault = `desc`;
13589
+ var ListToolCallsQueryParams = zod.object({
13590
+ "tool_id": zod.string().uuid().optional(),
13591
+ "count": zod.number().min(1).max(listToolCallsQueryCountMax).default(listToolCallsQueryCountDefault),
13592
+ "offset": zod.number().min(listToolCallsQueryOffsetMin).default(listToolCallsQueryOffsetDefault),
13593
+ "sort_by": zod.enum(["created_at"]).default(listToolCallsQuerySortByDefault),
13594
+ "sort_order": zod.enum(["asc", "desc"]).default(listToolCallsQuerySortOrderDefault)
13595
+ });
13596
+ var ListToolCallsResponse = zod.object({
13597
+ "data": zod.array(zod.object({
13598
+ "id": zod.string(),
13599
+ "tool_id": zod.string(),
13600
+ "tool_version": zod.number(),
13601
+ "environment": zod.enum(["live", "test"]),
13602
+ "outcome": zod.enum(["success", "failed"]),
13603
+ "created_by": zod.string().describe("Actor that executed the tool"),
13604
+ "created_at": zod.string().datetime({ "offset": true })
13605
+ })),
13606
+ "message": zod.string(),
13607
+ "meta": zod.object({
13608
+ "total": zod.number()
13609
+ })
13610
+ });
13611
+ var GetToolCallParams = zod.object({
13612
+ "toolCallId": zod.string().uuid()
13613
+ });
13614
+ var getToolCallResponseDataDispatchOneAttemptsMin = -9007199254740991;
13615
+ var getToolCallResponseDataDispatchOneAttemptsMax = 9007199254740991;
13616
+ var GetToolCallResponse = zod.object({
13617
+ "data": zod.object({
13618
+ "id": zod.string(),
13619
+ "tool_id": zod.string(),
13620
+ "tool_version": zod.number(),
13621
+ "environment": zod.enum(["live", "test"]),
13622
+ "outcome": zod.enum(["success", "failed"]),
13623
+ "created_by": zod.string().describe("Actor that executed the tool"),
13624
+ "created_at": zod.string().datetime({ "offset": true }),
13625
+ "dispatch": zod.union([zod.object({
13626
+ "id": zod.string(),
13627
+ "trigger": zod.object({
13628
+ "type": zod.enum(["schedule", "email", "information_request", "manual", "call"]),
13629
+ "id": zod.string()
13630
+ }),
13631
+ "target": zod.union([zod.object({
13632
+ "type": zod.enum(["worker_run", "extractor_job", "tool_call"]),
13633
+ "id": zod.string()
13634
+ }), zod.null()]),
13635
+ "due_at": zod.string().datetime({ "offset": true }),
13636
+ "expires_at": zod.string().datetime({ "offset": true }),
13637
+ "environment": zod.enum(["live", "test"]),
13638
+ "status": zod.enum(["pending", "dispatched", "abandoned"]),
13639
+ "attempts": zod.number().int().min(getToolCallResponseDataDispatchOneAttemptsMin).max(getToolCallResponseDataDispatchOneAttemptsMax)
13640
+ }), zod.null()]).describe("The dispatch that executed a scheduled call"),
13641
+ "params": zod.union([zod.record(zod.string(), zod.unknown()), zod.null()]).describe("Null for calls recorded before params were stored"),
13642
+ "result": zod.union([zod.string(), zod.null()]),
13643
+ "error": zod.union([zod.object({
13644
+ "name": zod.string(),
13645
+ "message": zod.string()
13646
+ }), zod.null()]),
13647
+ "traces": zod.union([zod.array(zod.object({
13648
+ "text": zod.string(),
13649
+ "timestamp": zod.string()
13650
+ })), zod.null()])
13651
+ }),
13652
+ "message": zod.string()
13653
+ });
13500
13654
  var workerListToolsQuerySortByDefault = `created_at`;
13501
13655
  var workerListToolsQuerySortOrderDefault = `desc`;
13502
13656
  var WorkerListToolsQueryParams = zod.object({
@@ -15491,7 +15645,7 @@ var createMcpServer = (options) => {
15491
15645
  "getAccess",
15492
15646
  {
15493
15647
  title: "Get access",
15494
- description: "List who an entity is shared with. Admins see every entity through their role, whether or not they are listed. Requires `workers:write` on a worker.",
15648
+ description: "List who an entity is shared with. Admins see every entity through their role, whether or not they are listed. Requires `workers:write` on a worker and `case-types:write` on a case type.",
15495
15649
  inputSchema: {
15496
15650
  pathParams: GetAccessParams
15497
15651
  },
@@ -15507,7 +15661,7 @@ var createMcpServer = (options) => {
15507
15661
  "updateAccess",
15508
15662
  {
15509
15663
  title: "Update access",
15510
- description: "Replace who an entity is shared with. Each grantee must be a team member or a worker of the tenant. Requires `workers:write` on a worker. An editor who leaves their own grant out loses access, unless their role gives it.",
15664
+ description: "Replace who an entity is shared with. Each grantee must be a team member or a worker of the tenant. Requires `workers:write` on a worker and `case-types:write` on a case type. An editor who leaves their own grant out loses access, unless their role gives it.",
15511
15665
  inputSchema: {
15512
15666
  pathParams: UpdateAccessParams,
15513
15667
  bodyParams: UpdateAccessBody.optional()
@@ -16845,6 +16999,38 @@ var createMcpServer = (options) => {
16845
16999
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16846
17000
  })
16847
17001
  );
17002
+ tools.listToolCalls = server2.registerTool(
17003
+ "listToolCalls",
17004
+ {
17005
+ title: "List tool calls",
17006
+ description: "List tool calls without their params, result, error and traces. Requires the `tool-calls:read` permission.",
17007
+ inputSchema: {
17008
+ queryParams: ListToolCallsQueryParams
17009
+ },
17010
+ outputSchema: ListToolCallsResponse,
17011
+ annotations: { readOnlyHint: true }
17012
+ },
17013
+ (args, ctx) => listToolCallsHandler(args, {
17014
+ ...options,
17015
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
17016
+ })
17017
+ );
17018
+ tools.getToolCall = server2.registerTool(
17019
+ "getToolCall",
17020
+ {
17021
+ title: "Get tool call",
17022
+ description: "Retrieve a single tool call. Requires the `tool-calls:read` permission.",
17023
+ inputSchema: {
17024
+ pathParams: GetToolCallParams
17025
+ },
17026
+ outputSchema: GetToolCallResponse,
17027
+ annotations: { readOnlyHint: true }
17028
+ },
17029
+ (args, ctx) => getToolCallHandler(args, {
17030
+ ...options,
17031
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
17032
+ })
17033
+ );
16848
17034
  tools.workerListTools = server2.registerTool(
16849
17035
  "workerListTools",
16850
17036
  {
@@ -17150,4 +17336,4 @@ var transport = new StdioServerTransport();
17150
17336
  server.connect(transport).then(() => {
17151
17337
  console.error("MCP server running on stdio");
17152
17338
  }).catch(console.error);
17153
- //# sourceMappingURL=server-2J3FHU34.js.map
17339
+ //# sourceMappingURL=server-NRTUNVHI.js.map