@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/CHANGELOG.md +11 -2
- package/README.md +2 -2
- package/dist/ai-sdk.cjs +126 -2
- package/dist/ai-sdk.cjs.map +1 -1
- package/dist/ai-sdk.d.cts +1 -1
- package/dist/ai-sdk.d.ts +1 -1
- package/dist/ai-sdk.js +126 -2
- package/dist/ai-sdk.js.map +1 -1
- package/dist/{base-C6QWbxc1.d.cts → base-DuHHyh4Q.d.cts} +2 -2
- package/dist/{base-C6QWbxc1.d.ts → base-DuHHyh4Q.d.ts} +2 -2
- package/dist/index.cjs +140 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -3
- package/dist/index.d.ts +53 -3
- package/dist/index.js +140 -2
- package/dist/index.js.map +1 -1
- package/dist/langchain.cjs +126 -2
- package/dist/langchain.cjs.map +1 -1
- package/dist/langchain.d.cts +1 -1
- package/dist/langchain.d.ts +1 -1
- package/dist/langchain.js +126 -2
- package/dist/langchain.js.map +1 -1
- package/dist/mastra.cjs +126 -2
- package/dist/mastra.cjs.map +1 -1
- package/dist/mastra.d.cts +1 -1
- package/dist/mastra.d.ts +1 -1
- package/dist/mastra.js +126 -2
- package/dist/mastra.js.map +1 -1
- package/dist/mcp.cjs +126 -2
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +126 -2
- package/dist/mcp.js.map +1 -1
- package/dist/openai.cjs +126 -2
- package/dist/openai.cjs.map +1 -1
- package/dist/openai.d.cts +1 -1
- package/dist/openai.d.ts +1 -1
- package/dist/openai.js +126 -2
- package/dist/openai.js.map +1 -1
- package/package.json +2 -2
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."),
|
|
@@ -151,6 +173,15 @@ var FindMeetingTimeSchema = z.object({
|
|
|
151
173
|
calendars: z.array(z.string()).optional().describe("Additional shared calendar IDs to treat as busy"),
|
|
152
174
|
include_busy: z.boolean().default(false).describe("Include per-agent busy blocks in response")
|
|
153
175
|
});
|
|
176
|
+
var CreateConnectionLinkSchema = z.object({
|
|
177
|
+
calendar_id: z.string().startsWith("cal_").describe("Chronary calendar whose owning agent will receive authorized availability"),
|
|
178
|
+
capabilities: z.array(z.enum(["availability", "publishing"])).min(1).max(2).default(["availability"]).describe("Request opaque availability and optional publishing permission"),
|
|
179
|
+
publication_policy: z.enum(["none", "confirmed", "confirmed_tentative"]).default("none").describe("Desired event publishing policy; a human still selects the destination")
|
|
180
|
+
});
|
|
181
|
+
var GetConnectionLinkSchema = z.object({
|
|
182
|
+
connection_link_id: z.string().startsWith("csl_").describe("Connection setup link ID")
|
|
183
|
+
});
|
|
184
|
+
var CancelConnectionLinkSchema = GetConnectionLinkSchema;
|
|
154
185
|
var GetCalendarContextSchema = z.object({
|
|
155
186
|
calendar_id: z.string().describe("Calendar ID")
|
|
156
187
|
});
|
|
@@ -344,6 +375,33 @@ var deleteCalendar = safeFunc(async (ctx) => {
|
|
|
344
375
|
await ctx.client.calendars.delete(ctx.params.calendar_id);
|
|
345
376
|
return void 0;
|
|
346
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
|
+
});
|
|
347
405
|
var listEvents = safeFunc(async (ctx) => {
|
|
348
406
|
const { client, params } = ctx;
|
|
349
407
|
if (!params.calendar_id && !params.agent_id) {
|
|
@@ -447,6 +505,15 @@ var findMeetingTime = safeFunc(async (ctx) => {
|
|
|
447
505
|
include_busy: params.include_busy
|
|
448
506
|
});
|
|
449
507
|
});
|
|
508
|
+
var createConnectionLink = safeFunc(async (ctx) => {
|
|
509
|
+
const { calendar_id, ...params } = ctx.params;
|
|
510
|
+
return ctx.client.connectionLinks.create(calendar_id, params);
|
|
511
|
+
});
|
|
512
|
+
var getConnectionLink = safeFunc(async (ctx) => ctx.client.connectionLinks.get(ctx.params.connection_link_id));
|
|
513
|
+
var cancelConnectionLink = safeFunc(async (ctx) => {
|
|
514
|
+
await ctx.client.connectionLinks.cancel(ctx.params.connection_link_id);
|
|
515
|
+
return { cancelled: true, id: ctx.params.connection_link_id };
|
|
516
|
+
});
|
|
450
517
|
var getCalendarContext = safeFunc(async (ctx) => {
|
|
451
518
|
return ctx.client.calendars.getContext(ctx.params.calendar_id);
|
|
452
519
|
});
|
|
@@ -576,6 +643,9 @@ var HOSTED_API_MCP_TOOL_NAMES = [
|
|
|
576
643
|
"update_event",
|
|
577
644
|
"get_availability",
|
|
578
645
|
"find_meeting_time",
|
|
646
|
+
"create_connection_link",
|
|
647
|
+
"get_connection_link",
|
|
648
|
+
"cancel_connection_link",
|
|
579
649
|
"cancel_event",
|
|
580
650
|
"confirm_event",
|
|
581
651
|
"release_event",
|
|
@@ -611,6 +681,10 @@ var HOSTED_API_MCP_TOOL_NAMES = [
|
|
|
611
681
|
"get_calendar",
|
|
612
682
|
"update_calendar",
|
|
613
683
|
"delete_calendar",
|
|
684
|
+
"create_booking_page",
|
|
685
|
+
"list_booking_pages",
|
|
686
|
+
"get_booking_page",
|
|
687
|
+
"delete_booking_page",
|
|
614
688
|
"get_usage",
|
|
615
689
|
"get_audit_log",
|
|
616
690
|
"accept_terms"
|
|
@@ -652,6 +726,35 @@ var TOOL_DEFINITIONS = [
|
|
|
652
726
|
annotations: { title: "Delete Calendar", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
653
727
|
execute: createExecutor(deleteCalendar)
|
|
654
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
|
+
},
|
|
655
758
|
// ── Events ─────────────────────────────────────────────────────
|
|
656
759
|
{
|
|
657
760
|
name: "list_events",
|
|
@@ -741,18 +844,39 @@ var TOOL_DEFINITIONS = [
|
|
|
741
844
|
// ── Availability ───────────────────────────────────────────────
|
|
742
845
|
{
|
|
743
846
|
name: "get_availability",
|
|
744
|
-
description: "Check when a single agent is free
|
|
847
|
+
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.",
|
|
745
848
|
schema: GetAvailabilitySchema,
|
|
746
849
|
annotations: { title: "Get Availability", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
747
850
|
execute: createExecutor(getAvailability)
|
|
748
851
|
},
|
|
749
852
|
{
|
|
750
853
|
name: "find_meeting_time",
|
|
751
|
-
description: "Find time
|
|
854
|
+
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.",
|
|
752
855
|
schema: FindMeetingTimeSchema,
|
|
753
856
|
annotations: { title: "Find Meeting Time", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
754
857
|
execute: createExecutor(findMeetingTime)
|
|
755
858
|
},
|
|
859
|
+
{
|
|
860
|
+
name: "create_connection_link",
|
|
861
|
+
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.",
|
|
862
|
+
schema: CreateConnectionLinkSchema,
|
|
863
|
+
annotations: { title: "Create Human Calendar Setup Link", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
864
|
+
execute: createExecutor(createConnectionLink)
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
name: "get_connection_link",
|
|
868
|
+
description: "Poll provider-neutral human-calendar setup status. The bearer setup URL and provider data are never returned by polling.",
|
|
869
|
+
schema: GetConnectionLinkSchema,
|
|
870
|
+
annotations: { title: "Get Human Calendar Setup Status", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
871
|
+
execute: createExecutor(getConnectionLink)
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
name: "cancel_connection_link",
|
|
875
|
+
description: "Cancel a pending human-calendar setup request and invalidate its setup URL.",
|
|
876
|
+
schema: CancelConnectionLinkSchema,
|
|
877
|
+
annotations: { title: "Cancel Human Calendar Setup Link", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
878
|
+
execute: createExecutor(cancelConnectionLink)
|
|
879
|
+
},
|
|
756
880
|
// ── Calendar context ───────────────────────────────────────────
|
|
757
881
|
{
|
|
758
882
|
name: "get_calendar_context",
|