@macro-inc/sdk 0.2.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -3
- package/dist/{chunk-OGE7WXJE.js → chunk-AZJUIUIV.js} +177 -23
- package/dist/{chunk-PRUFPW3B.js → chunk-G43PLP2U.js} +144 -0
- package/dist/{chunk-7LVVPVNT.js → chunk-K4G5VO4P.js} +76 -1
- package/dist/{chunk-PAAFJYGO.js → chunk-PPR7IWZ7.js} +77 -51
- package/dist/{chunk-QVBNNMQS.js → chunk-PTX2RV2N.js} +169 -20
- package/dist/{chunk-SUINKDXF.js → chunk-PZPTJI6F.js} +42 -0
- package/dist/{chunk-7YJ6Y7HJ.js → chunk-XFA7NCJ5.js} +207 -0
- package/dist/{chunk-ZQXOHNDB.js → chunk-ZLBDES7U.js} +789 -12
- package/dist/generated/agent-fold/index.d.ts +4332 -0
- package/dist/generated/agent-fold/index.js +0 -0
- package/dist/generated/agent-harness/index.d.ts +1 -1
- package/dist/generated/agent-harness/index.js +1 -1
- package/dist/generated/agent-harness/sdk.gen.d.ts +83 -9
- package/dist/generated/agent-harness/types.gen.d.ts +1504 -160
- package/dist/generated/agent-reviews/index.d.ts +893 -0
- package/dist/generated/agent-reviews/index.js +0 -0
- package/dist/generated/auth/index.d.ts +1 -1
- package/dist/generated/auth/index.js +1 -1
- package/dist/generated/auth/sdk.gen.d.ts +108 -2
- package/dist/generated/auth/types.gen.d.ts +799 -6
- package/dist/generated/calendar/index.d.ts +1 -1
- package/dist/generated/calendar/index.js +1 -1
- package/dist/generated/calendar/sdk.gen.d.ts +63 -1
- package/dist/generated/calendar/types.gen.d.ts +1234 -5
- package/dist/generated/cognition/index.d.ts +1 -1
- package/dist/generated/cognition/index.js +1 -1
- package/dist/generated/cognition/sdk.gen.d.ts +85 -20
- package/dist/generated/cognition/types.gen.d.ts +1040 -121
- package/dist/generated/connection/index.d.ts +1 -1
- package/dist/generated/connection/index.js +15 -0
- package/dist/generated/connection/sdk.gen.d.ts +6 -1
- package/dist/generated/connection/types.gen.d.ts +18 -1
- package/dist/generated/email/index.d.ts +1 -1
- package/dist/generated/email/index.js +1 -1
- package/dist/generated/email/sdk.gen.d.ts +44 -2
- package/dist/generated/email/types.gen.d.ts +475 -10
- package/dist/generated/notification/index.d.ts +1 -1
- package/dist/generated/notification/index.js +1 -1
- package/dist/generated/notification/sdk.gen.d.ts +29 -21
- package/dist/generated/notification/types.gen.d.ts +267 -73
- package/dist/generated/properties/index.d.ts +1 -1
- package/dist/generated/properties/types.gen.d.ts +21 -1
- package/dist/generated/scheduled-action/index.d.ts +1 -1
- package/dist/generated/scheduled-action/index.js +1 -1
- package/dist/generated/scheduled-action/sdk.gen.d.ts +8 -1
- package/dist/generated/scheduled-action/types.gen.d.ts +669 -19
- package/dist/generated/search/index.d.ts +1 -1
- package/dist/generated/search/types.gen.d.ts +87 -7
- package/dist/generated/static-files/types.gen.d.ts +6 -0
- package/dist/generated/storage/index.d.ts +1 -1
- package/dist/generated/storage/index.js +1 -1
- package/dist/generated/storage/sdk.gen.d.ts +376 -13
- package/dist/generated/storage/types.gen.d.ts +12038 -5562
- package/dist/src/entities/account-managers/grant.d.ts +39 -0
- package/dist/src/entities/account-managers/namespace.d.ts +17 -0
- package/dist/src/entities/agent-sessions/activity.d.ts +39 -0
- package/dist/src/entities/agent-sessions/agent-session.d.ts +148 -6
- package/dist/src/entities/agent-sessions/code-execution.d.ts +5 -0
- package/dist/src/entities/agent-sessions/namespace.d.ts +54 -4
- package/dist/src/entities/agent-sessions/origin.d.ts +94 -0
- package/dist/src/entities/agent-sessions/review.d.ts +18 -62
- package/dist/src/entities/agent-sessions/view.d.ts +11 -0
- package/dist/src/entities/agents/namespace.d.ts +11 -2
- package/dist/src/entities/ai/namespace.d.ts +5 -1
- package/dist/src/entities/api-keys/namespace.d.ts +5 -1
- package/dist/src/entities/bots/bot.d.ts +108 -0
- package/dist/src/entities/bots/namespace.d.ts +17 -4
- package/dist/src/entities/bots/token.d.ts +34 -0
- package/dist/src/entities/calendar/booking-link.d.ts +49 -0
- package/dist/src/entities/calendar/booking-namespace.d.ts +130 -0
- package/dist/src/entities/calendar/booking-namespace.test.d.ts +1 -0
- package/dist/src/entities/calendar/booking.d.ts +77 -0
- package/dist/src/entities/calendar/calendar.d.ts +11 -4
- package/dist/src/entities/calendar/create-confirmed.test.d.ts +1 -0
- package/dist/src/entities/calendar/event.d.ts +104 -3
- package/dist/src/entities/calendar/namespace.d.ts +151 -7
- package/dist/src/entities/calendar/namespace.test.d.ts +1 -0
- package/dist/src/entities/calls/call-record.d.ts +34 -4
- package/dist/src/entities/calls/connection.d.ts +53 -0
- package/dist/src/entities/calls/errors.d.ts +15 -0
- package/dist/src/entities/calls/namespace.d.ts +21 -1
- package/dist/src/entities/calls/participant.d.ts +22 -0
- package/dist/src/entities/channels/access-request.d.ts +34 -0
- package/dist/src/entities/channels/channel.d.ts +47 -1
- package/dist/src/entities/channels/namespace.d.ts +21 -5
- package/dist/src/entities/channels/namespace.test.d.ts +1 -0
- package/dist/src/entities/channels/post.d.ts +14 -3
- package/dist/src/entities/channels/thread.d.ts +10 -1
- package/dist/src/entities/chats/chat.d.ts +7 -1
- package/dist/src/entities/chats/namespace.d.ts +14 -1
- package/dist/src/entities/connected-apps/connected-app.d.ts +107 -0
- package/dist/src/entities/connected-apps/connector.d.ts +56 -0
- package/dist/src/entities/connected-apps/namespace.d.ts +74 -0
- package/dist/src/entities/crm/company.d.ts +7 -3
- package/dist/src/entities/crm/contact.d.ts +4 -4
- package/dist/src/entities/crm/namespace.d.ts +34 -1
- package/dist/src/entities/crm/pipeline.d.ts +43 -2
- package/dist/src/entities/databases/database.d.ts +17 -0
- package/dist/src/entities/databases/namespace.d.ts +56 -0
- package/dist/src/entities/documents/ai-edit.d.ts +52 -0
- package/dist/src/entities/documents/document.d.ts +244 -5
- package/dist/src/entities/documents/namespace.d.ts +89 -4
- package/dist/src/entities/documents/office-files.d.ts +47 -0
- package/dist/src/entities/email/draft.d.ts +36 -7
- package/dist/src/entities/email/message.d.ts +99 -3
- package/dist/src/entities/email/namespace.d.ts +47 -4
- package/dist/src/entities/email/namespace.test.d.ts +1 -0
- package/dist/src/entities/email/thread.d.ts +55 -3
- package/dist/src/entities/entity-mentions/namespace.d.ts +5 -1
- package/dist/src/entities/external-chat/chat.d.ts +105 -0
- package/dist/src/entities/external-chat/message.d.ts +54 -0
- package/dist/src/entities/external-chat/namespace.d.ts +18 -0
- package/dist/src/entities/external-chat/participant.d.ts +28 -0
- package/dist/src/entities/external-chat/send.d.ts +32 -0
- package/dist/src/entities/external-chat/upload.d.ts +25 -0
- package/dist/src/entities/favorites/namespace.d.ts +5 -1
- package/dist/src/entities/foreign/namespace.d.ts +3 -0
- package/dist/src/entities/forms/form.d.ts +17 -2
- package/dist/src/entities/forms/namespace.d.ts +5 -1
- package/dist/src/entities/github-pull-requests/namespace.d.ts +5 -1
- package/dist/src/entities/harnesses/harness.d.ts +9 -0
- package/dist/src/entities/harnesses/namespace.d.ts +5 -1
- package/dist/src/entities/images/image.d.ts +77 -0
- package/dist/src/entities/images/namespace.d.ts +48 -0
- package/dist/src/entities/images/namespace.test.d.ts +1 -0
- package/dist/src/entities/initiatives/initiative.d.ts +12 -1
- package/dist/src/entities/initiatives/namespace.d.ts +15 -2
- package/dist/src/entities/me/namespace.d.ts +43 -0
- package/dist/src/entities/meetings/meeting.d.ts +5 -0
- package/dist/src/entities/meetings/namespace.d.ts +5 -1
- package/dist/src/entities/messages/thread.d.ts +1 -1
- package/dist/src/entities/notifications/namespace.d.ts +3 -0
- package/dist/src/entities/pins/namespace.d.ts +5 -1
- package/dist/src/entities/projects/namespace.d.ts +4 -1
- package/dist/src/entities/projects/project.d.ts +9 -1
- package/dist/src/entities/properties/namespace.d.ts +2 -0
- package/dist/src/entities/referrals/namespace.d.ts +33 -0
- package/dist/src/entities/routines/namespace.d.ts +42 -2
- package/dist/src/entities/routines/routine.d.ts +84 -5
- package/dist/src/entities/search/namespace.d.ts +65 -0
- package/dist/src/entities/{search.d.ts → search/options.d.ts} +8 -2
- package/dist/src/entities/search/types.d.ts +90 -0
- package/dist/src/entities/sharing/access.d.ts +14 -0
- package/dist/src/entities/tasks/namespace.d.ts +42 -3
- package/dist/src/entities/tasks/task.d.ts +47 -6
- package/dist/src/entities/teams/invite.d.ts +30 -0
- package/dist/src/entities/teams/namespace.d.ts +3 -0
- package/dist/src/entities/teams/team.d.ts +37 -0
- package/dist/src/entities/unfurls/namespace.d.ts +5 -1
- package/dist/src/entities/users/namespace.d.ts +9 -0
- package/dist/src/entities/users/user.d.ts +8 -0
- package/dist/src/entities/web/namespace.d.ts +61 -0
- package/dist/src/entities/web/namespace.test.d.ts +1 -0
- package/dist/src/entities/webhooks/namespace.d.ts +2 -0
- package/dist/src/entities/whatsapp/account.d.ts +20 -0
- package/dist/src/entities/whatsapp/chat.d.ts +54 -0
- package/dist/src/entities/whatsapp/namespace.d.ts +23 -0
- package/dist/src/entities/workspace/items.d.ts +7 -0
- package/dist/src/entities/workspace/namespace.d.ts +14 -9
- package/dist/src/entities/workspace/query.d.ts +23 -0
- package/dist/src/entities/workspace/types.d.ts +6 -3
- package/dist/src/events/hydrate/agentSession.d.ts +1 -1
- package/dist/src/events/hydrate/call.d.ts +101 -0
- package/dist/src/events/hydrate/channel.d.ts +8 -1
- package/dist/src/events/hydrate/document.d.ts +1 -1
- package/dist/src/events/hydrate/message.d.ts +1 -1
- package/dist/src/events/types.d.ts +2 -1
- package/dist/src/macro.d.ts +73 -4
- package/dist/src/macro.js +8235 -3701
- package/dist/src/mentions.d.ts +6 -1
- package/dist/src/utils/activity.d.ts +23 -2
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/unwrap.d.ts +27 -2
- package/package.json +2 -2
|
@@ -0,0 +1,893 @@
|
|
|
1
|
+
/** An attendee supplied to a calendar tool. */
|
|
2
|
+
export type AttendeeInput = {
|
|
3
|
+
/** Attendee email address. */
|
|
4
|
+
email: EmailAddress;
|
|
5
|
+
/** Whether attendance is optional. */
|
|
6
|
+
isOptional?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/** How an out-of-office event handles conflicting invitations. */
|
|
9
|
+
export type AutoDeclineModeInput =
|
|
10
|
+
/** Leave conflicting invitations alone. */
|
|
11
|
+
"decline_none" |
|
|
12
|
+
/** Decline every conflicting invitation, existing and new. */
|
|
13
|
+
"decline_all" |
|
|
14
|
+
/** Decline only invitations that arrive after the event is created. */
|
|
15
|
+
"decline_new_only";
|
|
16
|
+
/** The kind of event a create tool call makes. */
|
|
17
|
+
export type CalendarEventTypeInput =
|
|
18
|
+
/** A regular calendar event. */
|
|
19
|
+
"default" |
|
|
20
|
+
/**
|
|
21
|
+
* A Google out-of-office status event: primary calendar only, timed, no
|
|
22
|
+
* attendees, and Google shows the user as away and can auto-decline
|
|
23
|
+
* conflicting invitations.
|
|
24
|
+
*/
|
|
25
|
+
"out_of_office";
|
|
26
|
+
/** Create a calendar event. */
|
|
27
|
+
export type CreateCalendarEvent = CreateCalendarEvent_Serialize | CreateCalendarEvent_Deserialize;
|
|
28
|
+
/** Create a calendar event. */
|
|
29
|
+
export type CreateCalendarEvent_Deserialize = {
|
|
30
|
+
/** Display title. */
|
|
31
|
+
title: string;
|
|
32
|
+
/** Timed or all-day span. */
|
|
33
|
+
time: EventTimeInput;
|
|
34
|
+
/** Optional event body. */
|
|
35
|
+
description?: string | null;
|
|
36
|
+
/** Optional location label. */
|
|
37
|
+
location?: string | null;
|
|
38
|
+
/** Attendees to invite. */
|
|
39
|
+
attendees?: AttendeeInput[];
|
|
40
|
+
/** Recurrence properties. */
|
|
41
|
+
recurrenceLines?: string[];
|
|
42
|
+
/** Calendar to create the event on. */
|
|
43
|
+
calendarId?: string | null;
|
|
44
|
+
/** Reminder configuration. */
|
|
45
|
+
reminders?: EventRemindersInput | null;
|
|
46
|
+
/** Whether to attach a Macro meeting link. */
|
|
47
|
+
addMacroCall?: boolean;
|
|
48
|
+
/** Kind of event to create. */
|
|
49
|
+
eventType?: CalendarEventTypeInput;
|
|
50
|
+
/** Out-of-office decline behavior. */
|
|
51
|
+
outOfOffice?: OutOfOfficeInput | null;
|
|
52
|
+
/** What guests may do with the event. */
|
|
53
|
+
guestPolicy?: GuestPolicy | null;
|
|
54
|
+
} & {
|
|
55
|
+
/** Whether to attach the calendar provider's meeting conference. */
|
|
56
|
+
addConference?: boolean;
|
|
57
|
+
} | {
|
|
58
|
+
/** Whether to attach the calendar provider's meeting conference. */
|
|
59
|
+
addGoogleMeet?: boolean;
|
|
60
|
+
};
|
|
61
|
+
/** Create a calendar event. */
|
|
62
|
+
export type CreateCalendarEvent_Serialize = {
|
|
63
|
+
/** Display title. */
|
|
64
|
+
title: string;
|
|
65
|
+
/** Timed or all-day span. */
|
|
66
|
+
time: EventTimeInput;
|
|
67
|
+
/** Optional event body. */
|
|
68
|
+
description: string | null;
|
|
69
|
+
/** Optional location label. */
|
|
70
|
+
location: string | null;
|
|
71
|
+
/** Attendees to invite. */
|
|
72
|
+
attendees: AttendeeInput[];
|
|
73
|
+
/** Recurrence properties. */
|
|
74
|
+
recurrenceLines: string[];
|
|
75
|
+
/** Calendar to create the event on. */
|
|
76
|
+
calendarId: string | null;
|
|
77
|
+
/** Reminder configuration. */
|
|
78
|
+
reminders: EventRemindersInput | null;
|
|
79
|
+
/** Whether to attach a Macro meeting link. */
|
|
80
|
+
addMacroCall: boolean;
|
|
81
|
+
/** Whether to attach the calendar provider's meeting conference. */
|
|
82
|
+
addConference: boolean;
|
|
83
|
+
/** Kind of event to create. */
|
|
84
|
+
eventType: CalendarEventTypeInput;
|
|
85
|
+
/** Out-of-office decline behavior. */
|
|
86
|
+
outOfOffice: OutOfOfficeInput | null;
|
|
87
|
+
/** What guests may do with the event. */
|
|
88
|
+
guestPolicy: GuestPolicy | null;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Review creation. Decoding it validates every draft; creating a review only
|
|
92
|
+
* presents the drafts, and the account holder acts separately.
|
|
93
|
+
*/
|
|
94
|
+
export type CreateReview = CreateReview_Serialize | CreateReview_Deserialize;
|
|
95
|
+
/**
|
|
96
|
+
* Review creation. Decoding it validates every draft; creating a review only
|
|
97
|
+
* presents the drafts, and the account holder acts separately.
|
|
98
|
+
*/
|
|
99
|
+
export type CreateReview_Deserialize = {
|
|
100
|
+
/** Optional code execution that prepared these drafts. */
|
|
101
|
+
executionId?: ExecutionId | null;
|
|
102
|
+
/** Stack label. */
|
|
103
|
+
title: ReviewTitle;
|
|
104
|
+
} & ReviewDrafts_Deserialize;
|
|
105
|
+
/**
|
|
106
|
+
* Review creation. Decoding it validates every draft; creating a review only
|
|
107
|
+
* presents the drafts, and the account holder acts separately.
|
|
108
|
+
*/
|
|
109
|
+
export type CreateReview_Serialize = {
|
|
110
|
+
/** Optional code execution that prepared these drafts. */
|
|
111
|
+
executionId: ExecutionId | null;
|
|
112
|
+
/** Stack label. */
|
|
113
|
+
title: ReviewTitle;
|
|
114
|
+
} & ReviewDrafts_Serialize;
|
|
115
|
+
/** Surface of a review decision. */
|
|
116
|
+
export type DecisionVia =
|
|
117
|
+
/** Review card. */
|
|
118
|
+
"card" |
|
|
119
|
+
/** Owner request in chat. */
|
|
120
|
+
"chat" |
|
|
121
|
+
/** Inbox action. */
|
|
122
|
+
"inbox";
|
|
123
|
+
/** One to [`MAX_DRAFTS`] drafts of one kind. */
|
|
124
|
+
export type DraftList<Draft> = Draft[];
|
|
125
|
+
/** An address that passes [`is_valid_email`]; decoding rejects any other string. */
|
|
126
|
+
export type EmailAddress = string;
|
|
127
|
+
/** A Macro document attached to an outgoing email as a file. */
|
|
128
|
+
export type EmailAttachment = {
|
|
129
|
+
/**
|
|
130
|
+
* The id of the Macro document to attach. It must be a stored file -
|
|
131
|
+
* an uploaded PDF, image, spreadsheet, Word document, or other upload -
|
|
132
|
+
* that the user can view. A Macro-native document (one written in the
|
|
133
|
+
* editor) has no file to attach; link to it in the body instead.
|
|
134
|
+
*/
|
|
135
|
+
documentId: string;
|
|
136
|
+
};
|
|
137
|
+
/** A recipient for an email. */
|
|
138
|
+
export type EmailRecipient = {
|
|
139
|
+
/** The recipient's email address. */
|
|
140
|
+
email: EmailAddress;
|
|
141
|
+
/** The recipient's display name (optional). */
|
|
142
|
+
name?: string | null;
|
|
143
|
+
};
|
|
144
|
+
/** One reminder override supplied to a calendar tool. */
|
|
145
|
+
export type EventReminderOverrideInput = {
|
|
146
|
+
/** Provider reminder method. `popup` creates a Macro notification. */
|
|
147
|
+
method: string;
|
|
148
|
+
/** Minutes before the event start. */
|
|
149
|
+
minutes: number;
|
|
150
|
+
};
|
|
151
|
+
/** Reminder configuration supplied when creating a calendar event. */
|
|
152
|
+
export type EventRemindersInput = {
|
|
153
|
+
/** Whether the selected calendar's default reminders should apply. */
|
|
154
|
+
useDefault: boolean;
|
|
155
|
+
/** Overrides used when calendar defaults are disabled. */
|
|
156
|
+
overrides?: EventReminderOverrideInput[];
|
|
157
|
+
};
|
|
158
|
+
/** The mutually exclusive time shape supplied to calendar tools. */
|
|
159
|
+
export type EventTimeInput =
|
|
160
|
+
/** A clock-time event with absolute instants. */
|
|
161
|
+
{
|
|
162
|
+
kind: "timed";
|
|
163
|
+
/** Inclusive start instant, RFC 3339 UTC (e.g. 2026-08-20T17:00:00Z). */
|
|
164
|
+
startsAt: string;
|
|
165
|
+
/** Exclusive end instant, RFC 3339 UTC. Must be after the start. */
|
|
166
|
+
endsAt: string;
|
|
167
|
+
/**
|
|
168
|
+
* IANA time zone the event was scheduled in (e.g.
|
|
169
|
+
* America/New_York). Recurring events expand in this zone.
|
|
170
|
+
*/
|
|
171
|
+
timeZone?: string | null;
|
|
172
|
+
} |
|
|
173
|
+
/** An all-day event spanning whole local dates. */
|
|
174
|
+
{
|
|
175
|
+
kind: "allDay";
|
|
176
|
+
/** Inclusive local start date (YYYY-MM-DD). */
|
|
177
|
+
startDate: string;
|
|
178
|
+
/**
|
|
179
|
+
* Exclusive local end date (YYYY-MM-DD); the day after the last
|
|
180
|
+
* covered day, so a one-day event ends the next date.
|
|
181
|
+
*/
|
|
182
|
+
endDate: string;
|
|
183
|
+
};
|
|
184
|
+
/** Caller-selected UUID persisted in tool input before execution begins. */
|
|
185
|
+
export type ExecutionId = string;
|
|
186
|
+
/**
|
|
187
|
+
* The switches an organizer sets on an event to bound what its guests may
|
|
188
|
+
* do. Google omits a switch from the payload while it holds its default.
|
|
189
|
+
*/
|
|
190
|
+
export type GuestPolicy = {
|
|
191
|
+
/** Whether guests may change the event, including its guest list. */
|
|
192
|
+
canModify: boolean;
|
|
193
|
+
/** Whether guests may invite others. */
|
|
194
|
+
canInviteOthers: boolean;
|
|
195
|
+
/** Whether guests may see the guest list. */
|
|
196
|
+
canSeeOtherGuests: boolean;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* The one draft an import review carries: which source's staged plan it
|
|
200
|
+
* presents, the plan rows the user took out of it, and the rows whose
|
|
201
|
+
* sharing they changed: `shared` to share with their team, `personal` to
|
|
202
|
+
* keep to themselves.
|
|
203
|
+
*/
|
|
204
|
+
export type ImportDraft = {
|
|
205
|
+
/** The staged plan's source; fixed once the review is presented. */
|
|
206
|
+
source: ImportReviewSource;
|
|
207
|
+
/** Plan rows left out of the import. */
|
|
208
|
+
excluded?: string[];
|
|
209
|
+
/** Plan rows shared with the team although the plan keeps them private. */
|
|
210
|
+
shared?: string[];
|
|
211
|
+
/** Plan rows kept private although the plan shares them. */
|
|
212
|
+
personal?: string[];
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* What an imported item is in its source system. Each source has its own
|
|
216
|
+
* kinds; a Notion database and a Notion page, or a Linear project and a
|
|
217
|
+
* Linear issue, are tracked and deduplicated separately.
|
|
218
|
+
*/
|
|
219
|
+
export type ImportKind =
|
|
220
|
+
/** A Linear issue. */
|
|
221
|
+
"issue" |
|
|
222
|
+
/** A Linear project. */
|
|
223
|
+
"project" |
|
|
224
|
+
/** A Linear document. */
|
|
225
|
+
"document" |
|
|
226
|
+
/** A Notion page. */
|
|
227
|
+
"page" |
|
|
228
|
+
/** A Notion database. */
|
|
229
|
+
"database" |
|
|
230
|
+
/** One data source (table) of a Notion database. */
|
|
231
|
+
"data_source" |
|
|
232
|
+
/** One row of a Notion data source. */
|
|
233
|
+
"row" |
|
|
234
|
+
/** A Jira issue. */
|
|
235
|
+
"jira_issue" |
|
|
236
|
+
/** A Jira project. */
|
|
237
|
+
"jira_project" |
|
|
238
|
+
/** A Jira epic grouping. */
|
|
239
|
+
"jira_epic" |
|
|
240
|
+
/** A Slack channel. */
|
|
241
|
+
"channel";
|
|
242
|
+
/** Which source's staged plan an import review presents. */
|
|
243
|
+
export type ImportReviewSource =
|
|
244
|
+
/** A Notion workspace plan, staged by ImportFromNotion. */
|
|
245
|
+
"notion" |
|
|
246
|
+
/** A Linear plan, staged by ImportFromLinear. */
|
|
247
|
+
"linear" |
|
|
248
|
+
/** A Jira plan, staged by ImportFromJira. */
|
|
249
|
+
"jira";
|
|
250
|
+
/** Review item state, shared with notification consumers. */
|
|
251
|
+
export type ItemStatus =
|
|
252
|
+
/** Still awaiting a decision. */
|
|
253
|
+
"pending" |
|
|
254
|
+
/** Claimed for execution. */
|
|
255
|
+
"submitting" |
|
|
256
|
+
/** Confirmed complete. */
|
|
257
|
+
"completed" |
|
|
258
|
+
/** Dismissed by the owner. */
|
|
259
|
+
"dismissed" |
|
|
260
|
+
/** Outcome requires reconciliation. */
|
|
261
|
+
"unknown";
|
|
262
|
+
/** Where a Notion workspace import stands. */
|
|
263
|
+
export type NotionImportReport = NotionImportReport_Serialize | NotionImportReport_Deserialize;
|
|
264
|
+
/** Where a Notion workspace import stands. */
|
|
265
|
+
export type NotionImportReport_Deserialize = {
|
|
266
|
+
/** Provider items skipped because they were unreadable, or optional features unavailable. */
|
|
267
|
+
warnings?: string[];
|
|
268
|
+
/** Tracker issues in the plan. */
|
|
269
|
+
issues?: number;
|
|
270
|
+
/** Tracker groups written as Macro projects. */
|
|
271
|
+
projects?: number;
|
|
272
|
+
/**
|
|
273
|
+
* The run's state: `running` while planning, `ready` once a plan is
|
|
274
|
+
* staged, `importing` while writing, `completed`, `failed`, or
|
|
275
|
+
* `dismissed` when cancelled. Absent before the first run.
|
|
276
|
+
*/
|
|
277
|
+
status?: RunStatus | null;
|
|
278
|
+
/** Why the run failed, when it did. */
|
|
279
|
+
error?: string | null;
|
|
280
|
+
/** What planning has found in Notion so far, while it is `running`. */
|
|
281
|
+
scanned?: ScanCounts | null;
|
|
282
|
+
/** Pages in the plan. */
|
|
283
|
+
pages: number;
|
|
284
|
+
/** Data sources (database tables) in the plan. */
|
|
285
|
+
dataSources: number;
|
|
286
|
+
/**
|
|
287
|
+
* Plan objects the decision model has not answered for yet, while
|
|
288
|
+
* planning is still `running`.
|
|
289
|
+
*/
|
|
290
|
+
deciding?: number;
|
|
291
|
+
/**
|
|
292
|
+
* Whether the user is on a team. Without one, everything the import
|
|
293
|
+
* writes stays visible only to them.
|
|
294
|
+
*/
|
|
295
|
+
onTeam?: boolean;
|
|
296
|
+
/** Objects to copy as they are. */
|
|
297
|
+
copy: number;
|
|
298
|
+
/** Data sources whose rows become tasks. */
|
|
299
|
+
tasks: number;
|
|
300
|
+
/** Objects left in Notion. */
|
|
301
|
+
skip: number;
|
|
302
|
+
/** Objects that need handling by hand. */
|
|
303
|
+
hand: number;
|
|
304
|
+
/** Pages written as documents. */
|
|
305
|
+
documents: number;
|
|
306
|
+
/** Data sources written as databases. */
|
|
307
|
+
databases: number;
|
|
308
|
+
/** Rows those databases hold, every one counted while planning. */
|
|
309
|
+
databaseRows: number;
|
|
310
|
+
/** Tasks the task lists become, one per row. */
|
|
311
|
+
taskRows: number;
|
|
312
|
+
/** Plan objects already imported. */
|
|
313
|
+
imported: number;
|
|
314
|
+
/** Plan objects still waiting to be written. */
|
|
315
|
+
waiting: number;
|
|
316
|
+
/** Plan objects being written now. */
|
|
317
|
+
writing: number;
|
|
318
|
+
/**
|
|
319
|
+
* Plan objects waiting for a teammate who is writing the same object
|
|
320
|
+
* for the team; they link to the teammate's copy once it is written.
|
|
321
|
+
*/
|
|
322
|
+
waitingOnTeammates?: number;
|
|
323
|
+
/** Written plan objects shared with the user's team. */
|
|
324
|
+
sharedWithTeam?: number;
|
|
325
|
+
/**
|
|
326
|
+
* Plan objects a teammate already imported and shared with the team;
|
|
327
|
+
* they link to that copy and are not counted as copies.
|
|
328
|
+
*/
|
|
329
|
+
alreadyInMacro?: number;
|
|
330
|
+
/** Who imported the objects already in Macro, most first. */
|
|
331
|
+
alreadyImportedBy?: NotionImporter[];
|
|
332
|
+
/** The review the plan is tied to, once presented. */
|
|
333
|
+
reviewId?: string | null;
|
|
334
|
+
/** Objects that need handling by hand, with reasons. */
|
|
335
|
+
handItems?: NotionReportItem_Deserialize[];
|
|
336
|
+
/** Objects that failed to import, with the failure. */
|
|
337
|
+
failures?: NotionReportItem_Deserialize[];
|
|
338
|
+
};
|
|
339
|
+
/** Where a Notion workspace import stands. */
|
|
340
|
+
export type NotionImportReport_Serialize = {
|
|
341
|
+
/** Provider items skipped because they were unreadable, or optional features unavailable. */
|
|
342
|
+
warnings?: string[];
|
|
343
|
+
/** Tracker issues in the plan. */
|
|
344
|
+
issues: number;
|
|
345
|
+
/** Tracker groups written as Macro projects. */
|
|
346
|
+
projects: number;
|
|
347
|
+
/**
|
|
348
|
+
* The run's state: `running` while planning, `ready` once a plan is
|
|
349
|
+
* staged, `importing` while writing, `completed`, `failed`, or
|
|
350
|
+
* `dismissed` when cancelled. Absent before the first run.
|
|
351
|
+
*/
|
|
352
|
+
status?: RunStatus | null;
|
|
353
|
+
/** Why the run failed, when it did. */
|
|
354
|
+
error?: string | null;
|
|
355
|
+
/** What planning has found in Notion so far, while it is `running`. */
|
|
356
|
+
scanned?: ScanCounts | null;
|
|
357
|
+
/** Pages in the plan. */
|
|
358
|
+
pages: number;
|
|
359
|
+
/** Data sources (database tables) in the plan. */
|
|
360
|
+
dataSources: number;
|
|
361
|
+
/**
|
|
362
|
+
* Plan objects the decision model has not answered for yet, while
|
|
363
|
+
* planning is still `running`.
|
|
364
|
+
*/
|
|
365
|
+
deciding: number;
|
|
366
|
+
/**
|
|
367
|
+
* Whether the user is on a team. Without one, everything the import
|
|
368
|
+
* writes stays visible only to them.
|
|
369
|
+
*/
|
|
370
|
+
onTeam: boolean;
|
|
371
|
+
/** Objects to copy as they are. */
|
|
372
|
+
copy: number;
|
|
373
|
+
/** Data sources whose rows become tasks. */
|
|
374
|
+
tasks: number;
|
|
375
|
+
/** Objects left in Notion. */
|
|
376
|
+
skip: number;
|
|
377
|
+
/** Objects that need handling by hand. */
|
|
378
|
+
hand: number;
|
|
379
|
+
/** Pages written as documents. */
|
|
380
|
+
documents: number;
|
|
381
|
+
/** Data sources written as databases. */
|
|
382
|
+
databases: number;
|
|
383
|
+
/** Rows those databases hold, every one counted while planning. */
|
|
384
|
+
databaseRows: number;
|
|
385
|
+
/** Tasks the task lists become, one per row. */
|
|
386
|
+
taskRows: number;
|
|
387
|
+
/** Plan objects already imported. */
|
|
388
|
+
imported: number;
|
|
389
|
+
/** Plan objects still waiting to be written. */
|
|
390
|
+
waiting: number;
|
|
391
|
+
/** Plan objects being written now. */
|
|
392
|
+
writing: number;
|
|
393
|
+
/**
|
|
394
|
+
* Plan objects waiting for a teammate who is writing the same object
|
|
395
|
+
* for the team; they link to the teammate's copy once it is written.
|
|
396
|
+
*/
|
|
397
|
+
waitingOnTeammates: number;
|
|
398
|
+
/** Written plan objects shared with the user's team. */
|
|
399
|
+
sharedWithTeam: number;
|
|
400
|
+
/**
|
|
401
|
+
* Plan objects a teammate already imported and shared with the team;
|
|
402
|
+
* they link to that copy and are not counted as copies.
|
|
403
|
+
*/
|
|
404
|
+
alreadyInMacro: number;
|
|
405
|
+
/** Who imported the objects already in Macro, most first. */
|
|
406
|
+
alreadyImportedBy: NotionImporter[];
|
|
407
|
+
/** The review the plan is tied to, once presented. */
|
|
408
|
+
reviewId?: string | null;
|
|
409
|
+
/** Objects that need handling by hand, with reasons. */
|
|
410
|
+
handItems: NotionReportItem_Serialize[];
|
|
411
|
+
/** Objects that failed to import, with the failure. */
|
|
412
|
+
failures: NotionReportItem_Serialize[];
|
|
413
|
+
};
|
|
414
|
+
/** A teammate who already imported some of a plan's objects. */
|
|
415
|
+
export type NotionImporter = {
|
|
416
|
+
/** The teammate, by email. */
|
|
417
|
+
by: string;
|
|
418
|
+
/** How many of the plan's objects they imported. */
|
|
419
|
+
count: number;
|
|
420
|
+
};
|
|
421
|
+
/** One object a workspace import report calls out. */
|
|
422
|
+
export type NotionReportItem = NotionReportItem_Serialize | NotionReportItem_Deserialize;
|
|
423
|
+
/** One object a workspace import report calls out. */
|
|
424
|
+
export type NotionReportItem_Deserialize = {
|
|
425
|
+
/** The ledger row. */
|
|
426
|
+
importId: string;
|
|
427
|
+
/** The object's title. */
|
|
428
|
+
title: string;
|
|
429
|
+
/** What the object is. */
|
|
430
|
+
kind: ImportKind;
|
|
431
|
+
/** Its Notion URL. */
|
|
432
|
+
url?: string | null;
|
|
433
|
+
/** Why it is called out: the decision model's reason, or the failure. */
|
|
434
|
+
reason?: string | null;
|
|
435
|
+
};
|
|
436
|
+
/** One object a workspace import report calls out. */
|
|
437
|
+
export type NotionReportItem_Serialize = {
|
|
438
|
+
/** The ledger row. */
|
|
439
|
+
importId: string;
|
|
440
|
+
/** The object's title. */
|
|
441
|
+
title: string;
|
|
442
|
+
/** What the object is. */
|
|
443
|
+
kind: ImportKind;
|
|
444
|
+
/** Its Notion URL. */
|
|
445
|
+
url?: string | null;
|
|
446
|
+
/** Why it is called out: the decision model's reason, or the failure. */
|
|
447
|
+
reason?: string | null;
|
|
448
|
+
};
|
|
449
|
+
/** Out-of-office decline behavior supplied to the calendar tools. */
|
|
450
|
+
export type OutOfOfficeInput = {
|
|
451
|
+
/**
|
|
452
|
+
* How conflicting invitations are handled. Defaults to declining nothing,
|
|
453
|
+
* so the event only blocks time and shows the away status.
|
|
454
|
+
*/
|
|
455
|
+
autoDeclineMode?: AutoDeclineModeInput | null;
|
|
456
|
+
/** Message returned to organizers whose invitations are auto-declined. */
|
|
457
|
+
declineMessage?: string | null;
|
|
458
|
+
};
|
|
459
|
+
/** One atomic user decision against the displayed revision. */
|
|
460
|
+
export type ReviewDecision = ReviewDecision_Serialize | ReviewDecision_Deserialize;
|
|
461
|
+
/** Facts about the most recent account-holder decision. */
|
|
462
|
+
export type ReviewDecisionContext = {
|
|
463
|
+
/** Authenticated account holder. */
|
|
464
|
+
by: string;
|
|
465
|
+
/** Entry surface. */
|
|
466
|
+
via: DecisionVia;
|
|
467
|
+
/** Revision claimed by this batch, used in notification deduplication. */
|
|
468
|
+
revision: number;
|
|
469
|
+
/** Items selected by this decision. */
|
|
470
|
+
items: string[];
|
|
471
|
+
};
|
|
472
|
+
/** One atomic user decision against the displayed revision. */
|
|
473
|
+
export type ReviewDecision_Deserialize =
|
|
474
|
+
/** Save one edited draft. */
|
|
475
|
+
({
|
|
476
|
+
action: "edit";
|
|
477
|
+
/** Revision displayed by the caller. */
|
|
478
|
+
revision: number;
|
|
479
|
+
/** Pending item to update. */
|
|
480
|
+
item: string;
|
|
481
|
+
/** Replacement action arguments, keyed by the review's kind. */
|
|
482
|
+
draft: ReviewDraft_Deserialize;
|
|
483
|
+
}) & {
|
|
484
|
+
items?: never;
|
|
485
|
+
} |
|
|
486
|
+
/** Send/create selected items, or all pending items when empty. */
|
|
487
|
+
({
|
|
488
|
+
action: "submit";
|
|
489
|
+
/** Revision displayed by the caller. */
|
|
490
|
+
revision: number;
|
|
491
|
+
/** Pending items, or an empty list to select all pending items. */
|
|
492
|
+
items: string[];
|
|
493
|
+
}) & {
|
|
494
|
+
draft?: never;
|
|
495
|
+
item?: never;
|
|
496
|
+
} |
|
|
497
|
+
/** Dismiss selected pending items, or all pending items when empty. */
|
|
498
|
+
({
|
|
499
|
+
action: "dismiss";
|
|
500
|
+
/** Revision displayed by the caller. */
|
|
501
|
+
revision: number;
|
|
502
|
+
/** Pending items, or an empty list to select all pending items. */
|
|
503
|
+
items: string[];
|
|
504
|
+
}) & {
|
|
505
|
+
draft?: never;
|
|
506
|
+
item?: never;
|
|
507
|
+
};
|
|
508
|
+
/** One atomic user decision against the displayed revision. */
|
|
509
|
+
export type ReviewDecision_Serialize =
|
|
510
|
+
/** Save one edited draft. */
|
|
511
|
+
({
|
|
512
|
+
action: "edit";
|
|
513
|
+
/** Revision displayed by the caller. */
|
|
514
|
+
revision: number;
|
|
515
|
+
/** Pending item to update. */
|
|
516
|
+
item: string;
|
|
517
|
+
/** Replacement action arguments, keyed by the review's kind. */
|
|
518
|
+
draft: ReviewDraft_Serialize;
|
|
519
|
+
}) & {
|
|
520
|
+
items?: never;
|
|
521
|
+
} |
|
|
522
|
+
/** Send/create selected items, or all pending items when empty. */
|
|
523
|
+
({
|
|
524
|
+
action: "submit";
|
|
525
|
+
/** Revision displayed by the caller. */
|
|
526
|
+
revision: number;
|
|
527
|
+
/** Pending items, or an empty list to select all pending items. */
|
|
528
|
+
items: string[];
|
|
529
|
+
}) & {
|
|
530
|
+
draft?: never;
|
|
531
|
+
item?: never;
|
|
532
|
+
} |
|
|
533
|
+
/** Dismiss selected pending items, or all pending items when empty. */
|
|
534
|
+
({
|
|
535
|
+
action: "dismiss";
|
|
536
|
+
/** Revision displayed by the caller. */
|
|
537
|
+
revision: number;
|
|
538
|
+
/** Pending items, or an empty list to select all pending items. */
|
|
539
|
+
items: string[];
|
|
540
|
+
}) & {
|
|
541
|
+
draft?: never;
|
|
542
|
+
item?: never;
|
|
543
|
+
};
|
|
544
|
+
/** One replacement draft, keyed by the kind of the review it edits. */
|
|
545
|
+
export type ReviewDraft = ReviewDraft_Serialize | ReviewDraft_Deserialize;
|
|
546
|
+
/** One replacement draft, keyed by the kind of the review it edits. */
|
|
547
|
+
export type ReviewDraft_Deserialize =
|
|
548
|
+
/** An edited email. */
|
|
549
|
+
{
|
|
550
|
+
kind: "email";
|
|
551
|
+
draft: SendEmail;
|
|
552
|
+
} |
|
|
553
|
+
/** An edited calendar event. */
|
|
554
|
+
{
|
|
555
|
+
kind: "calendar";
|
|
556
|
+
draft: CreateCalendarEvent_Deserialize;
|
|
557
|
+
} |
|
|
558
|
+
/** An edited import plan selection. */
|
|
559
|
+
{
|
|
560
|
+
kind: "import";
|
|
561
|
+
draft: ImportDraft;
|
|
562
|
+
};
|
|
563
|
+
/** One replacement draft, keyed by the kind of the review it edits. */
|
|
564
|
+
export type ReviewDraft_Serialize =
|
|
565
|
+
/** An edited email. */
|
|
566
|
+
{
|
|
567
|
+
kind: "email";
|
|
568
|
+
draft: SendEmail;
|
|
569
|
+
} |
|
|
570
|
+
/** An edited calendar event. */
|
|
571
|
+
{
|
|
572
|
+
kind: "calendar";
|
|
573
|
+
draft: CreateCalendarEvent_Serialize;
|
|
574
|
+
} |
|
|
575
|
+
/** An edited import plan selection. */
|
|
576
|
+
{
|
|
577
|
+
kind: "import";
|
|
578
|
+
draft: ImportDraft;
|
|
579
|
+
};
|
|
580
|
+
/** The drafts a new review presents, keyed by the review's kind. */
|
|
581
|
+
export type ReviewDrafts = ReviewDrafts_Serialize | ReviewDrafts_Deserialize;
|
|
582
|
+
/** The drafts a new review presents, keyed by the review's kind. */
|
|
583
|
+
export type ReviewDrafts_Deserialize =
|
|
584
|
+
/** Emails, each sent with the SendEmail action (Markdown body). */
|
|
585
|
+
{
|
|
586
|
+
kind: "email";
|
|
587
|
+
drafts: DraftList<SendEmail>;
|
|
588
|
+
} |
|
|
589
|
+
/** Calendar events, each created with the CreateCalendarEvent action. */
|
|
590
|
+
{
|
|
591
|
+
kind: "calendar";
|
|
592
|
+
drafts: DraftList<CreateCalendarEvent_Deserialize>;
|
|
593
|
+
} |
|
|
594
|
+
/** Exactly one staged import plan, approved as one item. */
|
|
595
|
+
{
|
|
596
|
+
kind: "import";
|
|
597
|
+
drafts: [ImportDraft];
|
|
598
|
+
};
|
|
599
|
+
/** The drafts a new review presents, keyed by the review's kind. */
|
|
600
|
+
export type ReviewDrafts_Serialize =
|
|
601
|
+
/** Emails, each sent with the SendEmail action (Markdown body). */
|
|
602
|
+
{
|
|
603
|
+
kind: "email";
|
|
604
|
+
drafts: DraftList<SendEmail>;
|
|
605
|
+
} |
|
|
606
|
+
/** Calendar events, each created with the CreateCalendarEvent action. */
|
|
607
|
+
{
|
|
608
|
+
kind: "calendar";
|
|
609
|
+
drafts: DraftList<CreateCalendarEvent_Serialize>;
|
|
610
|
+
} |
|
|
611
|
+
/** Exactly one staged import plan, approved as one item. */
|
|
612
|
+
{
|
|
613
|
+
kind: "import";
|
|
614
|
+
drafts: [ImportDraft];
|
|
615
|
+
};
|
|
616
|
+
/** Persisted review identity. */
|
|
617
|
+
export type ReviewId = string;
|
|
618
|
+
/** One editable item and its durable outcome. */
|
|
619
|
+
export type ReviewItem<Draft, Outcome> = {
|
|
620
|
+
/** Arguments for the existing composer and action. */
|
|
621
|
+
draft: Draft;
|
|
622
|
+
/** The action's confirmed response, never a model assertion. */
|
|
623
|
+
result: Outcome | null;
|
|
624
|
+
} & ReviewItemState;
|
|
625
|
+
/** Item facts every kind shares. */
|
|
626
|
+
export type ReviewItemState = {
|
|
627
|
+
/** Stable item identity across stack navigation and edits. */
|
|
628
|
+
id: string;
|
|
629
|
+
/** Whether the account holder edited this draft before deciding. */
|
|
630
|
+
edited?: boolean;
|
|
631
|
+
/** Current outcome. */
|
|
632
|
+
status: ItemStatus;
|
|
633
|
+
/** Failure or uncertainty description. */
|
|
634
|
+
error: string | null;
|
|
635
|
+
};
|
|
636
|
+
/** Saved items keyed by the review's kind. */
|
|
637
|
+
export type ReviewItems = ReviewItems_Serialize | ReviewItems_Deserialize;
|
|
638
|
+
/** Saved items keyed by the review's kind. */
|
|
639
|
+
export type ReviewItems_Deserialize =
|
|
640
|
+
/** Email drafts and their send responses. */
|
|
641
|
+
{
|
|
642
|
+
kind: "email";
|
|
643
|
+
items: (ReviewItem<SendEmail, SendEmailResponse>)[];
|
|
644
|
+
} |
|
|
645
|
+
/** Calendar drafts and their created events. */
|
|
646
|
+
{
|
|
647
|
+
kind: "calendar";
|
|
648
|
+
items: (ReviewItem<CreateCalendarEvent_Deserialize, ToolCalendarEvent>)[];
|
|
649
|
+
} |
|
|
650
|
+
/** The import plan selection and the started write's report. */
|
|
651
|
+
{
|
|
652
|
+
kind: "import";
|
|
653
|
+
items: [(ReviewItem<ImportDraft, NotionImportReport_Deserialize>)];
|
|
654
|
+
};
|
|
655
|
+
/** Saved items keyed by the review's kind. */
|
|
656
|
+
export type ReviewItems_Serialize =
|
|
657
|
+
/** Email drafts and their send responses. */
|
|
658
|
+
{
|
|
659
|
+
kind: "email";
|
|
660
|
+
items: (ReviewItem<SendEmail, SendEmailResponse>)[];
|
|
661
|
+
} |
|
|
662
|
+
/** Calendar drafts and their created events. */
|
|
663
|
+
{
|
|
664
|
+
kind: "calendar";
|
|
665
|
+
items: (ReviewItem<CreateCalendarEvent_Serialize, ToolCalendarEvent>)[];
|
|
666
|
+
} |
|
|
667
|
+
/** The import plan selection and the started write's report. */
|
|
668
|
+
{
|
|
669
|
+
kind: "import";
|
|
670
|
+
items: [(ReviewItem<ImportDraft, NotionImportReport_Serialize>)];
|
|
671
|
+
};
|
|
672
|
+
/** Full UI record, fetched outside the model context. */
|
|
673
|
+
export type ReviewRecord = ReviewRecord_Serialize | ReviewRecord_Deserialize;
|
|
674
|
+
/** Full UI record, fetched outside the model context. */
|
|
675
|
+
export type ReviewRecord_Deserialize = {
|
|
676
|
+
/** Review identity. */
|
|
677
|
+
id: ReviewId;
|
|
678
|
+
/** Owning session. */
|
|
679
|
+
sessionId: string;
|
|
680
|
+
/** Account whose email/calendar the drafts use. */
|
|
681
|
+
actingUser: string;
|
|
682
|
+
/** Originating code execution, absent for directly presented reviews. */
|
|
683
|
+
executionId: ExecutionId | null;
|
|
684
|
+
/** Durable presentation acknowledgment, separate from user decisions. */
|
|
685
|
+
presentedAt?: number | null;
|
|
686
|
+
/** Stack label. */
|
|
687
|
+
title: ReviewTitle;
|
|
688
|
+
/** Compare-and-swap revision for edits and submissions. */
|
|
689
|
+
revision: number;
|
|
690
|
+
/** Milliseconds since epoch of the last state change. */
|
|
691
|
+
updatedAt: number;
|
|
692
|
+
/** Current batch's authenticated decision, preserved for interrupted work. */
|
|
693
|
+
decision?: ReviewDecisionContext | null;
|
|
694
|
+
} & ReviewItems_Deserialize;
|
|
695
|
+
/** Full UI record, fetched outside the model context. */
|
|
696
|
+
export type ReviewRecord_Serialize = {
|
|
697
|
+
/** Review identity. */
|
|
698
|
+
id: ReviewId;
|
|
699
|
+
/** Owning session. */
|
|
700
|
+
sessionId: string;
|
|
701
|
+
/** Account whose email/calendar the drafts use. */
|
|
702
|
+
actingUser: string;
|
|
703
|
+
/** Originating code execution, absent for directly presented reviews. */
|
|
704
|
+
executionId: ExecutionId | null;
|
|
705
|
+
/** Durable presentation acknowledgment, separate from user decisions. */
|
|
706
|
+
presentedAt: number | null;
|
|
707
|
+
/** Stack label. */
|
|
708
|
+
title: ReviewTitle;
|
|
709
|
+
/** Compare-and-swap revision for edits and submissions. */
|
|
710
|
+
revision: number;
|
|
711
|
+
/** Milliseconds since epoch of the last state change. */
|
|
712
|
+
updatedAt: number;
|
|
713
|
+
/** Current batch's authenticated decision, preserved for interrupted work. */
|
|
714
|
+
decision: ReviewDecisionContext | null;
|
|
715
|
+
} & ReviewItems_Serialize;
|
|
716
|
+
/** A review stack label: not blank, at most 256 characters. */
|
|
717
|
+
export type ReviewTitle = string;
|
|
718
|
+
/** Lifecycle of a discovery run (one per user × source). */
|
|
719
|
+
export type RunStatus =
|
|
720
|
+
/**
|
|
721
|
+
* Slack discovery is staging candidates, or a Notion workspace import is
|
|
722
|
+
* being planned.
|
|
723
|
+
*/
|
|
724
|
+
"running" |
|
|
725
|
+
/** Discovery or planning finished; staged rows (if any) are ready. */
|
|
726
|
+
"ready" |
|
|
727
|
+
/** An approved Notion workspace import plan is being written. */
|
|
728
|
+
"importing" |
|
|
729
|
+
/**
|
|
730
|
+
* A Notion workspace import finished writing; `error` notes objects
|
|
731
|
+
* that could not be imported.
|
|
732
|
+
*/
|
|
733
|
+
"completed" |
|
|
734
|
+
/** Discovery, planning or writing failed; `error` has details. Retryable. */
|
|
735
|
+
"failed" |
|
|
736
|
+
/**
|
|
737
|
+
* A Notion workspace import was cancelled. Older rows may hold it from
|
|
738
|
+
* the removed onboarding import, where it meant a dismissed section.
|
|
739
|
+
*/
|
|
740
|
+
"dismissed";
|
|
741
|
+
/** What a planning run has found in the source so far. */
|
|
742
|
+
export type ScanCounts = {
|
|
743
|
+
/** Pages found. */
|
|
744
|
+
pages: number;
|
|
745
|
+
/** Data sources (database tables) found. */
|
|
746
|
+
dataSources: number;
|
|
747
|
+
};
|
|
748
|
+
/** Compose and send an email. Creates a draft and immediately queues it for delivery. */
|
|
749
|
+
export type SendEmail = {
|
|
750
|
+
/** The subject line of the email. */
|
|
751
|
+
subject: string;
|
|
752
|
+
/**
|
|
753
|
+
* The address of the inbox to send from, when the user has more than one
|
|
754
|
+
* connected and this email belongs to a particular one. Use the exact
|
|
755
|
+
* `emailAddress` of a connected inbox — `ListInboxes` lists them, and
|
|
756
|
+
* `GetThread` reports the `inbox` a thread belongs to. Omit it unless
|
|
757
|
+
* you know which inbox is right: a reply then goes out from the inbox
|
|
758
|
+
* that received the message it answers, and a new email from the user's
|
|
759
|
+
* primary inbox. The user can change it in the composer either way.
|
|
760
|
+
*/
|
|
761
|
+
from?: string | null;
|
|
762
|
+
/**
|
|
763
|
+
* The body of the email, written as Markdown. A host with a composer
|
|
764
|
+
* (chat) replaces this with the base64url-encoded HTML the composer
|
|
765
|
+
* exported before the tool runs; a host without one (an agent session)
|
|
766
|
+
* leaves the Markdown, and this tool renders it the same way.
|
|
767
|
+
*/
|
|
768
|
+
body: string;
|
|
769
|
+
/** The primary recipients (To field). */
|
|
770
|
+
to: EmailRecipient[];
|
|
771
|
+
/** Carbon copy recipients (optional). */
|
|
772
|
+
cc?: EmailRecipient[];
|
|
773
|
+
/** Blind carbon copy recipients (optional). */
|
|
774
|
+
bcc?: EmailRecipient[];
|
|
775
|
+
/**
|
|
776
|
+
* The ID of a message to reply to (optional). When set, the email is
|
|
777
|
+
* sent as a reply within the same thread.
|
|
778
|
+
*/
|
|
779
|
+
replyingToId?: string | null;
|
|
780
|
+
/**
|
|
781
|
+
* Per-message signature override, set by the composer's signature preview —
|
|
782
|
+
* not normally by you. Omit to use the inbox's default policy (always on a
|
|
783
|
+
* new email; on replies/forwards only when the user enabled it). `false`
|
|
784
|
+
* excludes the signature for this one email.
|
|
785
|
+
*/
|
|
786
|
+
includeSignature?: boolean | null;
|
|
787
|
+
/**
|
|
788
|
+
* Macro documents to attach as files (optional). Each must be an
|
|
789
|
+
* uploaded file the user can view; together they may total 18 MB.
|
|
790
|
+
*/
|
|
791
|
+
attachments?: EmailAttachment[];
|
|
792
|
+
};
|
|
793
|
+
/** Response from the SendEmail tool. */
|
|
794
|
+
export type SendEmailResponse = ({
|
|
795
|
+
sent: {
|
|
796
|
+
/** The database ID of the sent message. */
|
|
797
|
+
message_id: string;
|
|
798
|
+
/** The thread ID the message belongs to. */
|
|
799
|
+
thread_id: string;
|
|
800
|
+
};
|
|
801
|
+
}) & {
|
|
802
|
+
convertedToDraft?: never;
|
|
803
|
+
} | ({
|
|
804
|
+
convertedToDraft: {
|
|
805
|
+
draft_id: string;
|
|
806
|
+
};
|
|
807
|
+
}) & {
|
|
808
|
+
sent?: never;
|
|
809
|
+
} | "userEdited";
|
|
810
|
+
/** A calendar event as returned by the create and update tools. */
|
|
811
|
+
export type ToolCalendarEvent = {
|
|
812
|
+
/**
|
|
813
|
+
* Macro calendar event id, used by UpdateCalendarEvent and
|
|
814
|
+
* DeleteCalendarEvent.
|
|
815
|
+
*/
|
|
816
|
+
eventId: string;
|
|
817
|
+
/** Display title. */
|
|
818
|
+
title: string;
|
|
819
|
+
/** Event start: RFC 3339 UTC instant, or YYYY-MM-DD for all-day events. */
|
|
820
|
+
start: string;
|
|
821
|
+
/**
|
|
822
|
+
* Exclusive event end: RFC 3339 UTC instant, or YYYY-MM-DD for all-day
|
|
823
|
+
* events.
|
|
824
|
+
*/
|
|
825
|
+
end: string;
|
|
826
|
+
/** Whether the event covers whole days. */
|
|
827
|
+
isAllDay: boolean;
|
|
828
|
+
/** IANA time zone the event was scheduled in, when known. */
|
|
829
|
+
timeZone: string | null;
|
|
830
|
+
/** Location label, when set. */
|
|
831
|
+
location: string | null;
|
|
832
|
+
/** Event body, truncated for brevity. */
|
|
833
|
+
description: string | null;
|
|
834
|
+
/** Event status: confirmed, tentative, or cancelled. */
|
|
835
|
+
status: string;
|
|
836
|
+
/** Whether the event recurs. */
|
|
837
|
+
isRecurring: boolean;
|
|
838
|
+
/** Raw RFC 5545 recurrence properties, when the event recurs. */
|
|
839
|
+
recurrenceLines: string[];
|
|
840
|
+
/** Attendees, capped at 20; `attendee_count` has the full number. */
|
|
841
|
+
attendees: ToolEventAttendee[];
|
|
842
|
+
/** Total number of attendees. */
|
|
843
|
+
attendeeCount: number;
|
|
844
|
+
/** Organizer email address, when known. */
|
|
845
|
+
organizerEmail: string | null;
|
|
846
|
+
/** Conference join URL, when a conference is attached. */
|
|
847
|
+
conferenceUrl: string | null;
|
|
848
|
+
/**
|
|
849
|
+
* Join URL of the Macro call created with the event, when
|
|
850
|
+
* CreateCalendarEvent was asked for one.
|
|
851
|
+
*/
|
|
852
|
+
macroCallUrl: string | null;
|
|
853
|
+
/** Whether the user's calendar prohibits modifying this event. */
|
|
854
|
+
isReadOnly: boolean;
|
|
855
|
+
/** Calendar the event belongs to, when known. */
|
|
856
|
+
calendarId: string | null;
|
|
857
|
+
/** Display name of that calendar, when known. */
|
|
858
|
+
calendarName: string | null;
|
|
859
|
+
/**
|
|
860
|
+
* Connected inbox address syncing the calendar, when known. It stays the
|
|
861
|
+
* user's own address on a colleague's calendar, so it never says whose
|
|
862
|
+
* calendar it is.
|
|
863
|
+
*/
|
|
864
|
+
inbox: string | null;
|
|
865
|
+
/**
|
|
866
|
+
* Whether the user organizes this event or is a guest on it, through
|
|
867
|
+
* that inbox; absent when they are neither, can only write that
|
|
868
|
+
* calendar, or a read-only calendar names them organizer.
|
|
869
|
+
*/
|
|
870
|
+
myRole: ToolEventRole | null;
|
|
871
|
+
};
|
|
872
|
+
/** An attendee of a calendar event, as returned by calendar tools. */
|
|
873
|
+
export type ToolEventAttendee = {
|
|
874
|
+
/** Attendee email address. */
|
|
875
|
+
email: string;
|
|
876
|
+
/** RSVP state: needs_action, accepted, declined, or tentative. */
|
|
877
|
+
responseStatus: string;
|
|
878
|
+
/** Whether this attendee organized the event. */
|
|
879
|
+
isOrganizer: boolean;
|
|
880
|
+
/** Whether attendance is optional. */
|
|
881
|
+
isOptional: boolean;
|
|
882
|
+
};
|
|
883
|
+
/** What the user is on one copy of an event, through the inbox holding it. */
|
|
884
|
+
export type ToolEventRole =
|
|
885
|
+
/**
|
|
886
|
+
* The inbox organizes the event, or the event has no guests and is the
|
|
887
|
+
* user's own. Being able to write someone else's calendar is not this,
|
|
888
|
+
* nor is a read-only calendar naming them organizer; `viewerCan` says
|
|
889
|
+
* what the user may do there.
|
|
890
|
+
*/
|
|
891
|
+
"organizer" |
|
|
892
|
+
/** The inbox is invited to the event. */
|
|
893
|
+
"guest";
|