@elizaos/plugin-scheduling 2.0.0-alpha.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/LICENSE +21 -0
- package/README.md +204 -0
- package/dist/index.d.ts +403 -0
- package/dist/index.js +1732 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# @elizaos/plugin-scheduling
|
|
2
|
+
|
|
3
|
+
Scheduling and calendar coordination plugin for ElizaOS agents.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multi-party Availability Coordination**: Find meeting times that work for all participants
|
|
8
|
+
- **Time Zone Aware**: Handles availability across different time zones
|
|
9
|
+
- **Calendar Invites**: Generate ICS files for calendar integration
|
|
10
|
+
- **Automated Reminders**: Schedule SMS/email reminders before meetings
|
|
11
|
+
- **Meeting Lifecycle**: Track meetings from proposal to completion
|
|
12
|
+
- **Rescheduling Support**: Handle cancellations and reschedules gracefully
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @elizaos/plugin-scheduling
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { schedulingPlugin } from '@elizaos/plugin-scheduling';
|
|
24
|
+
import { createCharacter } from '@elizaos/core';
|
|
25
|
+
|
|
26
|
+
const character = createCharacter({
|
|
27
|
+
name: 'Scheduler',
|
|
28
|
+
plugins: [schedulingPlugin],
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## API
|
|
33
|
+
|
|
34
|
+
### SchedulingService
|
|
35
|
+
|
|
36
|
+
The core service for managing scheduling operations.
|
|
37
|
+
|
|
38
|
+
#### Save Availability
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
const schedulingService = runtime.getService<SchedulingService>('SCHEDULING');
|
|
42
|
+
|
|
43
|
+
await schedulingService.saveAvailability(entityId, {
|
|
44
|
+
timeZone: 'America/New_York',
|
|
45
|
+
weekly: [
|
|
46
|
+
{ day: 'mon', startMinutes: 540, endMinutes: 1020 }, // 9am-5pm
|
|
47
|
+
{ day: 'tue', startMinutes: 540, endMinutes: 1020 },
|
|
48
|
+
{ day: 'wed', startMinutes: 540, endMinutes: 1020 },
|
|
49
|
+
{ day: 'thu', startMinutes: 540, endMinutes: 1020 },
|
|
50
|
+
{ day: 'fri', startMinutes: 540, endMinutes: 1020 },
|
|
51
|
+
],
|
|
52
|
+
exceptions: [
|
|
53
|
+
{ date: '2024-01-20', unavailable: true, reason: 'Holiday' },
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### Create Scheduling Request
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
const request = await schedulingService.createSchedulingRequest(
|
|
62
|
+
roomId,
|
|
63
|
+
'Coffee Chat',
|
|
64
|
+
[
|
|
65
|
+
{ entityId: user1Id, name: 'Alice', availability: aliceAvailability },
|
|
66
|
+
{ entityId: user2Id, name: 'Bob', availability: bobAvailability },
|
|
67
|
+
],
|
|
68
|
+
{
|
|
69
|
+
minDurationMinutes: 30,
|
|
70
|
+
preferredDurationMinutes: 60,
|
|
71
|
+
maxDaysOut: 7,
|
|
72
|
+
preferredTimes: ['afternoon'],
|
|
73
|
+
locationType: 'in_person',
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Find Available Slots
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
const result = await schedulingService.findAvailableSlots(request);
|
|
82
|
+
|
|
83
|
+
if (result.success) {
|
|
84
|
+
// result.proposedSlots contains ranked time slots
|
|
85
|
+
const bestSlot = result.proposedSlots[0];
|
|
86
|
+
console.log(`Best slot: ${bestSlot.slot.start} - Score: ${bestSlot.score}`);
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Create Meeting
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
const meeting = await schedulingService.createMeeting(request, slot, {
|
|
94
|
+
type: 'in_person',
|
|
95
|
+
name: 'Blue Bottle Coffee',
|
|
96
|
+
address: '123 Main St',
|
|
97
|
+
city: 'San Francisco',
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### Confirm Attendance
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
await schedulingService.confirmParticipant(meetingId, entityId);
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Actions
|
|
108
|
+
|
|
109
|
+
The plugin provides conversational actions:
|
|
110
|
+
|
|
111
|
+
- `SCHEDULE_MEETING`: Start scheduling a meeting
|
|
112
|
+
- `CONFIRM_MEETING`: Confirm or decline attendance
|
|
113
|
+
- `SET_AVAILABILITY`: Update availability preferences
|
|
114
|
+
|
|
115
|
+
### Provider
|
|
116
|
+
|
|
117
|
+
The `SCHEDULING_CONTEXT` provider gives agents context about:
|
|
118
|
+
- Upcoming meetings
|
|
119
|
+
- Pending confirmations
|
|
120
|
+
- User's availability settings
|
|
121
|
+
|
|
122
|
+
## Types
|
|
123
|
+
|
|
124
|
+
### Availability
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
interface Availability {
|
|
128
|
+
timeZone: string; // IANA time zone
|
|
129
|
+
weekly: AvailabilityWindow[]; // Recurring windows
|
|
130
|
+
exceptions: AvailabilityException[]; // One-off changes
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface AvailabilityWindow {
|
|
134
|
+
day: DayOfWeek; // 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun'
|
|
135
|
+
startMinutes: number; // Minutes from midnight (0-1439)
|
|
136
|
+
endMinutes: number; // Minutes from midnight (0-1439)
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Meeting
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
interface Meeting {
|
|
144
|
+
id: string;
|
|
145
|
+
title: string;
|
|
146
|
+
slot: TimeSlot;
|
|
147
|
+
location: MeetingLocation;
|
|
148
|
+
participants: MeetingParticipant[];
|
|
149
|
+
status: MeetingStatus;
|
|
150
|
+
rescheduleCount: number;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
type MeetingStatus =
|
|
154
|
+
| 'proposed'
|
|
155
|
+
| 'confirmed'
|
|
156
|
+
| 'scheduled'
|
|
157
|
+
| 'in_progress'
|
|
158
|
+
| 'completed'
|
|
159
|
+
| 'cancelled'
|
|
160
|
+
| 'rescheduling'
|
|
161
|
+
| 'no_show';
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Configuration
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
const config: SchedulingServiceConfig = {
|
|
168
|
+
defaultReminderMinutes: [1440, 120], // 24h and 2h before
|
|
169
|
+
maxProposals: 3,
|
|
170
|
+
defaultMaxDaysOut: 7,
|
|
171
|
+
minMeetingDuration: 30,
|
|
172
|
+
defaultMeetingDuration: 60,
|
|
173
|
+
autoSendCalendarInvites: true,
|
|
174
|
+
autoScheduleReminders: true,
|
|
175
|
+
};
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Calendar Integration
|
|
179
|
+
|
|
180
|
+
Generate ICS files for calendar apps:
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
import { generateIcs } from '@elizaos/plugin-scheduling';
|
|
184
|
+
|
|
185
|
+
const ics = generateIcs({
|
|
186
|
+
uid: meeting.id,
|
|
187
|
+
title: meeting.title,
|
|
188
|
+
start: meeting.slot.start,
|
|
189
|
+
end: meeting.slot.end,
|
|
190
|
+
timeZone: meeting.slot.timeZone,
|
|
191
|
+
location: meeting.location.address,
|
|
192
|
+
organizer: { name: 'Ori', email: 'ori@soulmates.app' },
|
|
193
|
+
attendees: meeting.participants.map(p => ({
|
|
194
|
+
name: p.name,
|
|
195
|
+
email: p.email,
|
|
196
|
+
role: p.role,
|
|
197
|
+
})),
|
|
198
|
+
reminderMinutes: [1440, 120],
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { UUID, Service, IAgentRuntime, Plugin } from '@elizaos/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @module types
|
|
5
|
+
* @description Type definitions for the scheduling plugin
|
|
6
|
+
*
|
|
7
|
+
* Key concepts:
|
|
8
|
+
* - AvailabilityWindow: A recurring time slot (e.g., "Mondays 9am-5pm")
|
|
9
|
+
* - SchedulingRequest: A request to find a meeting time for multiple participants
|
|
10
|
+
* - Meeting: A scheduled event with time, location, and participants
|
|
11
|
+
* - CalendarEvent: An ICS-compatible event for calendar invites
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
type DayOfWeek = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
|
|
15
|
+
interface AvailabilityWindow {
|
|
16
|
+
day: DayOfWeek;
|
|
17
|
+
/** Minutes from midnight in local time (0-1439) */
|
|
18
|
+
startMinutes: number;
|
|
19
|
+
/** Minutes from midnight in local time (0-1439) */
|
|
20
|
+
endMinutes: number;
|
|
21
|
+
}
|
|
22
|
+
interface AvailabilityException {
|
|
23
|
+
/** ISO date string (YYYY-MM-DD) */
|
|
24
|
+
date: string;
|
|
25
|
+
/** If true, completely unavailable this day */
|
|
26
|
+
unavailable?: boolean;
|
|
27
|
+
/** Override start time for this day */
|
|
28
|
+
startMinutes?: number;
|
|
29
|
+
/** Override end time for this day */
|
|
30
|
+
endMinutes?: number;
|
|
31
|
+
/** Reason for the exception */
|
|
32
|
+
reason?: string;
|
|
33
|
+
}
|
|
34
|
+
interface Availability {
|
|
35
|
+
/** IANA time zone (e.g., "America/New_York") */
|
|
36
|
+
timeZone: string;
|
|
37
|
+
/** Weekly recurring availability */
|
|
38
|
+
weekly: AvailabilityWindow[];
|
|
39
|
+
/** One-off exceptions */
|
|
40
|
+
exceptions: AvailabilityException[];
|
|
41
|
+
}
|
|
42
|
+
interface TimeSlot {
|
|
43
|
+
/** ISO datetime string */
|
|
44
|
+
start: string;
|
|
45
|
+
/** ISO datetime string */
|
|
46
|
+
end: string;
|
|
47
|
+
/** IANA time zone */
|
|
48
|
+
timeZone: string;
|
|
49
|
+
}
|
|
50
|
+
interface Participant {
|
|
51
|
+
/** Entity ID in the system */
|
|
52
|
+
entityId: UUID;
|
|
53
|
+
/** Display name */
|
|
54
|
+
name: string;
|
|
55
|
+
/** Email for calendar invites (optional) */
|
|
56
|
+
email?: string;
|
|
57
|
+
/** Phone for SMS reminders (optional) */
|
|
58
|
+
phone?: string;
|
|
59
|
+
/** Their availability */
|
|
60
|
+
availability: Availability;
|
|
61
|
+
/** Priority weight (higher = more important to accommodate) */
|
|
62
|
+
priority?: number;
|
|
63
|
+
}
|
|
64
|
+
type ParticipantRole = 'organizer' | 'required' | 'optional';
|
|
65
|
+
interface MeetingParticipant {
|
|
66
|
+
entityId: UUID;
|
|
67
|
+
name: string;
|
|
68
|
+
email?: string;
|
|
69
|
+
phone?: string;
|
|
70
|
+
role: ParticipantRole;
|
|
71
|
+
/** Has this participant confirmed attendance? */
|
|
72
|
+
confirmed: boolean;
|
|
73
|
+
/** When they confirmed */
|
|
74
|
+
confirmedAt?: number;
|
|
75
|
+
/** If they declined, why */
|
|
76
|
+
declineReason?: string;
|
|
77
|
+
}
|
|
78
|
+
type LocationType = 'in_person' | 'virtual' | 'phone';
|
|
79
|
+
interface MeetingLocation {
|
|
80
|
+
type: LocationType;
|
|
81
|
+
/** Venue name for in-person meetings */
|
|
82
|
+
name?: string;
|
|
83
|
+
/** Physical address */
|
|
84
|
+
address?: string;
|
|
85
|
+
/** City */
|
|
86
|
+
city?: string;
|
|
87
|
+
/** Google Places ID or similar */
|
|
88
|
+
placeId?: string;
|
|
89
|
+
/** Video call URL for virtual meetings */
|
|
90
|
+
videoUrl?: string;
|
|
91
|
+
/** Phone number for phone meetings */
|
|
92
|
+
phoneNumber?: string;
|
|
93
|
+
/** Additional notes */
|
|
94
|
+
notes?: string;
|
|
95
|
+
}
|
|
96
|
+
type SchedulingUrgency = 'flexible' | 'soon' | 'urgent';
|
|
97
|
+
interface SchedulingConstraints {
|
|
98
|
+
/** Minimum meeting duration in minutes */
|
|
99
|
+
minDurationMinutes: number;
|
|
100
|
+
/** Preferred meeting duration in minutes */
|
|
101
|
+
preferredDurationMinutes: number;
|
|
102
|
+
/** Maximum days in the future to search */
|
|
103
|
+
maxDaysOut: number;
|
|
104
|
+
/** Preferred times of day */
|
|
105
|
+
preferredTimes?: ('morning' | 'afternoon' | 'evening')[];
|
|
106
|
+
/** Preferred days of week */
|
|
107
|
+
preferredDays?: DayOfWeek[];
|
|
108
|
+
/** Location type preference */
|
|
109
|
+
locationType?: LocationType;
|
|
110
|
+
/** Specific location constraint (e.g., "same city") */
|
|
111
|
+
locationConstraint?: string;
|
|
112
|
+
}
|
|
113
|
+
interface SchedulingRequest {
|
|
114
|
+
id: string;
|
|
115
|
+
/** Room/context this scheduling is happening in */
|
|
116
|
+
roomId: UUID;
|
|
117
|
+
/** Meeting title/purpose */
|
|
118
|
+
title: string;
|
|
119
|
+
/** Meeting description */
|
|
120
|
+
description?: string;
|
|
121
|
+
/** All participants who need to attend */
|
|
122
|
+
participants: Participant[];
|
|
123
|
+
/** Scheduling constraints */
|
|
124
|
+
constraints: SchedulingConstraints;
|
|
125
|
+
/** How urgent is this meeting */
|
|
126
|
+
urgency: SchedulingUrgency;
|
|
127
|
+
/** Created timestamp */
|
|
128
|
+
createdAt: number;
|
|
129
|
+
/** Max proposals before escalating */
|
|
130
|
+
maxProposals?: number;
|
|
131
|
+
}
|
|
132
|
+
type MeetingStatus = 'proposed' | 'confirmed' | 'scheduled' | 'in_progress' | 'completed' | 'cancelled' | 'rescheduling' | 'no_show';
|
|
133
|
+
interface Meeting {
|
|
134
|
+
id: string;
|
|
135
|
+
/** Reference to the scheduling request */
|
|
136
|
+
requestId: string;
|
|
137
|
+
/** Room/context */
|
|
138
|
+
roomId: UUID;
|
|
139
|
+
/** Meeting title */
|
|
140
|
+
title: string;
|
|
141
|
+
/** Meeting description */
|
|
142
|
+
description?: string;
|
|
143
|
+
/** Scheduled time slot */
|
|
144
|
+
slot: TimeSlot;
|
|
145
|
+
/** Meeting location */
|
|
146
|
+
location: MeetingLocation;
|
|
147
|
+
/** All participants */
|
|
148
|
+
participants: MeetingParticipant[];
|
|
149
|
+
/** Current status */
|
|
150
|
+
status: MeetingStatus;
|
|
151
|
+
/** Number of times rescheduled */
|
|
152
|
+
rescheduleCount: number;
|
|
153
|
+
/** If cancelled/rescheduled, why */
|
|
154
|
+
cancellationReason?: string;
|
|
155
|
+
/** Created timestamp */
|
|
156
|
+
createdAt: number;
|
|
157
|
+
/** Last updated timestamp */
|
|
158
|
+
updatedAt: number;
|
|
159
|
+
/** Meeting notes/agenda */
|
|
160
|
+
notes?: string;
|
|
161
|
+
/** Metadata */
|
|
162
|
+
meta?: Record<string, unknown>;
|
|
163
|
+
}
|
|
164
|
+
interface CalendarEvent {
|
|
165
|
+
/** Unique event ID */
|
|
166
|
+
uid: string;
|
|
167
|
+
/** Event title */
|
|
168
|
+
title: string;
|
|
169
|
+
/** Event description */
|
|
170
|
+
description?: string;
|
|
171
|
+
/** Start time (ISO string) */
|
|
172
|
+
start: string;
|
|
173
|
+
/** End time (ISO string) */
|
|
174
|
+
end: string;
|
|
175
|
+
/** IANA time zone */
|
|
176
|
+
timeZone: string;
|
|
177
|
+
/** Location */
|
|
178
|
+
location?: string;
|
|
179
|
+
/** Organizer */
|
|
180
|
+
organizer?: {
|
|
181
|
+
name: string;
|
|
182
|
+
email: string;
|
|
183
|
+
};
|
|
184
|
+
/** Attendees */
|
|
185
|
+
attendees?: Array<{
|
|
186
|
+
name: string;
|
|
187
|
+
email: string;
|
|
188
|
+
role: ParticipantRole;
|
|
189
|
+
}>;
|
|
190
|
+
/** URL to join (for virtual meetings) */
|
|
191
|
+
url?: string;
|
|
192
|
+
/** Reminder minutes before event */
|
|
193
|
+
reminderMinutes?: number[];
|
|
194
|
+
}
|
|
195
|
+
interface CalendarInvite {
|
|
196
|
+
/** The ICS file content */
|
|
197
|
+
ics: string;
|
|
198
|
+
/** Parsed event data */
|
|
199
|
+
event: CalendarEvent;
|
|
200
|
+
/** Recipient email */
|
|
201
|
+
recipientEmail: string;
|
|
202
|
+
/** Recipient name */
|
|
203
|
+
recipientName: string;
|
|
204
|
+
}
|
|
205
|
+
type ReminderType = 'sms' | 'email' | 'whatsapp' | 'push';
|
|
206
|
+
type ReminderStatus = 'pending' | 'sent' | 'failed' | 'cancelled';
|
|
207
|
+
interface Reminder {
|
|
208
|
+
id: string;
|
|
209
|
+
/** Meeting this reminder is for */
|
|
210
|
+
meetingId: string;
|
|
211
|
+
/** Participant to remind */
|
|
212
|
+
participantId: UUID;
|
|
213
|
+
/** When to send (ISO string) */
|
|
214
|
+
scheduledFor: string;
|
|
215
|
+
/** Reminder channel */
|
|
216
|
+
type: ReminderType;
|
|
217
|
+
/** Reminder message */
|
|
218
|
+
message: string;
|
|
219
|
+
/** Current status */
|
|
220
|
+
status: ReminderStatus;
|
|
221
|
+
/** When it was sent */
|
|
222
|
+
sentAt?: number;
|
|
223
|
+
/** Error if failed */
|
|
224
|
+
error?: string;
|
|
225
|
+
/** Created timestamp */
|
|
226
|
+
createdAt: number;
|
|
227
|
+
}
|
|
228
|
+
interface ProposedSlot {
|
|
229
|
+
slot: TimeSlot;
|
|
230
|
+
/** Score indicating how good this slot is (higher = better) */
|
|
231
|
+
score: number;
|
|
232
|
+
/** Why this slot was chosen */
|
|
233
|
+
reasons: string[];
|
|
234
|
+
/** Any concerns about this slot */
|
|
235
|
+
concerns: string[];
|
|
236
|
+
}
|
|
237
|
+
interface SchedulingResult {
|
|
238
|
+
/** Whether scheduling was successful */
|
|
239
|
+
success: boolean;
|
|
240
|
+
/** Proposed time slots, ranked by preference */
|
|
241
|
+
proposedSlots: ProposedSlot[];
|
|
242
|
+
/** If no slots found, why */
|
|
243
|
+
failureReason?: string;
|
|
244
|
+
/** Participants who have no availability overlap */
|
|
245
|
+
conflictingParticipants?: UUID[];
|
|
246
|
+
}
|
|
247
|
+
interface SchedulingServiceConfig {
|
|
248
|
+
/** Default reminder times (minutes before meeting) */
|
|
249
|
+
defaultReminderMinutes: number[];
|
|
250
|
+
/** Maximum proposals per scheduling request */
|
|
251
|
+
maxProposals: number;
|
|
252
|
+
/** How many days out to look for availability */
|
|
253
|
+
defaultMaxDaysOut: number;
|
|
254
|
+
/** Minimum meeting duration in minutes */
|
|
255
|
+
minMeetingDuration: number;
|
|
256
|
+
/** Default meeting duration in minutes */
|
|
257
|
+
defaultMeetingDuration: number;
|
|
258
|
+
/** Whether to auto-send calendar invites */
|
|
259
|
+
autoSendCalendarInvites: boolean;
|
|
260
|
+
/** Whether to auto-schedule reminders */
|
|
261
|
+
autoScheduleReminders: boolean;
|
|
262
|
+
}
|
|
263
|
+
declare const DEFAULT_CONFIG: SchedulingServiceConfig;
|
|
264
|
+
|
|
265
|
+
/** Core scheduling service for multi-party coordination, availability intersection, and calendar management */
|
|
266
|
+
|
|
267
|
+
declare class SchedulingService extends Service {
|
|
268
|
+
static serviceType: string;
|
|
269
|
+
capabilityDescription: string;
|
|
270
|
+
private schedulingConfig;
|
|
271
|
+
constructor(runtime?: IAgentRuntime, schedulingConfig?: Partial<SchedulingServiceConfig>);
|
|
272
|
+
static start(runtime: IAgentRuntime): Promise<Service>;
|
|
273
|
+
stop(): Promise<void>;
|
|
274
|
+
healthCheck(): Promise<{
|
|
275
|
+
healthy: boolean;
|
|
276
|
+
issues: string[];
|
|
277
|
+
}>;
|
|
278
|
+
getSchedulingConfig(): SchedulingServiceConfig;
|
|
279
|
+
saveAvailability(entityId: UUID, availability: Availability): Promise<void>;
|
|
280
|
+
getAvailability(entityId: UUID): Promise<Availability | null>;
|
|
281
|
+
isAvailableAt(availability: Availability, dateTime: Date): boolean;
|
|
282
|
+
createSchedulingRequest(roomId: UUID, title: string, participants: Participant[], constraints?: Partial<SchedulingConstraints>, options?: {
|
|
283
|
+
description?: string;
|
|
284
|
+
urgency?: 'flexible' | 'soon' | 'urgent';
|
|
285
|
+
}): Promise<SchedulingRequest>;
|
|
286
|
+
findAvailableSlots(request: SchedulingRequest): Promise<SchedulingResult>;
|
|
287
|
+
private findDayIntersection;
|
|
288
|
+
private findConflictingParticipants;
|
|
289
|
+
private hasAnyOverlap;
|
|
290
|
+
private scoreSlot;
|
|
291
|
+
createMeeting(request: SchedulingRequest, slot: TimeSlot, location: {
|
|
292
|
+
type: 'in_person' | 'virtual' | 'phone';
|
|
293
|
+
name?: string;
|
|
294
|
+
address?: string;
|
|
295
|
+
city?: string;
|
|
296
|
+
videoUrl?: string;
|
|
297
|
+
phoneNumber?: string;
|
|
298
|
+
notes?: string;
|
|
299
|
+
}): Promise<Meeting>;
|
|
300
|
+
getMeeting(meetingId: string): Promise<Meeting | null>;
|
|
301
|
+
getMeetingsForRoom(roomId: UUID): Promise<Meeting[]>;
|
|
302
|
+
getUpcomingMeetings(entityId: UUID): Promise<Meeting[]>;
|
|
303
|
+
confirmParticipant(meetingId: string, entityId: UUID): Promise<Meeting>;
|
|
304
|
+
declineParticipant(meetingId: string, entityId: UUID, reason?: string): Promise<Meeting>;
|
|
305
|
+
cancelMeeting(meetingId: string, reason?: string): Promise<Meeting>;
|
|
306
|
+
updateMeetingStatus(meetingId: string, status: MeetingStatus): Promise<Meeting>;
|
|
307
|
+
rescheduleMeeting(meetingId: string, newSlot: TimeSlot, reason?: string): Promise<Meeting>;
|
|
308
|
+
generateCalendarInvite(meeting: Meeting, recipientEmail: string, recipientName: string): CalendarInvite;
|
|
309
|
+
/** Sends invites via EMAIL service if available, otherwise returns ICS for manual handling */
|
|
310
|
+
sendCalendarInvites(meeting: Meeting): Promise<CalendarInvite[]>;
|
|
311
|
+
private formatInviteEmail;
|
|
312
|
+
scheduleReminders(meeting: Meeting): Promise<Reminder[]>;
|
|
313
|
+
getDueReminders(): Promise<Reminder[]>;
|
|
314
|
+
markReminderSent(reminderId: string): Promise<void>;
|
|
315
|
+
cancelReminders(meetingId: string): Promise<void>;
|
|
316
|
+
formatSlot(slot: TimeSlot, locale?: string): string;
|
|
317
|
+
getConfig(): SchedulingServiceConfig;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @module ical
|
|
322
|
+
* @description ICS (iCalendar) file generation utilities
|
|
323
|
+
*
|
|
324
|
+
* Generates RFC 5545 compliant iCalendar files for calendar invites.
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Generate ICS content for a calendar event
|
|
329
|
+
*/
|
|
330
|
+
declare const generateIcs: (event: CalendarEvent) => string;
|
|
331
|
+
/**
|
|
332
|
+
* Parse an ICS file and extract events (basic parser)
|
|
333
|
+
*/
|
|
334
|
+
declare const parseIcs: (ics: string) => CalendarEvent[];
|
|
335
|
+
|
|
336
|
+
/** Component-based persistence for scheduling data using ElizaOS Components */
|
|
337
|
+
|
|
338
|
+
interface AvailabilityStorage {
|
|
339
|
+
get(entityId: UUID): Promise<Availability | null>;
|
|
340
|
+
save(entityId: UUID, availability: Availability): Promise<void>;
|
|
341
|
+
delete(entityId: UUID): Promise<void>;
|
|
342
|
+
}
|
|
343
|
+
declare const getAvailabilityStorage: (runtime: IAgentRuntime) => AvailabilityStorage;
|
|
344
|
+
interface SchedulingRequestStorage {
|
|
345
|
+
get(requestId: string): Promise<SchedulingRequest | null>;
|
|
346
|
+
save(request: SchedulingRequest): Promise<void>;
|
|
347
|
+
delete(requestId: string): Promise<void>;
|
|
348
|
+
getByRoom(roomId: UUID): Promise<SchedulingRequest[]>;
|
|
349
|
+
}
|
|
350
|
+
declare const getSchedulingRequestStorage: (runtime: IAgentRuntime) => SchedulingRequestStorage;
|
|
351
|
+
interface MeetingStorage {
|
|
352
|
+
get(meetingId: string): Promise<Meeting | null>;
|
|
353
|
+
save(meeting: Meeting): Promise<void>;
|
|
354
|
+
delete(meetingId: string): Promise<void>;
|
|
355
|
+
getByRoom(roomId: UUID): Promise<Meeting[]>;
|
|
356
|
+
getUpcomingForParticipant(entityId: UUID): Promise<Meeting[]>;
|
|
357
|
+
}
|
|
358
|
+
declare const getMeetingStorage: (runtime: IAgentRuntime) => MeetingStorage;
|
|
359
|
+
interface ReminderStorage {
|
|
360
|
+
get(reminderId: string): Promise<Reminder | null>;
|
|
361
|
+
save(reminder: Reminder): Promise<void>;
|
|
362
|
+
delete(reminderId: string): Promise<void>;
|
|
363
|
+
getByMeeting(meetingId: string): Promise<Reminder[]>;
|
|
364
|
+
getDue(): Promise<Reminder[]>;
|
|
365
|
+
}
|
|
366
|
+
declare const getReminderStorage: (runtime: IAgentRuntime) => ReminderStorage;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* @module plugin-scheduling
|
|
370
|
+
* @description ElizaOS plugin for scheduling and calendar coordination
|
|
371
|
+
*
|
|
372
|
+
* This plugin provides:
|
|
373
|
+
* - Multi-party availability coordination
|
|
374
|
+
* - Meeting scheduling with time slot proposals
|
|
375
|
+
* - Calendar invite generation (ICS format)
|
|
376
|
+
* - Automated reminders
|
|
377
|
+
* - Rescheduling and cancellation handling
|
|
378
|
+
*
|
|
379
|
+
* Key features:
|
|
380
|
+
* - Time zone aware scheduling
|
|
381
|
+
* - Preference-based slot scoring
|
|
382
|
+
* - Integration with form plugin for conversational scheduling
|
|
383
|
+
*/
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Scheduling plugin for ElizaOS
|
|
387
|
+
*
|
|
388
|
+
* Provides scheduling capabilities for coordinating meetings
|
|
389
|
+
* between multiple participants.
|
|
390
|
+
*
|
|
391
|
+
* Usage:
|
|
392
|
+
* ```typescript
|
|
393
|
+
* import { schedulingPlugin } from '@elizaos/plugin-scheduling';
|
|
394
|
+
*
|
|
395
|
+
* const character = createCharacter({
|
|
396
|
+
* name: 'Scheduler',
|
|
397
|
+
* plugins: [schedulingPlugin],
|
|
398
|
+
* });
|
|
399
|
+
* ```
|
|
400
|
+
*/
|
|
401
|
+
declare const schedulingPlugin: Plugin;
|
|
402
|
+
|
|
403
|
+
export { type Availability, type AvailabilityException, type AvailabilityStorage, type AvailabilityWindow, type CalendarEvent, type CalendarInvite, DEFAULT_CONFIG, type DayOfWeek, type LocationType, type Meeting, type MeetingLocation, type MeetingParticipant, type MeetingStatus, type MeetingStorage, type Participant, type ParticipantRole, type ProposedSlot, type Reminder, type ReminderStatus, type ReminderStorage, type ReminderType, type SchedulingConstraints, type SchedulingRequest, type SchedulingRequestStorage, type SchedulingResult, SchedulingService, type SchedulingServiceConfig, type SchedulingUrgency, type TimeSlot, schedulingPlugin as default, generateIcs, getAvailabilityStorage, getMeetingStorage, getReminderStorage, getSchedulingRequestStorage, parseIcs, schedulingPlugin };
|