@avallon-labs/mcp 60.1.0 → 60.2.0-staging.1326

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-FHO2NMID.js");
59
+ await import("./server-7E6U7EWA.js");
60
60
  //# sourceMappingURL=index.js.map
@@ -2625,6 +2625,90 @@ var listChatMessages = async (chatId, params, options) => {
2625
2625
  const data = body ? JSON.parse(body) : {};
2626
2626
  return { data, status: res.status, headers: res.headers };
2627
2627
  };
2628
+ var getGetPublicFormSubmissionUrl = (id) => {
2629
+ return `/public/v1/form-submissions/${id}`;
2630
+ };
2631
+ var getPublicFormSubmission = async (id, options) => {
2632
+ const res = await fetch(
2633
+ getGetPublicFormSubmissionUrl(id),
2634
+ {
2635
+ ...options,
2636
+ method: "GET"
2637
+ }
2638
+ );
2639
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2640
+ const data = body ? JSON.parse(body) : {};
2641
+ return { data, status: res.status, headers: res.headers };
2642
+ };
2643
+ var getSubmitFormSubmissionUrl = (id) => {
2644
+ return `/public/v1/form-submissions/${id}`;
2645
+ };
2646
+ var submitFormSubmission = async (id, submitFormSubmissionBody, options) => {
2647
+ const getHeaders = (h) => {
2648
+ if (!h) return {};
2649
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
2650
+ if (Array.isArray(h)) return Object.fromEntries(h);
2651
+ return h;
2652
+ };
2653
+ const res = await fetch(
2654
+ getSubmitFormSubmissionUrl(id),
2655
+ {
2656
+ ...options,
2657
+ method: "PUT",
2658
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2659
+ body: JSON.stringify(submitFormSubmissionBody)
2660
+ }
2661
+ );
2662
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2663
+ const data = body ? JSON.parse(body) : {};
2664
+ return { data, status: res.status, headers: res.headers };
2665
+ };
2666
+ var getCreateFormUrl = () => {
2667
+ return `/v1/forms`;
2668
+ };
2669
+ var createForm = async (createFormBody, options) => {
2670
+ const getHeaders = (h) => {
2671
+ if (!h) return {};
2672
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
2673
+ if (Array.isArray(h)) return Object.fromEntries(h);
2674
+ return h;
2675
+ };
2676
+ const res = await fetch(
2677
+ getCreateFormUrl(),
2678
+ {
2679
+ ...options,
2680
+ method: "POST",
2681
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2682
+ body: JSON.stringify(createFormBody)
2683
+ }
2684
+ );
2685
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2686
+ const data = body ? JSON.parse(body) : {};
2687
+ return { data, status: res.status, headers: res.headers };
2688
+ };
2689
+ var getCreateFormSubmissionUrl = () => {
2690
+ return `/v1/form-submissions`;
2691
+ };
2692
+ var createFormSubmission = async (createFormSubmissionBody, options) => {
2693
+ const getHeaders = (h) => {
2694
+ if (!h) return {};
2695
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
2696
+ if (Array.isArray(h)) return Object.fromEntries(h);
2697
+ return h;
2698
+ };
2699
+ const res = await fetch(
2700
+ getCreateFormSubmissionUrl(),
2701
+ {
2702
+ ...options,
2703
+ method: "POST",
2704
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
2705
+ body: JSON.stringify(createFormSubmissionBody)
2706
+ }
2707
+ );
2708
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2709
+ const data = body ? JSON.parse(body) : {};
2710
+ return { data, status: res.status, headers: res.headers };
2711
+ };
2628
2712
  var getGetExtractUrl = (id) => {
2629
2713
  return `/v1/extracts/${id}`;
2630
2714
  };
@@ -6904,6 +6988,98 @@ var listChatMessagesHandler = async (args, options) => {
6904
6988
  structuredContent: res.data
6905
6989
  };
6906
6990
  };
