@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/openai.js CHANGED
@@ -53,6 +53,28 @@ var UpdateCalendarSchema = z.object({
53
53
  var DeleteCalendarSchema = z.object({
54
54
  calendar_id: z.string().describe("Calendar ID to delete")
55
55
  });
56
+ var ListBookingPagesSchema = z.object({
57
+ limit: z.number().int().min(1).max(200).default(50).describe("Max results to return"),
58
+ offset: z.number().int().min(0).default(0).describe("Pagination offset")
59
+ });
60
+ var GetBookingPageSchema = z.object({
61
+ booking_page_id: z.string().describe("Booking page ID to fetch (bkp_...)")
62
+ });
63
+ var CreateBookingPageSchema = z.object({
64
+ calendar_id: z.string().describe("Calendar a booking resolves to (from create_calendar/list_calendars)."),
65
+ title: z.string().min(1).max(200).describe("Meeting title shown on the page."),
66
+ description: z.string().max(2e3).optional().describe("Optional description shown to the booker."),
67
+ duration_minutes: z.number().int().min(5).max(480).optional().describe("Slot length in minutes (default 30)."),
68
+ buffer_minutes: z.number().int().min(0).max(120).optional().describe("Padding before/after existing events (default 0)."),
69
+ window_days: z.number().int().min(1).max(365).optional().describe("How far ahead bookings are allowed (default 14)."),
70
+ min_notice_minutes: z.number().int().min(0).max(40320).optional().describe("Minimum lead time before a bookable slot (default 0)."),
71
+ timezone: z.string().min(1).max(64).optional().describe("IANA timezone for display + working hours (default UTC)."),
72
+ availability_constraints: z.record(z.string(), z.object({ start: z.string(), end: 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.'),
73
+ active: z.boolean().optional().describe("Whether the page accepts bookings (default true).")
74
+ });
75
+ var DeleteBookingPageSchema = z.object({
76
+ booking_page_id: z.string().describe("Booking page ID to delete (bkp_...)")
77
+ });
56
78
  var ListEventsSchema = z.object({
57
79
  calendar_id: z.string().optional().describe("Calendar ID to list events from. Provide this or agent_id."),
58
80
  agent_id: z.string().optional().describe("Agent ID to list events for across all of the agent's calendars. Provide this or calendar_id."),
@@ -353,6 +375,33 @@ var deleteCalendar = safeFunc(async (ctx) => {
353
375
  await ctx.client.calendars.delete(ctx.params.calendar_id);
354
376
  return void 0;
355
377
  });
378
+ var listBookingPages = safeFunc(async (ctx) => {
379
+ const { client, params } = ctx;
380
+ const iter = client.bookingPages.list({ limit: params.limit });
381
+ return fetchPage(iter, params.offset, params.limit);
382
+ });
383
+ var getBookingPage = safeFunc(async (ctx) => {
384
+ return ctx.client.bookingPages.get(ctx.params.booking_page_id);
385
+ });
386
+ var createBookingPage = safeFunc(async (ctx) => {
387
+ const { client, params } = ctx;
388
+ return client.bookingPages.create({
389
+ calendar_id: params.calendar_id,
390
+ title: params.title,
391
+ description: params.description,
392
+ duration_minutes: params.duration_minutes,
393
+ buffer_minutes: params.buffer_minutes,
394
+ window_days: params.window_days,
395
+ min_notice_minutes: params.min_notice_minutes,
396
+ timezone: params.timezone,
397
+ availability_constraints: params.availability_constraints,
398
+ active: params.active
399
+ });
400
+ });
401
+ var deleteBookingPage = safeFunc(async (ctx) => {
402
+ await ctx.client.bookingPages.delete(ctx.params.booking_page_id);
403
+ return void 0;
404
+ });
356
405
  var listEvents = safeFunc(async (ctx) => {
357
406
  const { client, params } = ctx;
358
407
  if (!params.calendar_id && !params.agent_id) {
@@ -632,6 +681,10 @@ var HOSTED_API_MCP_TOOL_NAMES = [
632
681
  "get_calendar",
633
682
  "update_calendar",
634
683
  "delete_calendar",
684
+ "create_booking_page",
685
+ "list_booking_pages",
686
+ "get_booking_page",
687
+ "delete_booking_page",
635
688
  "get_usage",
636
689
  "get_audit_log",
637
690
  "accept_terms"
@@ -673,6 +726,35 @@ var TOOL_DEFINITIONS = [
673
726
  annotations: { title: "Delete Calendar", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
674
727
  execute: createExecutor(deleteCalendar)
675
728
  },
729
+ // ── Booking pages ──────────────────────────────────────────────
730
+ {
731
+ name: "create_booking_page",
732
+ 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.",
733
+ schema: CreateBookingPageSchema,
734
+ annotations: { title: "Create Booking Page", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
735
+ execute: createExecutor(createBookingPage)
736
+ },
737
+ {
738
+ name: "list_booking_pages",
739
+ description: "List booking pages in the org. Agent-scoped keys see only pages on their own agent's calendars.",
740
+ schema: ListBookingPagesSchema,
741
+ annotations: { title: "List Booking Pages", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
742
+ execute: createExecutor(listBookingPages)
743
+ },
744
+ {
745
+ name: "get_booking_page",
746
+ description: "Fetch a single booking page by ID, including its public booking_url and settings.",
747
+ schema: GetBookingPageSchema,
748
+ annotations: { title: "Get Booking Page", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
749
+ execute: createExecutor(getBookingPage)
750
+ },
751
+ {
752
+ name: "delete_booking_page",
753
+ description: "Delete (deactivate) a booking page. Its hosted URL stops resolving; already-booked events are unaffected.",
754
+ schema: DeleteBookingPageSchema,
755
+ annotations: { title: "Delete Booking Page", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
756
+ execute: createExecutor(deleteBookingPage)
757
+ },
676
758
  // ── Events ─────────────────────────────────────────────────────
677
759
  {
678
760
  name: "list_events",