@chronary/toolkit 0.1.3 → 1.0.1
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 +472 -38
- 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 +472 -38
- 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 +526 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +283 -233
- package/dist/index.d.ts +283 -233
- package/dist/index.js +526 -44
- package/dist/index.js.map +1 -1
- package/dist/langchain.cjs +472 -38
- 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 +472 -38
- package/dist/langchain.js.map +1 -1
- package/dist/mastra.cjs +472 -38
- 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 +472 -38
- package/dist/mastra.js.map +1 -1
- package/dist/mcp.cjs +474 -40
- 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 +474 -40
- package/dist/mcp.js.map +1 -1
- package/dist/openai.cjs +475 -41
- 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 +475 -41
- package/dist/openai.js.map +1 -1
- package/package.json +10 -10
package/dist/ai-sdk.cjs
CHANGED
|
@@ -43,13 +43,15 @@ var CreateCalendarSchema = import_zod.z.object({
|
|
|
43
43
|
name: import_zod.z.string().describe("Calendar name"),
|
|
44
44
|
timezone: import_zod.z.string().describe('IANA timezone (e.g., "America/New_York")'),
|
|
45
45
|
agent_id: import_zod.z.string().optional().describe("Agent ID to associate the calendar with"),
|
|
46
|
-
|
|
46
|
+
default_reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("Default reminder offsets in minutes before start, inherited by events that don't set their own (e.g. [10, 1440]). null/omit = system default (10 min); [] = no reminders. Max 5, each 1\u201340320."),
|
|
47
|
+
metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Arbitrary key-value metadata")
|
|
47
48
|
});
|
|
48
49
|
var UpdateCalendarSchema = import_zod.z.object({
|
|
49
50
|
calendar_id: import_zod.z.string().describe("The calendar ID to update"),
|
|
50
51
|
name: import_zod.z.string().optional().describe("New calendar name"),
|
|
51
52
|
timezone: import_zod.z.string().optional().describe("New IANA timezone"),
|
|
52
|
-
|
|
53
|
+
default_reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("New default reminder offsets in minutes before start. null = system default (10 min); [] = no reminders. Max 5, each 1\u201340320."),
|
|
54
|
+
metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Updated metadata")
|
|
53
55
|
});
|
|
54
56
|
var DeleteCalendarSchema = import_zod.z.object({
|
|
55
57
|
calendar_id: import_zod.z.string().describe("The calendar ID to delete")
|
|
@@ -76,7 +78,8 @@ var CreateEventSchema = import_zod.z.object({
|
|
|
76
78
|
description: import_zod.z.string().optional().describe("Event description"),
|
|
77
79
|
all_day: import_zod.z.boolean().optional().describe("Whether this is an all-day event"),
|
|
78
80
|
status: import_zod.z.enum(["confirmed", "tentative", "cancelled"]).optional().describe('Event status (default "confirmed")'),
|
|
79
|
-
|
|
81
|
+
reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("Reminder offsets in minutes before start (e.g. [10, 1440]). Each fires an event.reminder webhook. null/omit = inherit calendar default (then 10 min); [] = no reminders. Max 5, each 1\u201340320."),
|
|
82
|
+
metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Arbitrary key-value metadata")
|
|
80
83
|
});
|
|
81
84
|
var UpdateEventSchema = import_zod.z.object({
|
|
82
85
|
calendar_id: import_zod.z.string().describe("Calendar ID the event belongs to"),
|
|
@@ -87,20 +90,145 @@ var UpdateEventSchema = import_zod.z.object({
|
|
|
87
90
|
end_time: import_zod.z.string().optional().describe("New end time in ISO 8601 format"),
|
|
88
91
|
all_day: import_zod.z.boolean().optional().describe("Whether this is an all-day event"),
|
|
89
92
|
status: import_zod.z.enum(["confirmed", "tentative", "cancelled"]).optional().describe("New event status"),
|
|
90
|
-
|
|
93
|
+
reminders: import_zod.z.array(import_zod.z.number().int().min(1).max(40320)).max(5).nullable().optional().describe("New reminder offsets in minutes before start. null = inherit calendar default; [] = no reminders. Max 5, each 1\u201340320."),
|
|
94
|
+
metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Updated metadata")
|
|
91
95
|
});
|
|
92
|
-
var
|
|
93
|
-
calendar_id: import_zod.z.string().describe("Calendar ID the event
|
|
94
|
-
event_id: import_zod.z.string().describe("
|
|
95
|
-
});
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
var CancelEventSchema = import_zod.z.object({
|
|
97
|
+
calendar_id: import_zod.z.string().describe("Calendar ID that owns the event"),
|
|
98
|
+
event_id: import_zod.z.string().describe("Event ID to cancel")
|
|
99
|
+
});
|
|
100
|
+
var ConfirmEventSchema = import_zod.z.object({
|
|
101
|
+
event_id: import_zod.z.string().describe("Event ID of the hold to confirm")
|
|
102
|
+
});
|
|
103
|
+
var ReleaseEventSchema = import_zod.z.object({
|
|
104
|
+
event_id: import_zod.z.string().describe("Event ID of the hold to release")
|
|
105
|
+
});
|
|
106
|
+
var CreateAgentSchema = import_zod.z.object({
|
|
107
|
+
name: import_zod.z.string().min(1).max(255).describe("Display name for the agent"),
|
|
108
|
+
type: import_zod.z.enum(["ai", "human", "resource"]).describe("Agent type"),
|
|
109
|
+
description: import_zod.z.string().optional().describe("Optional description"),
|
|
110
|
+
metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Arbitrary key-value metadata")
|
|
111
|
+
});
|
|
112
|
+
var ListAgentsSchema = import_zod.z.object({
|
|
113
|
+
type: import_zod.z.enum(["ai", "human", "resource"]).optional().describe("Filter by agent type"),
|
|
114
|
+
status: import_zod.z.enum(["active", "paused", "decommissioned"]).optional().describe("Filter by status"),
|
|
115
|
+
limit: import_zod.z.number().int().min(1).max(200).optional().describe("Max results per page (default 50)"),
|
|
116
|
+
offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
|
|
117
|
+
});
|
|
118
|
+
var GetAgentSchema = import_zod.z.object({
|
|
119
|
+
agent_id: import_zod.z.string().describe("Agent ID to fetch")
|
|
120
|
+
});
|
|
121
|
+
var UpdateAgentSchema = import_zod.z.object({
|
|
122
|
+
agent_id: import_zod.z.string().describe("Agent ID to update"),
|
|
123
|
+
name: import_zod.z.string().min(1).max(255).optional().describe("New display name"),
|
|
124
|
+
description: import_zod.z.string().nullable().optional().describe("New description (null to clear)"),
|
|
125
|
+
metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional().describe("Arbitrary metadata (max 16KB)"),
|
|
126
|
+
status: import_zod.z.enum(["active", "paused"]).optional().describe("Operational status")
|
|
127
|
+
});
|
|
128
|
+
var DeleteAgentSchema = import_zod.z.object({
|
|
129
|
+
agent_id: import_zod.z.string().describe("Agent ID to decommission")
|
|
130
|
+
});
|
|
131
|
+
var GetAvailabilitySchema = import_zod.z.object({
|
|
132
|
+
agent_id: import_zod.z.string().describe("Agent ID to check availability for"),
|
|
133
|
+
start: import_zod.z.string().describe("Range start (ISO 8601)"),
|
|
134
|
+
end: import_zod.z.string().describe("Range end (ISO 8601)"),
|
|
135
|
+
slot_duration: import_zod.z.enum(["15m", "30m", "45m", "1h", "2h"]).optional().describe('Minimum slot duration required (default "30m")'),
|
|
102
136
|
include_busy: import_zod.z.boolean().optional().describe("Include busy blocks in response")
|
|
103
137
|
});
|
|
138
|
+
var FindMeetingTimeSchema = import_zod.z.object({
|
|
139
|
+
agents: import_zod.z.array(import_zod.z.string()).min(1).describe("Array of agent IDs to find common free time for. All agents must be free during the returned slots."),
|
|
140
|
+
start: import_zod.z.string().describe("Search range start (ISO 8601)"),
|
|
141
|
+
end: import_zod.z.string().describe("Search range end (ISO 8601)"),
|
|
142
|
+
slot_duration: import_zod.z.enum(["15m", "30m", "45m", "1h", "2h"]).optional().describe('Minimum slot duration required (default "30m")'),
|
|
143
|
+
calendars: import_zod.z.array(import_zod.z.string()).optional().describe("Additional shared calendar IDs to treat as busy"),
|
|
144
|
+
include_busy: import_zod.z.boolean().optional().describe("Include per-agent busy blocks in response")
|
|
145
|
+
});
|
|
146
|
+
var GetCalendarContextSchema = import_zod.z.object({
|
|
147
|
+
calendar_id: import_zod.z.string().describe("Calendar ID")
|
|
148
|
+
});
|
|
149
|
+
var proposalSlotSchema = import_zod.z.object({
|
|
150
|
+
start_time: import_zod.z.string().describe("Slot start (ISO 8601)"),
|
|
151
|
+
end_time: import_zod.z.string().describe("Slot end (ISO 8601)"),
|
|
152
|
+
weight: import_zod.z.number().min(0).max(10).optional().describe("Preference weight (default 1.0)"),
|
|
153
|
+
calendar_id: import_zod.z.string().optional().describe("Override calendar for this slot")
|
|
154
|
+
});
|
|
155
|
+
var CreateProposalSchema = import_zod.z.object({
|
|
156
|
+
title: import_zod.z.string().min(1).max(500).describe("Short description of what the meeting is about"),
|
|
157
|
+
description: import_zod.z.string().max(5e3).optional().describe("Longer context/agenda"),
|
|
158
|
+
organizer_agent_id: import_zod.z.string().describe("Agent ID proposing the meeting"),
|
|
159
|
+
participant_agent_ids: import_zod.z.array(import_zod.z.string()).min(1).max(50).describe("Agent IDs invited to respond"),
|
|
160
|
+
calendar_id: import_zod.z.string().describe("Calendar the resolved event will be created on"),
|
|
161
|
+
slots: import_zod.z.array(proposalSlotSchema).min(1).max(20).describe("Candidate time slots (up to 20)"),
|
|
162
|
+
expires_at: import_zod.z.string().optional().describe("Auto-cancel cutoff if unresolved (ISO 8601)")
|
|
163
|
+
});
|
|
164
|
+
var ListProposalsSchema = import_zod.z.object({
|
|
165
|
+
status: import_zod.z.enum(["pending", "confirmed", "expired", "cancelled"]).optional().describe("Filter by proposal status"),
|
|
166
|
+
organizer_agent_id: import_zod.z.string().optional().describe("Filter by organizer agent"),
|
|
167
|
+
limit: import_zod.z.number().int().min(1).max(200).optional().describe("Max results (default 50)"),
|
|
168
|
+
offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
|
|
169
|
+
});
|
|
170
|
+
var GetProposalSchema = import_zod.z.object({
|
|
171
|
+
proposal_id: import_zod.z.string().describe("Proposal to fetch")
|
|
172
|
+
});
|
|
173
|
+
var RespondToProposalSchema = import_zod.z.object({
|
|
174
|
+
proposal_id: import_zod.z.string().describe("Proposal to respond to"),
|
|
175
|
+
agent_id: import_zod.z.string().describe("Participant agent responding"),
|
|
176
|
+
response: import_zod.z.enum(["accept", "decline", "counter"]).describe("Decision from this agent"),
|
|
177
|
+
selected_slot_id: import_zod.z.string().optional().describe('Required when response is "accept"'),
|
|
178
|
+
counter_slots: import_zod.z.array(proposalSlotSchema).max(20).optional().describe('Alternative slots when response is "counter"'),
|
|
179
|
+
message: import_zod.z.string().max(2e3).optional().describe("Optional note for the organizer")
|
|
180
|
+
});
|
|
181
|
+
var ResolveProposalSchema = import_zod.z.object({
|
|
182
|
+
proposal_id: import_zod.z.string().describe("Proposal to resolve")
|
|
183
|
+
});
|
|
184
|
+
var CancelProposalSchema = import_zod.z.object({
|
|
185
|
+
proposal_id: import_zod.z.string().describe("Proposal to cancel")
|
|
186
|
+
});
|
|
187
|
+
var workingHoursDaySchema = import_zod.z.object({
|
|
188
|
+
start: import_zod.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "must be HH:MM in 24-hour time"),
|
|
189
|
+
end: import_zod.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "must be HH:MM in 24-hour time")
|
|
190
|
+
});
|
|
191
|
+
var workingHoursSchema = import_zod.z.object({
|
|
192
|
+
mon: workingHoursDaySchema.optional(),
|
|
193
|
+
tue: workingHoursDaySchema.optional(),
|
|
194
|
+
wed: workingHoursDaySchema.optional(),
|
|
195
|
+
thu: workingHoursDaySchema.optional(),
|
|
196
|
+
fri: workingHoursDaySchema.optional(),
|
|
197
|
+
sat: workingHoursDaySchema.optional(),
|
|
198
|
+
sun: workingHoursDaySchema.optional()
|
|
199
|
+
}).nullable();
|
|
200
|
+
var SetAvailabilityRulesSchema = import_zod.z.object({
|
|
201
|
+
calendar_id: import_zod.z.string().describe("Calendar to configure"),
|
|
202
|
+
buffer_before_minutes: import_zod.z.number().int().min(0).max(120).optional().describe("Minutes of buffer before each event (0\u2013120)"),
|
|
203
|
+
buffer_after_minutes: import_zod.z.number().int().min(0).max(120).optional().describe("Minutes of buffer after each event (0\u2013120)"),
|
|
204
|
+
working_hours: workingHoursSchema.optional().describe("Per-day working hours map in the calendar's timezone; omit keys for off-days. Pass null to remove any working-hours constraint."),
|
|
205
|
+
timezone: import_zod.z.string().min(1).max(64).optional().describe("IANA timezone used to interpret working_hours (e.g. America/New_York)")
|
|
206
|
+
});
|
|
207
|
+
var GetAvailabilityRulesSchema = import_zod.z.object({
|
|
208
|
+
calendar_id: import_zod.z.string().describe("Calendar to read")
|
|
209
|
+
});
|
|
210
|
+
var ClearAvailabilityRulesSchema = import_zod.z.object({
|
|
211
|
+
calendar_id: import_zod.z.string().describe("Calendar whose rules should be cleared")
|
|
212
|
+
});
|
|
213
|
+
var CreateScopedKeySchema = import_zod.z.object({
|
|
214
|
+
agent_id: import_zod.z.string().regex(/^agt_/).describe("Agent ID this key is scoped to"),
|
|
215
|
+
label: import_zod.z.string().min(1).max(100).optional().describe("Human-readable label for the key")
|
|
216
|
+
});
|
|
217
|
+
var ListScopedKeysSchema = import_zod.z.object({});
|
|
218
|
+
var RevokeScopedKeySchema = import_zod.z.object({
|
|
219
|
+
key_id: import_zod.z.string().describe("ID of the scoped key to revoke")
|
|
220
|
+
});
|
|
221
|
+
var GetAuditLogSchema = import_zod.z.object({
|
|
222
|
+
from: import_zod.z.string().optional().describe("Start of the window (ISO 8601). Silently clamped to the plan retention window if older."),
|
|
223
|
+
to: import_zod.z.string().optional().describe("End of the window (ISO 8601)"),
|
|
224
|
+
action: import_zod.z.string().min(1).max(64).optional().describe("Filter by action name (e.g. event.created)"),
|
|
225
|
+
actor_key_prefix: import_zod.z.string().min(1).max(32).optional().describe("Filter by the API key prefix that performed the action"),
|
|
226
|
+
cursor: import_zod.z.string().min(1).max(256).optional().describe("Opaque pagination cursor from a previous response"),
|
|
227
|
+
limit: import_zod.z.number().int().min(1).max(200).optional().describe("Max results to return (default 50)")
|
|
228
|
+
});
|
|
229
|
+
var AcceptTermsSchema = import_zod.z.object({
|
|
230
|
+
tos_version: import_zod.z.string().min(1).describe("The terms-of-service version to accept; must match the current version")
|
|
231
|
+
});
|
|
104
232
|
var ListWebhooksSchema = import_zod.z.object({
|
|
105
233
|
limit: import_zod.z.number().int().min(1).max(100).optional().describe("Max results per page (default 20)"),
|
|
106
234
|
offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
|
|
@@ -130,11 +258,18 @@ var ListICalSubscriptionsSchema = import_zod.z.object({
|
|
|
130
258
|
var GetICalSubscriptionSchema = import_zod.z.object({
|
|
131
259
|
subscription_id: import_zod.z.string().describe("The iCal subscription ID to retrieve")
|
|
132
260
|
});
|
|
133
|
-
var
|
|
134
|
-
agent_id: import_zod.z.string().describe("Agent ID
|
|
135
|
-
calendar_id: import_zod.z.string().describe("Calendar ID to
|
|
136
|
-
url: import_zod.z.string().describe("HTTPS URL of the iCal feed to subscribe to"),
|
|
137
|
-
label: import_zod.z.string().optional().describe("
|
|
261
|
+
var SubscribeICalSchema = import_zod.z.object({
|
|
262
|
+
agent_id: import_zod.z.string().describe("Agent ID that will own this subscription"),
|
|
263
|
+
calendar_id: import_zod.z.string().describe("Calendar ID to sync external events into"),
|
|
264
|
+
url: import_zod.z.string().url().describe("HTTPS URL of the iCal feed (.ics) to subscribe to"),
|
|
265
|
+
label: import_zod.z.string().optional().describe("Optional label for this subscription")
|
|
266
|
+
});
|
|
267
|
+
var ListWebhookDeliveriesSchema = import_zod.z.object({
|
|
268
|
+
webhook_id: import_zod.z.string().describe("Webhook subscription whose deliveries to list"),
|
|
269
|
+
limit: import_zod.z.number().int().min(1).max(100).optional().describe("Max results to return (default 20)"),
|
|
270
|
+
offset: import_zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)"),
|
|
271
|
+
status: import_zod.z.enum(["pending", "delivered", "failed"]).optional().describe("Filter to a single delivery status"),
|
|
272
|
+
include_payload: import_zod.z.boolean().optional().describe("Include the full event payload sent on each delivery")
|
|
138
273
|
});
|
|
139
274
|
var UpdateICalSubscriptionSchema = import_zod.z.object({
|
|
140
275
|
subscription_id: import_zod.z.string().describe("The iCal subscription ID to update"),
|
|
@@ -187,6 +322,7 @@ var createCalendar = safeFunc(async (ctx) => {
|
|
|
187
322
|
name: params.name,
|
|
188
323
|
timezone: params.timezone,
|
|
189
324
|
agentId: params.agent_id,
|
|
325
|
+
default_reminders: params.default_reminders,
|
|
190
326
|
metadata: params.metadata
|
|
191
327
|
});
|
|
192
328
|
});
|
|
@@ -225,13 +361,99 @@ var updateEvent = safeFunc(async (ctx) => {
|
|
|
225
361
|
const { calendar_id, event_id, ...updates } = params;
|
|
226
362
|
return client.events.update(calendar_id, event_id, updates);
|
|
227
363
|
});
|
|
228
|
-
var
|
|
364
|
+
var cancelEvent = safeFunc(async (ctx) => {
|
|
229
365
|
await ctx.client.events.delete(ctx.params.calendar_id, ctx.params.event_id);
|
|
230
366
|
return void 0;
|
|
231
367
|
});
|
|
232
|
-
var
|
|
368
|
+
var confirmEvent = safeFunc(async (ctx) => {
|
|
369
|
+
return ctx.client.events.confirm(ctx.params.event_id);
|
|
370
|
+
});
|
|
371
|
+
var releaseEvent = safeFunc(async (ctx) => {
|
|
372
|
+
return ctx.client.events.release(ctx.params.event_id);
|
|
373
|
+
});
|
|
374
|
+
var createAgent = safeFunc(async (ctx) => {
|
|
375
|
+
return ctx.client.agents.create(ctx.params);
|
|
376
|
+
});
|
|
377
|
+
var listAgents = safeFunc(async (ctx) => {
|
|
378
|
+
const { client, params } = ctx;
|
|
379
|
+
const iter = client.agents.list({ type: params.type, status: params.status, limit: params.limit });
|
|
380
|
+
return fetchPage(iter, params.offset, params.limit);
|
|
381
|
+
});
|
|
382
|
+
var getAgent = safeFunc(async (ctx) => {
|
|
383
|
+
return ctx.client.agents.get(ctx.params.agent_id);
|
|
384
|
+
});
|
|
385
|
+
var updateAgent = safeFunc(async (ctx) => {
|
|
386
|
+
const { client, params } = ctx;
|
|
387
|
+
const { agent_id, ...updates } = params;
|
|
388
|
+
return client.agents.update(agent_id, updates);
|
|
389
|
+
});
|
|
390
|
+
var deleteAgent = safeFunc(async (ctx) => {
|
|
391
|
+
await ctx.client.agents.delete(ctx.params.agent_id);
|
|
392
|
+
return void 0;
|
|
393
|
+
});
|
|
394
|
+
var getAvailability = safeFunc(async (ctx) => {
|
|
395
|
+
const { client, params } = ctx;
|
|
396
|
+
return client.availability.forAgent(params.agent_id, {
|
|
397
|
+
start: params.start,
|
|
398
|
+
end: params.end,
|
|
399
|
+
slot_duration: params.slot_duration,
|
|
400
|
+
include_busy: params.include_busy
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
var findMeetingTime = safeFunc(async (ctx) => {
|
|
233
404
|
return ctx.client.availability.check(ctx.params);
|
|
234
405
|
});
|
|
406
|
+
var getCalendarContext = safeFunc(async (ctx) => {
|
|
407
|
+
return ctx.client.calendars.getContext(ctx.params.calendar_id);
|
|
408
|
+
});
|
|
409
|
+
var createProposal = safeFunc(async (ctx) => {
|
|
410
|
+
return ctx.client.scheduling.create(ctx.params);
|
|
411
|
+
});
|
|
412
|
+
var listProposals = safeFunc(async (ctx) => {
|
|
413
|
+
const { client, params } = ctx;
|
|
414
|
+
const iter = client.scheduling.list({
|
|
415
|
+
status: params.status,
|
|
416
|
+
organizer_agent_id: params.organizer_agent_id,
|
|
417
|
+
limit: params.limit
|
|
418
|
+
});
|
|
419
|
+
return fetchPage(iter, params.offset, params.limit);
|
|
420
|
+
});
|
|
421
|
+
var getProposal = safeFunc(async (ctx) => {
|
|
422
|
+
return ctx.client.scheduling.get(ctx.params.proposal_id);
|
|
423
|
+
});
|
|
424
|
+
var respondToProposal = safeFunc(async (ctx) => {
|
|
425
|
+
const { client, params } = ctx;
|
|
426
|
+
const { proposal_id, ...body } = params;
|
|
427
|
+
return client.scheduling.respond(proposal_id, body);
|
|
428
|
+
});
|
|
429
|
+
var resolveProposal = safeFunc(async (ctx) => {
|
|
430
|
+
return ctx.client.scheduling.resolve(ctx.params.proposal_id);
|
|
431
|
+
});
|
|
432
|
+
var cancelProposal = safeFunc(async (ctx) => {
|
|
433
|
+
return ctx.client.scheduling.cancel(ctx.params.proposal_id);
|
|
434
|
+
});
|
|
435
|
+
var setAvailabilityRules = safeFunc(async (ctx) => {
|
|
436
|
+
const { client, params } = ctx;
|
|
437
|
+
const { calendar_id, ...rules } = params;
|
|
438
|
+
return client.calendars.setAvailabilityRules(calendar_id, rules);
|
|
439
|
+
});
|
|
440
|
+
var getAvailabilityRules = safeFunc(async (ctx) => {
|
|
441
|
+
return ctx.client.calendars.getAvailabilityRules(ctx.params.calendar_id);
|
|
442
|
+
});
|
|
443
|
+
var clearAvailabilityRules = safeFunc(async (ctx) => {
|
|
444
|
+
await ctx.client.calendars.deleteAvailabilityRules(ctx.params.calendar_id);
|
|
445
|
+
return void 0;
|
|
446
|
+
});
|
|
447
|
+
var createScopedKey = safeFunc(async (ctx) => {
|
|
448
|
+
return ctx.client.keys.create(ctx.params);
|
|
449
|
+
});
|
|
450
|
+
var listScopedKeys = safeFunc(async (ctx) => {
|
|
451
|
+
return ctx.client.keys.list();
|
|
452
|
+
});
|
|
453
|
+
var revokeScopedKey = safeFunc(async (ctx) => {
|
|
454
|
+
await ctx.client.keys.delete(ctx.params.key_id);
|
|
455
|
+
return void 0;
|
|
456
|
+
});
|
|
235
457
|
var listWebhooks = safeFunc(async (ctx) => {
|
|
236
458
|
const { client, params } = ctx;
|
|
237
459
|
const iter = client.webhooks.list({ limit: params.limit });
|
|
@@ -252,6 +474,17 @@ var deleteWebhook = safeFunc(async (ctx) => {
|
|
|
252
474
|
await ctx.client.webhooks.delete(ctx.params.webhook_id);
|
|
253
475
|
return void 0;
|
|
254
476
|
});
|
|
477
|
+
var listWebhookDeliveries = safeFunc(async (ctx) => {
|
|
478
|
+
const { client, params } = ctx;
|
|
479
|
+
const { webhook_id, ...query } = params;
|
|
480
|
+
return client.webhooks.listDeliveries(webhook_id, query);
|
|
481
|
+
});
|
|
482
|
+
var getAuditLog = safeFunc(async (ctx) => {
|
|
483
|
+
return ctx.client.auditLog.list(ctx.params);
|
|
484
|
+
});
|
|
485
|
+
var acceptTerms = safeFunc(async (ctx) => {
|
|
486
|
+
return ctx.client.terms.accept(ctx.params);
|
|
487
|
+
});
|
|
255
488
|
var listICalSubscriptions = safeFunc(async (ctx) => {
|
|
256
489
|
const { client, params } = ctx;
|
|
257
490
|
const iter = client.icalSubscriptions.list({
|
|
@@ -264,7 +497,7 @@ var listICalSubscriptions = safeFunc(async (ctx) => {
|
|
|
264
497
|
var getICalSubscription = safeFunc(async (ctx) => {
|
|
265
498
|
return ctx.client.icalSubscriptions.get(ctx.params.subscription_id);
|
|
266
499
|
});
|
|
267
|
-
var
|
|
500
|
+
var subscribeICal = safeFunc(async (ctx) => {
|
|
268
501
|
const { client, params } = ctx;
|
|
269
502
|
const { agent_id, ...subParams } = params;
|
|
270
503
|
return client.icalSubscriptions.create(agent_id, subParams);
|
|
@@ -295,12 +528,19 @@ var HOSTED_API_MCP_TOOL_NAMES = [
|
|
|
295
528
|
"create_calendar",
|
|
296
529
|
"create_event",
|
|
297
530
|
"list_events",
|
|
531
|
+
"get_event",
|
|
532
|
+
"update_event",
|
|
298
533
|
"get_availability",
|
|
299
534
|
"find_meeting_time",
|
|
300
535
|
"cancel_event",
|
|
301
536
|
"confirm_event",
|
|
302
537
|
"release_event",
|
|
303
538
|
"subscribe_ical",
|
|
539
|
+
"list_ical_subscriptions",
|
|
540
|
+
"get_ical_subscription",
|
|
541
|
+
"update_ical_subscription",
|
|
542
|
+
"delete_ical_subscription",
|
|
543
|
+
"sync_ical_subscription",
|
|
304
544
|
"get_calendar_context",
|
|
305
545
|
"create_proposal",
|
|
306
546
|
"list_proposals",
|
|
@@ -310,7 +550,26 @@ var HOSTED_API_MCP_TOOL_NAMES = [
|
|
|
310
550
|
"cancel_proposal",
|
|
311
551
|
"set_availability_rules",
|
|
312
552
|
"get_availability_rules",
|
|
313
|
-
"clear_availability_rules"
|
|
553
|
+
"clear_availability_rules",
|
|
554
|
+
"create_scoped_key",
|
|
555
|
+
"list_scoped_keys",
|
|
556
|
+
"revoke_scoped_key",
|
|
557
|
+
"create_webhook",
|
|
558
|
+
"list_webhooks",
|
|
559
|
+
"get_webhook",
|
|
560
|
+
"update_webhook",
|
|
561
|
+
"delete_webhook",
|
|
562
|
+
"list_webhook_deliveries",
|
|
563
|
+
"get_agent",
|
|
564
|
+
"update_agent",
|
|
565
|
+
"delete_agent",
|
|
566
|
+
"list_calendars",
|
|
567
|
+
"get_calendar",
|
|
568
|
+
"update_calendar",
|
|
569
|
+
"delete_calendar",
|
|
570
|
+
"get_usage",
|
|
571
|
+
"get_audit_log",
|
|
572
|
+
"accept_terms"
|
|
314
573
|
];
|
|
315
574
|
var TOOL_DEFINITIONS = [
|
|
316
575
|
// ── Calendars ──────────────────────────────────────────────────
|
|
@@ -379,19 +638,149 @@ var TOOL_DEFINITIONS = [
|
|
|
379
638
|
execute: createExecutor(updateEvent)
|
|
380
639
|
},
|
|
381
640
|
{
|
|
382
|
-
name: "
|
|
383
|
-
description: "Delete an event from a calendar.
|
|
384
|
-
schema:
|
|
385
|
-
annotations: { title: "
|
|
386
|
-
execute: createExecutor(
|
|
641
|
+
name: "cancel_event",
|
|
642
|
+
description: "Delete or cancel an event from a calendar. The event is marked cancelled and excluded from future availability calculations.",
|
|
643
|
+
schema: CancelEventSchema,
|
|
644
|
+
annotations: { title: "Cancel Event", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
645
|
+
execute: createExecutor(cancelEvent)
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
name: "confirm_event",
|
|
649
|
+
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.',
|
|
650
|
+
schema: ConfirmEventSchema,
|
|
651
|
+
annotations: { title: "Confirm Event", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
652
|
+
execute: createExecutor(confirmEvent)
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
name: "release_event",
|
|
656
|
+
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.',
|
|
657
|
+
schema: ReleaseEventSchema,
|
|
658
|
+
annotations: { title: "Release Event", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
659
|
+
execute: createExecutor(releaseEvent)
|
|
660
|
+
},
|
|
661
|
+
// ── Agents ─────────────────────────────────────────────────────
|
|
662
|
+
{
|
|
663
|
+
name: "create_agent",
|
|
664
|
+
description: "Register your agent (AI assistant, human participant, or resource) with Chronary so it can own calendars, events, and webhooks.",
|
|
665
|
+
schema: CreateAgentSchema,
|
|
666
|
+
annotations: { title: "Create Agent", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
667
|
+
execute: createExecutor(createAgent)
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
name: "list_agents",
|
|
671
|
+
description: "List all agents in your organization. Returns paginated results.",
|
|
672
|
+
schema: ListAgentsSchema,
|
|
673
|
+
annotations: { title: "List Agents", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
674
|
+
execute: createExecutor(listAgents)
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
name: "get_agent",
|
|
678
|
+
description: "Fetch a single agent by ID. An agent represents an AI assistant, human, or shared resource (e.g. a meeting room).",
|
|
679
|
+
schema: GetAgentSchema,
|
|
680
|
+
annotations: { title: "Get Agent", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
681
|
+
execute: createExecutor(getAgent)
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
name: "update_agent",
|
|
685
|
+
description: "Update an agent's name, description, metadata, or status (active/paused). Requires an org-level API key.",
|
|
686
|
+
schema: UpdateAgentSchema,
|
|
687
|
+
annotations: { title: "Update Agent", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
688
|
+
execute: createExecutor(updateAgent)
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
name: "delete_agent",
|
|
692
|
+
description: "Decommission an agent. This marks the agent as decommissioned and revokes all of its scoped API keys. Requires an org-level API key.",
|
|
693
|
+
schema: DeleteAgentSchema,
|
|
694
|
+
annotations: { title: "Delete Agent", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
695
|
+
execute: createExecutor(deleteAgent)
|
|
387
696
|
},
|
|
388
697
|
// ── Availability ───────────────────────────────────────────────
|
|
389
698
|
{
|
|
390
|
-
name: "
|
|
391
|
-
description: "Check
|
|
392
|
-
schema:
|
|
393
|
-
annotations: { title: "
|
|
394
|
-
execute: createExecutor(
|
|
699
|
+
name: "get_availability",
|
|
700
|
+
description: "Check when a single agent is free within a time range. Returns available time slots and optionally busy blocks.",
|
|
701
|
+
schema: GetAvailabilitySchema,
|
|
702
|
+
annotations: { title: "Get Availability", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
703
|
+
execute: createExecutor(getAvailability)
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
name: "find_meeting_time",
|
|
707
|
+
description: "Find time slots when multiple agents are all free simultaneously. All agents must be free during the returned slots.",
|
|
708
|
+
schema: FindMeetingTimeSchema,
|
|
709
|
+
annotations: { title: "Find Meeting Time", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
710
|
+
execute: createExecutor(findMeetingTime)
|
|
711
|
+
},
|
|
712
|
+
// ── Calendar context ───────────────────────────────────────────
|
|
713
|
+
{
|
|
714
|
+
name: "get_calendar_context",
|
|
715
|
+
description: "Get a calendar's temporal context in a single call: the current event, the next upcoming event, recent past events, a short upcoming window, and the owning agent's status.",
|
|
716
|
+
schema: GetCalendarContextSchema,
|
|
717
|
+
annotations: { title: "Get Calendar Context", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
718
|
+
execute: createExecutor(getCalendarContext)
|
|
719
|
+
},
|
|
720
|
+
// ── Scheduling proposals ───────────────────────────────────────
|
|
721
|
+
{
|
|
722
|
+
name: "create_proposal",
|
|
723
|
+
description: "Create a scheduling proposal \u2014 send candidate time slots to one or more participant agents so they can accept, decline, or counter-propose. Requires an org-level API key. Pro plan only.",
|
|
724
|
+
schema: CreateProposalSchema,
|
|
725
|
+
annotations: { title: "Create Proposal", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
726
|
+
execute: createExecutor(createProposal)
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
name: "list_proposals",
|
|
730
|
+
description: "List scheduling proposals for the org. Filter by status or organizer_agent_id. Requires an org-level API key.",
|
|
731
|
+
schema: ListProposalsSchema,
|
|
732
|
+
annotations: { title: "List Proposals", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
733
|
+
execute: createExecutor(listProposals)
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
name: "get_proposal",
|
|
737
|
+
description: "Get a scheduling proposal by id, including its slots and per-participant responses. Requires an org-level API key.",
|
|
738
|
+
schema: GetProposalSchema,
|
|
739
|
+
annotations: { title: "Get Proposal", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
740
|
+
execute: createExecutor(getProposal)
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
name: "respond_to_proposal",
|
|
744
|
+
description: "Submit a response (accept / decline / counter) on behalf of one participant agent to an open proposal. Requires an org-level API key. Pro plan only.",
|
|
745
|
+
schema: RespondToProposalSchema,
|
|
746
|
+
annotations: { title: "Respond To Proposal", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
747
|
+
execute: createExecutor(respondToProposal)
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
name: "resolve_proposal",
|
|
751
|
+
description: "Force-resolve an open proposal using responses collected so far. Picks the highest-scoring slot and creates a confirmed calendar event. Requires an org-level API key. Pro plan only.",
|
|
752
|
+
schema: ResolveProposalSchema,
|
|
753
|
+
annotations: { title: "Resolve Proposal", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
754
|
+
execute: createExecutor(resolveProposal)
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
name: "cancel_proposal",
|
|
758
|
+
description: 'Cancel an open proposal. Fires a proposal.cancelled webhook with reason="organizer_cancelled". Requires an org-level API key. Pro plan only.',
|
|
759
|
+
schema: CancelProposalSchema,
|
|
760
|
+
annotations: { title: "Cancel Proposal", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
761
|
+
execute: createExecutor(cancelProposal)
|
|
762
|
+
},
|
|
763
|
+
// ── Availability rules ─────────────────────────────────────────
|
|
764
|
+
{
|
|
765
|
+
name: "set_availability_rules",
|
|
766
|
+
description: "Set or replace the availability rules on a calendar \u2014 buffer times before/after events and optional per-day working hours. Upsert: overwrites any existing rules.",
|
|
767
|
+
schema: SetAvailabilityRulesSchema,
|
|
768
|
+
annotations: { title: "Set Availability Rules", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
769
|
+
execute: createExecutor(setAvailabilityRules)
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
name: "get_availability_rules",
|
|
773
|
+
description: "Read the buffer times and working-hours rules configured on a calendar. Returns the rules row, or an error if none are set.",
|
|
774
|
+
schema: GetAvailabilityRulesSchema,
|
|
775
|
+
annotations: { title: "Get Availability Rules", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
776
|
+
execute: createExecutor(getAvailabilityRules)
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
name: "clear_availability_rules",
|
|
780
|
+
description: "Remove the availability rules from a calendar, reverting to the default (no buffers, no working-hours mask).",
|
|
781
|
+
schema: ClearAvailabilityRulesSchema,
|
|
782
|
+
annotations: { title: "Clear Availability Rules", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
783
|
+
execute: createExecutor(clearAvailabilityRules)
|
|
395
784
|
},
|
|
396
785
|
// ── Webhooks ───────────────────────────────────────────────────
|
|
397
786
|
{
|
|
@@ -429,6 +818,13 @@ var TOOL_DEFINITIONS = [
|
|
|
429
818
|
annotations: { title: "Delete Webhook", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
430
819
|
execute: createExecutor(deleteWebhook)
|
|
431
820
|
},
|
|
821
|
+
{
|
|
822
|
+
name: "list_webhook_deliveries",
|
|
823
|
+
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.",
|
|
824
|
+
schema: ListWebhookDeliveriesSchema,
|
|
825
|
+
annotations: { title: "List Webhook Deliveries", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
826
|
+
execute: createExecutor(listWebhookDeliveries)
|
|
827
|
+
},
|
|
432
828
|
// ── iCal Subscriptions ─────────────────────────────────────────
|
|
433
829
|
{
|
|
434
830
|
name: "list_ical_subscriptions",
|
|
@@ -445,11 +841,11 @@ var TOOL_DEFINITIONS = [
|
|
|
445
841
|
execute: createExecutor(getICalSubscription)
|
|
446
842
|
},
|
|
447
843
|
{
|
|
448
|
-
name: "
|
|
449
|
-
description: "
|
|
450
|
-
schema:
|
|
451
|
-
annotations: { title: "
|
|
452
|
-
execute: createExecutor(
|
|
844
|
+
name: "subscribe_ical",
|
|
845
|
+
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. Events are synced every 30 minutes.",
|
|
846
|
+
schema: SubscribeICalSchema,
|
|
847
|
+
annotations: { title: "Subscribe iCal", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
848
|
+
execute: createExecutor(subscribeICal)
|
|
453
849
|
},
|
|
454
850
|
{
|
|
455
851
|
name: "update_ical_subscription",
|
|
@@ -472,6 +868,44 @@ var TOOL_DEFINITIONS = [
|
|
|
472
868
|
annotations: { title: "Sync iCal Subscription", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
473
869
|
execute: createExecutor(syncICalSubscription)
|
|
474
870
|
},
|
|
871
|
+
// ── Scoped keys ────────────────────────────────────────────────
|
|
872
|
+
{
|
|
873
|
+
name: "create_scoped_key",
|
|
874
|
+
description: "Create an agent-scoped API key (chr_ak_*) that can only act on behalf of a single agent. The plaintext key is returned exactly once. Requires an org-level API key.",
|
|
875
|
+
schema: CreateScopedKeySchema,
|
|
876
|
+
annotations: { title: "Create Scoped Key", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
877
|
+
execute: createExecutor(createScopedKey)
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
name: "list_scoped_keys",
|
|
881
|
+
description: "List all live (non-revoked) agent-scoped API keys for this org. Returns key metadata only \u2014 never the plaintext secret. Requires an org-level API key.",
|
|
882
|
+
schema: ListScopedKeysSchema,
|
|
883
|
+
annotations: { title: "List Scoped Keys", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
884
|
+
execute: createExecutor(listScopedKeys)
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
name: "revoke_scoped_key",
|
|
888
|
+
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.",
|
|
889
|
+
schema: RevokeScopedKeySchema,
|
|
890
|
+
annotations: { title: "Revoke Scoped Key", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
891
|
+
execute: createExecutor(revokeScopedKey)
|
|
892
|
+
},
|
|
893
|
+
// ── Audit log ──────────────────────────────────────────────────
|
|
894
|
+
{
|
|
895
|
+
name: "get_audit_log",
|
|
896
|
+
description: "List audit-log entries for the calling org \u2014 mutating operations and auth-lifecycle events, newest first. Results are clamped to the plan's retention window. Requires an org-level API key.",
|
|
897
|
+
schema: GetAuditLogSchema,
|
|
898
|
+
annotations: { title: "Get Audit Log", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
899
|
+
execute: createExecutor(getAuditLog)
|
|
900
|
+
},
|
|
901
|
+
// ── Terms ──────────────────────────────────────────────────────
|
|
902
|
+
{
|
|
903
|
+
name: "accept_terms",
|
|
904
|
+
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. Requires an org-level API key.",
|
|
905
|
+
schema: AcceptTermsSchema,
|
|
906
|
+
annotations: { title: "Accept Terms", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
907
|
+
execute: createExecutor(acceptTerms)
|
|
908
|
+
},
|
|
475
909
|
// ── Usage ──────────────────────────────────────────────────────
|
|
476
910
|
{
|
|
477
911
|
name: "get_usage",
|