6991
+ var getPublicFormSubmissionHandler = async (args, options) => {
6992
+ const res = await getPublicFormSubmission(args.pathParams.id, options);
6993
+ if (res.status >= 400) {
6994
+ return {
6995
+ content: [
6996
+ {
6997
+ type: "text",
6998
+ text: JSON.stringify(res.data ?? null)
6999
+ }
7000
+ ],
7001
+ isError: true
7002
+ };
7003
+ }
7004
+ return {
7005
+ content: [
7006
+ {
7007
+ type: "text",
7008
+ text: JSON.stringify(res.data ?? null)
7009
+ }
7010
+ ],
7011
+ structuredContent: res.data
7012
+ };
7013
+ };
7014
+ var submitFormSubmissionHandler = async (args, options) => {
7015
+ const res = await submitFormSubmission(args.pathParams.id, args.bodyParams, options);
7016
+ if (res.status >= 400) {
7017
+ return {
7018
+ content: [
7019
+ {
7020
+ type: "text",
7021
+ text: JSON.stringify(res.data ?? null)
7022
+ }
7023
+ ],
7024
+ isError: true
7025
+ };
7026
+ }
7027
+ return {
7028
+ content: [
7029
+ {
7030
+ type: "text",
7031
+ text: JSON.stringify(res.data ?? null)
7032
+ }
7033
+ ],
7034
+ structuredContent: res.data
7035
+ };
7036
+ };
7037
+ var createFormHandler = async (args, options) => {
7038
+ const res = await createForm(args.bodyParams, options);
7039
+ if (res.status >= 400) {
7040
+ return {
7041
+ content: [
7042
+ {
7043
+ type: "text",
7044
+ text: JSON.stringify(res.data ?? null)
7045
+ }
7046
+ ],
7047
+ isError: true
7048
+ };
7049
+ }
7050
+ return {
7051
+ content: [
7052
+ {
7053
+ type: "text",
7054
+ text: JSON.stringify(res.data ?? null)
7055
+ }
7056
+ ],
7057
+ structuredContent: res.data
7058
+ };
7059
+ };
7060
+ var createFormSubmissionHandler = async (args, options) => {
7061
+ const res = await createFormSubmission(args.bodyParams, options);
7062
+ if (res.status >= 400) {
7063
+ return {
7064
+ content: [
7065
+ {
7066
+ type: "text",
7067
+ text: JSON.stringify(res.data ?? null)
7068
+ }
7069
+ ],
7070
+ isError: true
7071
+ };
7072
+ }
7073
+ return {
7074
+ content: [
7075
+ {
7076
+ type: "text",
7077
+ text: JSON.stringify(res.data ?? null)
7078
+ }
7079
+ ],
7080
+ structuredContent: res.data
7081
+ };
7082
+ };
6907
7083
  var getExtractHandler = async (args, options) => {
6908
7084
  const res = await getExtract(args.pathParams.id, options);
6909
7085
  if (res.status >= 400) {
@@ -11178,7 +11354,7 @@ var CreateWorkerResponse = zod.object({
11178
11354
  "schema": zod.record(zod.string(), zod.unknown()),
11179
11355
  "tool_ids": zod.array(zod.string()),
11180
11356
  "secret_ids": zod.array(zod.string()).describe("Secrets attached to the worker. A worker with attached secrets sources its environment exclusively from the secret store."),
11181
- "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write"])).describe("Core Plane operations the worker's runs are authorized to perform. Executing a tool attached to the worker is governed by the attachment, not by this list."),
11357
+ "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write", "forms:request"])).describe("Core Plane operations the worker's runs are authorized to perform. Executing a tool attached to the worker is governed by the attachment, not by this list."),
11182
11358
  "model": zod.string(),
11183
11359
  "fast_mode": zod.boolean()
11184
11360
  }),
@@ -11255,7 +11431,7 @@ var GetWorkerResponse = zod.object({
11255
11431
  "schema": zod.record(zod.string(), zod.unknown()),
11256
11432
  "tool_ids": zod.array(zod.string()),
11257
11433
  "secret_ids": zod.array(zod.string()).describe("Secrets attached to the worker. A worker with attached secrets sources its environment exclusively from the secret store."),
11258
- "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write"])).describe("Core Plane operations the worker's runs are authorized to perform. Executing a tool attached to the worker is governed by the attachment, not by this list."),
11434
+ "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write", "forms:request"])).describe("Core Plane operations the worker's runs are authorized to perform. Executing a tool attached to the worker is governed by the attachment, not by this list."),
11259
11435
  "model": zod.string(),
11260
11436
  "fast_mode": zod.boolean()
11261
11437
  }),
@@ -11282,7 +11458,7 @@ var UpdateWorkerBody = zod.object({
11282
11458
  "schema": zod.record(zod.string(), zod.unknown()).optional(),
11283
11459
  "tools": zod.array(zod.string().uuid()).optional().describe("Replace the worker's attached tool set. Omit to leave unchanged; pass [] to clear."),
11284
11460
  "secrets": zod.array(zod.string().uuid()).optional().describe("Replace the worker's attached secret set. Omit to leave unchanged; pass [] to detach all."),
11285
- "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write"])).optional().describe("Permissions granted to the worker on each run")
11461
+ "permissions": zod.array(zod.enum(["workers:run", "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")
11286
11462
  });
