@chronary/toolkit 1.4.0 → 1.5.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.cjs CHANGED
@@ -37,6 +37,10 @@ var TOOL_NAMES = [
37
37
  "create_calendar",
38
38
  "update_calendar",
39
39
  "delete_calendar",
40
+ "create_booking_page",
41
+ "list_booking_pages",
42
+ "get_booking_page",
43
+ "delete_booking_page",
40
44
  "list_events",
41
45
  "get_event",
42
46
  "create_event",
@@ -94,6 +98,7 @@ __export(schemas_exports, {
94
98
  ClearAvailabilityRulesSchema: () => ClearAvailabilityRulesSchema,
95
99
  ConfirmEventSchema: () => ConfirmEventSchema,
96
100
  CreateAgentSchema: () => CreateAgentSchema,
101
+ CreateBookingPageSchema: () => CreateBookingPageSchema,
97
102
  CreateCalendarSchema: () => CreateCalendarSchema,
98
103
  CreateConnectionLinkSchema: () => CreateConnectionLinkSchema,
99
104
  CreateEventSchema: () => CreateEventSchema,
@@ -101,6 +106,7 @@ __export(schemas_exports, {
101
106
  CreateScopedKeySchema: () => CreateScopedKeySchema,
102
107
  CreateWebhookSchema: () => CreateWebhookSchema,
103
108
  DeleteAgentSchema: () => DeleteAgentSchema,
109
+ DeleteBookingPageSchema: () => DeleteBookingPageSchema,
104
110
  DeleteCalendarSchema: () => DeleteCalendarSchema,
105
111
  DeleteICalSubscriptionSchema: () => DeleteICalSubscriptionSchema,
106
112
  DeleteWebhookSchema: () => DeleteWebhookSchema,
@@ -109,6 +115,7 @@ __export(schemas_exports, {
109
115
  GetAuditLogSchema: () => GetAuditLogSchema,
110
116
  GetAvailabilityRulesSchema: () => GetAvailabilityRulesSchema,
111
117
  GetAvailabilitySchema: () => GetAvailabilitySchema,
118
+ GetBookingPageSchema: () => GetBookingPageSchema,
112
119
  GetCalendarContextSchema: () => GetCalendarContextSchema,
113
120
  GetCalendarSchema: () => GetCalendarSchema,
114
121
  GetConnectionLinkSchema: () => GetConnectionLinkSchema,
@@ -118,6 +125,7 @@ __export(schemas_exports, {
118
125
  GetUsageSchema: () => GetUsageSchema,
119
126
  GetWebhookSchema: () => GetWebhookSchema,
120
127
  ListAgentsSchema: () => ListAgentsSchema,
128
+ ListBookingPagesSchema: () => ListBookingPagesSchema,
121
129
  ListCalendarsSchema: () => ListCalendarsSchema,
122
130
  ListEventsSchema: () => ListEventsSchema,
123
131
  ListICalSubscriptionsSchema: () => ListICalSubscriptionsSchema,
@@ -186,6 +194,28 @@ var UpdateCalendarSchema = import_zod.z.object({
186
194
  var DeleteCalendarSchema = import_zod.z.object({
187
195
  calendar_id: import_zod.z.string().describe("Calendar ID to delete")
188
196
  });
197
+ var ListBookingPagesSchema = import_zod.z.object({
198
+ limit: import_zod.z.number().int().min(1).max(200).default(50).describe("Max results to return"),
199
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset")
200
+ });
201
+ var GetBookingPageSchema = import_zod.z.object({
202
+ booking_page_id: import_zod.z.string().describe("Booking page ID to fetch (bkp_...)")
203
+ });
204
+ var CreateBookingPageSchema = import_zod.z.object({
205
+ calendar_id: import_zod.z.string().describe("Calendar a booking resolves to (from create_calendar/list_calendars)."),
206
+ title: import_zod.z.string().min(1).max(200).describe("Meeting title shown on the page."),
207
+ description: import_zod.z.string().max(2e3).optional().describe("Optional description shown to the booker."),
208
+ duration_minutes: import_zod.z.number().int().min(5).max(480).optional().describe("Slot length in minutes (default 30)."),
209
+ buffer_minutes: import_zod.z.number().int().min(0).max(120).optional().describe("Padding before/after existing events (default 0)."),
210
+ window_days: import_zod.z.number().int().min(1).max(365).optional().describe("How far ahead bookings are allowed (default 14)."),
211
+ min_notice_minutes: import_zod.z.number().int().min(0).max(40320).optional().describe("Minimum lead time before a bookable slot (default 0)."),
212
+ timezone: import_zod.z.string().min(1).max(64).optional().describe("IANA timezone for display + working hours (default UTC)."),
213
+ availability_constraints: import_zod.z.record(import_zod.z.string(), import_zod.z.object({ start: import_zod.z.string(), end: import_zod.z.string() })).nullable().optional().describe('Weekly working hours, e.g. {"mon":{"start":"09:00","end":"17:00"}}. Omit/null for any time in the window.'),
214
+ active: import_zod.z.boolean().optional().describe("Whether the page accepts bookings (default true).")
215
+ });
216
+ var DeleteBookingPageSchema = import_zod.z.object({
217
+ booking_page_id: import_zod.z.string().describe("Booking page ID to delete (bkp_...)")
218
+ });
189
219
  var ListEventsSchema = import_zod.z.object({
190
220
  calendar_id: import_zod.z.string().optional().describe("Calendar ID to list events from. Provide this or agent_id."),
191
221
  agent_id: import_zod.z.string().optional().describe("Agent ID to list events for across all of the agent's calendars. Provide this or calendar_id."),
@@ -486,6 +516,33 @@ var deleteCalendar = safeFunc(async (ctx) => {
486
516
  await ctx.client.calendars.delete(ctx.params.calendar_id);
487
517
  return void 0;
488
518
  });
519
+ var listBookingPages = safeFunc(async (ctx) => {
520
+ const { client, params } = ctx;
521
+ const iter = client.bookingPages.list({ limit: params.limit });
522
+ return fetchPage(iter, params.offset, params.limit);
523
+ });
524
+ var getBookingPage = safeFunc(async (ctx) => {
525
+ return ctx.client.bookingPages.get(ctx.params.booking_page_id);
526
+ });
527
+ var createBookingPage = safeFunc(async (ctx) => {
528
+ const { client, params } = ctx;
529
+ return client.bookingPages.create({
530
+ calendar_id: params.calendar_id,
531
+ title: params.title,
532
+ description: params.description,
533
+ duration_minutes: params.duration_minutes,
534
+ buffer_minutes: params.buffer_minutes,
535
+ window_days: params.window_days,
536
+ min_notice_minutes: params.min_notice_minutes,
537
+ timezone: params.timezone,
538
+ availability_constraints: params.availability_constraints,
539
+ active: params.active
540
+ });
541
+ });
542
+ var deleteBookingPage = safeFunc(async (ctx) => {
543
+ await ctx.client.bookingPages.delete(ctx.params.booking_page_id);
544
+ return void 0;
545
+ });
489
546
  var listEvents = safeFunc(async (ctx) => {
490
547
  const { client, params } = ctx;
491
548
  if (!params.calendar_id && !params.agent_id) {
@@ -765,6 +822,10 @@ var HOSTED_API_MCP_TOOL_NAMES = [
765
822
  "get_calendar",
766
823
  "update_calendar",
767
824
  "delete_calendar",
825
+ "create_booking_page",
826
+ "list_booking_pages",
827
+ "get_booking_page",
828
+ "delete_booking_page",
768
829
  "get_usage",
769
830
  "get_audit_log",
770
831
  "accept_terms"
@@ -806,6 +867,35 @@ var TOOL_DEFINITIONS = [
806
867
  annotations: { title: "Delete Calendar", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
807
868
  execute: createExecutor(deleteCalendar)
808
869
  },
870
+ // ── Booking pages ──────────────────────────────────────────────
871
+ {
872
+ name: "create_booking_page",
873
+ description: "Create a public booking page (Calendly-style scheduling link) for a calendar. Returns a booking_url to send to a human; when they pick a slot, a confirmed event is created on the calendar and an event.created webhook fires with a booking_page_id field. Set availability_constraints to restrict to weekly working hours; existing calendar events always block slots.",
874
+ schema: CreateBookingPageSchema,
875
+ annotations: { title: "Create Booking Page", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
876
+ execute: createExecutor(createBookingPage)
877
+ },
878
+ {
879
+ name: "list_booking_pages",
880
+ description: "List booking pages in the org. Agent-scoped keys see only pages on their own agent's calendars.",
881
+ schema: ListBookingPagesSchema,
882
+ annotations: { title: "List Booking Pages", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
883
+ execute: createExecutor(listBookingPages)
884
+ },
885
+ {
886
+ name: "get_booking_page",
887
+ description: "Fetch a single booking page by ID, including its public booking_url and settings.",
888
+ schema: GetBookingPageSchema,
889
+ annotations: { title: "Get Booking Page", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
890
+ execute: createExecutor(getBookingPage)
891
+ },
892
+ {
893
+ name: "delete_booking_page",
894
+ description: "Delete (deactivate) a booking page. Its hosted URL stops resolving; already-booked events are unaffected.",
895
+ schema: DeleteBookingPageSchema,
896
+ annotations: { title: "Delete Booking Page", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
897
+ execute: createExecutor(deleteBookingPage)
898
+ },
809
899
  // ── Events ─────────────────────────────────────────────────────
810
900
  {
811
901
  name: "list_events",