@avallon-labs/mcp 61.1.0 → 62.1.0-staging.1334

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-GLJAJBOR.js");
59
+ await import("./server-WNWHYNZ4.js");
60
60
  //# sourceMappingURL=index.js.map
@@ -1928,29 +1928,6 @@ var getAccess = async (entityType, entityId, options) => {
1928
1928
  const data = body ? JSON.parse(body) : {};
1929
1929
  return { data, status: res.status, headers: res.headers };
1930
1930
  };
1931
- var getUpdateAccessUrl = (entityType, entityId) => {
1932
- return `/v1/access/${entityType}/${entityId}`;
1933
- };
1934
- var updateAccess = async (entityType, entityId, updateAccessBody, options) => {
1935
- const getHeaders = (h) => {
1936
- if (!h) return {};
1937
- if (h instanceof Headers) return Object.fromEntries(h.entries());
1938
- if (Array.isArray(h)) return Object.fromEntries(h);
1939
- return h;
1940
- };
1941
- const res = await fetch(
1942
- getUpdateAccessUrl(entityType, entityId),
1943
- {
1944
- ...options,
1945
- method: "PUT",
1946
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1947
- body: JSON.stringify(updateAccessBody)
1948
- }
1949
- );
1950
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1951
- const data = body ? JSON.parse(body) : {};
1952
- return { data, status: res.status, headers: res.headers };
1953
- };
1954
1931
  var getChangeAccessUrl = (entityType, entityId) => {
1955
1932
  return `/v1/access/${entityType}/${entityId}`;
1956
1933
  };
@@ -6244,29 +6221,6 @@ var getAccessHandler = async (args, options) => {
6244
6221
  structuredContent: res.data
6245
6222
  };
6246
6223
  };
6247
- var updateAccessHandler = async (args, options) => {
6248
- const res = await updateAccess(args.pathParams.entityType, args.pathParams.entityId, args.bodyParams, options);
6249
- if (res.status >= 400) {
6250
- return {
6251
- content: [
6252
- {
6253
- type: "text",
6254
- text: JSON.stringify(res.data ?? null)
6255
- }
6256
- ],
6257
- isError: true
6258
- };
6259
- }
6260
- return {
6261
- content: [
6262
- {
6263
- type: "text",
6264
- text: JSON.stringify(res.data ?? null)
6265
- }
6266
- ],
6267
- structuredContent: res.data
6268
- };
6269
- };
6270
6224
  var changeAccessHandler = async (args, options) => {
6271
6225
  const res = await changeAccess(args.pathParams.entityType, args.pathParams.entityId, args.bodyParams, options);
6272
6226
  if (res.status >= 400) {
@@ -11816,46 +11770,23 @@ var UpdateWorkerMcpsResponse = zod.object({
11816
11770
  "message": zod.string()
11817
11771
  });
11818
11772
  var GetAccessParams = zod.object({
11819
- "entityType": zod.enum(["worker", "case_type", "form"]),
11820
- "entityId": zod.string().describe("The worker's or form's id, or the case type's slug.")
11773
+ "entityType": zod.enum(["worker", "case_type", "form", "voice_agent"]),
11774
+ "entityId": zod.string().describe("The worker's, form's or voice agent's id, or the case type's slug.")
11821
11775
  });
11822
11776
  var GetAccessResponse = zod.object({
11823
11777
  "data": zod.object({
11824
11778
  "grants": zod.array(zod.object({
11825
11779
  "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."),
11826
11780
  "principal_id": zod.string().uuid(),
11827
- "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. On a `form`, `viewer` can see it and open form submissions; `editor` can also edit and share it."),
11828
- "created_at": zod.string().datetime({ "offset": true })
11829
- }))
11830
- }),
11831
- "message": zod.string()
11832
- });
11833
- var UpdateAccessParams = zod.object({
11834
- "entityType": zod.enum(["worker", "case_type", "form"]),
11835
- "entityId": zod.string().describe("The worker's or form's id, or the case type's slug.")
11836
- });
11837
- var updateAccessBodyGrantsMax = 1e3;
11838
- var UpdateAccessBody = zod.object({
11839
- "grants": zod.array(zod.object({
11840
- "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."),
11841
- "principal_id": zod.string().uuid(),
11842
- "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. On a `form`, `viewer` can see it and open form submissions; `editor` can also edit and share it.")
11843
- })).max(updateAccessBodyGrantsMax).describe("Everyone the entity is shared with, replacing the current set. Pass an empty array to share it with no one.")
11844
- });
11845
- var UpdateAccessResponse = zod.object({
11846
- "data": zod.object({
11847
- "grants": zod.array(zod.object({
11848
- "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."),
11849
- "principal_id": zod.string().uuid(),
11850
- "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. On a `form`, `viewer` can see it and open form submissions; `editor` can also edit and share it."),
11781
+ "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. On a `form`, `viewer` can see it and open form submissions; `editor` can also edit and share it. On a `voice_agent`, `editor` can also edit, promote, delete and share it and manage its webhooks; changing its prompt or greeting still needs `prompts:write`."),
11851
11782
  "created_at": zod.string().datetime({ "offset": true })
11852
11783
  }))
11853
11784
  }),