11287
11463
  var updateWorkerResponseDataVersionMin = 0;
11288
11464
  var updateWorkerResponseDataVersionsLatestMin = -9007199254740991;
@@ -11310,7 +11486,7 @@ var UpdateWorkerResponse = zod.object({
11310
11486
  "schema": zod.record(zod.string(), zod.unknown()),
11311
11487
  "tool_ids": zod.array(zod.string()),
11312
11488
  "secret_ids": zod.array(zod.string()).describe("Secrets attached to the worker. A worker with attached secrets sources its environment exclusively from the secret store."),
11313
- "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write"])).describe("Core Plane operations the worker's runs are authorized to perform. Executing a tool attached to the worker is governed by the attachment, not by this list."),
11489
+ "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write", "forms:request"])).describe("Core Plane operations the worker's runs are authorized to perform. Executing a tool attached to the worker is governed by the attachment, not by this list."),
11314
11490
  "model": zod.string(),
11315
11491
  "fast_mode": zod.boolean()
11316
11492
  }),
@@ -11383,37 +11559,37 @@ var UpdateWorkerMcpsResponse = zod.object({
11383
11559
  "schema": zod.record(zod.string(), zod.unknown()),
11384
11560
  "tool_ids": zod.array(zod.string()),
11385
11561
  "secret_ids": zod.array(zod.string()).describe("Secrets attached to the worker. A worker with attached secrets sources its environment exclusively from the secret store."),
11386
- "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write"])).describe("Core Plane operations the worker's runs are authorized to perform. Executing a tool attached to the worker is governed by the attachment, not by this list."),
11562
+ "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write", "forms:request"])).describe("Core Plane operations the worker's runs are authorized to perform. Executing a tool attached to the worker is governed by the attachment, not by this list."),
11387
11563
  "model": zod.string(),
11388
11564
  "fast_mode": zod.boolean()
11389
11565
  }),
11390
11566
  "message": zod.string()
11391
11567
  });
11392
11568
  var GetAccessParams = zod.object({
11393
- "entityType": zod.enum(["worker", "case_type"]),
11394
- "entityId": zod.string().describe("The worker's id or the case type's slug.")
11569
+ "entityType": zod.enum(["worker", "case_type", "form"]),
11570
+ "entityId": zod.string().describe("The worker's or form's id, or the case type's slug.")
11395
11571
  });
11396
11572
  var GetAccessResponse = zod.object({
11397
11573
  "data": zod.object({
11398
11574
  "grants": zod.array(zod.object({
11399
11575
  "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."),
11400
11576
  "principal_id": zod.string().uuid(),
11401
- "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."),
11577
+ "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."),
11402
11578
  "created_at": zod.string().datetime({ "offset": true })
11403
11579
  }))
11404
11580
  }),
11405
11581
  "message": zod.string()
11406
11582
  });
11407
11583
  var UpdateAccessParams = zod.object({
11408
- "entityType": zod.enum(["worker", "case_type"]),
11409
- "entityId": zod.string().describe("The worker's id or the case type's slug.")
11584
+ "entityType": zod.enum(["worker", "case_type", "form"]),
11585
+ "entityId": zod.string().describe("The worker's or form's id, or the case type's slug.")
11410
11586
  });
11411
11587
  var updateAccessBodyGrantsMax = 1e3;
11412
11588
  var UpdateAccessBody = zod.object({
11413
11589
  "grants": zod.array(zod.object({
11414
11590
  "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."),
11415
11591
  "principal_id": zod.string().uuid(),
11416
- "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.")
11592
+ "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.")
11417
11593
  })).max(updateAccessBodyGrantsMax).describe("Everyone the entity is shared with, replacing the current set. Pass an empty array to share it with no one.")
11418
11594
  });
11419
11595
  var UpdateAccessResponse = zod.object({
@@ -11421,15 +11597,15 @@ var UpdateAccessResponse = zod.object({
11421
11597
  "grants": zod.array(zod.object({
11422
11598
  "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."),
11423
11599
  "principal_id": zod.string().uuid(),
11424
- "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."),
11600
+ "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."),
11425
11601
  "created_at": zod.string().datetime({ "offset": true })
11426
11602
  }))
11427
11603
  }),
