@chronary/toolkit 1.3.1 → 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/mcp.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."),
@@ -175,6 +197,15 @@ var FindMeetingTimeSchema = import_zod.z.object({
175
197
  calendars: import_zod.z.array(import_zod.z.string()).optional().describe("Additional shared calendar IDs to treat as busy"),
176
198
  include_busy: import_zod.z.boolean().default(false).describe("Include per-agent busy blocks in response")
177
199
  });
200
+ var CreateConnectionLinkSchema = import_zod.z.object({
201
+ calendar_id: import_zod.z.string().startsWith("cal_").describe("Chronary calendar whose owning agent will receive authorized availability"),
202
+ capabilities: import_zod.z.array(import_zod.z.enum(["availability", "publishing"])).min(1).max(2).default(["availability"]).describe("Request opaque availability and optional publishing permission"),
203
+ publication_policy: import_zod.z.enum(["none", "confirmed", "confirmed_tentative"]).default("none").describe("Desired event publishing policy; a human still selects the destination")
204
+ });
205
+ var GetConnectionLinkSchema = import_zod.z.object({
206
+ connection_link_id: import_zod.z.string().startsWith("csl_").describe("Connection setup link ID")
207
+ });
208
+ var CancelConnectionLinkSchema = GetConnectionLinkSchema;
178
209
  var GetCalendarContextSchema = import_zod.z.object({
179
210
  calendar_id: import_zod.z.string().describe("Calendar ID")
180
211
  });
@@ -368,6 +399,33 @@ var deleteCalendar = safeFunc(async (ctx) => {
368
399
  await ctx.client.calendars.delete(ctx.params.calendar_id);
369
400
  return void 0;
370
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
+ });
371
429
  var listEvents = safeFunc(async (ctx) => {
372
430
  const { client, params } = ctx;
373
431
  if (!params.calendar_id && !params.agent_id) {
@@ -471,6 +529,15 @@ var findMeetingTime = safeFunc(async (ctx) => {
471
529
  include_busy: params.include_busy
472
530
  });
473
531
  });
532
+ var createConnectionLink = safeFunc(async (ctx) => {
533
+ const { calendar_id, ...params } = ctx.params;
534
+ return ctx.client.connectionLinks.create(calendar_id, params);
535
+ });
536
+ var getConnectionLink = safeFunc(async (ctx) => ctx.client.connectionLinks.get(ctx.params.connection_link_id));
537
+ var cancelConnectionLink = safeFunc(async (ctx) => {
538
+ await ctx.client.connectionLinks.cancel(ctx.params.connection_link_id);
539
+ return { cancelled: true, id: ctx.params.connection_link_id };
540
+ });
474
541
  var getCalendarContext = safeFunc(async (ctx) => {
475
542
  return ctx.client.calendars.getContext(ctx.params.calendar_id);
476
543
  });
@@ -600,6 +667,9 @@ var HOSTED_API_MCP_TOOL_NAMES = [
600
667
  "update_event",
601
668
  "get_availability",
602
669
  "find_meeting_time",
670
+ "create_connection_link",
671
+ "get_connection_link",
672
+ "cancel_connection_link",
603
673
  "cancel_event",
604
674
  "confirm_event",
605
675
  "release_event",
@@ -635,6 +705,10 @@ var HOSTED_API_MCP_TOOL_NAMES = [
635
705
  "get_calendar",
636
706
  "update_calendar",
637
707
  "delete_calendar",
708
+ "create_booking_page",
709
+ "list_booking_pages",
710
+ "get_booking_page",
711
+ "delete_booking_page",
638
712
  "get_usage",
639
713
  "get_audit_log",
640
714
  "accept_terms"
@@ -676,6 +750,35 @@ var TOOL_DEFINITIONS = [
676
750
  annotations: { title: "Delete Calendar", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
677
751
  execute: createExecutor(deleteCalendar)
678
752
  },
753
+ // ── Booking pages ──────────────────────────────────────────────
754
+ {
755
+ name: "create_booking_page",
756
+ 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.",
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
+ },
679
782
  // ── Events ─────────────────────────────────────────────────────
680
783
  {
681
784
  name: "list_events",
@@ -765,18 +868,39 @@ var TOOL_DEFINITIONS = [
765
868
  // ── Availability ───────────────────────────────────────────────
766
869
  {
767
870
  name: "get_availability",
768
- description: "Check when a single agent is free within a time range. Accepts `start`/`end` (preferred \u2014 matches the underlying availability service) or `start_time`/`end_time` (aliases that match the REST events schema).",
871
+ description: "Check when a single agent is free across Chronary and authorized human calendars. This tool is fail-closed: always inspect availability_state and warnings before using slots.",
769
872
  schema: GetAvailabilitySchema,
770
873
  annotations: { title: "Get Availability", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
771
874
  execute: createExecutor(getAvailability)
772
875
  },
773
876
  {
774
877
  name: "find_meeting_time",
775
- description: "Find time slots when multiple agents are all free simultaneously. Accepts `agents`/`start`/`end` (preferred \u2014 matches the availability service) or `agent_ids`/`start_time`/`end_time` (aliases that match the REST/scheduling-proposal naming).",
878
+ description: "Find time when multiple agents are free across Chronary and their authorized human calendars. This tool is fail-closed: always inspect availability_state and warnings before using slots.",
776
879
  schema: FindMeetingTimeSchema,
777
880
  annotations: { title: "Find Meeting Time", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
778
881
  execute: createExecutor(findMeetingTime)
779
882
  },
883
+ {
884
+ name: "create_connection_link",
885
+ description: "Request human setup of Google Calendar or Microsoft Outlook for a Chronary calendar. Give setup_url to a human; agents never receive provider credentials or event data. The secret URL is returned only once.",
886
+ schema: CreateConnectionLinkSchema,
887
+ annotations: { title: "Create Human Calendar Setup Link", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
888
+ execute: createExecutor(createConnectionLink)
889
+ },
890
+ {
891
+ name: "get_connection_link",
892
+ description: "Poll provider-neutral human-calendar setup status. The bearer setup URL and provider data are never returned by polling.",
893
+ schema: GetConnectionLinkSchema,
894
+ annotations: { title: "Get Human Calendar Setup Status", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
895
+ execute: createExecutor(getConnectionLink)
896
+ },
897
+ {
898
+ name: "cancel_connection_link",
899
+ description: "Cancel a pending human-calendar setup request and invalidate its setup URL.",
900
+ schema: CancelConnectionLinkSchema,
901
+ annotations: { title: "Cancel Human Calendar Setup Link", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
902
+ execute: createExecutor(cancelConnectionLink)
903
+ },
780
904
  // ── Calendar context ───────────────────────────────────────────
781
905
  {
782
906
  name: "get_calendar_context",