11854
11785
  "message": zod.string()
11855
11786
  });
11856
11787
  var ChangeAccessParams = zod.object({
11857
- "entityType": zod.enum(["worker", "case_type", "form"]),
11858
- "entityId": zod.string().describe("The worker's or form's id, or the case type's slug.")
11788
+ "entityType": zod.enum(["worker", "case_type", "form", "voice_agent"]),
11789
+ "entityId": zod.string().describe("The worker's, form's or voice agent's id, or the case type's slug.")
11859
11790
  });
11860
11791
  var changeAccessBodyGrantsDefault = [];
11861
11792
  var changeAccessBodyGrantsMax = 1e3;
@@ -11865,7 +11796,7 @@ var ChangeAccessBody = zod.object({
11865
11796
  "grants": zod.array(zod.object({
11866
11797
  "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."),
11867
11798
  "principal_id": zod.string().uuid(),
11868
- "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. On a `form`, `viewer` can see it and open form submissions; `editor` can also edit and share it.")
11799
+ "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. On a `form`, `viewer` can see it and open form submissions; `editor` can also edit and share it. On a `voice_agent`, `editor` can also edit, promote, delete and share it and manage its webhooks; changing its prompt or greeting still needs `prompts:write`.")
11869
11800
  })).max(changeAccessBodyGrantsMax).default(changeAccessBodyGrantsDefault).describe("Grants to create, or whose level to change."),
11870
11801
  "revocations": zod.array(zod.object({
11871
11802
  "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."),
@@ -11877,19 +11808,19 @@ var ChangeAccessResponse = zod.object({
11877
11808
  "grants": zod.array(zod.object({
11878
11809
  "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."),
11879
11810
  "principal_id": zod.string().uuid(),
11880
- "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. On a `form`, `viewer` can see it and open form submissions; `editor` can also edit and share it."),
11811
+ "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. On a `form`, `viewer` can see it and open form submissions; `editor` can also edit and share it. On a `voice_agent`, `editor` can also edit, promote, delete and share it and manage its webhooks; changing its prompt or greeting still needs `prompts:write`."),
11881
11812
  "created_at": zod.string().datetime({ "offset": true })
11882
11813
  }))
11883
11814
  }),
11884
11815
  "message": zod.string()
11885
11816
  });
11886
11817
  var GetMyAccessParams = zod.object({
11887
- "entityType": zod.enum(["worker", "case_type", "form"]),
11888
- "entityId": zod.string().describe("The worker's or form's id, or the case type's slug.")
11818
+ "entityType": zod.enum(["worker", "case_type", "form", "voice_agent"]),
11819
+ "entityId": zod.string().describe("The worker's, form's or voice agent's id, or the case type's slug.")
11889
11820
  });