11428
11604
  "message": zod.string()
11429
11605
  });
11430
11606
  var ChangeAccessParams = zod.object({
11431
- "entityType": zod.enum(["worker", "case_type"]),
11432
- "entityId": zod.string().describe("The worker's id or the case type's slug.")
11607
+ "entityType": zod.enum(["worker", "case_type", "form"]),
11608
+ "entityId": zod.string().describe("The worker's or form's id, or the case type's slug.")
11433
11609
  });
11434
11610
  var changeAccessBodyGrantsDefault = [];
11435
11611
  var changeAccessBodyGrantsMax = 1e3;
@@ -11439,7 +11615,7 @@ var ChangeAccessBody = zod.object({
11439
11615
  "grants": zod.array(zod.object({
11440
11616
  "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."),
11441
11617
  "principal_id": zod.string().uuid(),
11442
- "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.")
11618
+ "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.")
11443
11619
  })).max(changeAccessBodyGrantsMax).default(changeAccessBodyGrantsDefault).describe("Grants to create, or whose level to change."),
11444
11620
  "revocations": zod.array(zod.object({
11445
11621
  "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."),
@@ -11451,19 +11627,19 @@ var ChangeAccessResponse = zod.object({
11451
11627
  "grants": zod.array(zod.object({
11452
11628
  "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."),
11453
11629
  "principal_id": zod.string().uuid(),
11454
- "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."),
11630
+ "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."),
11455
11631
  "created_at": zod.string().datetime({ "offset": true })
11456
11632
  }))
11457
11633
  }),
11458
11634
  "message": zod.string()
11459
11635
  });
11460
11636
  var GetMyAccessParams = zod.object({
11461
- "entityType": zod.enum(["worker", "case_type"]),
11462
- "entityId": zod.string().describe("The worker's id or the case type's slug.")
11637
+ "entityType": zod.enum(["worker", "case_type", "form"]),
11638
+ "entityId": zod.string().describe("The worker's or form's id, or the case type's slug.")
11463
11639
  });
11464
11640
  var GetMyAccessResponse = zod.object({
11465
11641
  "data": zod.object({
11466
- "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.")
11642
+ "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.")
11467
11643
  }),
11468
11644
  "message": zod.string()
11469
11645
  });
@@ -11516,7 +11692,7 @@ var GetWorkerVersionResponse = zod.object({
11516
11692
  "name": zod.enum(["ventiv", "klear", "klear-browser", "demo-browser", "demo-claims", "filehandler-browser"]).describe("MCP server identifier.")
11517
11693
  })),
11518
11694
  "schema": zod.record(zod.string(), zod.unknown()),
11519
- "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write"])),
11695
+ "permissions": zod.array(zod.enum(["workers:run", "inboxes:send", "artifacts:write", "outbound-jobs:schedule", "cases:write", "schedules:write", "information-requests:write", "forms:request"])),
11520
11696
  "model": zod.string(),
11521
11697
  "fast_mode": zod.boolean(),
11522
11698
  "tool_ids": zod.array(zod.string()),
@@ -12105,6 +12281,66 @@ var ListChatMessagesResponse = zod.object({
12105
12281
  "total": zod.number()
12106
12282
  })
12107
12283
  });
