@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/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",
@@ -51,6 +55,9 @@ var TOOL_NAMES = [
51
55
  "delete_agent",
52
56
  "get_availability",
53
57
  "find_meeting_time",
58
+ "create_connection_link",
59
+ "get_connection_link",
60
+ "cancel_connection_link",
54
61
  "get_calendar_context",
55
62
  "create_proposal",
56
63
  "list_proposals",
@@ -85,17 +92,21 @@ var TOOL_NAMES = [
85
92
  var schemas_exports = {};
86
93
  __export(schemas_exports, {
87
94
  AcceptTermsSchema: () => AcceptTermsSchema,
95
+ CancelConnectionLinkSchema: () => CancelConnectionLinkSchema,
88
96
  CancelEventSchema: () => CancelEventSchema,
89
97
  CancelProposalSchema: () => CancelProposalSchema,
90
98
  ClearAvailabilityRulesSchema: () => ClearAvailabilityRulesSchema,
91
99
  ConfirmEventSchema: () => ConfirmEventSchema,
92
100
  CreateAgentSchema: () => CreateAgentSchema,
101
+ CreateBookingPageSchema: () => CreateBookingPageSchema,
93
102
  CreateCalendarSchema: () => CreateCalendarSchema,
103
+ CreateConnectionLinkSchema: () => CreateConnectionLinkSchema,
94
104
  CreateEventSchema: () => CreateEventSchema,
95
105
  CreateProposalSchema: () => CreateProposalSchema,
96
106
  CreateScopedKeySchema: () => CreateScopedKeySchema,
97
107
  CreateWebhookSchema: () => CreateWebhookSchema,
98
108
  DeleteAgentSchema: () => DeleteAgentSchema,
109
+ DeleteBookingPageSchema: () => DeleteBookingPageSchema,
99
110
  DeleteCalendarSchema: () => DeleteCalendarSchema,
100
111
  DeleteICalSubscriptionSchema: () => DeleteICalSubscriptionSchema,
101
112
  DeleteWebhookSchema: () => DeleteWebhookSchema,
@@ -104,14 +115,17 @@ __export(schemas_exports, {
104
115
  GetAuditLogSchema: () => GetAuditLogSchema,
105
116
  GetAvailabilityRulesSchema: () => GetAvailabilityRulesSchema,
106
117
  GetAvailabilitySchema: () => GetAvailabilitySchema,
118
+ GetBookingPageSchema: () => GetBookingPageSchema,
107
119
  GetCalendarContextSchema: () => GetCalendarContextSchema,
108
120
  GetCalendarSchema: () => GetCalendarSchema,
121
+ GetConnectionLinkSchema: () => GetConnectionLinkSchema,
109
122
  GetEventSchema: () => GetEventSchema,
110
123
  GetICalSubscriptionSchema: () => GetICalSubscriptionSchema,
111
124
  GetProposalSchema: () => GetProposalSchema,
112
125
  GetUsageSchema: () => GetUsageSchema,
113
126
  GetWebhookSchema: () => GetWebhookSchema,
114
127
  ListAgentsSchema: () => ListAgentsSchema,
128
+ ListBookingPagesSchema: () => ListBookingPagesSchema,
115
129
  ListCalendarsSchema: () => ListCalendarsSchema,
116
130
  ListEventsSchema: () => ListEventsSchema,
117
131
  ListICalSubscriptionsSchema: () => ListICalSubscriptionsSchema,
@@ -180,6 +194,28 @@ var UpdateCalendarSchema = import_zod.z.object({
180
194
  var DeleteCalendarSchema = import_zod.z.object({
181
195
  calendar_id: import_zod.z.string().describe("Calendar ID to delete")
182
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
+ });
183
219
  var ListEventsSchema = import_zod.z.object({
184
220
  calendar_id: import_zod.z.string().optional().describe("Calendar ID to list events from. Provide this or agent_id."),
185
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."),
@@ -278,6 +314,15 @@ var FindMeetingTimeSchema = import_zod.z.object({
278
314
  calendars: import_zod.z.array(import_zod.z.string()).optional().describe("Additional shared calendar IDs to treat as busy"),
279
315
  include_busy: import_zod.z.boolean().default(false).describe("Include per-agent busy blocks in response")
280
316
  });
317
+ var CreateConnectionLinkSchema = import_zod.z.object({
318
+ calendar_id: import_zod.z.string().startsWith("cal_").describe("Chronary calendar whose owning agent will receive authorized availability"),
319
+ 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"),
320
+ publication_policy: import_zod.z.enum(["none", "confirmed", "confirmed_tentative"]).default("none").describe("Desired event publishing policy; a human still selects the destination")
321
+ });
322
+ var GetConnectionLinkSchema = import_zod.z.object({
323
+ connection_link_id: import_zod.z.string().startsWith("csl_").describe("Connection setup link ID")
324
+ });
325
+ var CancelConnectionLinkSchema = GetConnectionLinkSchema;
281
326
  var GetCalendarContextSchema = import_zod.z.object({
282
327
  calendar_id: import_zod.z.string().describe("Calendar ID")
283
328
  });
@@ -471,6 +516,33 @@ var deleteCalendar = safeFunc(async (ctx) => {
471
516
  await ctx.client.calendars.delete(ctx.params.calendar_id);
472
517
  return void 0;
473
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
+ });
474
546
  var listEvents = safeFunc(async (ctx) => {
475
547
  const { client, params } = ctx;
476
548
  if (!params.calendar_id && !params.agent_id) {
@@ -574,6 +646,15 @@ var findMeetingTime = safeFunc(async (ctx) => {
574
646
  include_busy: params.include_busy
575
647
  });
576
648
  });
649
+ var createConnectionLink = safeFunc(async (ctx) => {
650
+ const { calendar_id, ...params } = ctx.params;
651
+ return ctx.client.connectionLinks.create(calendar_id, params);
652
+ });
653
+ var getConnectionLink = safeFunc(async (ctx) => ctx.client.connectionLinks.get(ctx.params.connection_link_id));
654
+ var cancelConnectionLink = safeFunc(async (ctx) => {
655
+ await ctx.client.connectionLinks.cancel(ctx.params.connection_link_id);
656
+ return { cancelled: true, id: ctx.params.connection_link_id };
657
+ });
577
658
  var getCalendarContext = safeFunc(async (ctx) => {
578
659
  return ctx.client.calendars.getContext(ctx.params.calendar_id);
579
660
  });
@@ -703,6 +784,9 @@ var HOSTED_API_MCP_TOOL_NAMES = [
703
784
  "update_event",
704
785
  "get_availability",
705
786
  "find_meeting_time",
787
+ "create_connection_link",
788
+ "get_connection_link",
789
+ "cancel_connection_link",
706
790
  "cancel_event",
707
791
  "confirm_event",
708
792
  "release_event",
@@ -738,6 +822,10 @@ var HOSTED_API_MCP_TOOL_NAMES = [
738
822
  "get_calendar",
739
823
  "update_calendar",
740
824
  "delete_calendar",
825
+ "create_booking_page",
826
+ "list_booking_pages",
827
+ "get_booking_page",
828
+ "delete_booking_page",
741
829
  "get_usage",
742
830
  "get_audit_log",
743
831
  "accept_terms"
@@ -779,6 +867,35 @@ var TOOL_DEFINITIONS = [
779
867
  annotations: { title: "Delete Calendar", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
780
868
  execute: createExecutor(deleteCalendar)
781
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
+ },
782
899
  // ── Events ─────────────────────────────────────────────────────
783
900
  {
784
901
  name: "list_events",
@@ -868,18 +985,39 @@ var TOOL_DEFINITIONS = [
868
985
  // ── Availability ───────────────────────────────────────────────
869
986
  {
870
987
  name: "get_availability",
871
- 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).",
988
+ 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.",
872
989
  schema: GetAvailabilitySchema,
873
990
  annotations: { title: "Get Availability", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
874
991
  execute: createExecutor(getAvailability)
875
992
  },
876
993
  {
877
994
  name: "find_meeting_time",
878
- 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).",
995
+ 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.",
879
996
  schema: FindMeetingTimeSchema,
880
997
  annotations: { title: "Find Meeting Time", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
881
998
  execute: createExecutor(findMeetingTime)
882
999
  },
1000
+ {
1001
+ name: "create_connection_link",
1002
+ 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.",
1003
+ schema: CreateConnectionLinkSchema,
1004
+ annotations: { title: "Create Human Calendar Setup Link", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
1005
+ execute: createExecutor(createConnectionLink)
1006
+ },
1007
+ {
1008
+ name: "get_connection_link",
1009
+ description: "Poll provider-neutral human-calendar setup status. The bearer setup URL and provider data are never returned by polling.",
1010
+ schema: GetConnectionLinkSchema,
1011
+ annotations: { title: "Get Human Calendar Setup Status", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1012
+ execute: createExecutor(getConnectionLink)
1013
+ },
1014
+ {
1015
+ name: "cancel_connection_link",
1016
+ description: "Cancel a pending human-calendar setup request and invalidate its setup URL.",
1017
+ schema: CancelConnectionLinkSchema,
1018
+ annotations: { title: "Cancel Human Calendar Setup Link", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
1019
+ execute: createExecutor(cancelConnectionLink)
1020
+ },
883
1021
  // ── Calendar context ───────────────────────────────────────────
884
1022
  {
885
1023
  name: "get_calendar_context",