@chronary/toolkit 1.3.0 → 1.4.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/mastra.js CHANGED
@@ -148,6 +148,15 @@ var FindMeetingTimeSchema = z.object({
148
148
  calendars: z.array(z.string()).optional().describe("Additional shared calendar IDs to treat as busy"),
149
149
  include_busy: z.boolean().default(false).describe("Include per-agent busy blocks in response")
150
150
  });
151
+ var CreateConnectionLinkSchema = z.object({
152
+ calendar_id: z.string().startsWith("cal_").describe("Chronary calendar whose owning agent will receive authorized availability"),
153
+ capabilities: z.array(z.enum(["availability", "publishing"])).min(1).max(2).default(["availability"]).describe("Request opaque availability and optional publishing permission"),
154
+ publication_policy: z.enum(["none", "confirmed", "confirmed_tentative"]).default("none").describe("Desired event publishing policy; a human still selects the destination")
155
+ });
156
+ var GetConnectionLinkSchema = z.object({
157
+ connection_link_id: z.string().startsWith("csl_").describe("Connection setup link ID")
158
+ });
159
+ var CancelConnectionLinkSchema = GetConnectionLinkSchema;
151
160
  var GetCalendarContextSchema = z.object({
152
161
  calendar_id: z.string().describe("Calendar ID")
153
162
  });
@@ -444,6 +453,15 @@ var findMeetingTime = safeFunc(async (ctx) => {
444
453
  include_busy: params.include_busy
445
454
  });
446
455
  });
456
+ var createConnectionLink = safeFunc(async (ctx) => {
457
+ const { calendar_id, ...params } = ctx.params;
458
+ return ctx.client.connectionLinks.create(calendar_id, params);
459
+ });
460
+ var getConnectionLink = safeFunc(async (ctx) => ctx.client.connectionLinks.get(ctx.params.connection_link_id));
461
+ var cancelConnectionLink = safeFunc(async (ctx) => {
462
+ await ctx.client.connectionLinks.cancel(ctx.params.connection_link_id);
463
+ return { cancelled: true, id: ctx.params.connection_link_id };
464
+ });
447
465
  var getCalendarContext = safeFunc(async (ctx) => {
448
466
  return ctx.client.calendars.getContext(ctx.params.calendar_id);
449
467
  });
@@ -573,6 +591,9 @@ var HOSTED_API_MCP_TOOL_NAMES = [
573
591
  "update_event",
574
592
  "get_availability",
575
593
  "find_meeting_time",
594
+ "create_connection_link",
595
+ "get_connection_link",
596
+ "cancel_connection_link",
576
597
  "cancel_event",
577
598
  "confirm_event",
578
599
  "release_event",
@@ -738,18 +759,39 @@ var TOOL_DEFINITIONS = [
738
759
  // ── Availability ───────────────────────────────────────────────
739
760
  {
740
761
  name: "get_availability",
741
- 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).",
762
+ 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.",
742
763
  schema: GetAvailabilitySchema,
743
764
  annotations: { title: "Get Availability", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
744
765
  execute: createExecutor(getAvailability)
745
766
  },
746
767
  {
747
768
  name: "find_meeting_time",
748
- 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).",
769
+ 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.",
749
770
  schema: FindMeetingTimeSchema,
750
771
  annotations: { title: "Find Meeting Time", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
751
772
  execute: createExecutor(findMeetingTime)
752
773
  },
774
+ {
775
+ name: "create_connection_link",
776
+ 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.",
777
+ schema: CreateConnectionLinkSchema,
778
+ annotations: { title: "Create Human Calendar Setup Link", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
779
+ execute: createExecutor(createConnectionLink)
780
+ },
781
+ {
782
+ name: "get_connection_link",
783
+ description: "Poll provider-neutral human-calendar setup status. The bearer setup URL and provider data are never returned by polling.",
784
+ schema: GetConnectionLinkSchema,
785
+ annotations: { title: "Get Human Calendar Setup Status", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
786
+ execute: createExecutor(getConnectionLink)
787
+ },
788
+ {
789
+ name: "cancel_connection_link",
790
+ description: "Cancel a pending human-calendar setup request and invalidate its setup URL.",
791
+ schema: CancelConnectionLinkSchema,
792
+ annotations: { title: "Cancel Human Calendar Setup Link", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
793
+ execute: createExecutor(cancelConnectionLink)
794
+ },
753
795
  // ── Calendar context ───────────────────────────────────────────
754
796
  {
755
797
  name: "get_calendar_context",