12284
+ var GetPublicFormSubmissionParams = zod.object({
12285
+ "id": zod.string().uuid()
12286
+ });
12287
+ var GetPublicFormSubmissionResponse = zod.object({
12288
+ "data": zod.object({
12289
+ "title": zod.string(),
12290
+ "schema": zod.record(zod.string(), zod.unknown()).describe("JSON Schema of the form version this submission is pinned to. Property order is the display order.")
12291
+ }),
12292
+ "message": zod.string()
12293
+ });
12294
+ var SubmitFormSubmissionParams = zod.object({
12295
+ "id": zod.string().uuid()
12296
+ });
12297
+ var SubmitFormSubmissionBody = zod.object({
12298
+ "answers": zod.record(zod.string(), zod.union([zod.string(), zod.number(), zod.boolean()])).describe("Answers keyed by form field. Validated against the JSON Schema of the form version this submission is pinned to; failures return 400 with the field path in the message.")
12299
+ });
12300
+ var SubmitFormSubmissionResponse = zod.object({
12301
+ "data": zod.object({
12302
+ "id": zod.string().uuid()
12303
+ }),
12304
+ "message": zod.string()
12305
+ });
12306
+ var CreateFormBody = zod.object({
12307
+ "title": zod.string().min(1),
12308
+ "schema": zod.record(zod.string(), zod.unknown()).describe("JSON Schema (draft 2020-12) of the form's fields, restricted to the renderer subset: a flat object of boolean, string and number fields with `title`, `additionalProperties: false`, optional `if`/`then`/`else`, `allOf`, `dependentRequired` and `$data` bounds. Property order is the display order."),
12309
+ "processor_type": zod.enum(["extractor", "worker"]),
12310
+ "processor_id": zod.string().uuid().describe("Id of the worker that processes each submission.")
12311
+ });
12312
+ var CreateFormResponse = zod.object({
12313
+ "data": zod.object({
12314
+ "id": zod.string(),
12315
+ "title": zod.string(),
12316
+ "version": zod.number().describe("Version the schema below belongs to."),
12317
+ "versions": zod.object({
12318
+ "live": zod.number(),
12319
+ "test": zod.number()
12320
+ }),
12321
+ "schema": zod.record(zod.string(), zod.unknown()).describe("JSON Schema (draft 2020-12) of the form's fields, restricted to the renderer subset: a flat object of boolean, string and number fields with `title`, `additionalProperties: false`, optional `if`/`then`/`else`, `allOf`, `dependentRequired` and `$data` bounds. Property order is the display order."),
12322
+ "processor_type": zod.enum(["extractor", "worker"]),
12323
+ "processor_id": zod.string(),
12324
+ "created_at": zod.string().datetime({ "offset": true }),
12325
+ "updated_at": zod.string().datetime({ "offset": true })
12326
+ }),
12327
+ "message": zod.string()
12328
+ });
12329
+ var CreateFormSubmissionBody = zod.object({
12330
+ "form_id": zod.string().uuid(),
12331
+ "environment": zod.enum(["live", "test"])
12332
+ });
12333
+ var CreateFormSubmissionResponse = zod.object({
12334
+ "data": zod.object({
12335
+ "id": zod.string().describe("Unguessable id that is the link: the renderer opens `/public/v1/form-submissions/{id}`."),
12336
+ "form_id": zod.string().uuid(),
12337
+ "form_version": zod.number(),
12338
+ "environment": zod.enum(["live", "test"]),
12339
+ "created_at": zod.string().datetime({ "offset": true }),
12340
+ "submitted_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()])
12341
+ }),
12342
+ "message": zod.string()
12343
+ });
12108
12344
  var GetExtractParams = zod.object({
12109
12345
  "id": zod.string().uuid()
12110
12346
  });
