@chronary/toolkit 1.4.0 → 1.5.1

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.cjs CHANGED
@@ -77,6 +77,28 @@ var UpdateCalendarSchema = import_zod.z.object({
77
77
  var DeleteCalendarSchema = import_zod.z.object({
78
78
  calendar_id: import_zod.z.string().describe("Calendar ID to delete")
79
79
  });
80
+ var ListBookingPagesSchema = import_zod.z.object({
81
+ limit: import_zod.z.number().int().min(1).max(200).default(50).describe("Max results to return"),
82
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset")
83
+ });
84
+ var GetBookingPageSchema = import_zod.z.object({
85
+ booking_page_id: import_zod.z.string().describe("Booking page ID to fetch (bkp_...)")
86
+ });
87
+ var CreateBookingPageSchema = import_zod.z.object({
88
+ calendar_id: import_zod.z.string().describe("Calendar a booking resolves to (from create_calendar/list_calendars)."),
89
+ title: import_zod.z.string().min(1).max(200).describe("Meeting title shown on the page."),
90
+ description: import_zod.z.string().max(2e3).optional().describe("Optional description shown to the booker."),
91
+ duration_minutes: import_zod.z.number().int().min(5).max(480).optional().describe("Slot length in minutes (default 30)."),
92
+ buffer_minutes: import_zod.z.number().int().min(0).max(120).optional().describe("Padding before/after existing events (default 0)."),
93
+ window_days: import_zod.z.number().int().min(1).max(365).optional().describe("How far ahead bookings are allowed (default 14)."),
94
+ min_notice_minutes: import_zod.z.number().int().min(0).max(40320).optional().describe("Minimum lead time before a bookable slot (default 0)."),
95
+ timezone: import_zod.z.string().min(1).max(64).optional().describe("IANA timezone for display + working hours (default UTC)."),
96
+ 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.'),
97
+ active: import_zod.z.boolean().optional().describe("Whether the page accepts bookings (default true).")
98
+ });
99
+ var DeleteBookingPageSchema = import_zod.z.object({
100
+ booking_page_id: import_zod.z.string().describe("Booking page ID to delete (bkp_...)")
101
+ });
80
102
  var ListEventsSchema = import_zod.z.object({
81
103
  calendar_id: import_zod.z.string().optional().describe("Calendar ID to list events from. Provide this or agent_id."),
82
104
  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."),
@@ -377,6 +399,33 @@ var deleteCalendar = safeFunc(async (ctx) => {
377
399
  await ctx.client.calendars.delete(ctx.params.calendar_id);
378
400
  return void 0;
379
401
  });
402
+ var listBookingPages = safeFunc(async (ctx) => {
403
+ const { client, params } = ctx;
404
+ const iter = client.bookingPages.list({ limit: params.limit });
405
+ return fetchPage(iter, params.offset, params.limit);
406
+ });
407
+ var getBookingPage = safeFunc(async (ctx) => {
408
+ return ctx.client.bookingPages.get(ctx.params.booking_page_id);
409
+ });
410
+ var createBookingPage = safeFunc(async (ctx) => {
411
+ const { client, params } = ctx;
412
+ return client.bookingPages.create({
413
+ calendar_id: params.calendar_id,
414
+ title: params.title,
415
+ description: params.description,
416
+ duration_minutes: params.duration_minutes,
417
+ buffer_minutes: params.buffer_minutes,
418
+ window_days: params.window_days,
419
+ min_notice_minutes: params.min_notice_minutes,
420
+ timezone: params.timezone,
421
+ availability_constraints: params.availability_constraints,
422
+ active: params.active
423
+ });
424
+ });
425
+ var deleteBookingPage = safeFunc(async (ctx) => {
426
+ await ctx.client.bookingPages.delete(ctx.params.booking_page_id);
427
+ return void 0;
428
+ });
380
429
  var listEvents = safeFunc(async (ctx) => {
381
430
  const { client, params } = ctx;
382
431
  if (!params.calendar_id && !params.agent_id) {
@@ -656,6 +705,10 @@ var HOSTED_API_MCP_TOOL_NAMES = [
656
705
  "get_calendar",
657
706
  "update_calendar",
658
707
  "delete_calendar",
708
+ "create_booking_page",
709
+ "list_booking_pages",
710
+ "get_booking_page",
711
+ "delete_booking_page",
659
712
  "get_usage",
660
713
  "get_audit_log",
661
714
  "accept_terms"
@@ -697,6 +750,35 @@ var TOOL_DEFINITIONS = [
697
750
  annotations: { title: "Delete Calendar", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
698
751
  execute: createExecutor(deleteCalendar)
699
752
  },
753
+ // ── Booking pages ──────────────────────────────────────────────
754
+ {
755
+ name: "create_booking_page",
756
+ description: "Create a public booking page (a hosted 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.",
757
+ schema: CreateBookingPageSchema,
758
+ annotations: { title: "Create Booking Page", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
759
+ execute: createExecutor(createBookingPage)
760
+ },
761
+ {
762
+ name: "list_booking_pages",
763
+ description: "List booking pages in the org. Agent-scoped keys see only pages on their own agent's calendars.",
764
+ schema: ListBookingPagesSchema,
765
+ annotations: { title: "List Booking Pages", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
766
+ execute: createExecutor(listBookingPages)
767
+ },
768
+ {
769
+ name: "get_booking_page",
770
+ description: "Fetch a single booking page by ID, including its public booking_url and settings.",
771
+ schema: GetBookingPageSchema,
772
+ annotations: { title: "Get Booking Page", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
773
+ execute: createExecutor(getBookingPage)
774
+ },
775
+ {
776
+ name: "delete_booking_page",
777
+ description: "Delete (deactivate) a booking page. Its hosted URL stops resolving; already-booked events are unaffected.",
778
+ schema: DeleteBookingPageSchema,
779
+ annotations: { title: "Delete Booking Page", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
780
+ execute: createExecutor(deleteBookingPage)
781
+ },
700
782
  // ── Events ─────────────────────────────────────────────────────
701
783
  {
702
784
  name: "list_events",