@chronary/toolkit 0.1.3 → 1.1.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/ai-sdk.cjs +590 -117
- package/dist/ai-sdk.cjs.map +1 -1
- package/dist/ai-sdk.d.cts +5 -6
- package/dist/ai-sdk.d.ts +5 -6
- package/dist/ai-sdk.js +590 -117
- package/dist/ai-sdk.js.map +1 -1
- package/dist/{base-CUC_3BPj.d.cts → base-C6QWbxc1.d.cts} +3 -3
- package/dist/{base-CUC_3BPj.d.ts → base-C6QWbxc1.d.ts} +3 -3
- package/dist/index.cjs +644 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +339 -252
- package/dist/index.d.ts +339 -252
- package/dist/index.js +644 -123
- package/dist/index.js.map +1 -1
- package/dist/langchain.cjs +590 -117
- 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 +590 -117
- package/dist/langchain.js.map +1 -1
- package/dist/mastra.cjs +590 -117
- 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 +590 -117
- package/dist/mastra.js.map +1 -1
- package/dist/mcp.cjs +592 -119
- 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 +592 -119
- package/dist/mcp.js.map +1 -1
- package/dist/openai.cjs +593 -120
- 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 +593 -120
- package/dist/openai.js.map +1 -1
- package/package.json +10 -10
package/dist/ai-sdk.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/adapters/ai-sdk.ts","../src/base.ts","../src/schemas.ts","../src/safe.ts","../src/functions.ts","../src/definitions.ts"],"sourcesContent":["import { MapToolkit } from '../base';\nimport type { ToolDefinition, ChronaryToolkitConfig } from '../types';\n\n/**\n * Vercel AI SDK 6.x adapter.\n *\n * Returns tools as `Record<string, Tool>` compatible with `generateText({ tools })`.\n * Zod schemas are passed directly via `parameters` (AI SDK accepts Zod natively).\n *\n * @example\n * ```ts\n * import { ChronaryToolkit } from '@chronary/toolkit/ai-sdk';\n * import { generateText } from 'ai';\n *\n * const toolkit = new ChronaryToolkit({ apiKey: process.env.CHRONARY_API_KEY });\n * const result = await generateText({\n * model: openai('gpt-4o'),\n * tools: toolkit.getTools(),\n * prompt: 'Schedule a meeting tomorrow at 2pm',\n * });\n * ```\n */\nexport class ChronaryToolkit extends MapToolkit<{\n description: string;\n parameters: ToolDefinition['schema'];\n execute: (params: Record<string, unknown>) => Promise<unknown>;\n}> {\n constructor(config: ChronaryToolkitConfig) {\n super(config);\n }\n\n protected buildTool(def: ToolDefinition) {\n const client = this.client;\n return {\n description: def.description,\n parameters: def.schema,\n execute: async (params: Record<string, unknown>) => {\n const result = await def.execute(client, params);\n if (result.isError) throw new Error(result.result as string);\n return result.result;\n },\n };\n }\n}\n\n/** Convenience function that returns the tools map directly */\nexport function chronaryTools(config: ChronaryToolkitConfig) {\n return new ChronaryToolkit(config).getTools();\n}\n","import { Chronary } from '@chronary/sdk';\nimport type { ToolDefinition, ToolName, ChronaryToolkitConfig } from './types';\nimport { TOOL_DEFINITIONS } from './definitions';\n\nfunction resolveClient(config: ChronaryToolkitConfig): Chronary {\n if ('client' in config && config.client) return config.client;\n const { tools: _tools, ...sdkConfig } = config as {\n apiKey?: string;\n baseUrl?: string;\n tools?: ToolName[];\n extraHeaders?: Record<string, string>;\n };\n return new Chronary(sdkConfig);\n}\n\nexport abstract class BaseToolkit<T> {\n protected readonly client: Chronary;\n protected readonly definitions: ToolDefinition[];\n\n constructor(config: ChronaryToolkitConfig) {\n this.client = resolveClient(config);\n this.definitions = config.tools\n ? TOOL_DEFINITIONS.filter((d) => (config.tools as ToolName[]).includes(d.name))\n : [...TOOL_DEFINITIONS];\n }\n\n /** Convert a framework-agnostic ToolDefinition into the adapter's native format */\n protected abstract buildTool(def: ToolDefinition): T;\n\n abstract getTools(): T[] | Record<string, T>;\n}\n\nexport abstract class ListToolkit<T> extends BaseToolkit<T> {\n getTools(): T[] {\n return this.definitions.map((def) => this.buildTool(def));\n }\n}\n\nexport abstract class MapToolkit<T> extends BaseToolkit<T> {\n getTools(): Record<string, T> {\n const map: Record<string, T> = {};\n for (const def of this.definitions) {\n map[def.name] = this.buildTool(def);\n }\n return map;\n }\n}\n","import { z } from 'zod';\n\n// ── Calendars ──────────────────────────────────────────────────\n\nexport const ListCalendarsSchema = z.object({\n agent_id: z.string().optional().describe('Filter calendars by agent ID'),\n include: z.enum(['all']).optional().describe('Set to \"all\" to include soft-deleted calendars'),\n limit: z.number().int().min(1).max(200).optional().describe('Max results per page (default 50)'),\n offset: z.number().int().min(0).optional().describe('Pagination offset (default 0)'),\n});\n\nexport const GetCalendarSchema = z.object({\n calendar_id: z.string().describe('The calendar ID to retrieve'),\n});\n\nexport const CreateCalendarSchema = z.object({\n name: z.string().describe('Calendar name'),\n timezone: z.string().describe('IANA timezone (e.g., \"America/New_York\")'),\n agent_id: z.string().optional().describe('Agent ID to associate the calendar with'),\n metadata: z.record(z.unknown()).optional().describe('Arbitrary key-value metadata'),\n});\n\nexport const UpdateCalendarSchema = z.object({\n calendar_id: z.string().describe('The calendar ID to update'),\n name: z.string().optional().describe('New calendar name'),\n timezone: z.string().optional().describe('New IANA timezone'),\n metadata: z.record(z.unknown()).optional().describe('Updated metadata'),\n});\n\nexport const DeleteCalendarSchema = z.object({\n calendar_id: z.string().describe('The calendar ID to delete'),\n});\n\n// ── Events ─────────────────────────────────────────────────────\n\nexport const ListEventsSchema = z.object({\n calendar_id: z.string().optional().describe('Calendar ID to list events from (provide this or agent_id)'),\n agent_id: z.string().optional().describe('Agent ID to list events for (provide this or calendar_id)'),\n start_after: z.string().optional().describe('Only events starting after this ISO 8601 datetime'),\n start_before: z.string().optional().describe('Only events starting before this ISO 8601 datetime'),\n status: z.enum(['confirmed', 'tentative', 'cancelled']).optional().describe('Filter by event status'),\n source: z.enum(['internal', 'external_ical']).optional().describe('Filter by event source'),\n limit: z.number().int().min(1).max(200).optional().describe('Max results per page (default 50)'),\n offset: z.number().int().min(0).optional().describe('Pagination offset (default 0)'),\n});\n\nexport const GetEventSchema = z.object({\n calendar_id: z.string().describe('Calendar ID the event belongs to'),\n event_id: z.string().describe('The event ID to retrieve'),\n});\n\nexport const CreateEventSchema = z.object({\n calendar_id: z.string().describe('Calendar ID to create the event on'),\n title: z.string().describe('Event title'),\n start_time: z.string().describe('Start time in ISO 8601 format'),\n end_time: z.string().describe('End time in ISO 8601 format'),\n description: z.string().optional().describe('Event description'),\n all_day: z.boolean().optional().describe('Whether this is an all-day event'),\n status: z.enum(['confirmed', 'tentative', 'cancelled']).optional().describe('Event status (default \"confirmed\")'),\n metadata: z.record(z.unknown()).optional().describe('Arbitrary key-value metadata'),\n});\n\nexport const UpdateEventSchema = z.object({\n calendar_id: z.string().describe('Calendar ID the event belongs to'),\n event_id: z.string().describe('The event ID to update'),\n title: z.string().optional().describe('New event title'),\n description: z.string().nullable().optional().describe('New description (null to clear)'),\n start_time: z.string().optional().describe('New start time in ISO 8601 format'),\n end_time: z.string().optional().describe('New end time in ISO 8601 format'),\n all_day: z.boolean().optional().describe('Whether this is an all-day event'),\n status: z.enum(['confirmed', 'tentative', 'cancelled']).optional().describe('New event status'),\n metadata: z.record(z.unknown()).optional().describe('Updated metadata'),\n});\n\nexport const DeleteEventSchema = z.object({\n calendar_id: z.string().describe('Calendar ID the event belongs to'),\n event_id: z.string().describe('The event ID to delete'),\n});\n\n// ── Availability ───────────────────────────────────────────────\n\nexport const CheckAvailabilitySchema = z.object({\n agents: z.array(z.string()).min(1).describe('Agent IDs to check availability for'),\n start: z.string().describe('Start of time range in ISO 8601 format'),\n end: z.string().describe('End of time range in ISO 8601 format'),\n slot_duration: z.enum(['15m', '30m', '45m', '1h', '2h']).optional().describe('Duration of availability slots (default \"30m\")'),\n calendars: z.array(z.string()).optional().describe('Specific calendar IDs to check (default: all agent calendars)'),\n include_busy: z.boolean().optional().describe('Include busy blocks in response'),\n});\n\n// ── Webhooks ───────────────────────────────────────────────────\n\nexport const ListWebhooksSchema = z.object({\n limit: z.number().int().min(1).max(100).optional().describe('Max results per page (default 20)'),\n offset: z.number().int().min(0).optional().describe('Pagination offset (default 0)'),\n});\n\nexport const GetWebhookSchema = z.object({\n webhook_id: z.string().describe('The webhook ID to retrieve'),\n});\n\nexport const CreateWebhookSchema = z.object({\n url: z.string().describe('HTTPS URL to receive webhook payloads'),\n events: z.array(z.string()).describe('Event types to subscribe to (e.g., [\"event.created\", \"event.updated\"])'),\n});\n\nexport const UpdateWebhookSchema = z.object({\n webhook_id: z.string().describe('The webhook ID to update'),\n url: z.string().optional().describe('New webhook URL'),\n events: z.array(z.string()).optional().describe('New event type subscriptions'),\n active: z.boolean().optional().describe('Enable or disable the webhook'),\n});\n\nexport const DeleteWebhookSchema = z.object({\n webhook_id: z.string().describe('The webhook ID to delete'),\n});\n\n// ── iCal Subscriptions ─────────────────────────────────────────\n\nexport const ListICalSubscriptionsSchema = z.object({\n agent_id: z.string().describe('Agent ID to list subscriptions for'),\n status: z.enum(['active', 'error', 'paused']).optional().describe('Filter by subscription status'),\n limit: z.number().int().min(1).max(200).optional().describe('Max results per page (default 50)'),\n offset: z.number().int().min(0).optional().describe('Pagination offset (default 0)'),\n});\n\nexport const GetICalSubscriptionSchema = z.object({\n subscription_id: z.string().describe('The iCal subscription ID to retrieve'),\n});\n\nexport const CreateICalSubscriptionSchema = z.object({\n agent_id: z.string().describe('Agent ID to create the subscription for'),\n calendar_id: z.string().describe('Calendar ID to import events into'),\n url: z.string().describe('HTTPS URL of the iCal feed to subscribe to'),\n label: z.string().optional().describe('Human-readable label for the subscription'),\n});\n\nexport const UpdateICalSubscriptionSchema = z.object({\n subscription_id: z.string().describe('The iCal subscription ID to update'),\n label: z.string().optional().describe('New label'),\n url: z.string().optional().describe('New iCal feed URL'),\n});\n\nexport const DeleteICalSubscriptionSchema = z.object({\n subscription_id: z.string().describe('The iCal subscription ID to delete'),\n});\n\nexport const SyncICalSubscriptionSchema = z.object({\n subscription_id: z.string().describe('The iCal subscription ID to sync immediately'),\n});\n\n// ── Usage ──────────────────────────────────────────────────────\n\nexport const GetUsageSchema = z.object({});\n","import { ChronaryError } from '@chronary/sdk';\nimport type { ToolResult } from './types';\n\n/**\n * Wraps an async function so SDK errors become structured ToolResult objects\n * instead of thrown exceptions. LLMs see error messages, never stack traces.\n */\nexport function safeFunc<TParams>(\n fn: (params: TParams) => Promise<unknown>,\n): (params: TParams) => Promise<ToolResult> {\n return async (params: TParams): Promise<ToolResult> => {\n try {\n const result = await fn(params);\n return { result: result ?? { success: true }, isError: false };\n } catch (err) {\n if (err instanceof ChronaryError) {\n return { result: `${err.name}: ${err.message}`, isError: true };\n }\n return {\n result: `Error: ${err instanceof Error ? err.message : String(err)}`,\n isError: true,\n };\n }\n };\n}\n","import type { Chronary } from '@chronary/sdk';\nimport { safeFunc } from './safe';\nimport type { ToolResult } from './types';\n\ninterface Ctx<P = Record<string, unknown>> {\n client: Chronary;\n params: P;\n}\n\n// Helper to consume a PageIterator's first page\nasync function fetchPage(\n iterator: AsyncIterable<unknown> & { getPage(offset?: number, limit?: number): Promise<{ data: unknown[]; total: number; hasMore: boolean }> },\n offset?: number,\n limit?: number,\n) {\n const page = await iterator.getPage(offset ?? 0, limit);\n return { data: page.data, total: page.total, has_more: page.hasMore };\n}\n\n// ── Calendars ──────────────────────────────────────────────────\n\nexport const listCalendars = safeFunc(async (ctx: Ctx<{\n agent_id?: string; include?: 'all'; limit?: number; offset?: number;\n}>) => {\n const { client, params } = ctx;\n const iter = client.calendars.list({ agentId: params.agent_id, include: params.include, limit: params.limit });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getCalendar = safeFunc(async (ctx: Ctx<{ calendar_id: string }>) => {\n return ctx.client.calendars.get(ctx.params.calendar_id);\n});\n\nexport const createCalendar = safeFunc(async (ctx: Ctx<{\n name: string; timezone: string; agent_id?: string; metadata?: Record<string, unknown>;\n}>) => {\n const { client, params } = ctx;\n return client.calendars.create({\n name: params.name,\n timezone: params.timezone,\n agentId: params.agent_id,\n metadata: params.metadata,\n });\n});\n\nexport const updateCalendar = safeFunc(async (ctx: Ctx<{\n calendar_id: string; name?: string; timezone?: string; metadata?: Record<string, unknown>;\n}>) => {\n const { client, params } = ctx;\n const { calendar_id, ...updates } = params;\n return client.calendars.update(calendar_id, updates);\n});\n\nexport const deleteCalendar = safeFunc(async (ctx: Ctx<{ calendar_id: string }>) => {\n await ctx.client.calendars.delete(ctx.params.calendar_id);\n return undefined; // safeFunc normalizes to { success: true }\n});\n\n// ── Events ─────────────────────────────────────────────────────\n\nexport const listEvents = safeFunc(async (ctx: Ctx<{\n calendar_id?: string; agent_id?: string; start_after?: string; start_before?: string;\n status?: 'confirmed' | 'tentative' | 'cancelled'; source?: 'internal' | 'external_ical';\n limit?: number; offset?: number;\n}>) => {\n const { client, params } = ctx;\n const iter = client.events.list({\n calendarId: params.calendar_id,\n agentId: params.agent_id,\n start_after: params.start_after,\n start_before: params.start_before,\n status: params.status,\n source: params.source,\n limit: params.limit,\n });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getEvent = safeFunc(async (ctx: Ctx<{ calendar_id: string; event_id: string }>) => {\n return ctx.client.events.get(ctx.params.calendar_id, ctx.params.event_id);\n});\n\nexport const createEvent = safeFunc(async (ctx: Ctx<{\n calendar_id: string; title: string; start_time: string; end_time: string;\n description?: string; all_day?: boolean;\n status?: 'confirmed' | 'tentative' | 'cancelled'; metadata?: Record<string, unknown>;\n}>) => {\n const { client, params } = ctx;\n const { calendar_id, ...eventParams } = params;\n return client.events.create(calendar_id, eventParams);\n});\n\nexport const updateEvent = safeFunc(async (ctx: Ctx<{\n calendar_id: string; event_id: string; title?: string; description?: string | null;\n start_time?: string; end_time?: string; all_day?: boolean;\n status?: 'confirmed' | 'tentative' | 'cancelled'; metadata?: Record<string, unknown>;\n}>) => {\n const { client, params } = ctx;\n const { calendar_id, event_id, ...updates } = params;\n return client.events.update(calendar_id, event_id, updates);\n});\n\nexport const deleteEvent = safeFunc(async (ctx: Ctx<{ calendar_id: string; event_id: string }>) => {\n await ctx.client.events.delete(ctx.params.calendar_id, ctx.params.event_id);\n return undefined;\n});\n\n// ── Availability ───────────────────────────────────────────────\n\nexport const checkAvailability = safeFunc(async (ctx: Ctx<{\n agents: string[]; start: string; end: string;\n slot_duration?: '15m' | '30m' | '45m' | '1h' | '2h';\n calendars?: string[]; include_busy?: boolean;\n}>) => {\n return ctx.client.availability.check(ctx.params);\n});\n\n// ── Webhooks ───────────────────────────────────────────────────\n\nexport const listWebhooks = safeFunc(async (ctx: Ctx<{ limit?: number; offset?: number }>) => {\n const { client, params } = ctx;\n const iter = client.webhooks.list({ limit: params.limit });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getWebhook = safeFunc(async (ctx: Ctx<{ webhook_id: string }>) => {\n return ctx.client.webhooks.get(ctx.params.webhook_id);\n});\n\nexport const createWebhook = safeFunc(async (ctx: Ctx<{ url: string; events: string[] }>) => {\n return ctx.client.webhooks.create(ctx.params);\n});\n\nexport const updateWebhook = safeFunc(async (ctx: Ctx<{\n webhook_id: string; url?: string; events?: string[]; active?: boolean;\n}>) => {\n const { client, params } = ctx;\n const { webhook_id, ...updates } = params;\n return client.webhooks.update(webhook_id, updates);\n});\n\nexport const deleteWebhook = safeFunc(async (ctx: Ctx<{ webhook_id: string }>) => {\n await ctx.client.webhooks.delete(ctx.params.webhook_id);\n return undefined;\n});\n\n// ── iCal Subscriptions ─────────────────────────────────────────\n\nexport const listICalSubscriptions = safeFunc(async (ctx: Ctx<{\n agent_id: string; status?: 'active' | 'error' | 'paused'; limit?: number; offset?: number;\n}>) => {\n const { client, params } = ctx;\n const iter = client.icalSubscriptions.list({\n agentId: params.agent_id,\n status: params.status,\n limit: params.limit,\n });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getICalSubscription = safeFunc(async (ctx: Ctx<{ subscription_id: string }>) => {\n return ctx.client.icalSubscriptions.get(ctx.params.subscription_id);\n});\n\nexport const createICalSubscription = safeFunc(async (ctx: Ctx<{\n agent_id: string; calendar_id: string; url: string; label?: string;\n}>) => {\n const { client, params } = ctx;\n const { agent_id, ...subParams } = params;\n return client.icalSubscriptions.create(agent_id, subParams);\n});\n\nexport const updateICalSubscription = safeFunc(async (ctx: Ctx<{\n subscription_id: string; label?: string; url?: string;\n}>) => {\n const { client, params } = ctx;\n const { subscription_id, ...updates } = params;\n return client.icalSubscriptions.update(subscription_id, updates);\n});\n\nexport const deleteICalSubscription = safeFunc(async (ctx: Ctx<{ subscription_id: string }>) => {\n await ctx.client.icalSubscriptions.delete(ctx.params.subscription_id);\n return undefined;\n});\n\nexport const syncICalSubscription = safeFunc(async (ctx: Ctx<{ subscription_id: string }>) => {\n return ctx.client.icalSubscriptions.sync(ctx.params.subscription_id);\n});\n\n// ── Usage ──────────────────────────────────────────────────────\n\nexport const getUsage = safeFunc(async (ctx: Ctx) => {\n return ctx.client.usage.get();\n});\n\n// ── Factory ────────────────────────────────────────────────────\n\n/** Map of tool name → executor function. Used by definitions.ts to wire up execute(). */\nexport function createExecutor(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fn: (ctx: { client: Chronary; params: any }) => Promise<ToolResult>,\n): (client: Chronary, params: Record<string, unknown>) => Promise<ToolResult> {\n return (client, params) => fn({ client, params });\n}\n","import type { ToolDefinition } from './types';\nimport * as schemas from './schemas';\nimport * as fns from './functions';\nimport { createExecutor } from './functions';\n\nexport const HOSTED_API_MCP_TOOL_NAMES = [\n 'create_agent',\n 'list_agents',\n 'create_calendar',\n 'create_event',\n 'list_events',\n 'get_availability',\n 'find_meeting_time',\n 'cancel_event',\n 'confirm_event',\n 'release_event',\n 'subscribe_ical',\n 'get_calendar_context',\n 'create_proposal',\n 'list_proposals',\n 'get_proposal',\n 'respond_to_proposal',\n 'resolve_proposal',\n 'cancel_proposal',\n 'set_availability_rules',\n 'get_availability_rules',\n 'clear_availability_rules',\n] as const;\n\nexport const TOOL_DEFINITIONS: ToolDefinition[] = [\n // ── Calendars ──────────────────────────────────────────────────\n {\n name: 'list_calendars',\n description: 'List calendars, optionally filtered by agent. Returns paginated results.',\n schema: schemas.ListCalendarsSchema,\n annotations: { title: 'List Calendars', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listCalendars),\n },\n {\n name: 'get_calendar',\n description: 'Get a calendar by its ID, including its name, timezone, and iCal feed URL.',\n schema: schemas.GetCalendarSchema,\n annotations: { title: 'Get Calendar', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getCalendar),\n },\n {\n name: 'create_calendar',\n description: 'Create a new calendar. Specify a name and IANA timezone. Optionally scope it to an agent.',\n schema: schemas.CreateCalendarSchema,\n annotations: { title: 'Create Calendar', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.createCalendar),\n },\n {\n name: 'update_calendar',\n description: 'Update a calendar\\'s name, timezone, or metadata.',\n schema: schemas.UpdateCalendarSchema,\n annotations: { title: 'Update Calendar', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.updateCalendar),\n },\n {\n name: 'delete_calendar',\n description: 'Permanently delete a calendar and all its events.',\n schema: schemas.DeleteCalendarSchema,\n annotations: { title: 'Delete Calendar', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.deleteCalendar),\n },\n\n // ── Events ─────────────────────────────────────────────────────\n {\n name: 'list_events',\n description: 'List events on a calendar or for an agent. Supports date range and status filters. Provide calendar_id or agent_id.',\n schema: schemas.ListEventsSchema,\n annotations: { title: 'List Events', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listEvents),\n },\n {\n name: 'get_event',\n description: 'Get a specific event by its calendar ID and event ID.',\n schema: schemas.GetEventSchema,\n annotations: { title: 'Get Event', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getEvent),\n },\n {\n name: 'create_event',\n description: 'Create a new event on a calendar. The event blocks the agent\\'s availability during the specified time window and appears in availability queries.',\n schema: schemas.CreateEventSchema,\n annotations: { title: 'Create Event', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.createEvent),\n },\n {\n name: 'update_event',\n description: 'Update an existing event\\'s title, times, status, or other properties.',\n schema: schemas.UpdateEventSchema,\n annotations: { title: 'Update Event', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.updateEvent),\n },\n {\n name: 'delete_event',\n description: 'Delete an event from a calendar. This frees the agent\\'s availability during that time.',\n schema: schemas.DeleteEventSchema,\n annotations: { title: 'Delete Event', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.deleteEvent),\n },\n\n // ── Availability ───────────────────────────────────────────────\n {\n name: 'check_availability',\n description: 'Check free/busy availability across one or more agents within a time range. Returns available time slots and optionally busy blocks.',\n schema: schemas.CheckAvailabilitySchema,\n annotations: { title: 'Check Availability', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.checkAvailability),\n },\n\n // ── Webhooks ───────────────────────────────────────────────────\n {\n name: 'list_webhooks',\n description: 'List all webhook subscriptions for the organization.',\n schema: schemas.ListWebhooksSchema,\n annotations: { title: 'List Webhooks', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listWebhooks),\n },\n {\n name: 'get_webhook',\n description: 'Get a webhook subscription by its ID.',\n schema: schemas.GetWebhookSchema,\n annotations: { title: 'Get Webhook', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getWebhook),\n },\n {\n name: 'create_webhook',\n description: 'Create a webhook subscription to receive event notifications at a URL. Payloads are signed with HMAC-SHA256.',\n schema: schemas.CreateWebhookSchema,\n annotations: { title: 'Create Webhook', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.createWebhook),\n },\n {\n name: 'update_webhook',\n description: 'Update a webhook\\'s URL, subscribed events, or active status.',\n schema: schemas.UpdateWebhookSchema,\n annotations: { title: 'Update Webhook', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.updateWebhook),\n },\n {\n name: 'delete_webhook',\n description: 'Delete a webhook subscription. No further events will be delivered to this URL.',\n schema: schemas.DeleteWebhookSchema,\n annotations: { title: 'Delete Webhook', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.deleteWebhook),\n },\n\n // ── iCal Subscriptions ─────────────────────────────────────────\n {\n name: 'list_ical_subscriptions',\n description: 'List external calendar imports (iCal subscriptions) for an agent.',\n schema: schemas.ListICalSubscriptionsSchema,\n annotations: { title: 'List iCal Subscriptions', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listICalSubscriptions),\n },\n {\n name: 'get_ical_subscription',\n description: 'Get an iCal subscription by its ID, including sync status and last error.',\n schema: schemas.GetICalSubscriptionSchema,\n annotations: { title: 'Get iCal Subscription', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getICalSubscription),\n },\n {\n name: 'create_ical_subscription',\n description: 'Import an external calendar by subscribing to an iCal feed URL. Events are synced every 30 minutes.',\n schema: schemas.CreateICalSubscriptionSchema,\n annotations: { title: 'Create iCal Subscription', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },\n execute: createExecutor(fns.createICalSubscription),\n },\n {\n name: 'update_ical_subscription',\n description: 'Update an iCal subscription\\'s label or feed URL.',\n schema: schemas.UpdateICalSubscriptionSchema,\n annotations: { title: 'Update iCal Subscription', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.updateICalSubscription),\n },\n {\n name: 'delete_ical_subscription',\n description: 'Remove an external calendar import. Previously synced events remain on the calendar.',\n schema: schemas.DeleteICalSubscriptionSchema,\n annotations: { title: 'Delete iCal Subscription', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.deleteICalSubscription),\n },\n {\n name: 'sync_ical_subscription',\n description: 'Trigger an immediate sync of an iCal subscription instead of waiting for the next 30-minute poll.',\n schema: schemas.SyncICalSubscriptionSchema,\n annotations: { title: 'Sync iCal Subscription', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },\n execute: createExecutor(fns.syncICalSubscription),\n },\n\n // ── Usage ──────────────────────────────────────────────────────\n {\n name: 'get_usage',\n description: 'Get quota and usage statistics for the current billing period.',\n schema: schemas.GetUsageSchema,\n annotations: { title: 'Get Usage', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getUsage),\n },\n];\n\nconst toolkitToolNames = new Set<string>(TOOL_DEFINITIONS.map((tool) => tool.name));\nconst hostedToolNames = new Set<string>(HOSTED_API_MCP_TOOL_NAMES);\n\nexport const TOOLKIT_MCP_PARITY = {\n hostedToolNames: HOSTED_API_MCP_TOOL_NAMES,\n missingHostedTools: HOSTED_API_MCP_TOOL_NAMES.filter((name) => !toolkitToolNames.has(name)),\n toolkitOnlyTools: TOOL_DEFINITIONS.map((tool) => tool.name).filter((name) => !hostedToolNames.has(name)),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,cAAyB;;;ACAzB,iBAAkB;AAIX,IAAM,sBAAsB,aAAE,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AC,GAAG,gBAAgB;AAAA,EAC1B;AAMF;AAQO,IAAe,aAAf,cAAqC,YAAe;AAAA,EACzD,WAA8B;AAC5B,UAAM,MAAyB,CAAC;AAChC,eAAW,OAAO,KAAK,aAAa;AAClC,UAAI,IAAI,IAAI,IAAI,KAAK,UAAU,GAAG;AAAA,IACpC;AACA,WAAO;AAAA,EACT;AACF;;;ADxBO,IAAM,kBAAN,cAA8B,WAIlC;AAAA,EACD,YAAY,QAA+B;AACzC,UAAM,MAAM;AAAA,EACd;AAAA,EAEU,UAAU,KAAqB;AACvC,UAAM,SAAS,KAAK;AACpB,WAAO;AAAA,MACL,aAAa,IAAI;AAAA,MACjB,YAAY,IAAI;AAAA,MAChB,SAAS,OAAO,WAAoC;AAClD,cAAM,SAAS,MAAM,IAAI,QAAQ,QAAQ,MAAM;AAC/C,YAAI,OAAO,QAAS,OAAM,IAAI,MAAM,OAAO,MAAgB;AAC3D,eAAO,OAAO;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AACF;AAGO,SAAS,cAAc,QAA+B;AAC3D,SAAO,IAAI,gBAAgB,MAAM,EAAE,SAAS;AAC9C;","names":["import_sdk"]}
|
|
1
|
+
{"version":3,"sources":["../src/adapters/ai-sdk.ts","../src/base.ts","../src/schemas.ts","../src/safe.ts","../src/functions.ts","../src/definitions.ts"],"sourcesContent":["import { MapToolkit } from '../base';\nimport type { ToolDefinition, ChronaryToolkitConfig } from '../types';\n\n/**\n * Vercel AI SDK 6.x adapter.\n *\n * Returns tools as `Record<string, Tool>` compatible with `generateText({ tools })`.\n * Zod schemas are passed directly via `parameters` (AI SDK accepts Zod natively).\n *\n * @example\n * ```ts\n * import { ChronaryToolkit } from '@chronary/toolkit/ai-sdk';\n * import { generateText } from 'ai';\n *\n * const toolkit = new ChronaryToolkit({ apiKey: process.env.CHRONARY_API_KEY });\n * const result = await generateText({\n * model: openai('gpt-4o'),\n * tools: toolkit.getTools(),\n * prompt: 'Schedule a meeting tomorrow at 2pm',\n * });\n * ```\n */\nexport class ChronaryToolkit extends MapToolkit<{\n description: string;\n parameters: ToolDefinition['schema'];\n execute: (params: Record<string, unknown>) => Promise<unknown>;\n}> {\n constructor(config: ChronaryToolkitConfig) {\n super(config);\n }\n\n protected buildTool(def: ToolDefinition) {\n const client = this.client;\n return {\n description: def.description,\n parameters: def.schema,\n execute: async (params: Record<string, unknown>) => {\n const result = await def.execute(client, params);\n if (result.isError) throw new Error(result.result as string);\n return result.result;\n },\n };\n }\n}\n\n/** Convenience function that returns the tools map directly */\nexport function chronaryTools(config: ChronaryToolkitConfig) {\n return new ChronaryToolkit(config).getTools();\n}\n","import { Chronary } from '@chronary/sdk';\nimport type { ToolDefinition, ToolName, ChronaryToolkitConfig } from './types';\nimport { TOOL_DEFINITIONS } from './definitions';\n\nfunction resolveClient(config: ChronaryToolkitConfig): Chronary {\n if ('client' in config && config.client) return config.client;\n const { tools: _tools, ...sdkConfig } = config as {\n apiKey?: string;\n baseUrl?: string;\n tools?: ToolName[];\n extraHeaders?: Record<string, string>;\n };\n return new Chronary(sdkConfig);\n}\n\nexport abstract class BaseToolkit<T> {\n protected readonly client: Chronary;\n protected readonly definitions: ToolDefinition[];\n\n constructor(config: ChronaryToolkitConfig) {\n this.client = resolveClient(config);\n this.definitions = config.tools\n ? TOOL_DEFINITIONS.filter((d) => (config.tools as ToolName[]).includes(d.name))\n : [...TOOL_DEFINITIONS];\n }\n\n /** Convert a framework-agnostic ToolDefinition into the adapter's native format */\n protected abstract buildTool(def: ToolDefinition): T;\n\n abstract getTools(): T[] | Record<string, T>;\n}\n\nexport abstract class ListToolkit<T> extends BaseToolkit<T> {\n getTools(): T[] {\n return this.definitions.map((def) => this.buildTool(def));\n }\n}\n\nexport abstract class MapToolkit<T> extends BaseToolkit<T> {\n getTools(): Record<string, T> {\n const map: Record<string, T> = {};\n for (const def of this.definitions) {\n map[def.name] = this.buildTool(def);\n }\n return map;\n }\n}\n","import { z } from 'zod';\n\n// Webhook event types and delivery statuses — kept in lockstep with the hosted\n// MCP server's `@chronary/shared` WEBHOOK_EVENT_TYPES / WEBHOOK_DELIVERY_STATUSES.\n// Inlined here because the toolkit deliberately does not depend on @chronary/shared.\nconst WEBHOOK_EVENT_TYPES = [\n 'agent.created',\n 'agent.updated',\n 'event.created',\n 'event.updated',\n 'event.deleted',\n 'event.started',\n 'event.ended',\n 'event.reminder',\n 'event.hold_created',\n 'event.hold_expired',\n 'event.hold_released',\n 'event.hold_confirmed',\n 'proposal.created',\n 'proposal.responded',\n 'proposal.confirmed',\n 'proposal.expired',\n 'proposal.cancelled',\n 'webhook.deactivated',\n] as const;\n\nconst WEBHOOK_DELIVERY_STATUSES = ['pending', 'delivered', 'failed'] as const;\n\n// ── Calendars ──────────────────────────────────────────────────\n\nexport const ListCalendarsSchema = z.object({\n include: z.enum(['all']).optional().describe('Pass \"all\" to include calendars across all agents (org keys only)'),\n limit: z.number().int().min(1).max(200).default(50).describe('Max results to return'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset'),\n});\n\nexport const GetCalendarSchema = z.object({\n calendar_id: z.string().describe('Calendar ID to fetch'),\n});\n\nexport const CreateCalendarSchema = z.object({\n name: z.string().min(1).max(255).describe('Calendar name'),\n agent_id: z.string().optional().describe('Agent ID to own this calendar (omit for org-level)'),\n timezone: z.string().min(1).describe('IANA timezone (e.g. America/New_York)'),\n default_reminders: z.array(z.number().int().min(1).max(40320)).max(5).nullable().optional().describe('Default reminder offsets in minutes before start, inherited by events on this calendar that don\\'t set their own. Omit or null to use the system default (10 min); [] for no reminders.'),\n});\n\nexport const UpdateCalendarSchema = z.object({\n calendar_id: z.string().describe('Calendar ID to update'),\n name: z.string().min(1).max(255).optional().describe('New calendar name'),\n timezone: z.string().min(1).optional().describe('New IANA timezone (e.g. America/New_York)'),\n agent_status: z.enum(['idle', 'working', 'waiting', 'error']).optional().describe('Owning agent\\'s status'),\n default_reminders: z.array(z.number().int().min(1).max(40320)).max(5).nullable().optional().describe('Default reminder offsets in minutes; null for system default, [] for none'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Arbitrary metadata (max 16KB)'),\n});\n\nexport const DeleteCalendarSchema = z.object({\n calendar_id: z.string().describe('Calendar ID to delete'),\n});\n\n// ── Events ─────────────────────────────────────────────────────\n\nexport const ListEventsSchema = z.object({\n calendar_id: z.string().describe('Calendar ID to list events from'),\n start_after: z.string().datetime().optional().describe('Filter events starting after this time'),\n start_before: z.string().datetime().optional().describe('Filter events starting before this time'),\n limit: z.number().int().min(1).max(200).default(50).describe('Max results to return'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset'),\n});\n\nexport const GetEventSchema = z.object({\n event_id: z.string().describe('Event ID to retrieve'),\n calendar_id: z.string().describe('Calendar ID that owns the event. Required — the SDK is calendar-scoped (unlike the hosted MCP, which can resolve the calendar from event_id).'),\n});\n\nexport const CreateEventSchema = z.object({\n calendar_id: z.string().describe('Calendar ID to add the event to'),\n title: z.string().min(1).max(500).describe('Event title'),\n start_time: z.string().datetime().describe('Start time (ISO 8601)'),\n end_time: z.string().datetime().describe('End time (ISO 8601)'),\n description: z.string().optional().describe('Optional event description'),\n all_day: z.boolean().default(false).describe('Whether this is an all-day event'),\n status: z.enum(['confirmed', 'tentative', 'hold']).optional().describe('Event status. \"hold\" creates a tentative reservation that auto-expires at hold_expires_at. Defaults to \"confirmed\".'),\n reminders: z.array(z.number().int().min(1).max(40320)).max(5).nullable().optional().describe('Reminder offsets in minutes before start_time (e.g. [10, 1440]). Each fires an event.reminder webhook and shows as an alarm in the iCal feed. Omit or null to inherit the calendar default (then the system default of 10 min); [] for no reminders.'),\n hold_expires_at: z.string().datetime().optional().describe('Required when status=\"hold\". ISO 8601 timestamp 30s-15min in the future. Auto-releases the hold when reached.'),\n hold_priority: z.number().int().min(0).max(100).optional().describe('Only valid with status=\"hold\". Higher-priority overlapping holds pre-empt lower-priority ones. Defaults to 0.'),\n});\n\nexport const UpdateEventSchema = z.object({\n event_id: z.string().describe('Event ID to update'),\n calendar_id: z.string().describe('Calendar ID that owns the event. Required — the SDK is calendar-scoped (unlike the hosted MCP, which can resolve the calendar from event_id).'),\n title: z.string().min(1).max(500).optional().describe('New event title'),\n description: z.string().nullable().optional().describe('New description, or null to clear it'),\n start_time: z.string().datetime().optional().describe('New start time (ISO 8601)'),\n end_time: z.string().datetime().optional().describe('New end time (ISO 8601)'),\n all_day: z.boolean().optional().describe('Whether this is an all-day event'),\n status: z.enum(['confirmed', 'tentative', 'cancelled']).optional().describe('New event status'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Replacement metadata object'),\n reminders: z.array(z.number().int().min(1).max(40320)).max(5).nullable().optional().describe('Reminder offsets in minutes before start_time. Omit to leave unchanged, null to inherit the calendar default, [] for no reminders.'),\n});\n\nexport const CancelEventSchema = z.object({\n event_id: z.string().describe('Event ID to cancel'),\n calendar_id: z.string().describe('Calendar ID that owns the event. Required — the SDK is calendar-scoped (unlike the hosted MCP, which can resolve the calendar from event_id).'),\n});\n\nexport const ConfirmEventSchema = z.object({\n event_id: z.string().describe('Event ID of the hold to confirm'),\n});\n\nexport const ReleaseEventSchema = z.object({\n event_id: z.string().describe('Event ID of the hold to release'),\n});\n\n// ── Agents ─────────────────────────────────────────────────────\n\nexport const CreateAgentSchema = z.object({\n name: z.string().min(1).max(255).describe('Display name for the agent'),\n type: z.enum(['ai', 'human', 'resource']).describe('Agent type'),\n description: z.string().optional().describe('Optional description'),\n});\n\nexport const ListAgentsSchema = z.object({\n type: z.enum(['ai', 'human', 'resource']).optional().describe('Filter by agent type'),\n status: z.enum(['active', 'paused', 'decommissioned']).optional().describe('Filter by status'),\n limit: z.number().int().min(1).max(200).default(50).describe('Max results to return'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset'),\n});\n\nexport const GetAgentSchema = z.object({\n agent_id: z.string().describe('Agent ID to fetch'),\n});\n\nexport const UpdateAgentSchema = z.object({\n agent_id: z.string().describe('Agent ID to update'),\n name: z.string().min(1).max(255).optional().describe('New display name'),\n description: z.string().nullable().optional().describe('New description (null to clear)'),\n metadata: z.record(z.string(), z.unknown()).optional().describe('Arbitrary metadata (max 16KB)'),\n status: z.enum(['active', 'paused']).optional().describe('Operational status'),\n});\n\nexport const DeleteAgentSchema = z.object({\n agent_id: z.string().describe('Agent ID to decommission'),\n});\n\n// ── Availability ───────────────────────────────────────────────\n\nexport const GetAvailabilitySchema = z.object({\n agent_id: z.string().describe('Agent ID to check availability for'),\n start: z.string().datetime().optional().describe('Range start (ISO 8601). Alias: start_time.'),\n end: z.string().datetime().optional().describe('Range end (ISO 8601). Alias: end_time.'),\n start_time: z.string().datetime().optional().describe('Alias for `start` (matches REST events naming).'),\n end_time: z.string().datetime().optional().describe('Alias for `end` (matches REST events naming).'),\n slot_duration: z.enum(['15m', '30m', '45m', '1h', '2h']).default('30m').describe('Minimum slot duration required — only free blocks at least this long are returned'),\n include_busy: z.boolean().default(false).describe('Include busy blocks in response'),\n});\n\nexport const FindMeetingTimeSchema = z.object({\n agents: z.array(z.string()).min(1).optional().describe('Array of agent IDs to find common free time for. All agents must be free during the returned slots. Alias: agent_ids.'),\n agent_ids: z.array(z.string()).min(1).optional().describe('Alias for `agents` (matches REST/scheduling-proposal naming).'),\n start: z.string().datetime().optional().describe('Search range start (ISO 8601). Alias: start_time.'),\n end: z.string().datetime().optional().describe('Search range end (ISO 8601). Alias: end_time.'),\n start_time: z.string().datetime().optional().describe('Alias for `start` (matches REST events naming).'),\n end_time: z.string().datetime().optional().describe('Alias for `end` (matches REST events naming).'),\n slot_duration: z.enum(['15m', '30m', '45m', '1h', '2h']).default('30m').describe('Minimum slot duration required — only free blocks at least this long are returned'),\n calendars: z.array(z.string()).optional().describe('Additional shared calendar IDs to treat as busy'),\n include_busy: z.boolean().default(false).describe('Include per-agent busy blocks in response'),\n});\n\n// ── Calendar context ───────────────────────────────────────────\n\nexport const GetCalendarContextSchema = z.object({\n calendar_id: z.string().describe('Calendar ID'),\n});\n\n// ── Scheduling proposals ───────────────────────────────────────\n\nconst proposalSlotSchema = z.object({\n start_time: z.string().datetime(),\n end_time: z.string().datetime(),\n weight: z.number().min(0).max(10).default(1.0).optional(),\n calendar_id: z.string().optional(),\n});\n\nexport const CreateProposalSchema = z.object({\n title: z.string().min(1).max(500).describe('Short description of what the meeting is about'),\n description: z.string().max(5000).optional().describe('Longer context/agenda'),\n organizer_agent_id: z.string().describe('Agent ID proposing the meeting'),\n participant_agent_ids: z.array(z.string()).min(1).max(50).describe('Agent IDs invited to respond'),\n calendar_id: z.string().describe('Calendar the resolved event will be created on'),\n slots: z.array(proposalSlotSchema).min(1).max(20).describe('Candidate time slots (up to 20)'),\n expires_at: z.string().datetime().optional().describe('Auto-cancel cutoff if unresolved'),\n});\n\nexport const ListProposalsSchema = z.object({\n status: z.enum(['pending', 'confirmed', 'expired', 'cancelled']).optional().describe('Filter by proposal status'),\n organizer_agent_id: z.string().optional().describe('Filter by organizer agent'),\n limit: z.number().int().min(1).max(200).optional().describe('Max results (default 50)'),\n offset: z.number().int().min(0).optional().describe('Pagination offset (default 0)'),\n});\n\nexport const GetProposalSchema = z.object({\n proposal_id: z.string().describe('Proposal to fetch'),\n});\n\nexport const RespondToProposalSchema = z.object({\n proposal_id: z.string().describe('Proposal to respond to'),\n agent_id: z.string().describe('Participant agent responding'),\n response: z.enum(['accept', 'decline', 'counter']).describe('Decision from this agent'),\n selected_slot_id: z.string().optional().describe('Required when response is \"accept\"'),\n counter_slots: z.array(proposalSlotSchema).max(20).optional().describe('Alternative slots when response is \"counter\"'),\n message: z.string().max(2000).optional().describe('Optional note for the organizer'),\n});\n\nexport const ResolveProposalSchema = z.object({\n proposal_id: z.string().describe('Proposal to resolve'),\n});\n\nexport const CancelProposalSchema = z.object({\n proposal_id: z.string().describe('Proposal to cancel'),\n});\n\n// ── Availability rules ─────────────────────────────────────────\n\nconst timeOfDay = z.string().regex(/^([01]\\d|2[0-3]):[0-5]\\d$/, 'must be HH:MM in 24-hour time');\n\nconst workingHoursDaySchema = z.object({\n start: timeOfDay,\n end: timeOfDay,\n});\n\nconst workingHoursSchema = z.object({\n mon: workingHoursDaySchema.optional(),\n tue: workingHoursDaySchema.optional(),\n wed: workingHoursDaySchema.optional(),\n thu: workingHoursDaySchema.optional(),\n fri: workingHoursDaySchema.optional(),\n sat: workingHoursDaySchema.optional(),\n sun: workingHoursDaySchema.optional(),\n}).nullable();\n\nexport const SetAvailabilityRulesSchema = z.object({\n calendar_id: z.string().describe('Calendar to configure'),\n buffer_before_minutes: z.number().int().min(0).max(120).default(0).describe('Minutes of buffer before each event (0–120)'),\n buffer_after_minutes: z.number().int().min(0).max(120).default(0).describe('Minutes of buffer after each event (0–120)'),\n working_hours: workingHoursSchema.default(null).describe('Per-day working hours map in the calendar\\'s timezone; omit keys for off-days. Pass null to remove any working-hours constraint.'),\n timezone: z.string().min(1).max(64).default('UTC').describe('IANA timezone used to interpret working_hours (e.g. America/New_York)'),\n});\n\nexport const GetAvailabilityRulesSchema = z.object({\n calendar_id: z.string().describe('Calendar to read'),\n});\n\nexport const ClearAvailabilityRulesSchema = z.object({\n calendar_id: z.string().describe('Calendar whose rules should be cleared'),\n});\n\n// ── Scoped keys ────────────────────────────────────────────────\n\nexport const CreateScopedKeySchema = z.object({\n agent_id: z.string().regex(/^agt_/).describe('Agent ID this key is scoped to'),\n label: z.string().min(1).max(100).optional().describe('Human-readable label for the key'),\n});\n\nexport const ListScopedKeysSchema = z.object({});\n\nexport const RevokeScopedKeySchema = z.object({\n key_id: z.string().describe('ID of the scoped key to revoke'),\n});\n\n// ── Audit log ──────────────────────────────────────────────────\n\nexport const GetAuditLogSchema = z.object({\n from: z.string().datetime({ offset: true }).optional().describe('Start of the window (ISO 8601). Silently clamped to the plan retention window if older.'),\n to: z.string().datetime({ offset: true }).optional().describe('End of the window (ISO 8601)'),\n action: z.string().min(1).max(64).optional().describe('Filter by action name (e.g. event.created)'),\n actor_key_prefix: z.string().min(1).max(32).optional().describe('Filter by the API key prefix that performed the action'),\n cursor: z.string().min(1).max(256).optional().describe('Opaque pagination cursor from a previous response'),\n limit: z.number().int().min(1).max(200).optional().describe('Max results to return (default 50)'),\n});\n\n// ── Terms ──────────────────────────────────────────────────────\n\nexport const AcceptTermsSchema = z.object({\n tos_version: z.string().min(1).describe('The terms-of-service version to accept; must match the current version'),\n});\n\n// ── Webhooks ───────────────────────────────────────────────────\n\nexport const ListWebhooksSchema = z.object({\n limit: z.number().int().min(1).max(100).default(20).describe('Max results to return'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset'),\n});\n\nexport const GetWebhookSchema = z.object({\n webhook_id: z.string().describe('Webhook subscription to fetch'),\n});\n\nexport const CreateWebhookSchema = z.object({\n url: z.string().url().describe('HTTPS endpoint that will receive event deliveries'),\n events: z.array(z.enum(WEBHOOK_EVENT_TYPES)).min(1).describe('Event types to subscribe to'),\n});\n\nexport const UpdateWebhookSchema = z.object({\n webhook_id: z.string().describe('Webhook subscription to update'),\n url: z.string().url().optional().describe('New HTTPS delivery endpoint'),\n events: z.array(z.enum(WEBHOOK_EVENT_TYPES)).min(1).optional().describe('Replacement set of event types to subscribe to'),\n active: z.boolean().optional().describe('Set false to pause deliveries, true to resume'),\n});\n\nexport const DeleteWebhookSchema = z.object({\n webhook_id: z.string().describe('Webhook subscription to delete'),\n});\n\nexport const ListWebhookDeliveriesSchema = z.object({\n webhook_id: z.string().describe('Webhook subscription whose deliveries to list'),\n limit: z.number().int().min(1).max(100).default(20).describe('Max results to return'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset'),\n status: z.enum(WEBHOOK_DELIVERY_STATUSES).optional().describe('Filter to a single delivery status'),\n include_payload: z.boolean().optional().describe('Include the full event payload sent on each delivery'),\n});\n\n// ── iCal Subscriptions ─────────────────────────────────────────\n\nexport const ListICalSubscriptionsSchema = z.object({\n agent_id: z.string().describe('Agent ID whose iCal subscriptions to list'),\n status: z.enum(['active', 'error', 'paused']).optional().describe('Filter by subscription status'),\n limit: z.number().int().min(1).max(200).default(50).describe('Max results to return'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset'),\n});\n\nexport const GetICalSubscriptionSchema = z.object({\n subscription_id: z.string().describe('iCal subscription ID to fetch'),\n});\n\nexport const SubscribeICalSchema = z.object({\n agent_id: z.string().describe('Agent ID that will own this subscription'),\n calendar_id: z.string().describe('Calendar ID to sync external events into'),\n url: z.string().url().describe('HTTPS URL of the iCal feed (.ics) to subscribe to'),\n label: z.string().optional().describe('Optional label for this subscription'),\n});\n\nexport const UpdateICalSubscriptionSchema = z.object({\n subscription_id: z.string().describe('iCal subscription ID to update'),\n label: z.string().min(1).max(255).optional().describe('New label for this subscription'),\n url: z.string().url().startsWith('https://', 'URL must use HTTPS').optional().describe('New HTTPS URL of the iCal feed (.ics)'),\n});\n\nexport const DeleteICalSubscriptionSchema = z.object({\n subscription_id: z.string().describe('iCal subscription ID to delete'),\n});\n\nexport const SyncICalSubscriptionSchema = z.object({\n subscription_id: z.string().describe('iCal subscription ID to sync'),\n});\n\n// ── Usage ──────────────────────────────────────────────────────\n\nexport const GetUsageSchema = z.object({});\n","import { ChronaryError } from '@chronary/sdk';\nimport type { ToolResult } from './types';\n\n/**\n * Wraps an async function so SDK errors become structured ToolResult objects\n * instead of thrown exceptions. LLMs see error messages, never stack traces.\n */\nexport function safeFunc<TParams>(\n fn: (params: TParams) => Promise<unknown>,\n): (params: TParams) => Promise<ToolResult> {\n return async (params: TParams): Promise<ToolResult> => {\n try {\n const result = await fn(params);\n return { result: result ?? { success: true }, isError: false };\n } catch (err) {\n if (err instanceof ChronaryError) {\n return { result: `${err.name}: ${err.message}`, isError: true };\n }\n return {\n result: `Error: ${err instanceof Error ? err.message : String(err)}`,\n isError: true,\n };\n }\n };\n}\n","import type { Chronary } from '@chronary/sdk';\nimport { safeFunc } from './safe';\nimport type { ToolResult } from './types';\n\ninterface Ctx<P = Record<string, unknown>> {\n client: Chronary;\n params: P;\n}\n\n// Helper to consume a PageIterator's first page\nasync function fetchPage(\n iterator: AsyncIterable<unknown> & { getPage(offset?: number, limit?: number): Promise<{ data: unknown[]; total: number; hasMore: boolean }> },\n offset?: number,\n limit?: number,\n) {\n const page = await iterator.getPage(offset ?? 0, limit);\n return { data: page.data, total: page.total, has_more: page.hasMore };\n}\n\n// ── Calendars ──────────────────────────────────────────────────\n\nexport const listCalendars = safeFunc(async (ctx: Ctx<{\n include?: 'all'; limit?: number; offset?: number;\n}>) => {\n const { client, params } = ctx;\n const iter = client.calendars.list({ include: params.include, limit: params.limit });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getCalendar = safeFunc(async (ctx: Ctx<{ calendar_id: string }>) => {\n return ctx.client.calendars.get(ctx.params.calendar_id);\n});\n\nexport const createCalendar = safeFunc(async (ctx: Ctx<{\n name: string; timezone: string; agent_id?: string; default_reminders?: number[] | null; metadata?: Record<string, unknown>;\n}>) => {\n const { client, params } = ctx;\n return client.calendars.create({\n name: params.name,\n timezone: params.timezone,\n agentId: params.agent_id,\n default_reminders: params.default_reminders,\n metadata: params.metadata,\n });\n});\n\nexport const updateCalendar = safeFunc(async (ctx: Ctx<{\n calendar_id: string; name?: string; timezone?: string;\n agent_status?: 'idle' | 'working' | 'waiting' | 'error';\n default_reminders?: number[] | null; metadata?: Record<string, unknown>;\n}>) => {\n const { client, params } = ctx;\n const { calendar_id, ...updates } = params;\n return client.calendars.update(calendar_id, updates);\n});\n\nexport const deleteCalendar = safeFunc(async (ctx: Ctx<{ calendar_id: string }>) => {\n await ctx.client.calendars.delete(ctx.params.calendar_id);\n return undefined; // safeFunc normalizes to { success: true }\n});\n\n// ── Events ─────────────────────────────────────────────────────\n\nexport const listEvents = safeFunc(async (ctx: Ctx<{\n calendar_id: string; start_after?: string; start_before?: string;\n limit?: number; offset?: number;\n}>) => {\n const { client, params } = ctx;\n const iter = client.events.list({\n calendarId: params.calendar_id,\n start_after: params.start_after,\n start_before: params.start_before,\n limit: params.limit,\n });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getEvent = safeFunc(async (ctx: Ctx<{ calendar_id: string; event_id: string }>) => {\n return ctx.client.events.get(ctx.params.calendar_id, ctx.params.event_id);\n});\n\nexport const createEvent = safeFunc(async (ctx: Ctx<{\n calendar_id: string; title: string; start_time: string; end_time: string;\n description?: string; all_day?: boolean;\n status?: 'confirmed' | 'tentative' | 'hold'; reminders?: number[] | null; metadata?: Record<string, unknown>;\n hold_expires_at?: string; hold_priority?: number;\n}>) => {\n const { client, params } = ctx;\n const { calendar_id, ...eventParams } = params;\n return client.events.create(calendar_id, eventParams);\n});\n\nexport const updateEvent = safeFunc(async (ctx: Ctx<{\n calendar_id: string; event_id: string; title?: string; description?: string | null;\n start_time?: string; end_time?: string; all_day?: boolean;\n status?: 'confirmed' | 'tentative' | 'cancelled'; reminders?: number[] | null; metadata?: Record<string, unknown>;\n}>) => {\n const { client, params } = ctx;\n const { calendar_id, event_id, ...updates } = params;\n return client.events.update(calendar_id, event_id, updates);\n});\n\nexport const cancelEvent = safeFunc(async (ctx: Ctx<{ calendar_id: string; event_id: string }>) => {\n await ctx.client.events.delete(ctx.params.calendar_id, ctx.params.event_id);\n return undefined;\n});\n\nexport const confirmEvent = safeFunc(async (ctx: Ctx<{ event_id: string }>) => {\n return ctx.client.events.confirm(ctx.params.event_id);\n});\n\nexport const releaseEvent = safeFunc(async (ctx: Ctx<{ event_id: string }>) => {\n return ctx.client.events.release(ctx.params.event_id);\n});\n\n// ── Agents ─────────────────────────────────────────────────────\n\nexport const createAgent = safeFunc(async (ctx: Ctx<{\n name: string; type: 'ai' | 'human' | 'resource'; description?: string; metadata?: Record<string, unknown>;\n}>) => {\n return ctx.client.agents.create(ctx.params);\n});\n\nexport const listAgents = safeFunc(async (ctx: Ctx<{\n type?: 'ai' | 'human' | 'resource'; status?: 'active' | 'paused' | 'decommissioned'; limit?: number; offset?: number;\n}>) => {\n const { client, params } = ctx;\n const iter = client.agents.list({ type: params.type, status: params.status, limit: params.limit });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getAgent = safeFunc(async (ctx: Ctx<{ agent_id: string }>) => {\n return ctx.client.agents.get(ctx.params.agent_id);\n});\n\nexport const updateAgent = safeFunc(async (ctx: Ctx<{\n agent_id: string; name?: string; description?: string | null; metadata?: Record<string, unknown>; status?: 'active' | 'paused';\n}>) => {\n const { client, params } = ctx;\n const { agent_id, ...updates } = params;\n return client.agents.update(agent_id, updates);\n});\n\nexport const deleteAgent = safeFunc(async (ctx: Ctx<{ agent_id: string }>) => {\n await ctx.client.agents.delete(ctx.params.agent_id);\n return undefined;\n});\n\n// ── Availability ───────────────────────────────────────────────\n\nexport const getAvailability = safeFunc(async (ctx: Ctx<{\n agent_id: string; start?: string; end?: string; start_time?: string; end_time?: string;\n slot_duration?: '15m' | '30m' | '45m' | '1h' | '2h'; include_busy?: boolean;\n}>) => {\n const { client, params } = ctx;\n // Resolve the `start`/`end` canonical names from their REST aliases, mirroring\n // the hosted MCP tool's validation.\n const start = params.start ?? params.start_time;\n const end = params.end ?? params.end_time;\n if (!start || !end) {\n throw new Error('start (or start_time) and end (or end_time) are required');\n }\n return client.availability.forAgent(params.agent_id, {\n start,\n end,\n slot_duration: params.slot_duration,\n include_busy: params.include_busy,\n });\n});\n\nexport const findMeetingTime = safeFunc(async (ctx: Ctx<{\n agents?: string[]; agent_ids?: string[];\n start?: string; end?: string; start_time?: string; end_time?: string;\n slot_duration?: '15m' | '30m' | '45m' | '1h' | '2h';\n calendars?: string[]; include_busy?: boolean;\n}>) => {\n const { client, params } = ctx;\n // Resolve the canonical `agents`/`start`/`end` from their REST/scheduling\n // aliases, mirroring the hosted MCP tool's validation.\n const agents = params.agents ?? params.agent_ids;\n const start = params.start ?? params.start_time;\n const end = params.end ?? params.end_time;\n if (!agents || !start || !end) {\n throw new Error('agents (or agent_ids), start (or start_time), and end (or end_time) are required');\n }\n return client.availability.check({\n agents,\n start,\n end,\n slot_duration: params.slot_duration,\n calendars: params.calendars,\n include_busy: params.include_busy,\n });\n});\n\n// ── Calendar context ───────────────────────────────────────────\n\nexport const getCalendarContext = safeFunc(async (ctx: Ctx<{ calendar_id: string }>) => {\n return ctx.client.calendars.getContext(ctx.params.calendar_id);\n});\n\n// ── Scheduling proposals ───────────────────────────────────────\n\ninterface ProposalSlotInput {\n start_time: string;\n end_time: string;\n weight?: number;\n calendar_id?: string;\n}\n\nexport const createProposal = safeFunc(async (ctx: Ctx<{\n title: string; description?: string; organizer_agent_id: string;\n participant_agent_ids: string[]; calendar_id: string;\n slots: ProposalSlotInput[]; expires_at?: string;\n}>) => {\n return ctx.client.scheduling.create(ctx.params);\n});\n\nexport const listProposals = safeFunc(async (ctx: Ctx<{\n status?: 'pending' | 'confirmed' | 'expired' | 'cancelled'; organizer_agent_id?: string; limit?: number; offset?: number;\n}>) => {\n const { client, params } = ctx;\n const iter = client.scheduling.list({\n status: params.status,\n organizer_agent_id: params.organizer_agent_id,\n limit: params.limit,\n });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getProposal = safeFunc(async (ctx: Ctx<{ proposal_id: string }>) => {\n return ctx.client.scheduling.get(ctx.params.proposal_id);\n});\n\nexport const respondToProposal = safeFunc(async (ctx: Ctx<{\n proposal_id: string; agent_id: string; response: 'accept' | 'decline' | 'counter';\n selected_slot_id?: string; counter_slots?: ProposalSlotInput[]; message?: string;\n}>) => {\n const { client, params } = ctx;\n const { proposal_id, ...body } = params;\n return client.scheduling.respond(proposal_id, body);\n});\n\nexport const resolveProposal = safeFunc(async (ctx: Ctx<{ proposal_id: string }>) => {\n return ctx.client.scheduling.resolve(ctx.params.proposal_id);\n});\n\nexport const cancelProposal = safeFunc(async (ctx: Ctx<{ proposal_id: string }>) => {\n return ctx.client.scheduling.cancel(ctx.params.proposal_id);\n});\n\n// ── Availability rules ─────────────────────────────────────────\n\ninterface WorkingHoursDayInput { start: string; end: string; }\ntype WorkingHoursInput = {\n mon?: WorkingHoursDayInput; tue?: WorkingHoursDayInput; wed?: WorkingHoursDayInput;\n thu?: WorkingHoursDayInput; fri?: WorkingHoursDayInput; sat?: WorkingHoursDayInput; sun?: WorkingHoursDayInput;\n} | null;\n\nexport const setAvailabilityRules = safeFunc(async (ctx: Ctx<{\n calendar_id: string; buffer_before_minutes?: number; buffer_after_minutes?: number;\n working_hours?: WorkingHoursInput; timezone?: string;\n}>) => {\n const { client, params } = ctx;\n const { calendar_id, ...rules } = params;\n return client.calendars.setAvailabilityRules(calendar_id, rules);\n});\n\nexport const getAvailabilityRules = safeFunc(async (ctx: Ctx<{ calendar_id: string }>) => {\n return ctx.client.calendars.getAvailabilityRules(ctx.params.calendar_id);\n});\n\nexport const clearAvailabilityRules = safeFunc(async (ctx: Ctx<{ calendar_id: string }>) => {\n await ctx.client.calendars.deleteAvailabilityRules(ctx.params.calendar_id);\n return undefined;\n});\n\n// ── Scoped keys ────────────────────────────────────────────────\n\nexport const createScopedKey = safeFunc(async (ctx: Ctx<{ agent_id: string; label?: string }>) => {\n return ctx.client.keys.create(ctx.params);\n});\n\nexport const listScopedKeys = safeFunc(async (ctx: Ctx) => {\n return ctx.client.keys.list();\n});\n\nexport const revokeScopedKey = safeFunc(async (ctx: Ctx<{ key_id: string }>) => {\n await ctx.client.keys.delete(ctx.params.key_id);\n return undefined;\n});\n\n// ── Webhooks ───────────────────────────────────────────────────\n\nexport const listWebhooks = safeFunc(async (ctx: Ctx<{ limit?: number; offset?: number }>) => {\n const { client, params } = ctx;\n const iter = client.webhooks.list({ limit: params.limit });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getWebhook = safeFunc(async (ctx: Ctx<{ webhook_id: string }>) => {\n return ctx.client.webhooks.get(ctx.params.webhook_id);\n});\n\nexport const createWebhook = safeFunc(async (ctx: Ctx<{ url: string; events: string[] }>) => {\n return ctx.client.webhooks.create(ctx.params);\n});\n\nexport const updateWebhook = safeFunc(async (ctx: Ctx<{\n webhook_id: string; url?: string; events?: string[]; active?: boolean;\n}>) => {\n const { client, params } = ctx;\n const { webhook_id, ...updates } = params;\n return client.webhooks.update(webhook_id, updates);\n});\n\nexport const deleteWebhook = safeFunc(async (ctx: Ctx<{ webhook_id: string }>) => {\n await ctx.client.webhooks.delete(ctx.params.webhook_id);\n return undefined;\n});\n\nexport const listWebhookDeliveries = safeFunc(async (ctx: Ctx<{\n webhook_id: string; limit?: number; offset?: number;\n status?: 'pending' | 'delivered' | 'failed'; include_payload?: boolean;\n}>) => {\n const { client, params } = ctx;\n const { webhook_id, ...query } = params;\n return client.webhooks.listDeliveries(webhook_id, query);\n});\n\n// ── Audit log ──────────────────────────────────────────────────\n\nexport const getAuditLog = safeFunc(async (ctx: Ctx<{\n from?: string; to?: string; action?: string; actor_key_prefix?: string; cursor?: string; limit?: number;\n}>) => {\n return ctx.client.auditLog.list(ctx.params);\n});\n\n// ── Terms ──────────────────────────────────────────────────────\n\nexport const acceptTerms = safeFunc(async (ctx: Ctx<{ tos_version: string }>) => {\n return ctx.client.terms.accept(ctx.params);\n});\n\n// ── iCal Subscriptions ─────────────────────────────────────────\n\nexport const listICalSubscriptions = safeFunc(async (ctx: Ctx<{\n agent_id: string; status?: 'active' | 'error' | 'paused'; limit?: number; offset?: number;\n}>) => {\n const { client, params } = ctx;\n const iter = client.icalSubscriptions.list({\n agentId: params.agent_id,\n status: params.status,\n limit: params.limit,\n });\n return fetchPage(iter, params.offset, params.limit);\n});\n\nexport const getICalSubscription = safeFunc(async (ctx: Ctx<{ subscription_id: string }>) => {\n return ctx.client.icalSubscriptions.get(ctx.params.subscription_id);\n});\n\nexport const subscribeICal = safeFunc(async (ctx: Ctx<{\n agent_id: string; calendar_id: string; url: string; label?: string;\n}>) => {\n const { client, params } = ctx;\n const { agent_id, ...subParams } = params;\n return client.icalSubscriptions.create(agent_id, subParams);\n});\n\nexport const updateICalSubscription = safeFunc(async (ctx: Ctx<{\n subscription_id: string; label?: string; url?: string;\n}>) => {\n const { client, params } = ctx;\n const { subscription_id, ...updates } = params;\n return client.icalSubscriptions.update(subscription_id, updates);\n});\n\nexport const deleteICalSubscription = safeFunc(async (ctx: Ctx<{ subscription_id: string }>) => {\n await ctx.client.icalSubscriptions.delete(ctx.params.subscription_id);\n return undefined;\n});\n\nexport const syncICalSubscription = safeFunc(async (ctx: Ctx<{ subscription_id: string }>) => {\n return ctx.client.icalSubscriptions.sync(ctx.params.subscription_id);\n});\n\n// ── Usage ──────────────────────────────────────────────────────\n\nexport const getUsage = safeFunc(async (ctx: Ctx) => {\n return ctx.client.usage.get();\n});\n\n// ── Factory ────────────────────────────────────────────────────\n\n/** Map of tool name → executor function. Used by definitions.ts to wire up execute(). */\nexport function createExecutor(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fn: (ctx: { client: Chronary; params: any }) => Promise<ToolResult>,\n): (client: Chronary, params: Record<string, unknown>) => Promise<ToolResult> {\n return (client, params) => fn({ client, params });\n}\n","import type { ToolDefinition } from './types';\nimport * as schemas from './schemas';\nimport * as fns from './functions';\nimport { createExecutor } from './functions';\n\nexport const HOSTED_API_MCP_TOOL_NAMES = [\n 'create_agent',\n 'list_agents',\n 'create_calendar',\n 'create_event',\n 'list_events',\n 'get_event',\n 'update_event',\n 'get_availability',\n 'find_meeting_time',\n 'cancel_event',\n 'confirm_event',\n 'release_event',\n 'subscribe_ical',\n 'list_ical_subscriptions',\n 'get_ical_subscription',\n 'update_ical_subscription',\n 'delete_ical_subscription',\n 'sync_ical_subscription',\n 'get_calendar_context',\n 'create_proposal',\n 'list_proposals',\n 'get_proposal',\n 'respond_to_proposal',\n 'resolve_proposal',\n 'cancel_proposal',\n 'set_availability_rules',\n 'get_availability_rules',\n 'clear_availability_rules',\n 'create_scoped_key',\n 'list_scoped_keys',\n 'revoke_scoped_key',\n 'create_webhook',\n 'list_webhooks',\n 'get_webhook',\n 'update_webhook',\n 'delete_webhook',\n 'list_webhook_deliveries',\n 'get_agent',\n 'update_agent',\n 'delete_agent',\n 'list_calendars',\n 'get_calendar',\n 'update_calendar',\n 'delete_calendar',\n 'get_usage',\n 'get_audit_log',\n 'accept_terms',\n] as const;\n\nexport const TOOL_DEFINITIONS: ToolDefinition[] = [\n // ── Calendars ──────────────────────────────────────────────────\n {\n name: 'list_calendars',\n description: 'List calendars in the org. Org-level API keys see every calendar (agent-owned and shared); agent-scoped keys see only their own agent\\'s calendars. Use this to discover calendar IDs before creating or listing events.',\n schema: schemas.ListCalendarsSchema,\n annotations: { title: 'List Calendars', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listCalendars),\n },\n {\n name: 'get_calendar',\n description: 'Fetch a single calendar by ID, including its name, timezone, agent status, and default reminders. Agent-scoped keys may only read calendars owned by their agent.',\n schema: schemas.GetCalendarSchema,\n annotations: { title: 'Get Calendar', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getCalendar),\n },\n {\n name: 'create_calendar',\n description: 'Create a calendar to hold events and track availability. Calendars are required before creating events — call this first when setting up a new agent. An agent can have multiple calendars (e.g. \"Work\", \"Personal\"). Org-level calendars (no agent_id) can be used as shared resources like meeting rooms.',\n schema: schemas.CreateCalendarSchema,\n annotations: { title: 'Create Calendar', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.createCalendar),\n },\n {\n name: 'update_calendar',\n description: 'Update a calendar\\'s name, timezone, agent status, default reminders, or metadata. Agent-scoped keys may only update calendars owned by their agent.',\n schema: schemas.UpdateCalendarSchema,\n annotations: { title: 'Update Calendar', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.updateCalendar),\n },\n {\n name: 'delete_calendar',\n description: 'Delete a calendar (soft delete). Its events are no longer returned and it stops contributing to availability. Agent-scoped keys may only delete calendars owned by their agent.',\n schema: schemas.DeleteCalendarSchema,\n annotations: { title: 'Delete Calendar', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.deleteCalendar),\n },\n\n // ── Events ─────────────────────────────────────────────────────\n {\n name: 'list_events',\n description: 'List all events on a calendar, including internally created events and externally synced events from iCal subscriptions (e.g. Google Calendar, Outlook). Use start_after and start_before to query a specific time window.',\n schema: schemas.ListEventsSchema,\n annotations: { title: 'List Events', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listEvents),\n },\n {\n name: 'get_event',\n description: 'Retrieve a single event by ID, including its title, times, status, location, reminders, and metadata. Works for both internally created events and externally synced iCal events. `calendar_id` is optional — if omitted the calendar is resolved from the event. Provide `calendar_id` to fail fast on cross-calendar typos.',\n schema: schemas.GetEventSchema,\n annotations: { title: 'Get Event', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getEvent),\n },\n {\n name: 'create_event',\n description: 'Create a booking, appointment, meeting, hold, or any scheduled event on a calendar. The calendar_id comes from create_calendar or list_events. Once created, this event blocks the agent\\'s availability during that time and appears in availability queries. Use status=\"hold\" with hold_expires_at to tentatively reserve a slot that auto-releases on TTL.',\n schema: schemas.CreateEventSchema,\n annotations: { title: 'Create Event', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.createEvent),\n },\n {\n name: 'update_event',\n description: 'Reschedule or edit an event — change its title, description, start/end times, location, status, reminders, or metadata. Use this to move an appointment to a new time or update its details. Provide only the fields you want to change. Holds cannot be edited via this tool (use confirm_event / release_event). External iCal events are read-only. `calendar_id` is optional — if omitted it is resolved from the event.',\n schema: schemas.UpdateEventSchema,\n annotations: { title: 'Update Event', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.updateEvent),\n },\n {\n name: 'cancel_event',\n description: 'Delete or cancel an event from a calendar. Use this to remove, cancel, or delete any scheduled event or appointment. The event is marked cancelled and excluded from future availability calculations. `calendar_id` is optional — if omitted the calendar is looked up from the event. Provide `calendar_id` to fail fast on cross-calendar typos.',\n schema: schemas.CancelEventSchema,\n annotations: { title: 'Cancel Event', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.cancelEvent),\n },\n {\n name: 'confirm_event',\n description: 'Promote a held event to a confirmed booking. The event must currently have status=\"hold\" and its hold_expires_at must not have passed. After confirmation, event.started and event.ended lifecycle webhooks fire at the scheduled times.',\n schema: schemas.ConfirmEventSchema,\n annotations: { title: 'Confirm Event', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.confirmEvent),\n },\n {\n name: 'release_event',\n description: 'Manually release a held event before its hold_expires_at. The event must currently have status=\"hold\". Frees the slot for other agents to book.',\n schema: schemas.ReleaseEventSchema,\n annotations: { title: 'Release Event', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.releaseEvent),\n },\n\n // ── Agents ─────────────────────────────────────────────────────\n {\n name: 'create_agent',\n description: 'Register your agent (AI assistant, human participant, or resource) with Chronary so it can own calendars, events, and webhooks.',\n schema: schemas.CreateAgentSchema,\n annotations: { title: 'Create Agent', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.createAgent),\n },\n {\n name: 'list_agents',\n description: 'List all agents in your organization',\n schema: schemas.ListAgentsSchema,\n annotations: { title: 'List Agents', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listAgents),\n },\n {\n name: 'get_agent',\n description: 'Fetch a single agent by ID. An agent represents an AI assistant, human, or shared resource (e.g. a meeting room). Agent-scoped API keys may only read their own agent.',\n schema: schemas.GetAgentSchema,\n annotations: { title: 'Get Agent', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getAgent),\n },\n {\n name: 'update_agent',\n description: 'Update an agent\\'s name, description, metadata, or status (active/paused). Requires an org-level API key — agent-scoped keys cannot mutate agents.',\n schema: schemas.UpdateAgentSchema,\n annotations: { title: 'Update Agent', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.updateAgent),\n },\n {\n name: 'delete_agent',\n description: 'Decommission an agent. This marks the agent as decommissioned and revokes all of its scoped API keys. Requires an org-level API key — agent-scoped keys cannot delete agents.',\n schema: schemas.DeleteAgentSchema,\n annotations: { title: 'Delete Agent', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.deleteAgent),\n },\n\n // ── Availability ───────────────────────────────────────────────\n {\n name: 'get_availability',\n description: 'Check when a single agent is free within a time range. Accepts `start`/`end` (preferred — matches the underlying availability service) or `start_time`/`end_time` (aliases that match the REST events schema).',\n schema: schemas.GetAvailabilitySchema,\n annotations: { title: 'Get Availability', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getAvailability),\n },\n {\n name: 'find_meeting_time',\n description: 'Find time slots when multiple agents are all free simultaneously. Accepts `agents`/`start`/`end` (preferred — matches the availability service) or `agent_ids`/`start_time`/`end_time` (aliases that match the REST/scheduling-proposal naming).',\n schema: schemas.FindMeetingTimeSchema,\n annotations: { title: 'Find Meeting Time', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.findMeetingTime),\n },\n\n // ── Calendar context ───────────────────────────────────────────\n {\n name: 'get_calendar_context',\n description: 'Get a calendar\\'s temporal context in a single call: the current event (if one is happening now), the next upcoming event, recent past events, a short upcoming window, and the owning agent\\'s status (idle/working/waiting/error). Use this to answer \"what is this agent doing right now?\" without issuing multiple list_events queries.',\n schema: schemas.GetCalendarContextSchema,\n annotations: { title: 'Get Calendar Context', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getCalendarContext),\n },\n\n // ── Scheduling proposals ───────────────────────────────────────\n {\n name: 'create_proposal',\n description: 'Create a scheduling proposal — send a set of candidate time slots to one or more participant agents so they can accept, decline, or counter-propose. The organizer agent owns the proposal; once every participant responds, the system auto-resolves to the highest-scoring slot (or cancels if all decline). Requires an org-level API key. Pro plan only.',\n schema: schemas.CreateProposalSchema,\n annotations: { title: 'Create Proposal', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.createProposal),\n },\n {\n name: 'list_proposals',\n description: 'List scheduling proposals for the org. Filter by status (pending|confirmed|expired|cancelled) or organizer_agent_id. Requires an org-level API key.',\n schema: schemas.ListProposalsSchema,\n annotations: { title: 'List Proposals', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listProposals),\n },\n {\n name: 'get_proposal',\n description: 'Get a scheduling proposal by id, including its slots and per-participant responses. Requires an org-level API key.',\n schema: schemas.GetProposalSchema,\n annotations: { title: 'Get Proposal', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getProposal),\n },\n {\n name: 'respond_to_proposal',\n description: 'Submit a response (accept / decline / counter) on behalf of one participant agent to an open proposal. An \"accept\" requires the slot id from the proposal; a \"counter\" can suggest alternative slots. When all participants have responded the proposal auto-resolves — no separate resolve call needed in the normal flow. Requires an org-level API key. Pro plan only.',\n schema: schemas.RespondToProposalSchema,\n annotations: { title: 'Respond To Proposal', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.respondToProposal),\n },\n {\n name: 'resolve_proposal',\n description: 'Force-resolve an open proposal using responses collected so far. Picks the highest-scoring slot among those accepted by the most participants and creates a confirmed calendar event. If every response was \"decline\", the proposal is cancelled instead. Use when you want to close out a proposal without waiting for every participant. Requires an org-level API key. Pro plan only.',\n schema: schemas.ResolveProposalSchema,\n annotations: { title: 'Resolve Proposal', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.resolveProposal),\n },\n {\n name: 'cancel_proposal',\n description: 'Cancel an open proposal. Fires a proposal.cancelled webhook with reason=\"organizer_cancelled\". Requires an org-level API key. Pro plan only.',\n schema: schemas.CancelProposalSchema,\n annotations: { title: 'Cancel Proposal', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.cancelProposal),\n },\n\n // ── Availability rules ─────────────────────────────────────────\n {\n name: 'set_availability_rules',\n description: 'Set or replace the availability rules on a calendar — buffer times before/after events and optional per-day working hours. When these rules are set, every availability query on this calendar automatically applies them (busy-block expansion for buffers, masking outside working hours). Upsert: overwrites any existing rules.',\n schema: schemas.SetAvailabilityRulesSchema,\n annotations: { title: 'Set Availability Rules', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.setAvailabilityRules),\n },\n {\n name: 'get_availability_rules',\n description: 'Read the buffer times and working-hours rules configured on a calendar. Returns the rules row, or an error if none are set.',\n schema: schemas.GetAvailabilityRulesSchema,\n annotations: { title: 'Get Availability Rules', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getAvailabilityRules),\n },\n {\n name: 'clear_availability_rules',\n description: 'Remove the availability rules from a calendar, reverting to the default (no buffers, no working-hours mask). Returns the deleted row, or an error if none were set.',\n schema: schemas.ClearAvailabilityRulesSchema,\n annotations: { title: 'Clear Availability Rules', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.clearAvailabilityRules),\n },\n\n // ── Webhooks ───────────────────────────────────────────────────\n {\n name: 'list_webhooks',\n description: 'List the org\\'s webhook subscriptions with their subscribed event types and active state. Signing secrets are never returned. Requires an org-level API key.',\n schema: schemas.ListWebhooksSchema,\n annotations: { title: 'List Webhooks', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listWebhooks),\n },\n {\n name: 'get_webhook',\n description: 'Get a single webhook subscription by id, including its subscribed event types and active state. The signing secret is never returned. Requires an org-level API key.',\n schema: schemas.GetWebhookSchema,\n annotations: { title: 'Get Webhook', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getWebhook),\n },\n {\n name: 'create_webhook',\n description: 'Create a webhook subscription so the org receives HTTP POST notifications when events occur (e.g. event.created, proposal.confirmed). The signing secret is returned ONCE in this response — store it to verify the HMAC-SHA256 signature on delivered payloads. Requires an org-level API key.',\n schema: schemas.CreateWebhookSchema,\n annotations: { title: 'Create Webhook', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.createWebhook),\n },\n {\n name: 'update_webhook',\n description: 'Update a webhook subscription — change its delivery URL, the set of subscribed event types, or pause/resume it via active. At least one field must be supplied. Requires an org-level API key.',\n schema: schemas.UpdateWebhookSchema,\n annotations: { title: 'Update Webhook', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.updateWebhook),\n },\n {\n name: 'delete_webhook',\n description: 'Permanently delete a webhook subscription. This frees its endpoint slot against the per-plan cap. Requires an org-level API key.',\n schema: schemas.DeleteWebhookSchema,\n annotations: { title: 'Delete Webhook', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.deleteWebhook),\n },\n {\n name: 'list_webhook_deliveries',\n description: 'List delivery attempts for a webhook subscription, with per-status counts (pending/delivered/failed). Use this to debug failing deliveries. Requires an org-level API key.',\n schema: schemas.ListWebhookDeliveriesSchema,\n annotations: { title: 'List Webhook Deliveries', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listWebhookDeliveries),\n },\n\n // ── iCal Subscriptions ─────────────────────────────────────────\n {\n name: 'list_ical_subscriptions',\n description: \"List an agent's external iCal feed subscriptions (e.g. linked Google Calendar / Outlook feeds), including their sync status and last sync time.\",\n schema: schemas.ListICalSubscriptionsSchema,\n annotations: { title: 'List iCal Subscriptions', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listICalSubscriptions),\n },\n {\n name: 'get_ical_subscription',\n description: 'Get a single external iCal feed subscription by id, including its sync status, last sync time, and last error.',\n schema: schemas.GetICalSubscriptionSchema,\n annotations: { title: 'Get iCal Subscription', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getICalSubscription),\n },\n {\n name: 'subscribe_ical',\n description: \"Link an external iCal feed (e.g. a human's Google Calendar) to an agent's calendar so external events appear in availability calculations. The target calendar must be owned by the specified agent — create the calendar with that agent_id first (org-level calendars without an agent_id cannot host external iCal subscriptions; create a dedicated per-agent calendar for sync targets).\",\n schema: schemas.SubscribeICalSchema,\n annotations: { title: 'Subscribe iCal', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },\n execute: createExecutor(fns.subscribeICal),\n },\n {\n name: 'update_ical_subscription',\n description: 'Update an external iCal feed subscription — change its label or its feed URL. Changing the URL forces a full re-sync on the next poll.',\n schema: schemas.UpdateICalSubscriptionSchema,\n annotations: { title: 'Update iCal Subscription', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.updateICalSubscription),\n },\n {\n name: 'delete_ical_subscription',\n description: 'Delete an external iCal feed subscription. Events previously synced from the feed are no longer refreshed.',\n schema: schemas.DeleteICalSubscriptionSchema,\n annotations: { title: 'Delete iCal Subscription', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.deleteICalSubscription),\n },\n {\n name: 'sync_ical_subscription',\n description: 'Trigger an immediate sync of an external iCal feed subscription instead of waiting for the next scheduled poll. Returns once the sync has been queued.',\n schema: schemas.SyncICalSubscriptionSchema,\n annotations: { title: 'Sync iCal Subscription', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },\n execute: createExecutor(fns.syncICalSubscription),\n },\n\n // ── Scoped keys ────────────────────────────────────────────────\n {\n name: 'create_scoped_key',\n description: 'Create an agent-scoped API key (chr_ak_*) that can only act on behalf of a single agent. Use this to self-provision or rotate per-agent credentials. The plaintext key is returned exactly once in the response — store it immediately, it cannot be retrieved later. Requires an org-level API key.',\n schema: schemas.CreateScopedKeySchema,\n annotations: { title: 'Create Scoped Key', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n execute: createExecutor(fns.createScopedKey),\n },\n {\n name: 'list_scoped_keys',\n description: 'List all live (non-revoked) agent-scoped API keys for this org. Returns key metadata only (id, prefix, agent_id, label, created_at) — never the plaintext secret. Requires an org-level API key.',\n schema: schemas.ListScopedKeysSchema,\n annotations: { title: 'List Scoped Keys', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.listScopedKeys),\n },\n {\n name: 'revoke_scoped_key',\n description: 'Revoke an agent-scoped API key by ID. The key stops authenticating immediately and cannot be un-revoked. Requires an org-level API key.',\n schema: schemas.RevokeScopedKeySchema,\n annotations: { title: 'Revoke Scoped Key', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.revokeScopedKey),\n },\n\n // ── Audit log ──────────────────────────────────────────────────\n {\n name: 'get_audit_log',\n description: 'List audit-log entries for the calling org — mutating operations and auth-lifecycle events, newest first. Results are clamped to the plan\\'s retention window. Requires an org-level API key (chr_sk_*); agent-scoped keys cannot read the org-wide audit log.',\n schema: schemas.GetAuditLogSchema,\n annotations: { title: 'Get Audit Log', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getAuditLog),\n },\n\n // ── Terms ──────────────────────────────────────────────────────\n {\n name: 'accept_terms',\n description: 'Re-accept the current Chronary terms of service on behalf of the calling org. Use this when responses carry the Chronary-Terms-Upgrade-Required header — a material ToS bump otherwise leaves MCP-only agents stuck without a console session. Pass the current tos_version (read it from GET /v1/auth/terms/current). Requires an org-level API key (chr_sk_*); agent-scoped keys cannot accept org-wide terms.',\n schema: schemas.AcceptTermsSchema,\n annotations: { title: 'Accept Terms', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.acceptTerms),\n },\n\n // ── Usage ──────────────────────────────────────────────────────\n {\n name: 'get_usage',\n description: 'Get the calling org\\'s current-period usage and plan limits (agents, calendars, events, API calls, webhooks, availability queries, iCal subscriptions, proposals, scoped keys, holds, cross-calendar queries). Requires an org-level API key (chr_sk_*); agent-scoped keys cannot read org-wide usage.',\n schema: schemas.GetUsageSchema,\n annotations: { title: 'Get Usage', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n execute: createExecutor(fns.getUsage),\n },\n];\n\nconst toolkitToolNames = new Set<string>(TOOL_DEFINITIONS.map((tool) => tool.name));\nconst hostedToolNames = new Set<string>(HOSTED_API_MCP_TOOL_NAMES);\n\nexport const TOOLKIT_MCP_PARITY = {\n hostedToolNames: HOSTED_API_MCP_TOOL_NAMES,\n missingHostedTools: HOSTED_API_MCP_TOOL_NAMES.filter((name) => !toolkitToolNames.has(name)),\n toolkitOnlyTools: TOOL_DEFINITIONS.map((tool) => tool.name).filter((name) => !hostedToolNames.has(name)),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,cAAyB;;;ACAzB,iBAAkB;AAKlB,IAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,4BAA4B,CAAC,WAAW,aAAa,QAAQ;AAI5D,IAAM,sBAAsB,aAAE,OAAO;AAAA,EAC1C,SAAS,aAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,mEAAmE;AAAA,EAChH,OAAO,aAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,QAAQ,EAAE,EAAE,SA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MAChB,SAAS,OAAO,WAAoC;AAClD,cAAM,SAAS,MAAM,IAAI,QAAQ,QAAQ,MAAM;AAC/C,YAAI,OAAO,QAAS,OAAM,IAAI,MAAM,OAAO,MAAgB;AAC3D,eAAO,OAAO;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AACF;AAGO,SAAS,cAAc,QAA+B;AAC3D,SAAO,IAAI,gBAAgB,MAAM,EAAE,SAAS;AAC9C;","names":["import_sdk"]}
|
package/dist/ai-sdk.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
|
-
import
|
|
2
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
3
|
+
import { M as MapToolkit, T as ToolDefinition, C as ChronaryToolkitConfig } from './base-C6QWbxc1.cjs';
|
|
3
4
|
import '@chronary/sdk';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -29,11 +30,9 @@ declare class ChronaryToolkit extends MapToolkit<{
|
|
|
29
30
|
constructor(config: ChronaryToolkitConfig);
|
|
30
31
|
protected buildTool(def: ToolDefinition): {
|
|
31
32
|
description: string;
|
|
32
|
-
parameters: zod.ZodObject<
|
|
33
|
-
[
|
|
34
|
-
}
|
|
35
|
-
[x: string]: any;
|
|
36
|
-
}>;
|
|
33
|
+
parameters: zod.ZodObject<Readonly<{
|
|
34
|
+
[k: string]: zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>;
|
|
35
|
+
}>, zod_v4_core.$strip>;
|
|
37
36
|
execute: (params: Record<string, unknown>) => Promise<unknown>;
|
|
38
37
|
};
|
|
39
38
|
}
|
package/dist/ai-sdk.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
|
-
import
|
|
2
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
3
|
+
import { M as MapToolkit, T as ToolDefinition, C as ChronaryToolkitConfig } from './base-C6QWbxc1.js';
|
|
3
4
|
import '@chronary/sdk';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -29,11 +30,9 @@ declare class ChronaryToolkit extends MapToolkit<{
|
|
|
29
30
|
constructor(config: ChronaryToolkitConfig);
|
|
30
31
|
protected buildTool(def: ToolDefinition): {
|
|
31
32
|
description: string;
|
|
32
|
-
parameters: zod.ZodObject<
|
|
33
|
-
[
|
|
34
|
-
}
|
|
35
|
-
[x: string]: any;
|
|
36
|
-
}>;
|
|
33
|
+
parameters: zod.ZodObject<Readonly<{
|
|
34
|
+
[k: string]: zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>;
|
|
35
|
+
}>, zod_v4_core.$strip>;
|
|
37
36
|
execute: (params: Record<string, unknown>) => Promise<unknown>;
|
|
38
37
|
};
|
|
39
38
|
}
|