@@ -12192,7 +12428,7 @@ var GetProfileResponse = zod.object({
12192
12428
  "last_name": zod.union([zod.string(), zod.null()]),
12193
12429
  "email": zod.string(),
12194
12430
  "role": zod.enum(["admin", "avallon_admin", "member"]),
12195
- "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"])),
12431
+ "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"])),
12196
12432
  "tenants": zod.object({
12197
12433
  "active": zod.object({
12198
12434
  "id": zod.string(),
@@ -12734,7 +12970,7 @@ var listDispatchesQueryOffsetMin = 0;
12734
12970
  var listDispatchesQuerySortByDefault = `due_at`;
12735
12971
  var listDispatchesQuerySortOrderDefault = `desc`;
12736
12972
  var ListDispatchesQueryParams = zod.object({
12737
- "trigger_type": zod.enum(["schedule", "email", "information_request", "manual", "call"]).optional().describe("Only dispatches produced by this kind of trigger"),
12973
+ "trigger_type": zod.enum(["schedule", "email", "information_request", "manual", "call", "form_submission"]).optional().describe("Only dispatches produced by this kind of trigger"),
12738
12974
  "trigger_id": zod.string().uuid().optional().describe("Only dispatches produced by this trigger. Requires `trigger_type`."),
12739
12975
  "count": zod.number().min(1).max(listDispatchesQueryCountMax).default(listDispatchesQueryCountDefault),
12740
12976
  "offset": zod.number().min(listDispatchesQueryOffsetMin).default(listDispatchesQueryOffsetDefault),
@@ -12747,7 +12983,7 @@ var ListDispatchesResponse = zod.object({
12747
12983
  "data": zod.array(zod.object({
12748
12984
  "id": zod.string(),
12749
12985
  "trigger": zod.object({
12750
- "type": zod.enum(["schedule", "email", "information_request", "manual", "call"]),
12986
+ "type": zod.enum(["schedule", "email", "information_request", "manual", "call", "form_submission"]),
12751
12987
  "id": zod.string()
12752
12988
  }),
12753
12989
  "target": zod.union([zod.object({
@@ -13701,7 +13937,7 @@ var GetToolCallResponse = zod.object({
13701
13937
  "dispatch": zod.union([zod.object({
13702
13938
  "id": zod.string(),
13703
13939
  "trigger": zod.object({
13704
- "type": zod.enum(["schedule", "email", "information_request", "manual", "call"]),
13940
+ "type": zod.enum(["schedule", "email", "information_request", "manual", "call", "form_submission"]),
13705
13941
  "id": zod.string()
13706
13942
  }),
13707
13943
  "target": zod.union([zod.object({
@@ -16280,6 +16516,71 @@ var createMcpServer = (options) => {
16280
16516
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16281
16517
  })
16282
16518
  );
16519
+ tools.getPublicFormSubmission = server2.registerTool(
16520
+ "getPublicFormSubmission",
16521
+ {
16522
+ title: "Get a form submission's form (public)",
16523
+ description: "Return the title and JSON Schema of the form version a submission link is pinned to, for the form renderer. The id is the link and the only credential; an unknown id is 404. Once the request has been submitted the request fails with 409 and `{ title }`.",
16524
+ inputSchema: {
16525
+ pathParams: GetPublicFormSubmissionParams
16526
+ },
16527
+ outputSchema: GetPublicFormSubmissionResponse,
16528
+ annotations: { readOnlyHint: true }
16529
+ },
16530
+ (args, ctx) => getPublicFormSubmissionHandler(args, {
16531
+ ...options,
16532
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16533
+ })
16534
+ );
16535
+ tools.submitFormSubmission = server2.registerTool(
16536
+ "submitFormSubmission",
16537
+ {
16538
+ title: "Submit a form submission (public)",
16539
+ description: "Store the answers for a submission link and hand them to the form's processor. Each link can be submitted once: a second submit fails with 409. The id is the link and the only credential; an unknown id is 404.",
16540
+ inputSchema: {
16541
+ pathParams: SubmitFormSubmissionParams,
16542
+ bodyParams: SubmitFormSubmissionBody.optional()
16543
+ },
16544
+ outputSchema: SubmitFormSubmissionResponse,
16545
+ annotations: { destructiveHint: true, idempotentHint: true }
16546
+ },
16547
+ (args, ctx) => submitFormSubmissionHandler(args, {
16548
+ ...options,
16549
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16550
+ })
16551
+ );
16552
+ tools.createForm = server2.registerTool(
16553
+ "createForm",
16554
+ {
16555
+ title: "Create form",
16556
+ description: "Create a form. Its schema becomes version 1, used by both live and test. The schema is validated against the renderer subset; violations are reported as 400 with the offending field path.",
16557
+ inputSchema: {
16558
+ bodyParams: CreateFormBody.optional()
16559
+ },
16560
+ outputSchema: CreateFormResponse,
16561
+ annotations: { destructiveHint: true }
16562
+ },
16563
+ (args, ctx) => createFormHandler(args, {
16564
+ ...options,
16565
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16566
+ })
16567
+ );
16568
+ tools.createFormSubmission = server2.registerTool(
16569
+ "createFormSubmission",
16570
+ {
16571
+ title: "Create form submission",
16572
+ description: "Open a submission link for a form, pinned to the version the given environment points at. Share the returned id with the person filling the form.",
16573
+ inputSchema: {
16574
+ bodyParams: CreateFormSubmissionBody.optional()
16575
+ },
16576
+ outputSchema: CreateFormSubmissionResponse,
16577
+ annotations: { destructiveHint: true }
16578
+ },
16579
+ (args, ctx) => createFormSubmissionHandler(args, {
16580
+ ...options,
16581
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16582
+ })
16583
+ );
16283
16584
  tools.getExtract = server2.registerTool(
16284
16585
  "getExtract",
16285
16586
  {
@@ -17429,4 +17730,4 @@ var transport = new StdioServerTransport();
17429
17730
  server.connect(transport).then(() => {
17430
17731
  console.error("MCP server running on stdio");
17431
17732
  }).catch(console.error);
17432
- //# sourceMappingURL=server-FHO2NMID.js.map
17733
+ //# sourceMappingURL=server-7E6U7EWA.js.map