@plotday/twister 0.36.0 → 0.38.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.
Files changed (243) hide show
  1. package/README.md +4 -2
  2. package/bin/commands/create.js +37 -3
  3. package/bin/commands/create.js.map +1 -1
  4. package/bin/commands/deploy.js +4 -0
  5. package/bin/commands/deploy.js.map +1 -1
  6. package/bin/index.js +1 -0
  7. package/bin/index.js.map +1 -1
  8. package/bin/templates/AGENTS.template.md +101 -189
  9. package/bin/templates/README.template.md +2 -23
  10. package/cli/templates/AGENTS.template.md +101 -189
  11. package/cli/templates/README.template.md +2 -23
  12. package/dist/docs/assets/hierarchy.js +1 -1
  13. package/dist/docs/assets/navigation.js +1 -1
  14. package/dist/docs/assets/search.js +1 -1
  15. package/dist/docs/classes/index.Options.html +1 -1
  16. package/dist/docs/classes/index.Source.html +200 -0
  17. package/dist/docs/classes/tool.ITool.html +1 -1
  18. package/dist/docs/classes/tool.Tool.html +21 -21
  19. package/dist/docs/classes/tools_ai.AI.html +1 -1
  20. package/dist/docs/classes/tools_callbacks.Callbacks.html +2 -2
  21. package/dist/docs/classes/tools_integrations.Integrations.html +45 -16
  22. package/dist/docs/classes/tools_network.Network.html +1 -1
  23. package/dist/docs/classes/tools_plot.Plot.html +93 -60
  24. package/dist/docs/classes/tools_store.Store.html +1 -1
  25. package/dist/docs/classes/tools_tasks.Tasks.html +1 -1
  26. package/dist/docs/classes/tools_twists.Twists.html +1 -1
  27. package/dist/docs/classes/twist.Twist.html +42 -10
  28. package/dist/docs/documents/Building_Sources.html +137 -0
  29. package/dist/docs/documents/Built-in_Tools.html +11 -2
  30. package/dist/docs/documents/Core_Concepts.html +5 -10
  31. package/dist/docs/documents/Getting_Started.html +1 -1
  32. package/dist/docs/enums/{plot.ActivityLinkType.html → plot.ActionType.html} +10 -8
  33. package/dist/docs/enums/plot.ActorType.html +7 -7
  34. package/dist/docs/enums/plot.ConferencingProvider.html +6 -6
  35. package/dist/docs/enums/plot.ThemeColor.html +9 -9
  36. package/dist/docs/enums/tag.Tag.html +3 -10
  37. package/dist/docs/enums/tools_integrations.AuthProvider.html +11 -11
  38. package/dist/docs/enums/tools_plot.ContactAccess.html +3 -3
  39. package/dist/docs/enums/tools_plot.PriorityAccess.html +3 -3
  40. package/dist/docs/enums/{tools_plot.ActivityAccess.html → tools_plot.ThreadAccess.html} +6 -6
  41. package/dist/docs/hierarchy.html +1 -1
  42. package/dist/docs/index.html +5 -6
  43. package/dist/docs/media/AGENTS.md +910 -0
  44. package/dist/docs/media/MULTI_USER_AUTH.md +111 -0
  45. package/dist/docs/media/SYNC_STRATEGIES.md +7 -7
  46. package/dist/docs/modules/index.html +1 -1
  47. package/dist/docs/modules/plot.html +1 -1
  48. package/dist/docs/modules/tool.html +1 -1
  49. package/dist/docs/modules/tools_integrations.html +1 -1
  50. package/dist/docs/modules/tools_plot.html +1 -1
  51. package/dist/docs/modules.html +1 -1
  52. package/dist/docs/types/index.NewSchedule.html +33 -0
  53. package/dist/docs/types/index.NewScheduleContact.html +5 -0
  54. package/dist/docs/types/index.NewScheduleOccurrence.html +6 -0
  55. package/dist/docs/types/index.Schedule.html +37 -0
  56. package/dist/docs/types/index.ScheduleContact.html +5 -0
  57. package/dist/docs/types/index.ScheduleContactRole.html +1 -0
  58. package/dist/docs/types/index.ScheduleContactStatus.html +1 -0
  59. package/dist/docs/types/index.ScheduleOccurrence.html +17 -0
  60. package/dist/docs/types/index.ScheduleOccurrenceUpdate.html +2 -0
  61. package/dist/docs/types/plot.Action.html +28 -0
  62. package/dist/docs/types/plot.Actor.html +6 -6
  63. package/dist/docs/types/plot.ActorId.html +1 -1
  64. package/dist/docs/types/plot.ContentType.html +1 -1
  65. package/dist/docs/types/plot.Link.html +36 -0
  66. package/dist/docs/types/plot.NewActor.html +1 -1
  67. package/dist/docs/types/plot.NewContact.html +5 -5
  68. package/dist/docs/types/plot.NewLink.html +26 -0
  69. package/dist/docs/types/plot.NewLinkWithNotes.html +7 -0
  70. package/dist/docs/types/plot.NewNote.html +10 -10
  71. package/dist/docs/types/plot.NewPriority.html +1 -1
  72. package/dist/docs/types/plot.NewTags.html +1 -1
  73. package/dist/docs/types/plot.NewThread.html +27 -0
  74. package/dist/docs/types/plot.NewThreadWithNotes.html +1 -0
  75. package/dist/docs/types/plot.Note.html +9 -8
  76. package/dist/docs/types/plot.NoteUpdate.html +2 -2
  77. package/dist/docs/types/plot.PickPriorityConfig.html +8 -10
  78. package/dist/docs/types/plot.Priority.html +6 -6
  79. package/dist/docs/types/plot.PriorityUpdate.html +1 -1
  80. package/dist/docs/types/plot.Tags.html +1 -1
  81. package/dist/docs/types/plot.Thread.html +1 -0
  82. package/dist/docs/types/plot.ThreadCommon.html +17 -0
  83. package/dist/docs/types/plot.ThreadFilter.html +2 -0
  84. package/dist/docs/types/plot.ThreadMeta.html +11 -0
  85. package/dist/docs/types/plot.ThreadUpdate.html +3 -0
  86. package/dist/docs/types/plot.ThreadWithNotes.html +1 -0
  87. package/dist/docs/types/tools_integrations.ArchiveLinkFilter.html +11 -0
  88. package/dist/docs/types/tools_integrations.AuthToken.html +4 -4
  89. package/dist/docs/types/tools_integrations.Authorization.html +4 -4
  90. package/dist/docs/types/tools_integrations.Channel.html +11 -0
  91. package/dist/docs/types/tools_integrations.LinkTypeConfig.html +17 -0
  92. package/dist/docs/types/tools_plot.LinkFilter.html +10 -0
  93. package/dist/docs/types/tools_plot.LinkSearchResult.html +1 -0
  94. package/dist/docs/types/tools_plot.NoteIntentHandler.html +6 -6
  95. package/dist/docs/types/tools_plot.NoteSearchResult.html +1 -0
  96. package/dist/docs/types/tools_plot.SearchOptions.html +7 -0
  97. package/dist/docs/types/tools_plot.SearchResult.html +1 -0
  98. package/dist/docs/types/tools_twists.TwistPermissions.html +1 -1
  99. package/dist/docs/variables/tools_plot.SEARCH_DEFAULT_LIMIT.html +2 -0
  100. package/dist/docs/variables/tools_plot.SEARCH_MAX_LIMIT.html +2 -0
  101. package/dist/index.d.ts +2 -0
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +2 -0
  104. package/dist/index.js.map +1 -1
  105. package/dist/llm-docs/index.d.ts.map +1 -1
  106. package/dist/llm-docs/index.js +4 -8
  107. package/dist/llm-docs/index.js.map +1 -1
  108. package/dist/llm-docs/plot.d.ts +1 -1
  109. package/dist/llm-docs/plot.d.ts.map +1 -1
  110. package/dist/llm-docs/plot.js +1 -1
  111. package/dist/llm-docs/plot.js.map +1 -1
  112. package/dist/llm-docs/schedule.d.ts +9 -0
  113. package/dist/llm-docs/schedule.d.ts.map +1 -0
  114. package/dist/llm-docs/schedule.js +8 -0
  115. package/dist/llm-docs/schedule.js.map +1 -0
  116. package/dist/llm-docs/source.d.ts +9 -0
  117. package/dist/llm-docs/source.d.ts.map +1 -0
  118. package/dist/llm-docs/source.js +8 -0
  119. package/dist/llm-docs/source.js.map +1 -0
  120. package/dist/llm-docs/tag.d.ts +1 -1
  121. package/dist/llm-docs/tag.d.ts.map +1 -1
  122. package/dist/llm-docs/tag.js +1 -1
  123. package/dist/llm-docs/tag.js.map +1 -1
  124. package/dist/llm-docs/tool.d.ts +1 -1
  125. package/dist/llm-docs/tool.d.ts.map +1 -1
  126. package/dist/llm-docs/tool.js +1 -1
  127. package/dist/llm-docs/tool.js.map +1 -1
  128. package/dist/llm-docs/tools/callbacks.d.ts +1 -1
  129. package/dist/llm-docs/tools/callbacks.d.ts.map +1 -1
  130. package/dist/llm-docs/tools/callbacks.js +1 -1
  131. package/dist/llm-docs/tools/callbacks.js.map +1 -1
  132. package/dist/llm-docs/tools/integrations.d.ts +1 -1
  133. package/dist/llm-docs/tools/integrations.d.ts.map +1 -1
  134. package/dist/llm-docs/tools/integrations.js +1 -1
  135. package/dist/llm-docs/tools/integrations.js.map +1 -1
  136. package/dist/llm-docs/tools/plot.d.ts +1 -1
  137. package/dist/llm-docs/tools/plot.d.ts.map +1 -1
  138. package/dist/llm-docs/tools/plot.js +1 -1
  139. package/dist/llm-docs/tools/plot.js.map +1 -1
  140. package/dist/llm-docs/tools/twists.d.ts +1 -1
  141. package/dist/llm-docs/tools/twists.d.ts.map +1 -1
  142. package/dist/llm-docs/tools/twists.js +1 -1
  143. package/dist/llm-docs/tools/twists.js.map +1 -1
  144. package/dist/llm-docs/twist-guide-template.d.ts +1 -1
  145. package/dist/llm-docs/twist-guide-template.d.ts.map +1 -1
  146. package/dist/llm-docs/twist-guide-template.js +1 -1
  147. package/dist/llm-docs/twist-guide-template.js.map +1 -1
  148. package/dist/llm-docs/twist.d.ts +1 -1
  149. package/dist/llm-docs/twist.d.ts.map +1 -1
  150. package/dist/llm-docs/twist.js +1 -1
  151. package/dist/llm-docs/twist.js.map +1 -1
  152. package/dist/plot.d.ts +264 -589
  153. package/dist/plot.d.ts.map +1 -1
  154. package/dist/plot.js +18 -49
  155. package/dist/plot.js.map +1 -1
  156. package/dist/schedule.d.ts +172 -0
  157. package/dist/schedule.d.ts.map +1 -0
  158. package/dist/schedule.js +2 -0
  159. package/dist/schedule.js.map +1 -0
  160. package/dist/source.d.ts +158 -0
  161. package/dist/source.d.ts.map +1 -0
  162. package/dist/source.js +144 -0
  163. package/dist/source.js.map +1 -0
  164. package/dist/tag.d.ts +3 -10
  165. package/dist/tag.d.ts.map +1 -1
  166. package/dist/tag.js +2 -11
  167. package/dist/tag.js.map +1 -1
  168. package/dist/tool.d.ts +1 -15
  169. package/dist/tool.d.ts.map +1 -1
  170. package/dist/tool.js.map +1 -1
  171. package/dist/tools/callbacks.d.ts +1 -1
  172. package/dist/tools/callbacks.js +1 -1
  173. package/dist/tools/integrations.d.ts +119 -52
  174. package/dist/tools/integrations.d.ts.map +1 -1
  175. package/dist/tools/integrations.js +23 -22
  176. package/dist/tools/integrations.js.map +1 -1
  177. package/dist/tools/plot.d.ts +182 -117
  178. package/dist/tools/plot.d.ts.map +1 -1
  179. package/dist/tools/plot.js +23 -21
  180. package/dist/tools/plot.js.map +1 -1
  181. package/dist/tools/twists.d.ts +1 -1
  182. package/dist/twist-guide.d.ts +1 -1
  183. package/dist/twist-guide.d.ts.map +1 -1
  184. package/dist/twist.d.ts +66 -11
  185. package/dist/twist.d.ts.map +1 -1
  186. package/dist/twist.js +79 -10
  187. package/dist/twist.js.map +1 -1
  188. package/package.json +11 -41
  189. package/dist/common/calendar.d.ts +0 -135
  190. package/dist/common/calendar.d.ts.map +0 -1
  191. package/dist/common/calendar.js +0 -2
  192. package/dist/common/calendar.js.map +0 -1
  193. package/dist/common/documents.d.ts +0 -122
  194. package/dist/common/documents.d.ts.map +0 -1
  195. package/dist/common/documents.js +0 -2
  196. package/dist/common/documents.js.map +0 -1
  197. package/dist/common/messaging.d.ts +0 -84
  198. package/dist/common/messaging.d.ts.map +0 -1
  199. package/dist/common/messaging.js +0 -2
  200. package/dist/common/messaging.js.map +0 -1
  201. package/dist/common/projects.d.ts +0 -112
  202. package/dist/common/projects.d.ts.map +0 -1
  203. package/dist/common/projects.js +0 -2
  204. package/dist/common/projects.js.map +0 -1
  205. package/dist/docs/documents/Building_Custom_Tools.html +0 -215
  206. package/dist/docs/enums/plot.ActivityKind.html +0 -14
  207. package/dist/docs/enums/plot.ActivityType.html +0 -10
  208. package/dist/docs/modules/common_calendar.html +0 -1
  209. package/dist/docs/types/common_calendar.Calendar.html +0 -13
  210. package/dist/docs/types/common_calendar.CalendarTool.html +0 -81
  211. package/dist/docs/types/common_calendar.SyncOptions.html +0 -24
  212. package/dist/docs/types/plot.Activity.html +0 -2
  213. package/dist/docs/types/plot.ActivityCommon.html +0 -20
  214. package/dist/docs/types/plot.ActivityFilter.html +0 -3
  215. package/dist/docs/types/plot.ActivityLink.html +0 -26
  216. package/dist/docs/types/plot.ActivityMeta.html +0 -11
  217. package/dist/docs/types/plot.ActivityOccurrence.html +0 -22
  218. package/dist/docs/types/plot.ActivityOccurrenceUpdate.html +0 -3
  219. package/dist/docs/types/plot.ActivityUpdate.html +0 -3
  220. package/dist/docs/types/plot.ActivityWithNotes.html +0 -1
  221. package/dist/docs/types/plot.NewActivity.html +0 -81
  222. package/dist/docs/types/plot.NewActivityOccurrence.html +0 -24
  223. package/dist/docs/types/plot.NewActivityWithNotes.html +0 -1
  224. package/dist/docs/types/tool.SyncToolOptions.html +0 -9
  225. package/dist/docs/types/tools_integrations.IntegrationOptions.html +0 -4
  226. package/dist/docs/types/tools_integrations.IntegrationProviderConfig.html +0 -13
  227. package/dist/docs/types/tools_integrations.Syncable.html +0 -9
  228. package/dist/llm-docs/common/calendar.d.ts +0 -9
  229. package/dist/llm-docs/common/calendar.d.ts.map +0 -1
  230. package/dist/llm-docs/common/calendar.js +0 -8
  231. package/dist/llm-docs/common/calendar.js.map +0 -1
  232. package/dist/llm-docs/common/documents.d.ts +0 -9
  233. package/dist/llm-docs/common/documents.d.ts.map +0 -1
  234. package/dist/llm-docs/common/documents.js +0 -8
  235. package/dist/llm-docs/common/documents.js.map +0 -1
  236. package/dist/llm-docs/common/messaging.d.ts +0 -9
  237. package/dist/llm-docs/common/messaging.d.ts.map +0 -1
  238. package/dist/llm-docs/common/messaging.js +0 -8
  239. package/dist/llm-docs/common/messaging.js.map +0 -1
  240. package/dist/llm-docs/common/projects.d.ts +0 -9
  241. package/dist/llm-docs/common/projects.d.ts.map +0 -1
  242. package/dist/llm-docs/common/projects.js +0 -8
  243. package/dist/llm-docs/common/projects.js.map +0 -1