11890
11821
  var GetMyAccessResponse = zod.object({
11891
11822
  "data": zod.object({
11892
- "permissions": zod.array(zod.enum(["workers:read", "workers:run", "workers:write", "workers:promote", "case-types:read", "case-types:write", "forms:read", "forms:request", "forms: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.")
11823
+ "permissions": zod.array(zod.enum(["workers:read", "workers:run", "workers:write", "workers:promote", "case-types:read", "case-types:write", "forms:read", "forms:request", "forms:write", "voice-agents:read", "voice-agents:write", "voice-agents:promote"])).describe("What the caller may do with the entity, through their role or a grant on it. `workers:write` on a worker, `case-types:write` on a case type and `voice-agents:write` on a voice agent also let the caller share it.")
11893
11824
  }),
11894
11825
  "message": zod.string()
11895
11826
  });
@@ -12694,7 +12625,7 @@ var GetProfileResponse = zod.object({
12694
12625
  "last_name": zod.union([zod.string(), zod.null()]),
12695
12626
  "email": zod.string(),
12696
12627
  "role": zod.enum(["admin", "avallon_admin", "member"]),
12697
- "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", "forms:read", "forms:create", "forms:write", "forms:request", "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"])),
12628
+ "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", "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"])),
12698
12629
  "tenants": zod.object({
12699
12630
  "active": zod.object({
12700
12631
  "id": zod.string(),
@@ -14332,7 +14263,7 @@ var UploadFileResponse = zod.object({
14332
14263
  "message": zod.string()
14333
14264
  });
14334
14265
  var CreateAgentWebhookParams = zod.object({
14335
- "voiceAgentId": zod.string().min(1)
14266
+ "voiceAgentId": zod.string().uuid()
14336
14267
  });
14337
14268
  var createAgentWebhookBodyNameMax = 256;
14338
14269
  var createAgentWebhookBodyUrlMax = 2048;
@@ -16223,7 +16154,7 @@ var createMcpServer = (options) => {
16223
16154
  "getAccess",
16224
16155
  {
16225
16156
  title: "Get access",
16226
- 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.",
16157
+ 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, `case-types:write` on a case type and `voice-agents:write` on a voice agent.",
16227
16158
  inputSchema: {
16228
16159
  pathParams: GetAccessParams
16229
16160
  },
@@ -16235,28 +16166,11 @@ var createMcpServer = (options) => {
16235
16166
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16236
16167
  })
16237
16168
  );
16238
- tools.updateAccess = server2.registerTool(
16239
- "updateAccess",
16240
- {
16241
- title: "Update access (deprecated)",
16242
- 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.\n\n**Deprecated:** Use `PATCH /v1/access/{entityType}/{entityId}` instead.",
16243
- inputSchema: {
16244
- pathParams: UpdateAccessParams,
16245
- bodyParams: UpdateAccessBody.optional()
16246
- },
16247
- outputSchema: UpdateAccessResponse,
16248
- annotations: { destructiveHint: true, idempotentHint: true }
16249
- },
16250
- (args, ctx) => updateAccessHandler(args, {
16251
- ...options,
16252
- signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16253
- })
16254
- );
16255
16169
  tools.changeAccess = server2.registerTool(
16256
16170
  "changeAccess",
16257
16171
  {
16258
16172
  title: "Change access",
16259
- description: "Grant, change or revoke access for specific team members and workers. Everyone not named keeps their access. 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 revokes their own grant loses access, and one who downgrades it can no longer change or share the entity, unless their role gives it.",
16173
+ description: "Grant, change or revoke access for specific team members and workers. Everyone not named keeps their access. Each grantee must be a team member or a worker of the tenant. Requires `workers:write` on a worker, `case-types:write` on a case type and `voice-agents:write` on a voice agent. An editor who revokes their own grant loses access, and one who downgrades it can no longer change or share the entity, unless their role gives it.",
16260
16174
  inputSchema: {
16261
16175
  pathParams: ChangeAccessParams,
16262
16176
  bodyParams: ChangeAccessBody.optional()
@@ -18012,4 +17926,4 @@ var transport = new StdioServerTransport();
18012
17926
  server.connect(transport).then(() => {
18013
17927
  console.error("MCP server running on stdio");
18014
17928
  }).catch(console.error);
18015
- //# sourceMappingURL=server-GLJAJBOR.js.map
17929
+ //# sourceMappingURL=server-WNWHYNZ4.js.map