@plotday/twister 0.28.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/calendar.d.ts +17 -7
- package/dist/common/calendar.d.ts.map +1 -1
- package/dist/common/messaging.d.ts +10 -5
- package/dist/common/messaging.d.ts.map +1 -1
- package/dist/common/projects.d.ts +10 -5
- package/dist/common/projects.d.ts.map +1 -1
- package/dist/common/serializable.d.ts +40 -0
- package/dist/common/serializable.d.ts.map +1 -0
- package/dist/common/serializable.js +2 -0
- package/dist/common/serializable.js.map +1 -0
- package/dist/docs/assets/hierarchy.js +1 -1
- package/dist/docs/assets/navigation.js +1 -1
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/classes/tool.ITool.html +1 -1
- package/dist/docs/classes/tool.Tool.html +32 -33
- package/dist/docs/classes/tools_ai.AI.html +2 -2
- package/dist/docs/classes/tools_callbacks.Callbacks.html +6 -6
- package/dist/docs/classes/tools_integrations.Integrations.html +3 -3
- package/dist/docs/classes/tools_network.Network.html +12 -12
- package/dist/docs/classes/tools_plot.Plot.html +40 -30
- package/dist/docs/classes/tools_store.Store.html +29 -18
- package/dist/docs/classes/tools_tasks.Tasks.html +8 -8
- package/dist/docs/classes/tools_twists.Twists.html +5 -5
- package/dist/docs/classes/twist.Twist.html +28 -24
- package/dist/docs/enums/plot.ActivityLinkType.html +5 -5
- package/dist/docs/enums/plot.ActivityType.html +4 -4
- package/dist/docs/enums/plot.ActorType.html +4 -4
- package/dist/docs/enums/plot.ConferencingProvider.html +6 -6
- package/dist/docs/enums/tag.Tag.html +2 -2
- package/dist/docs/enums/tools_ai.AIModel.html +2 -2
- package/dist/docs/enums/tools_integrations.AuthLevel.html +3 -3
- package/dist/docs/enums/tools_integrations.AuthProvider.html +11 -11
- package/dist/docs/enums/tools_plot.ActivityAccess.html +3 -3
- package/dist/docs/enums/tools_plot.ContactAccess.html +3 -3
- package/dist/docs/enums/tools_plot.PriorityAccess.html +3 -3
- package/dist/docs/functions/index.Uuid.Generate.html +1 -1
- package/dist/docs/functions/utils_hash.quickHash.html +1 -1
- package/dist/docs/hierarchy.html +1 -1
- package/dist/docs/interfaces/common_calendar.Calendar.html +5 -5
- package/dist/docs/interfaces/common_calendar.CalendarTool.html +16 -10
- package/dist/docs/interfaces/common_calendar.SyncOptions.html +3 -3
- package/dist/docs/interfaces/index.SerializableArray.html +2 -0
- package/dist/docs/interfaces/index.SerializableMap.html +2 -0
- package/dist/docs/interfaces/index.SerializableObject.html +2 -0
- package/dist/docs/interfaces/index.SerializableSet.html +2 -0
- package/dist/docs/interfaces/tools_ai.AIRequest.html +11 -11
- package/dist/docs/interfaces/tools_ai.AIResponse.html +9 -9
- package/dist/docs/interfaces/tools_ai.FilePart.html +5 -5
- package/dist/docs/interfaces/tools_ai.ImagePart.html +4 -4
- package/dist/docs/interfaces/tools_ai.ReasoningPart.html +4 -4
- package/dist/docs/interfaces/tools_ai.RedactedReasoningPart.html +3 -3
- package/dist/docs/interfaces/tools_ai.TextPart.html +3 -3
- package/dist/docs/interfaces/tools_ai.ToolCallPart.html +5 -5
- package/dist/docs/interfaces/tools_ai.ToolExecutionOptions.html +4 -4
- package/dist/docs/interfaces/tools_ai.ToolResultPart.html +5 -5
- package/dist/docs/interfaces/tools_twists.TwistSource.html +3 -3
- package/dist/docs/interfaces/utils_types.ToolShed.html +5 -5
- package/dist/docs/modules/index.html +1 -1
- package/dist/docs/modules/plot.html +1 -1
- package/dist/docs/modules/utils_types.html +1 -1
- package/dist/docs/types/common_calendar.CalendarAuth.html +2 -2
- package/dist/docs/types/index.Serializable.html +17 -0
- package/dist/docs/types/index.Uuid.html +1 -1
- package/dist/docs/types/plot.Activity.html +1 -1
- package/dist/docs/types/plot.ActivityCommon.html +9 -9
- package/dist/docs/types/plot.ActivityLink.html +1 -1
- package/dist/docs/types/plot.ActivityMeta.html +5 -3
- package/dist/docs/types/plot.ActivityUpdate.html +2 -2
- package/dist/docs/types/plot.ActivityWithNotes.html +1 -1
- package/dist/docs/types/plot.Actor.html +15 -5
- package/dist/docs/types/plot.ActorId.html +1 -1
- package/dist/docs/types/plot.ContentType.html +1 -1
- package/dist/docs/types/plot.NewActivity.html +1 -1
- package/dist/docs/types/plot.NewActivityWithNotes.html +1 -1
- package/dist/docs/types/plot.NewActor.html +1 -1
- package/dist/docs/types/plot.NewContact.html +4 -4
- package/dist/docs/types/plot.NewNote.html +1 -1
- package/dist/docs/types/plot.NewPriority.html +15 -5
- package/dist/docs/types/plot.NewTags.html +1 -1
- package/dist/docs/types/plot.Note.html +1 -1
- package/dist/docs/types/plot.NoteUpdate.html +2 -2
- package/dist/docs/types/plot.PickPriorityConfig.html +3 -3
- package/dist/docs/types/plot.Priority.html +9 -4
- package/dist/docs/types/plot.PriorityUpdate.html +3 -0
- package/dist/docs/types/plot.SyncUpdate.html +1 -1
- package/dist/docs/types/plot.Tags.html +1 -1
- package/dist/docs/types/tools_ai.AIAssistantMessage.html +2 -2
- package/dist/docs/types/tools_ai.AIMessage.html +1 -1
- package/dist/docs/types/tools_ai.AISource.html +1 -1
- package/dist/docs/types/tools_ai.AISystemMessage.html +2 -2
- package/dist/docs/types/tools_ai.AITool.html +1 -1
- package/dist/docs/types/tools_ai.AIToolMessage.html +2 -2
- package/dist/docs/types/tools_ai.AIToolSet.html +1 -1
- package/dist/docs/types/tools_ai.AIUsage.html +5 -5
- package/dist/docs/types/tools_ai.AIUserMessage.html +2 -2
- package/dist/docs/types/tools_ai.DataContent.html +1 -1
- package/dist/docs/types/tools_ai.ModelPreferences.html +4 -4
- package/dist/docs/types/tools_callbacks.Callback.html +1 -1
- package/dist/docs/types/tools_integrations.AuthToken.html +4 -4
- package/dist/docs/types/tools_integrations.Authorization.html +4 -4
- package/dist/docs/types/tools_network.WebhookRequest.html +6 -6
- package/dist/docs/types/tools_plot.NoteIntentHandler.html +4 -4
- package/dist/docs/types/tools_twists.Log.html +2 -2
- package/dist/docs/types/tools_twists.TwistPermissions.html +1 -1
- package/dist/docs/types/utils_types.BuiltInTools.html +2 -2
- package/dist/docs/types/utils_types.CallbackMethods.html +1 -1
- package/dist/docs/types/utils_types.ExtractBuildReturn.html +1 -1
- package/dist/docs/types/utils_types.InferOptions.html +1 -1
- package/dist/docs/types/utils_types.InferTools.html +1 -1
- package/dist/docs/types/utils_types.JSONValue.html +7 -0
- package/dist/docs/types/utils_types.NoFunctions.html +1 -1
- package/dist/docs/types/utils_types.NonFunction.html +1 -1
- package/dist/docs/types/utils_types.PromiseValues.html +1 -1
- package/dist/docs/types/utils_types.ToolBuilder.html +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/llm-docs/common/calendar.d.ts +1 -1
- package/dist/llm-docs/common/calendar.d.ts.map +1 -1
- package/dist/llm-docs/common/calendar.js +1 -1
- package/dist/llm-docs/common/calendar.js.map +1 -1
- package/dist/llm-docs/common/messaging.d.ts +1 -1
- package/dist/llm-docs/common/messaging.d.ts.map +1 -1
- package/dist/llm-docs/common/messaging.js +1 -1
- package/dist/llm-docs/common/messaging.js.map +1 -1
- package/dist/llm-docs/common/projects.d.ts +1 -1
- package/dist/llm-docs/common/projects.d.ts.map +1 -1
- package/dist/llm-docs/common/projects.js +1 -1
- package/dist/llm-docs/common/projects.js.map +1 -1
- package/dist/llm-docs/plot.d.ts +1 -1
- package/dist/llm-docs/plot.d.ts.map +1 -1
- package/dist/llm-docs/plot.js +1 -1
- package/dist/llm-docs/plot.js.map +1 -1
- package/dist/llm-docs/tool.d.ts +1 -1
- package/dist/llm-docs/tool.d.ts.map +1 -1
- package/dist/llm-docs/tool.js +1 -1
- package/dist/llm-docs/tool.js.map +1 -1
- package/dist/llm-docs/tools/network.d.ts +1 -1
- package/dist/llm-docs/tools/network.d.ts.map +1 -1
- package/dist/llm-docs/tools/network.js +1 -1
- package/dist/llm-docs/tools/network.js.map +1 -1
- package/dist/llm-docs/tools/plot.d.ts +1 -1
- package/dist/llm-docs/tools/plot.d.ts.map +1 -1
- package/dist/llm-docs/tools/plot.js +1 -1
- package/dist/llm-docs/tools/plot.js.map +1 -1
- package/dist/llm-docs/tools/store.d.ts +1 -1
- package/dist/llm-docs/tools/store.d.ts.map +1 -1
- package/dist/llm-docs/tools/store.js +1 -1
- package/dist/llm-docs/tools/store.js.map +1 -1
- package/dist/llm-docs/tools/tasks.d.ts +1 -1
- package/dist/llm-docs/tools/tasks.d.ts.map +1 -1
- package/dist/llm-docs/tools/tasks.js +1 -1
- package/dist/llm-docs/tools/tasks.js.map +1 -1
- package/dist/llm-docs/twist.d.ts +1 -1
- package/dist/llm-docs/twist.d.ts.map +1 -1
- package/dist/llm-docs/twist.js +1 -1
- package/dist/llm-docs/twist.js.map +1 -1
- package/dist/plot.d.ts +125 -14
- package/dist/plot.d.ts.map +1 -1
- package/dist/plot.js.map +1 -1
- package/dist/tool.d.ts +26 -18
- package/dist/tool.d.ts.map +1 -1
- package/dist/tool.js +25 -17
- package/dist/tool.js.map +1 -1
- package/dist/tools/network.d.ts +19 -16
- package/dist/tools/network.d.ts.map +1 -1
- package/dist/tools/network.js +6 -4
- package/dist/tools/network.js.map +1 -1
- package/dist/tools/plot.d.ts +91 -22
- package/dist/tools/plot.d.ts.map +1 -1
- package/dist/tools/plot.js +45 -0
- package/dist/tools/plot.js.map +1 -1
- package/dist/tools/store.d.ts +43 -18
- package/dist/tools/store.d.ts.map +1 -1
- package/dist/tools/store.js +12 -1
- package/dist/tools/store.js.map +1 -1
- package/dist/tools/tasks.d.ts +4 -4
- package/dist/tools/tasks.js +4 -4
- package/dist/twist.d.ts +24 -10
- package/dist/twist.d.ts.map +1 -1
- package/dist/twist.js +19 -5
- package/dist/twist.js.map +1 -1
- package/dist/utils/types.d.ts +19 -0
- package/dist/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/plot.d.ts
CHANGED
|
@@ -1,8 +1,69 @@
|
|
|
1
1
|
import { type Tag } from "./tag";
|
|
2
2
|
import { type Callback } from "./tools/callbacks";
|
|
3
|
+
import { type JSONValue } from "./utils/types";
|
|
3
4
|
import { Uuid } from "./utils/uuid";
|
|
4
5
|
export { Tag } from "./tag";
|
|
5
6
|
export { Uuid } from "./utils/uuid";
|
|
7
|
+
export { type JSONValue } from "./utils/types";
|
|
8
|
+
/**
|
|
9
|
+
* @fileoverview
|
|
10
|
+
* Core Plot entity types for working with activities, notes, priorities, and contacts.
|
|
11
|
+
*
|
|
12
|
+
* ## Type Pattern: Null vs Undefined Semantics
|
|
13
|
+
*
|
|
14
|
+
* Plot entity types use a consistent pattern to distinguish between missing, unset, and explicitly cleared values:
|
|
15
|
+
*
|
|
16
|
+
* ### Entity Types (Activity, Priority, Note, Actor)
|
|
17
|
+
* - **Required fields**: No `?`, cannot be `undefined`
|
|
18
|
+
* - Example: `id: Uuid`, `type: ActivityType`
|
|
19
|
+
* - **Nullable fields**: Use `| null` to allow explicit clearing
|
|
20
|
+
* - Example: `assignee: ActorId | null`, `done: Date | null`
|
|
21
|
+
* - `null` = field is explicitly unset/cleared
|
|
22
|
+
* - Non-null value = field has a value
|
|
23
|
+
* - **Optional nullable fields**: Use `?` with `| null` for permission-based access
|
|
24
|
+
* - Example: `email?: string | null`, `name?: string | null`
|
|
25
|
+
* - `undefined` = field not included (e.g., no permission to access)
|
|
26
|
+
* - `null` = field included but not set
|
|
27
|
+
* - Value = field has a value
|
|
28
|
+
*
|
|
29
|
+
* ### New* Types (NewActivity, NewNote, NewPriority)
|
|
30
|
+
* Used for creating or updating entities. Support partial updates by distinguishing omitted vs cleared fields:
|
|
31
|
+
* - **Required fields**: Must be provided (no `?`)
|
|
32
|
+
* - Example: `type: ActivityType` in NewActivity
|
|
33
|
+
* - **Optional fields**: Use `?` to make them optional
|
|
34
|
+
* - Example: `title?: string`, `author?: NewActor`
|
|
35
|
+
* - `undefined` (omitted) = don't set/update this field
|
|
36
|
+
* - Provided value = set/update this field
|
|
37
|
+
* - **Optional nullable fields**: Use `?` with `| null` to support clearing
|
|
38
|
+
* - Example: `assignee?: NewActor | null`
|
|
39
|
+
* - `undefined` (omitted) = don't change assignee
|
|
40
|
+
* - `null` = clear the assignee
|
|
41
|
+
* - NewActor = set/update the assignee
|
|
42
|
+
*
|
|
43
|
+
* This pattern allows API consumers to:
|
|
44
|
+
* 1. Omit fields they don't want to change (undefined)
|
|
45
|
+
* 2. Explicitly clear fields by setting to null
|
|
46
|
+
* 3. Set or update fields by providing values
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* // Creating a new activity
|
|
51
|
+
* const newActivity: NewActivity = {
|
|
52
|
+
* type: ActivityType.Action, // Required
|
|
53
|
+
* title: "Review PR", // Optional, provided
|
|
54
|
+
* assignee: null, // Optional nullable, explicitly clearing
|
|
55
|
+
* // priority is omitted (undefined), will auto-select or use default
|
|
56
|
+
* };
|
|
57
|
+
*
|
|
58
|
+
* // Updating an activity - only change what's specified
|
|
59
|
+
* const update: ActivityUpdate = {
|
|
60
|
+
* id: activityId,
|
|
61
|
+
* done: new Date(), // Mark as done
|
|
62
|
+
* assignee: null, // Clear assignee
|
|
63
|
+
* // title is omitted, won't be changed
|
|
64
|
+
* };
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
6
67
|
/**
|
|
7
68
|
* Represents a unique user, contact, or twist in Plot.
|
|
8
69
|
*
|
|
@@ -23,20 +84,57 @@ export type ActorId = string & {
|
|
|
23
84
|
*/
|
|
24
85
|
export type Priority = {
|
|
25
86
|
/** Unique identifier for the priority */
|
|
26
|
-
id:
|
|
87
|
+
id: Uuid;
|
|
27
88
|
/** Human-readable title for the priority */
|
|
28
89
|
title: string;
|
|
90
|
+
/** Whether this priority has been archived */
|
|
91
|
+
archived: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Optional key for referencing this priority.
|
|
94
|
+
* Keys are unique per priority tree (a user's personal priorities or the root of a shared priority).
|
|
95
|
+
*/
|
|
96
|
+
key: string | null;
|
|
29
97
|
};
|
|
30
98
|
/**
|
|
31
99
|
* Type for creating new priorities.
|
|
32
100
|
*
|
|
33
|
-
*
|
|
34
|
-
* for
|
|
101
|
+
* Supports multiple creation patterns:
|
|
102
|
+
* - Provide a specific UUID for the priority
|
|
103
|
+
* - Provide a key for upsert within the user's priorities
|
|
104
|
+
* - Omit both to auto-generate a new UUID
|
|
105
|
+
*
|
|
106
|
+
* Optionally specify a parent priority by ID or key for hierarchical structures.
|
|
35
107
|
*/
|
|
36
|
-
export type NewPriority = Omit<Priority, "id"
|
|
37
|
-
/**
|
|
38
|
-
|
|
108
|
+
export type NewPriority = Pick<Priority, "title"> & Partial<Omit<Priority, "id" | "title">> & ({
|
|
109
|
+
/**
|
|
110
|
+
* Unique identifier for the priority, generated by Uuid.Generate().
|
|
111
|
+
* Specifying an ID allows tools to track and upsert priorities.
|
|
112
|
+
*/
|
|
113
|
+
id: Uuid;
|
|
114
|
+
} | {
|
|
115
|
+
/**
|
|
116
|
+
* Unique key for the priority within the user's priorities.
|
|
117
|
+
* Can be used to upsert without knowing the UUID.
|
|
118
|
+
* For example, "@plot" identifies the Plot priority.
|
|
119
|
+
*/
|
|
120
|
+
key: string;
|
|
121
|
+
} | {}) & {
|
|
122
|
+
/** Add the new priority as the child of another priority */
|
|
123
|
+
parent?: {
|
|
124
|
+
id: Uuid;
|
|
125
|
+
} | {
|
|
126
|
+
key: string;
|
|
127
|
+
};
|
|
39
128
|
};
|
|
129
|
+
/**
|
|
130
|
+
* Type for updating existing priorities.
|
|
131
|
+
* Must provide either id or key to identify the priority to update.
|
|
132
|
+
*/
|
|
133
|
+
export type PriorityUpdate = ({
|
|
134
|
+
id: Uuid;
|
|
135
|
+
} | {
|
|
136
|
+
key: string;
|
|
137
|
+
}) & Partial<Pick<Priority, "title" | "archived">>;
|
|
40
138
|
/**
|
|
41
139
|
* Enumeration of supported activity types in Plot.
|
|
42
140
|
*
|
|
@@ -167,6 +265,9 @@ export type ActivityLink = {
|
|
|
167
265
|
* which is useful for synchronization, linking back to external systems,
|
|
168
266
|
* and storing tool-specific data.
|
|
169
267
|
*
|
|
268
|
+
* Must be valid JSON data (strings, numbers, booleans, null, objects, arrays).
|
|
269
|
+
* Functions and other non-JSON values are not supported.
|
|
270
|
+
*
|
|
170
271
|
* @example
|
|
171
272
|
* ```typescript
|
|
172
273
|
* // Calendar event metadata
|
|
@@ -195,7 +296,7 @@ export type ActivityLink = {
|
|
|
195
296
|
*/
|
|
196
297
|
export type ActivityMeta = {
|
|
197
298
|
/** Source-specific properties and metadata */
|
|
198
|
-
[key: string]:
|
|
299
|
+
[key: string]: JSONValue;
|
|
199
300
|
};
|
|
200
301
|
/**
|
|
201
302
|
* Tags on an item, along with the actors who added each tag.
|
|
@@ -400,8 +501,8 @@ export type NewActivityWithNotes = NewActivity & {
|
|
|
400
501
|
* // Score based on content (max 100 points) and require exact type match
|
|
401
502
|
* pickPriority: { content: 100, type: true }
|
|
402
503
|
*
|
|
403
|
-
* // Match on meta
|
|
404
|
-
* pickPriority: { "meta.
|
|
504
|
+
* // Match on meta and score content
|
|
505
|
+
* pickPriority: { "meta.projectId": true, content: 50 }
|
|
405
506
|
* ```
|
|
406
507
|
*/
|
|
407
508
|
export type PickPriorityConfig = {
|
|
@@ -532,7 +633,7 @@ export type ActivityUpdate = ({
|
|
|
532
633
|
* Canonical URL for the item in an external system.
|
|
533
634
|
*/
|
|
534
635
|
source: string;
|
|
535
|
-
}) & Partial<Pick<Activity, "type" | "start" | "end" | "done" | "title" | "assignee" | "draft" | "private" | "meta" | "recurrenceRule" | "recurrenceDates" | "recurrenceExdates" | "recurrenceUntil" | "recurrenceCount" | "occurrence">> & {
|
|
636
|
+
}) & Partial<Pick<Activity, "type" | "start" | "end" | "done" | "title" | "assignee" | "draft" | "private" | "archived" | "meta" | "recurrenceRule" | "recurrenceDates" | "recurrenceExdates" | "recurrenceUntil" | "recurrenceCount" | "occurrence">> & {
|
|
536
637
|
/**
|
|
537
638
|
* Tags to change on the activity. Use an empty array of NewActor to remove a tag.
|
|
538
639
|
* Use twistTags to add/remove the twist from tags to avoid clearing other actors' tags.
|
|
@@ -656,7 +757,7 @@ export type NoteUpdate = ({
|
|
|
656
757
|
id: Uuid;
|
|
657
758
|
} | {
|
|
658
759
|
key: string;
|
|
659
|
-
}) & Partial<Pick<Note, "draft" | "private" | "content" | "links">> & {
|
|
760
|
+
}) & Partial<Pick<Note, "draft" | "private" | "archived" | "content" | "links">> & {
|
|
660
761
|
/**
|
|
661
762
|
* Format of the note content. Determines how the note is processed:
|
|
662
763
|
* - 'text': Plain text that will be converted to markdown (auto-links URLs, preserves line breaks)
|
|
@@ -701,9 +802,19 @@ export type Actor = {
|
|
|
701
802
|
id: ActorId;
|
|
702
803
|
/** Type of actor (User, Contact, or Twist) */
|
|
703
804
|
type: ActorType;
|
|
704
|
-
/**
|
|
705
|
-
|
|
706
|
-
|
|
805
|
+
/**
|
|
806
|
+
* Email address (only included with ContactAccess.Read permission).
|
|
807
|
+
* - `undefined`: No permission to read email
|
|
808
|
+
* - `null`: Permission granted but email not set
|
|
809
|
+
* - `string`: Email address
|
|
810
|
+
*/
|
|
811
|
+
email?: string | null;
|
|
812
|
+
/**
|
|
813
|
+
* Display name.
|
|
814
|
+
* - `undefined`: Not included due to permissions
|
|
815
|
+
* - `null`: Not set
|
|
816
|
+
* - `string`: Display name
|
|
817
|
+
*/
|
|
707
818
|
name?: string | null;
|
|
708
819
|
};
|
|
709
820
|
/**
|
package/dist/plot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../src/plot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,GAAG,EAAE,MAAM,OAA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EAAE,SAAS,CAAC;IAChB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB;IACE,sCAAsC;IACtC,EAAE,EAAE,OAAO,CAAC;CACb,GACD,UAAU,CAAC;AAEf;;;;;GAKG;AACH,oBAAY,SAAS;IACnB,wCAAwC;IACxC,IAAI,IAAA;IACJ,8CAA8C;IAC9C,OAAO,IAAA;IACP,6CAA6C;IAC7C,KAAK,IAAA;CACN;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC"}
|
package/dist/plot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plot.js","sourceRoot":"","sources":["../src/plot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plot.js","sourceRoot":"","sources":["../src/plot.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAyIpC;;;;;GAKG;AACH,MAAM,CAAN,IAAY,YAOX;AAPD,WAAY,YAAY;IACtB,qEAAqE;IACrE,+CAAI,CAAA;IACJ,+CAA+C;IAC/C,mDAAM,CAAA;IACN,8DAA8D;IAC9D,iDAAK,CAAA;AACP,CAAC,EAPW,YAAY,KAAZ,YAAY,QAOvB;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,8CAA8C;IAC9C,yCAAqB,CAAA;IACrB,mDAAmD;IACnD,iCAAa,CAAA;IACb,6DAA6D;IAC7D,yCAAqB,CAAA;IACrB,+DAA+D;IAC/D,iDAA6B,CAAA;AAC/B,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,oBAWX;AAXD,WAAY,oBAAoB;IAC9B,kBAAkB;IAClB,iDAAyB,CAAA;IACzB,WAAW;IACX,qCAAa,CAAA;IACb,sBAAsB;IACtB,yDAAiC,CAAA;IACjC,kBAAkB;IAClB,uCAAe,CAAA;IACf,6CAA6C;IAC7C,uCAAe,CAAA;AACjB,CAAC,EAXW,oBAAoB,KAApB,oBAAoB,QAW/B;AAotBD;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,wCAAwC;IACxC,yCAAI,CAAA;IACJ,8CAA8C;IAC9C,+CAAO,CAAA;IACP,6CAA6C;IAC7C,2CAAK,CAAA;AACP,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB"}
|
package/dist/tool.d.ts
CHANGED
|
@@ -99,38 +99,46 @@ export declare abstract class Tool<TSelf> implements ITool {
|
|
|
99
99
|
* @param args - Optional arguments to pass to the callback
|
|
100
100
|
* @returns Promise resolving to the callback result
|
|
101
101
|
*/
|
|
102
|
-
protected run(token: Callback, args
|
|
102
|
+
protected run(token: Callback, ...args: any[]): Promise<any>;
|
|
103
103
|
/**
|
|
104
104
|
* Retrieves a value from persistent storage by key.
|
|
105
105
|
*
|
|
106
|
-
*
|
|
106
|
+
* Values are automatically deserialized using SuperJSON, which
|
|
107
|
+
* properly restores Date objects, Maps, Sets, and other complex types.
|
|
108
|
+
*
|
|
109
|
+
* @template T - The expected type of the stored value (must be Serializable)
|
|
107
110
|
* @param key - The storage key to retrieve
|
|
108
111
|
* @returns Promise resolving to the stored value or null
|
|
109
112
|
*/
|
|
110
|
-
protected get<T>(key: string): Promise<T | null>;
|
|
113
|
+
protected get<T extends import("./index").Serializable>(key: string): Promise<T | null>;
|
|
111
114
|
/**
|
|
112
115
|
* Stores a value in persistent storage.
|
|
113
116
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* - Object keys with undefined values are automatically removed
|
|
118
|
-
* - Arrays with undefined elements will throw a validation error
|
|
119
|
-
* - Use null instead of undefined for array elements
|
|
117
|
+
* The value will be serialized using SuperJSON and stored persistently.
|
|
118
|
+
* SuperJSON automatically handles Date objects, Maps, Sets, undefined values,
|
|
119
|
+
* and other complex types that standard JSON doesn't support.
|
|
120
120
|
*
|
|
121
|
+
* **Important**: Functions and Symbols cannot be stored.
|
|
121
122
|
* **For function references**: Use callbacks instead of storing functions directly.
|
|
122
123
|
*
|
|
123
124
|
* @example
|
|
124
125
|
* ```typescript
|
|
125
|
-
* // ✅
|
|
126
|
+
* // ✅ Date objects are preserved
|
|
127
|
+
* await this.set("sync_state", {
|
|
128
|
+
* lastSync: new Date(),
|
|
129
|
+
* minDate: new Date(2024, 0, 1)
|
|
130
|
+
* });
|
|
131
|
+
*
|
|
132
|
+
* // ✅ undefined is now supported
|
|
126
133
|
* await this.set("data", { name: "test", optional: undefined });
|
|
127
|
-
* // Stores: { name: "test" }
|
|
128
134
|
*
|
|
129
|
-
* // ✅ Arrays
|
|
130
|
-
* await this.set("items", [1,
|
|
135
|
+
* // ✅ Arrays with undefined are supported
|
|
136
|
+
* await this.set("items", [1, undefined, 3]);
|
|
137
|
+
* await this.set("items", [1, null, 3]); // Also works
|
|
131
138
|
*
|
|
132
|
-
* //
|
|
133
|
-
* await this.set("
|
|
139
|
+
* // ✅ Maps and Sets are supported
|
|
140
|
+
* await this.set("mapping", new Map([["key", "value"]]));
|
|
141
|
+
* await this.set("tags", new Set(["tag1", "tag2"]));
|
|
134
142
|
*
|
|
135
143
|
* // ❌ WRONG: Cannot store functions directly
|
|
136
144
|
* await this.set("handler", this.myHandler);
|
|
@@ -144,12 +152,12 @@ export declare abstract class Tool<TSelf> implements ITool {
|
|
|
144
152
|
* await this.run(token, args);
|
|
145
153
|
* ```
|
|
146
154
|
*
|
|
147
|
-
* @template T - The type of value being stored
|
|
155
|
+
* @template T - The type of value being stored (must be Serializable)
|
|
148
156
|
* @param key - The storage key to use
|
|
149
|
-
* @param value - The value to store (must be
|
|
157
|
+
* @param value - The value to store (must be SuperJSON-serializable)
|
|
150
158
|
* @returns Promise that resolves when the value is stored
|
|
151
159
|
*/
|
|
152
|
-
protected set<T>(key: string, value: T): Promise<void>;
|
|
160
|
+
protected set<T extends import("./index").Serializable>(key: string, value: T): Promise<void>;
|
|
153
161
|
/**
|
|
154
162
|
* Removes a specific key from persistent storage.
|
|
155
163
|
*
|
package/dist/tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACT,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B;;;GAGG;AACH,8BAAsB,KAAK;CAAG;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,8BAAsB,IAAI,CAAC,KAAK,CAAE,YAAW,KAAK;IAE9C,SAAS,CAAC,EAAE,EAAE,MAAM;IACpB,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC;IACtC,OAAO,CAAC,QAAQ;gBAFN,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,EAC9B,QAAQ,EAAE,QAAQ;IAG5B;;;OAGG;IACH,SAAS,KAAK,KAAK,sBAElB;I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AO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIzB;;;;;OAKG;cACa,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxD;;;;OAIG;cACa,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/C;;;;;;;;;OASG;IAEH,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C;;;;;;;;OAQG;IAEH,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C;;;;;;;;OAQG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;;;;OAOG;IACH,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;;;;;;;OAQG;IACH,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;;;;;;OAOG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B;;;;OAIG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC"}
|
package/dist/tool.js
CHANGED
|
@@ -110,13 +110,16 @@ export class Tool {
|
|
|
110
110
|
* @param args - Optional arguments to pass to the callback
|
|
111
111
|
* @returns Promise resolving to the callback result
|
|
112
112
|
*/
|
|
113
|
-
async run(token, args) {
|
|
114
|
-
return this.tools.callbacks.run(token, args);
|
|
113
|
+
async run(token, ...args) {
|
|
114
|
+
return this.tools.callbacks.run(token, ...args);
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Retrieves a value from persistent storage by key.
|
|
118
118
|
*
|
|
119
|
-
*
|
|
119
|
+
* Values are automatically deserialized using SuperJSON, which
|
|
120
|
+
* properly restores Date objects, Maps, Sets, and other complex types.
|
|
121
|
+
*
|
|
122
|
+
* @template T - The expected type of the stored value (must be Serializable)
|
|
120
123
|
* @param key - The storage key to retrieve
|
|
121
124
|
* @returns Promise resolving to the stored value or null
|
|
122
125
|
*/
|
|
@@ -126,26 +129,31 @@ export class Tool {
|
|
|
126
129
|
/**
|
|
127
130
|
* Stores a value in persistent storage.
|
|
128
131
|
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* - Object keys with undefined values are automatically removed
|
|
133
|
-
* - Arrays with undefined elements will throw a validation error
|
|
134
|
-
* - Use null instead of undefined for array elements
|
|
132
|
+
* The value will be serialized using SuperJSON and stored persistently.
|
|
133
|
+
* SuperJSON automatically handles Date objects, Maps, Sets, undefined values,
|
|
134
|
+
* and other complex types that standard JSON doesn't support.
|
|
135
135
|
*
|
|
136
|
+
* **Important**: Functions and Symbols cannot be stored.
|
|
136
137
|
* **For function references**: Use callbacks instead of storing functions directly.
|
|
137
138
|
*
|
|
138
139
|
* @example
|
|
139
140
|
* ```typescript
|
|
140
|
-
* // ✅
|
|
141
|
+
* // ✅ Date objects are preserved
|
|
142
|
+
* await this.set("sync_state", {
|
|
143
|
+
* lastSync: new Date(),
|
|
144
|
+
* minDate: new Date(2024, 0, 1)
|
|
145
|
+
* });
|
|
146
|
+
*
|
|
147
|
+
* // ✅ undefined is now supported
|
|
141
148
|
* await this.set("data", { name: "test", optional: undefined });
|
|
142
|
-
* // Stores: { name: "test" }
|
|
143
149
|
*
|
|
144
|
-
* // ✅ Arrays
|
|
145
|
-
* await this.set("items", [1,
|
|
150
|
+
* // ✅ Arrays with undefined are supported
|
|
151
|
+
* await this.set("items", [1, undefined, 3]);
|
|
152
|
+
* await this.set("items", [1, null, 3]); // Also works
|
|
146
153
|
*
|
|
147
|
-
* //
|
|
148
|
-
* await this.set("
|
|
154
|
+
* // ✅ Maps and Sets are supported
|
|
155
|
+
* await this.set("mapping", new Map([["key", "value"]]));
|
|
156
|
+
* await this.set("tags", new Set(["tag1", "tag2"]));
|
|
149
157
|
*
|
|
150
158
|
* // ❌ WRONG: Cannot store functions directly
|
|
151
159
|
* await this.set("handler", this.myHandler);
|
|
@@ -159,9 +167,9 @@ export class Tool {
|
|
|
159
167
|
* await this.run(token, args);
|
|
160
168
|
* ```
|
|
161
169
|
*
|
|
162
|
-
* @template T - The type of value being stored
|
|
170
|
+
* @template T - The type of value being stored (must be Serializable)
|
|
163
171
|
* @param key - The storage key to use
|
|
164
|
-
* @param value - The value to store (must be
|
|
172
|
+
* @param value - The value to store (must be SuperJSON-serializable)
|
|
165
173
|
* @returns Promise that resolves when the value is stored
|
|
166
174
|
*/
|
|
167
175
|
async set(key, value) {
|
package/dist/tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,MAAM,OAAgB,KAAK;CAAG;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAgB,IAAI;IAEZ;IACA;IACF;IAHV,YACY,EAAU,EACV,OAA4B,EAC9B,QAAkB;QAFhB,OAAE,GAAF,EAAE,CAAQ;QACV,YAAO,GAAP,OAAO,CAAqB;QAC9B,aAAQ,GAAR,QAAQ,CAAU;IACzB,CAAC;IAEJ;;;OAGG;IACH,IAAc,KAAK;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAqB,CAAC;IACrD,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,6DAA6D;IAC7D,KAAK,CAAC,KAAkB;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;;;;;;;;;;;;OAaG;IACO,KAAK,CAAC,QAAQ,CACtB,EAAM,EACN,GAAG,SAAyB;QAE5B,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,cAAc,CAAC,KAAe;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED;;;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AAC,QAAkB;QAC5B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;;OAQG;IACH,6DAA6D;IAC7D,YAAY,CAAC,QAAkB;QAC7B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;;OAQG;IACH,UAAU;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;OAOG;IACH,WAAW;QACT,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;;OAQG;IACH,aAAa;QACX,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;OAOG;IACH,cAAc;QACZ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;CACF"}
|
package/dist/tools/network.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ITool } from "..";
|
|
2
2
|
import { type AuthProvider, type Authorization } from "./integrations";
|
|
3
|
+
import { type NoFunctions, type JSONValue } from "../utils/types";
|
|
3
4
|
/**
|
|
4
5
|
* Represents an incoming webhook request.
|
|
5
6
|
*
|
|
@@ -25,7 +26,7 @@ export type WebhookRequest = {
|
|
|
25
26
|
/** Query string parameters from the request URL */
|
|
26
27
|
params: Record<string, string>;
|
|
27
28
|
/** Request body (parsed as JSON if applicable) */
|
|
28
|
-
body:
|
|
29
|
+
body: JSONValue;
|
|
29
30
|
/** Raw request body (for signature verification) */
|
|
30
31
|
rawBody?: string;
|
|
31
32
|
};
|
|
@@ -82,10 +83,12 @@ export type WebhookRequest = {
|
|
|
82
83
|
*
|
|
83
84
|
* async setupCalendarWebhook(calendarId: string) {
|
|
84
85
|
* // Create webhook URL that will call onCalendarEvent
|
|
85
|
-
* const webhookUrl = await this.tools.network.createWebhook(
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
86
|
+
* const webhookUrl = await this.tools.network.createWebhook(
|
|
87
|
+
* {},
|
|
88
|
+
* this.onCalendarEvent,
|
|
89
|
+
* calendarId,
|
|
90
|
+
* "google"
|
|
91
|
+
* );
|
|
89
92
|
*
|
|
90
93
|
* // Register webhook with Google Calendar API
|
|
91
94
|
* await this.registerWithGoogleCalendar(calendarId, webhookUrl);
|
|
@@ -133,21 +136,23 @@ export declare abstract class Network extends ITool {
|
|
|
133
136
|
* - **Default**: Returns a standard webhook URL for all other cases.
|
|
134
137
|
*
|
|
135
138
|
* @param options - Webhook creation options
|
|
136
|
-
* @param options.callback - Function receiving (request, ...extraArgs)
|
|
137
|
-
* @param options.extraArgs - Additional arguments to pass to the callback (type-checked)
|
|
138
139
|
* @param options.provider - Optional provider for provider-specific webhook routing
|
|
139
140
|
* @param options.authorization - Optional authorization for provider-specific webhooks (required for Slack and Gmail)
|
|
141
|
+
* @param callback - Function receiving (request, ...extraArgs)
|
|
142
|
+
* @param extraArgs - Additional arguments to pass to the callback (type-checked, no functions allowed)
|
|
140
143
|
* @returns Promise resolving to the webhook URL, or for Gmail, a Pub/Sub topic name
|
|
141
144
|
*
|
|
142
145
|
* @example
|
|
143
146
|
* ```typescript
|
|
144
147
|
* // Gmail webhook - returns Pub/Sub topic name
|
|
145
|
-
* const topicName = await this.tools.network.createWebhook(
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
148
|
+
* const topicName = await this.tools.network.createWebhook(
|
|
149
|
+
* {
|
|
150
|
+
* provider: AuthProvider.Google,
|
|
151
|
+
* authorization: gmailAuth
|
|
152
|
+
* },
|
|
153
|
+
* this.onGmailNotification,
|
|
154
|
+
* "inbox"
|
|
155
|
+
* );
|
|
151
156
|
* // topicName: "projects/plot-prod/topics/gmail-webhook-abc123"
|
|
152
157
|
*
|
|
153
158
|
* // Pass topic name to Gmail API
|
|
@@ -161,11 +166,9 @@ export declare abstract class Network extends ITool {
|
|
|
161
166
|
* ```
|
|
162
167
|
*/
|
|
163
168
|
abstract createWebhook<TCallback extends (request: WebhookRequest, ...args: any[]) => any>(options: {
|
|
164
|
-
callback: TCallback;
|
|
165
|
-
extraArgs?: TCallback extends (req: any, ...rest: infer R) => any ? R : [];
|
|
166
169
|
provider?: AuthProvider;
|
|
167
170
|
authorization?: Authorization;
|
|
168
|
-
}): Promise<string>;
|
|
171
|
+
}, callback: TCallback, ...extraArgs: TCallback extends (req: any, ...rest: infer R) => any ? NoFunctions<R> : []): Promise<string>;
|
|
169
172
|
/**
|
|
170
173
|
* Deletes an existing webhook endpoint.
|
|
171
174
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/tools/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/tools/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,kDAAkD;IAClD,IAAI,EAAE,SAAS,CAAC;IAChB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,8BAAsB,OAAQ,SAAQ,KAAK;IACzC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE;QACvB;;;WAGG;QACH,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,QAAQ,CAAC,aAAa,CACpB,SAAS,SAAS,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAElE,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,YAAY,CAAC;QACxB,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B,EACD,QAAQ,EAAE,SAAS,EACnB,GAAG,SAAS,EAAE,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAC/D,WAAW,CAAC,CAAC,CAAC,GACd,EAAE,GACL,OAAO,CAAC,MAAM,CAAC;IAElB;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CACnD"}
|
package/dist/tools/network.js
CHANGED
|
@@ -52,10 +52,12 @@ import { ITool } from "..";
|
|
|
52
52
|
*
|
|
53
53
|
* async setupCalendarWebhook(calendarId: string) {
|
|
54
54
|
* // Create webhook URL that will call onCalendarEvent
|
|
55
|
-
* const webhookUrl = await this.tools.network.createWebhook(
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
55
|
+
* const webhookUrl = await this.tools.network.createWebhook(
|
|
56
|
+
* {},
|
|
57
|
+
* this.onCalendarEvent,
|
|
58
|
+
* calendarId,
|
|
59
|
+
* "google"
|
|
60
|
+
* );
|
|
59
61
|
*
|
|
60
62
|
* // Register webhook with Google Calendar API
|
|
61
63
|
* await this.registerWithGoogleCalendar(calendarId, webhookUrl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/tools/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/tools/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAkC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,MAAM,OAAgB,OAAQ,SAAQ,KAAK;IACzC,MAAM,CAAU,OAAO,CAMrB;CA8EH"}
|