package/dist/tag.d.ts CHANGED
@@ -1,18 +1,14 @@
1
1
  /**
2
- * Activity tags. Three types:
2
+ * Thread tags. Three types:
3
3
  * 1. Special tags, which trigger other behaviors
4
4
  * 2. Toggle tags, which anyone can toggle a shared value on or off
5
5
  * 3. Count tags, where everyone can add or remove their own
6
6
  */
7
7
  export declare enum Tag {
8
- Now = 1,
9
- Later = 2,
8
+ Todo = 1,
10
9
  Done = 3,
11
- Archived = 4,
12
- Someday = 7,
13
10
  Pinned = 100,
14
11
  Urgent = 101,
15
- Inbox = 102,
16
12
  Goal = 103,
17
13
  Decision = 104,
18
14
  Waiting = 105,
@@ -38,9 +34,6 @@ export declare enum Tag {
38
34
  Praise = 1015,
39
35
  Applause = 1016,
40
36
  Cool = 1017,
41
- Sad = 1018,
42
- Attend = 1019,
43
- Skip = 1020,
44
- Undecided = 1021
37
+ Sad = 1018
45
38
  }
46
39
  //# sourceMappingURL=tag.d.ts.map
package/dist/tag.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,GAAG;IAEb,GAAG,IAAI;IACP,KAAK,IAAI;IACT,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,OAAO,IAAI;IAGX,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,KAAK,MAAM;IACX,IAAI,MAAM;IACV,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,QAAQ,MAAM;IACd,KAAK,MAAM;IACX,IAAI,MAAM;IACV,IAAI,MAAM;IAGV,GAAG,OAAO;IACV,EAAE,OAAO;IACT,SAAS,OAAO;IAChB,IAAI,OAAO;IACX,IAAI,OAAO;IACX,OAAO,OAAO;IACd,OAAO,OAAO;IACd,IAAI,OAAO;IACX,MAAM,OAAO;IACb,QAAQ,OAAO;IACf,MAAM,OAAO;IACb,KAAK,OAAO;IACZ,IAAI,OAAO;IACX,MAAM,OAAO;IACb,QAAQ,OAAO;IACf,IAAI,OAAO;IACX,GAAG,OAAO;IAGV,MAAM,OAAO;IACb,IAAI,OAAO;IACX,SAAS,OAAO;CACjB"}
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,GAAG;IAEb,IAAI,IAAI;IACR,IAAI,IAAI;IAGR,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,IAAI,MAAM;IACV,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,QAAQ,MAAM;IACd,KAAK,MAAM;IACX,IAAI,MAAM;IACV,IAAI,MAAM;IAGV,GAAG,OAAO;IACV,EAAE,OAAO;IACT,SAAS,OAAO;IAChB,IAAI,OAAO;IACX,IAAI,OAAO;IACX,OAAO,OAAO;IACd,OAAO,OAAO;IACd,IAAI,OAAO;IACX,MAAM,OAAO;IACb,QAAQ,OAAO;IACf,MAAM,OAAO;IACb,KAAK,OAAO;IACZ,IAAI,OAAO;IACX,MAAM,OAAO;IACb,QAAQ,OAAO;IACf,IAAI,OAAO;IACX,GAAG,OAAO;CACX"}
package/dist/tag.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Activity tags. Three types:
2
+ * Thread tags. Three types:
3
3
  * 1. Special tags, which trigger other behaviors
4
4
  * 2. Toggle tags, which anyone can toggle a shared value on or off
5
5
  * 3. Count tags, where everyone can add or remove their own
@@ -7,15 +7,11 @@
7
7
  export var Tag;
8
8
  (function (Tag) {
9
9
  // Special tags
10
- Tag[Tag["Now"] = 1] = "Now";
11
- Tag[Tag["Later"] = 2] = "Later";
10
+ Tag[Tag["Todo"] = 1] = "Todo";
12
11
  Tag[Tag["Done"] = 3] = "Done";
13
- Tag[Tag["Archived"] = 4] = "Archived";
14
- Tag[Tag["Someday"] = 7] = "Someday";
15
12
  // Toggle tags
16
13
  Tag[Tag["Pinned"] = 100] = "Pinned";
17
14
  Tag[Tag["Urgent"] = 101] = "Urgent";
18
- Tag[Tag["Inbox"] = 102] = "Inbox";
19
15
  Tag[Tag["Goal"] = 103] = "Goal";
20
16
  Tag[Tag["Decision"] = 104] = "Decision";
21
17
  Tag[Tag["Waiting"] = 105] = "Waiting";
@@ -43,10 +39,5 @@ export var Tag;
43
39
  Tag[Tag["Applause"] = 1016] = "Applause";
44
40
  Tag[Tag["Cool"] = 1017] = "Cool";
45
41
  Tag[Tag["Sad"] = 1018] = "Sad";
46
- // RSVP tags - mutually exclusive per actor
47
- // When an actor adds one of these tags, the other two are automatically removed
48
- Tag[Tag["Attend"] = 1019] = "Attend";
49
- Tag[Tag["Skip"] = 1020] = "Skip";
50
- Tag[Tag["Undecided"] = 1021] = "Undecided";
51
42
  })(Tag || (Tag = {}));
52
43
  //# sourceMappingURL=tag.js.map
package/dist/tag.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,GA6CX;AA7CD,WAAY,GAAG;IACb,eAAe;IACf,2BAAO,CAAA;IACP,+BAAS,CAAA;IACT,6BAAQ,CAAA;IACR,qCAAY,CAAA;IACZ,mCAAW,CAAA;IAEX,cAAc;IACd,mCAAY,CAAA;IACZ,mCAAY,CAAA;IACZ,iCAAW,CAAA;IACX,+BAAU,CAAA;IACV,uCAAc,CAAA;IACd,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,uCAAc,CAAA;IACd,iCAAW,CAAA;IACX,+BAAU,CAAA;IACV,+BAAU,CAAA;IAEV,aAAa;IACb,8BAAU,CAAA;IACV,4BAAS,CAAA;IACT,0CAAgB,CAAA;IAChB,gCAAW,CAAA;IACX,gCAAW,CAAA;IACX,sCAAc,CAAA;IACd,sCAAc,CAAA;IACd,gCAAW,CAAA;IACX,oCAAa,CAAA;IACb,wCAAe,CAAA;IACf,oCAAa,CAAA;IACb,kCAAY,CAAA;IACZ,gCAAW,CAAA;IACX,oCAAa,CAAA;IACb,wCAAe,CAAA;IACf,gCAAW,CAAA;IACX,8BAAU,CAAA;IACV,2CAA2C;IAC3C,gFAAgF;IAChF,oCAAa,CAAA;IACb,gCAAW,CAAA;IACX,0CAAgB,CAAA;AAClB,CAAC,EA7CW,GAAG,KAAH,GAAG,QA6Cd"}
1
+ {"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,GAoCX;AApCD,WAAY,GAAG;IACb,eAAe;IACf,6BAAQ,CAAA;IACR,6BAAQ,CAAA;IAER,cAAc;IACd,mCAAY,CAAA;IACZ,mCAAY,CAAA;IACZ,+BAAU,CAAA;IACV,uCAAc,CAAA;IACd,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,uCAAc,CAAA;IACd,iCAAW,CAAA;IACX,+BAAU,CAAA;IACV,+BAAU,CAAA;IAEV,aAAa;IACb,8BAAU,CAAA;IACV,4BAAS,CAAA;IACT,0CAAgB,CAAA;IAChB,gCAAW,CAAA;IACX,gCAAW,CAAA;IACX,sCAAc,CAAA;IACd,sCAAc,CAAA;IACd,gCAAW,CAAA;IACX,oCAAa,CAAA;IACb,wCAAe,CAAA;IACf,oCAAa,CAAA;IACb,kCAAY,CAAA;IACZ,gCAAW,CAAA;IACX,oCAAa,CAAA;IACb,wCAAe,CAAA;IACf,gCAAW,CAAA;IACX,8BAAU,CAAA;AACZ,CAAC,EApCW,GAAG,KAAH,GAAG,QAoCd"}
package/dist/tool.d.ts CHANGED
@@ -1,21 +1,7 @@
1
- import { type Actor, type ActivityFilter, type NewActivityWithNotes, type Priority } from "./plot";
1
+ import { type Actor, type Priority } from "./plot";
2
2
  import type { Callback } from "./tools/callbacks";
3
3
  import type { InferOptions, InferTools, Serializable, ToolBuilder, ToolShed } from "./utils/types";
4
4
  export type { ToolBuilder };
5
- /**
6
- * Options for tools that sync activities from external services.
7
- *
8
- * @example
9
- * ```typescript
10
- * static readonly Options: SyncToolOptions;
11
- * ```
12
- */
13
- export type SyncToolOptions = {
14
- /** Callback invoked for each synced item. The tool adds sync metadata before passing it. */
15
- onItem: (item: NewActivityWithNotes) => Promise<void>;
16
- /** Callback invoked when a syncable is disabled, receiving an ActivityFilter for bulk operations. */
17
- onSyncableDisabled?: (filter: ActivityFilter) => Promise<void>;
18
- };
19
5
  /**
20
6
  * Abstrtact parent for both built-in tools and regular Tools.
21
7
  * Regular tools extend Tool.
@@ -1 +1 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,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,UAAU,CAAC,KAAa;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,cAAc;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;IAC3C,CAAC;IAED;;;;;;;;;;OAUG;IACH,6DAA6D;IAC7D,WAAW,CAAC,QAAkB,EAAE,OAA0B;QACxD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;;;;;;;OASG;IACH,6DAA6D;IAC7D,YAAY,CAAC,QAAkB,EAAE,OAA0B;QACzD,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"}
@@ -32,7 +32,7 @@ export type Callback = string & {
32
32
  * **When to use callbacks:**
33
33
  * - Webhook handlers that need persistent function references
34
34
  * - Scheduled operations that run after worker timeouts
35
- * - User interaction links (ActivityLinkType.callback)
35
+ * - User interaction actions (ActionType.callback)
36
36
  * - Cross-tool communication that survives restarts
37
37
  *
38
38
  * **Type Safety:**
@@ -14,7 +14,7 @@ import { ITool } from "..";
14
14
  * **When to use callbacks:**
15
15
  * - Webhook handlers that need persistent function references
16
16
  * - Scheduled operations that run after worker timeouts
17
- * - User interaction links (ActivityLinkType.callback)
17
+ * - User interaction actions (ActionType.callback)
18
18
  * - Cross-tool communication that survives restarts
19
19
  *
20
20
  * **Type Safety:**
@@ -1,76 +1,80 @@
1
- import { type Actor, type ActorId, ITool, Serializable } from "..";
1
+ import { type Actor, type ActorId, type NewContact, type NewLinkWithNotes, ITool, Serializable } from "..";
2
+ import type { JSONValue } from "../utils/types";
2
3
  import type { Uuid } from "../utils/uuid";
3
4
  /**
4
5
  * A resource that can be synced (e.g., a calendar, project, channel).
5
- * Returned by getSyncables() and managed by users in the twist setup/edit modal.
6
+ * Returned by getChannels() and managed by users in the twist setup/edit modal.
6
7
  */
7
- export type Syncable = {
8
+ export type Channel = {
8
9
  /** External ID shared across users (e.g., Google calendar ID) */
9
10
  id: string;
10
11
  /** Display name shown in the UI */
11
12
  title: string;
12
- /** Optional nested syncable resources (e.g., subfolders) */
13
- children?: Syncable[];
13
+ /** Optional nested channel resources (e.g., subfolders) */
14
+ children?: Channel[];
15
+ /** Priority ID this channel is routed to (set when channel is enabled) */
16
+ priorityId?: string;
14
17
  };
15
18
  /**
16
- * Configuration for an OAuth provider in a tool's build options.
17
- * Declares the provider, scopes, and lifecycle callbacks.
19
+ * Describes a link type that a source creates.
20
+ * Used for display in the UI (icons, labels).
18
21
  */
19
- export type IntegrationProviderConfig = {
20
- /** The OAuth provider */
21
- provider: AuthProvider;
22
- /** OAuth scopes to request */
23
- scopes: string[];
24
- /** Returns available syncables for the authorized actor. Must not use Plot tool. */
25
- getSyncables: (auth: Authorization, token: AuthToken) => Promise<Syncable[]>;
26
- /** Called when a syncable resource is enabled for syncing */
27
- onSyncEnabled: (syncable: Syncable) => Promise<void>;
28
- /** Called when a syncable resource is disabled */
29
- onSyncDisabled: (syncable: Syncable) => Promise<void>;
30
- };
31
- /**
32
- * Options passed to Integrations in the build() method.
33
- */
34
- export type IntegrationOptions = {
35
- /** Provider configurations with lifecycle callbacks */
36
- providers: IntegrationProviderConfig[];
22
+ export type LinkTypeConfig = {
23
+ /** Machine-readable type identifier (e.g., "issue", "pull_request") */
24
+ type: string;
25
+ /** Human-readable label (e.g., "Issue", "Pull Request") */
26
+ label: string;
27
+ /** URL to an icon for this link type (light mode). Prefer Iconify `logos/*` URLs. */
28
+ logo?: string;
29
+ /** URL to an icon for dark mode. Use when the default logo is invisible on dark backgrounds (e.g., Iconify `simple-icons/*` with `?color=`). */
30
+ logoDark?: string;
31
+ /** URL to a monochrome icon (uses `currentColor`). Prefer Iconify `simple-icons/*` URLs without a `?color=` param. */
32
+ logoMono?: string;
33
+ /** Possible status values for this type */
34
+ statuses?: Array<{
35
+ /** Machine-readable status (e.g., "open", "done") */
36
+ status: string;
37
+ /** Human-readable label (e.g., "Open", "Done") */
38
+ label: string;
39
+ }>;
37
40
  };
38
41
  /**
39
- * Built-in tool for managing OAuth authentication and syncable resources.
42
+ * Built-in tool for managing OAuth authentication and channel resources.
40
43
  *
41
- * The redesigned Integrations tool:
42
- * 1. Declares providers/scopes in build options with lifecycle callbacks
43
- * 2. Manages syncable resources (calendars, projects, etc.) per actor
44
- * 3. Returns tokens for the user who enabled sync on a syncable
45
- * 4. Supports per-actor auth via actAs() for write-back operations
44
+ * The Integrations tool:
45
+ * 1. Manages channel resources (calendars, projects, etc.) per actor
46
+ * 2. Returns tokens for the user who enabled sync on a channel
47
+ * 3. Supports per-actor auth via actAs() for write-back operations
48
+ * 4. Provides saveLink/saveContacts for Sources to save data directly
46
49
  *
47
- * Auth and syncable management is handled in the twist edit modal in Flutter,
48
- * removing the need for tools to create auth activities or selection UIs.
50
+ * Sources declare their provider, scopes, and channel lifecycle methods as
51
+ * class properties and methods. The Integrations tool reads these automatically.
52
+ * Auth and channel management is handled in the twist edit modal in Flutter.
49
53
  *
50
54
  * @example
51
55
  * ```typescript
52
- * class CalendarTool extends Tool<CalendarTool> {
53
- * static readonly PROVIDER = AuthProvider.Google;
54
- * static readonly SCOPES = ["https://www.googleapis.com/auth/calendar"];
56
+ * class CalendarSource extends Source<CalendarSource> {
57
+ * readonly provider = AuthProvider.Google;
58
+ * readonly scopes = ["https://www.googleapis.com/auth/calendar"];
55
59
  *
56
60
  * build(build: ToolBuilder) {
57
61
  * return {
58
- * integrations: build(Integrations, {
59
- * providers: [{
60
- * provider: AuthProvider.Google,
61
- * scopes: CalendarTool.SCOPES,
62
- * getSyncables: this.getSyncables,
63
- * onSyncEnabled: this.onSyncEnabled,
64
- * onSyncDisabled: this.onSyncDisabled,
65
- * }]
66
- * }),
62
+ * integrations: build(Integrations),
67
63
  * };
68
64
  * }
69
65
  *
70
- * async getSyncables(auth: Authorization, token: AuthToken): Promise<Syncable[]> {
66
+ * async getChannels(auth: Authorization, token: AuthToken): Promise<Channel[]> {
71
67
  * const calendars = await this.listCalendars(token);
72
68
  * return calendars.map(c => ({ id: c.id, title: c.name }));
73
69
  * }
70
+ *
71
+ * async onChannelEnabled(channel: Channel) {
72
+ * // Start syncing
73
+ * }
74
+ *
75
+ * async onChannelDisabled(channel: Channel) {
76
+ * // Stop syncing
77
+ * }
74
78
  * }
75
79
  * ```
76
80
  */
@@ -83,16 +87,24 @@ export declare abstract class Integrations extends ITool {
83
87
  */
84
88
  static MergeScopes(...scopeArrays: string[][]): string[];
85
89
  /**
86
- * Retrieves an access token for a syncable resource.
90
+ * Retrieves an access token for a channel resource.
87
91
  *
88
- * Returns the token of the user who enabled sync on the given syncable.
89
- * If the syncable is not enabled or the token is expired/invalid, returns null.
92
+ * Returns the token of the user who enabled sync on the given channel.
93
+ * If the channel is not enabled or the token is expired/invalid, returns null.
90
94
  *
91
- * @param provider - The OAuth provider
92
- * @param syncableId - The syncable resource ID (e.g., calendar ID)
95
+ * @param channelId - The channel resource ID (e.g., calendar ID)
96
+ * @returns Promise resolving to the access token or null
97
+ */
98
+ abstract get(channelId: string): Promise<AuthToken | null>;
99
+ /**
100
+ * Retrieves an access token for a channel resource.
101
+ *
102
+ * @param provider - The OAuth provider (deprecated, ignored for single-provider sources)
103
+ * @param channelId - The channel resource ID (e.g., calendar ID)
93
104
  * @returns Promise resolving to the access token or null
105
+ * @deprecated Use get(channelId) instead. The provider is implicit from the source.
94
106
  */
95
- abstract get(provider: AuthProvider, syncableId: string): Promise<AuthToken | null>;
107
+ abstract get(provider: AuthProvider, channelId: string): Promise<AuthToken | null>;
96
108
  /**
97
109
  * Execute a callback as a specific actor, requesting auth if needed.
98
110
  *
@@ -107,7 +119,62 @@ export declare abstract class Integrations extends ITool {
107
119
  * @param extraArgs - Additional arguments to pass to the callback
108
120
  */
109
121
  abstract actAs<TArgs extends Serializable[], TCallback extends (token: AuthToken, ...args: TArgs) => any>(provider: AuthProvider, actorId: ActorId, activityId: Uuid, callback: TCallback, ...extraArgs: TArgs): Promise<void>;
122
+ /**
123
+ * Saves a link with notes to the source's priority.
124
+ *
125
+ * Creates a thread+link pair. The thread is a lightweight container;
126
+ * the link holds the external entity data (source, meta, type, status, etc.).
127
+ *
128
+ * This method is available only to Sources (not regular Twists).
129
+ *
130
+ * @param link - The link with notes to save
131
+ * @returns Promise resolving to the saved thread's UUID
132
+ */
133
+ abstract saveLink(link: NewLinkWithNotes): Promise<Uuid>;
134
+ /**
135
+ * Saves contacts to the source's priority.
136
+ *
137
+ * @param contacts - Array of contacts to save
138
+ * @returns Promise resolving to the saved actors
139
+ */
140
+ abstract saveContacts(contacts: NewContact[]): Promise<Actor[]>;
141
+ /**
142
+ * Archives links matching the given filter that were created by this source.
143
+ *
144
+ * For each archived link's thread, if no other non-archived links remain,
145
+ * the thread is also archived.
146
+ *
147
+ * @param filter - Filter criteria for which links to archive
148
+ * @returns Promise that resolves when archiving is complete
149
+ */
150
+ abstract archiveLinks(filter: ArchiveLinkFilter): Promise<void>;
151
+ /**
152
+ * Sets or clears todo status on a thread owned by this source.
153
+ *
154
+ * @param source - The link source URL identifying the thread
155
+ * @param actorId - The user to set the todo for
156
+ * @param todo - true to mark as todo, false to clear/complete
157
+ * @param options - Additional options
158
+ * @param options.date - The todo date (when todo=true). Defaults to today.
159
+ */
160
+ abstract setThreadToDo(source: string, actorId: ActorId, todo: boolean, options?: {
161
+ date?: Date | string;
162
+ }): Promise<void>;
110
163
  }
164
+ /**
165
+ * Filter criteria for archiving links.
166
+ * All fields are optional; only provided fields are used for matching.
167
+ */
168
+ export type ArchiveLinkFilter = {
169
+ /** Filter by channel ID */
170
+ channelId?: string;
171
+ /** Filter by link type (e.g., "issue", "pull_request") */
172
+ type?: string;
173
+ /** Filter by link status (e.g., "open", "closed") */
174
+ status?: string;
175
+ /** Filter by metadata fields (uses containment matching) */
176
+ meta?: Record<string, JSONValue>;
177
+ };
111
178
  /**
112
179
  * Enumeration of supported OAuth providers.
113
180
  *
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,yBAAyB;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,oFAAoF;IACpF,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,SAA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AkD;IAClD,MAAM,WAAW;IACjB,gCAAgC;IAChC,MAAM,WAAW;IACjB,sEAAsE;IACtE,MAAM,WAAW;IACjB,gDAAgD;IAChD,KAAK,UAAU;IACf,6CAA6C;IAC7C,OAAO,YAAY;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,mDAAmD;IACnD,QAAQ,EAAE,YAAY,CAAC;IACvB,sDAAsD;IACtD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,0EAA0E;IAC1E,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC"}
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,EACL,YAAY,EACb,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,uEAAuE;IACvE,I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B,sDAAsD;IACtD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,0EAA0E;IAC1E,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC"}
@@ -1,40 +1,41 @@
1
- import { ITool } from "..";
1
+ import { ITool, } from "..";
2
2
  /**
3
- * Built-in tool for managing OAuth authentication and syncable resources.
3
+ * Built-in tool for managing OAuth authentication and channel resources.
4
4
  *
5
- * The redesigned Integrations tool:
6
- * 1. Declares providers/scopes in build options with lifecycle callbacks
7
- * 2. Manages syncable resources (calendars, projects, etc.) per actor
8
- * 3. Returns tokens for the user who enabled sync on a syncable
9
- * 4. Supports per-actor auth via actAs() for write-back operations
5
+ * The Integrations tool:
6
+ * 1. Manages channel resources (calendars, projects, etc.) per actor
7
+ * 2. Returns tokens for the user who enabled sync on a channel
8
+ * 3. Supports per-actor auth via actAs() for write-back operations
9
+ * 4. Provides saveLink/saveContacts for Sources to save data directly
10
10
  *
11
- * Auth and syncable management is handled in the twist edit modal in Flutter,
12
- * removing the need for tools to create auth activities or selection UIs.
11
+ * Sources declare their provider, scopes, and channel lifecycle methods as
12
+ * class properties and methods. The Integrations tool reads these automatically.
13
+ * Auth and channel management is handled in the twist edit modal in Flutter.
13
14
  *
14
15
  * @example
15
16
  * ```typescript
16
- * class CalendarTool extends Tool<CalendarTool> {
17
- * static readonly PROVIDER = AuthProvider.Google;
18
- * static readonly SCOPES = ["https://www.googleapis.com/auth/calendar"];
17
+ * class CalendarSource extends Source<CalendarSource> {
18
+ * readonly provider = AuthProvider.Google;
19
+ * readonly scopes = ["https://www.googleapis.com/auth/calendar"];
19
20
  *
20
21
  * build(build: ToolBuilder) {
21
22
  * return {
22
- * integrations: build(Integrations, {
23
- * providers: [{
24
- * provider: AuthProvider.Google,
25
- * scopes: CalendarTool.SCOPES,
26
- * getSyncables: this.getSyncables,
27
- * onSyncEnabled: this.onSyncEnabled,
28
- * onSyncDisabled: this.onSyncDisabled,
29
- * }]
30
- * }),
23
+ * integrations: build(Integrations),
31
24
  * };
32
25
  * }
33
26
  *
34
- * async getSyncables(auth: Authorization, token: AuthToken): Promise<Syncable[]> {
27
+ * async getChannels(auth: Authorization, token: AuthToken): Promise<Channel[]> {
35
28
  * const calendars = await this.listCalendars(token);
36
29
  * return calendars.map(c => ({ id: c.id, title: c.name }));
37
30
  * }
31
+ *
32
+ * async onChannelEnabled(channel: Channel) {
33
+ * // Start syncing
34
+ * }
35
+ *
36
+ * async onChannelDisabled(channel: Channel) {
37
+ * // Stop syncing
38
+ * }
38
39
  * }
39
40
  * ```
40
41
  */
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,EAAgB,MAAM,IAAI,CAAC;AAyCnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,OAAgB,YAAa,SAAQ,KAAK;IAC9C;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,WAAuB;QAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;CAwCF;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,0DAA0D;IAC1D,iCAAiB,CAAA;IACjB,0DAA0D;IAC1D,uCAAuB,CAAA;IACvB,kDAAkD;IAClD,iCAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAe,CAAA;IACf,uDAAuD;IACvD,uCAAuB,CAAA;IACvB,kDAAkD;IAClD,iCAAiB,CAAA;IACjB,gCAAgC;IAChC,iCAAiB,CAAA;IACjB,sEAAsE;IACtE,iCAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAe,CAAA;IACf,6CAA6C;IAC7C,mCAAmB,CAAA;AACrB,CAAC,EArBW,YAAY,KAAZ,YAAY,QAqBvB"}
1
+ {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/tools/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,GAEN,MAAM,IAAI,CAAC;AA2CZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAgB,YAAa,SAAQ,KAAK;IAC9C;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,WAAuB;QAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;CAoGF;AAiBD;;;;;GAKG;AACH,MAAM,CAAN,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,0DAA0D;IAC1D,iCAAiB,CAAA;IACjB,0DAA0D;IAC1D,uCAAuB,CAAA;IACvB,kDAAkD;IAClD,iCAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAe,CAAA;IACf,uDAAuD;IACvD,uCAAuB,CAAA;IACvB,kDAAkD;IAClD,iCAAiB,CAAA;IACjB,gCAAgC;IAChC,iCAAiB,CAAA;IACjB,sEAAsE;IACtE,iCAAiB,CAAA;IACjB,gDAAgD;IAChD,+BAAe,CAAA;IACf,6CAA6C;IAC7C,mCAAmB,CAAA;AACrB,CAAC,EArBW,YAAY,KAAZ,YAAY,QAqBvB"}